Skip to content

Add LLM-generated question-specific confounders for noul augmentation - #110

Merged
Oaklight merged 8 commits into
mainfrom
worktree-feature+augmented-noul-as-choice-labeling
Sep 27, 2026
Merged

Oaklight merged 8 commits into
mainfrom
worktree-feature+augmented-noul-as-choice-labeling

Conversation

@Oaklight

Copy link
Copy Markdown
Owner

Summary

  • Generate question-specific confounders for all 17,904 noul questions via Qwen3.8-27B (vLLM on rbdgx3)
  • Each noul question now has both template-based (augmented_options) and LLM-generated (augmented_options_llm) confounders
  • LLM confounders are domain/question-specific (e.g. "allergic_reaction" for a medical question) vs templates which are cognitive-type-generic
  • 17,904/17,904 generated, 0 failures, 0 refusals across all 23 domains including sensitive ones (safety_moderation, medical_triage, adversarial_inference)
  • Standalone generate_llm_confounders.py script: resumable, shardable, outputs to separate files with --merge step
  • Separate *_llm_confounders.jsonl provenance files preserved alongside families

Closes partial checklist in #104 (LLM-generated confounders as Approach 2)

Test plan

  • Prompt quality tested across 14 samples from 7 domains (including sensitive: safety, medical, financial, legal, adversarial)
  • 100% coverage: 17,904/17,904 noul questions across 23 domains
  • 0 failures, 0 parse errors, 0 safety refusals
  • Resume behavior verified (re-run skips existing confounders)
  • Merge verified: all families have augmented_options_llm field
  • Unit tests (pending — data files required)

When a noul question has augmented_options, treat it as a choice question
for labeling: use augmented_options as criteria, get multi-option
probability distribution from Jev/LLM instead of binary true/false.
- label_augmented_noul.py: resumable, shardable Jev labeling for
  augmented noul items (--shard N --num-shards M for parallel runs)
- synthetic_llm_label.py: route augmented noul through choice path
- synthetic_label.py: route augmented noul through choice path for Jev
- Disable Qwen thinking mode via chat_template_kwargs for clean JSON
- Strip <think> blocks in response parser as safety net
- Add --model, --base-url, --shard, --num-shards args to fill_luna_gaps
Labeled via local vLLM (Qwen/Qwen3.8-27B on rbdgx3 H200) to fill
items that had Jev labels but no Luna labels. Stored as separate
teacher key (qwen3_8_27b) rather than mixing into gpt_5_6_luna files.
These items will be re-labeled with actual GPT-5.6 Luna (low effort).
Re-labeled 11,619 / 11,724 previously missing items using Luna low
reasoning effort + 4k max_tokens. Remaining 105 items blocked by
Azure content filter (sensitive content in state text). These items
retain Qwen3.8-27B labels in *_qwen3_8_27b_labels.jsonl as fallback.
- Jev augmented noul labels: 87,822 items (5-option choice distributions)
- Fix max_tokens for reasoning models (200 → 4096, was causing empty content)
- Switch reasoning_effort to "low" for Luna (no content filter, faster)
- Strip <think> blocks from Qwen responses in JSON parser
- Add clean_orphan_labels.py script (fixed _family_idx bug)
…uestions

Generate question-specific confounders via Qwen3.8-27B (vLLM on rbdgx3),
stored as augmented_options_llm alongside existing template-based
augmented_options. Each noul question now has both:
- augmented_options: cognitive-type templates (shared per type)
- augmented_options_llm: question-specific confounders (unique per question)

17,904/17,904 generated, 0 failures across 23 domains.
Separate confounder files preserved for provenance.

@milo-oaklight milo-oaklight Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved ✅

LLM-generated question-specific confounders for all 17,904 noul questions.

Coverage

Metric Value
Total questions 17,904/17,904 (100%)
Failures 0
Parse errors 0
Safety refusals 0
Domains 23 (including sensitive: safety_moderation, medical_triage, adversarial_inference)

