William2390401/aime-gen-qwen3-4b-lora-v3
AIME-Style Problem Generator — Qwen3-4B QLoRA (v3)
LoRA adapters that turn Qwen/Qwen3-4B-Instruct-2507 into a generator of novel, difficulty- calibrated AIME-style competition problems — from a bare one-line prompt, no system prompt, no few-shot exemplars. Trained on the companion SFT dataset.
Thesis: problem-posing failure in LLMs is a diversity deficit, not a reasoning deficit; fine-tuning on a curated dataset instills the behavior a prompt can't reliably buy.
Usage (4-bit base + adapters — the faithful config)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
BASE = "Qwen/Qwen3-4B-Instruct-2507"
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True, bnb_4bit_compute_dtype=torch.bfloat16)
tok = AutoTokenizer.from_pretrained(BASE)
m = AutoModelForCausalLM.from_pretrained(BASE, quantization_config=bnb, device_map="auto")
m = PeftModel.from_pretrained(m, "William2390401/aime-gen-qwen3-4b-lora-v3")
msgs = [{"role": "user", "content":
"Write an AIME-style problem. Difficulty: late (problems 11-15). Topic: number theory."}]
text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
out = m.generate(**tok(text, return_tensors="pt").to(m.device),
max_new_tokens=1600, do_sample=True, temperature=0.8, top_p=0.95)
print(tok.decode(out[0], skip_special_tokens=True))Output format: <problem>…</problem><solution>…</solution><answer>N</answer> (integer 0–999).
Results — tuned (bare prompt) vs base (full engineered prompt)
The win: a fine-tuned 4B on a one-liner beats a fully-prompted base on format, diversity, and calibration — the properties a dataset can encode.
The honest limitation: validity is 12% — the model is a strong problem stylist but a weak verifier; a 4B can't reliably solve the problems it poses. (v2's higher 33% was inflated by degenerate answer-0 collusion; removing it made the number honest.) Not fixable by data; would need verify-in-the-loop generation.
Training
QLoRA (4-bit NF4), rank 32 on all attention+MLP projections, 2 epochs, lr 2e-4, effective batch 8, completion-only loss, seed 3407. 786-row quality-filtered dataset. Base: Qwen3-4B-Instruct-2507.
Intended use & scope
Research/education — generating fresh AIME-style practice problems. Not a solver; not verified correct beyond the strong-solver validity gate. Eval it on 4-bit base + adapters (fp16 degenerates more). See report_v3_analysis.md and BRAINLIFT_RESULTS.md in the project repo for full analysis.
