Repository navigation
Add LLM-generated question-specific confounders for noul augmentation - #110
Conversation
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.
There was a problem hiding this comment.
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 newaugmented_options_llmfield*_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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.pyis 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
--mergestep
Data Structure:
- Both
augmented_options(template-based) andaugmented_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)
Summary
augmented_options) and LLM-generated (augmented_options_llm) confoundersgenerate_llm_confounders.pyscript: resumable, shardable, outputs to separate files with--mergestep*_llm_confounders.jsonlprovenance files preserved alongside familiesCloses partial checklist in #104 (LLM-generated confounders as Approach 2)
Test plan
augmented_options_llmfield