Data Quality (from diff samples)

Template-based confounders are cognitive-type-generic:

"augmented_options": {
  "true": "The stated condition is confirmed by the available evidence",
  "false": "The stated condition is contradicted by the available evidence",
  "borderline": "The evidence is marginally sufficient but not robust",
  ...
}

LLM-generated confounders are question-specific:

"augmented_options_llm": {
  "true": "The stated condition is confirmed by the available evidence",
  "false": "The stated condition is contradicted by the available evidence",
  "mutual_benefit": "Both hookworms and the dog gain significant advantages from this interaction.",
  "equal_benefit": "The benefits and costs are perfectly balanced between the two species.",
  "dog_benefits_more": "The dog gains more from the relationship than the hookworms do."
}

The LLM confounders are semantically plausible alternatives that a learner might consider — better training signal than generic cognitive-type templates.

File Structure

  • *_families.jsonl: Modified with new augmented_options_llm field
  • *_llm_confounders.jsonl: Provenance files (new)
  • *_jev_augmented_labels.jsonl: JeV augmented labels (new)
  • *_qwen3_8_27b_labels.jsonl: Qwen labeling output (new)

CI green. Ready to merge.

@clementine-oaklight clementine-oaklight Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅ — LLM-generated confounders complete for all 17,904 noul questions.

Metric Value
Questions 17,904/17,904 (100%)
Domains 23 (including safety_moderation, medical_triage, adversarial_inference)
Failures 0
Refusals 0
Model Qwen3.8-27B via vLLM

Quality observations (from safety_moderation samples):

  • partial_evidence: "Some hostile language exists, but no specific individual is named."
  • conditional_true: "True only if the restaurant owner is considered a named individual."
  • uncertain_intent: "Intent is ambiguous due to lack of direct personal attacks."

These are domain-specific and question-aware, vs template confounders which are cognitive-type-generic.

Architecture:

Component Design
Script Standalone generate_llm_confounders.py — resumable, shardable
Output Separate *_llm_confounders.jsonl provenance files
Merge --merge step adds augmented_options_llm to families
Both options preserved augmented_options (template) + augmented_options_llm (LLM)

Relationship with #107:

PR Approach
#107 Template confounders — cognitive-type-generic, deterministic
#110 LLM confounders — question-specific, domain-aware

Having both gives flexibility: templates for baseline, LLM for richer training signal.

CI green. Data quality validated across 14 samples from 7 domains.

@Oaklight
Oaklight merged commit c740721 into main Sep 27, 2026
4 checks passed
@Oaklight
Oaklight deleted the worktree-feature+augmented-noul-as-choice-labeling branch September 27, 2026 12:31

@elena-oaklight elena-oaklight Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

CI: All checks passing (test 3.10, 3.12, build-web, GitGuardian)

Quality Assessment:

  • 17,904/17,904 noul questions have LLM-generated confounders (100% coverage)
  • 0 failures, 0 refusals across all 23 domains including sensitive ones (safety_moderation, medical_triage, adversarial_inference)
  • Domain-specific confounders are semantically relevant and meaningful (e.g., implicit_threat_present, partial_denial, conditional_validity)

Code Review:

  • generate_llm_confounders.py is well-designed: resumable, shardable, async with semaphore throttling
  • Proper handling of Qwen thinking mode (enable_thinking: False + <think> block stripping)
  • Clean JSON parsing with snake_case validation
  • Separate provenance files preserved alongside families via --merge step

Data Structure:

  • Both augmented_options (template-based) and augmented_options_llm (question-specific) preserved
  • Backward compatible: existing fields unchanged
  • Consistent structure: true/false base keys + 3 confounders per question

Minor Notes:

  • Some items have 4 or 6 confounders instead of the typical 5 — acceptable variance
  • Unit tests marked as pending for data files (acceptable for data-heavy PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant