Views
No views yet
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.1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
3from peft import PeftModel
4
5BASE = "Qwen/Qwen3-4B-Instruct-2507"
6bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
7 bnb_4bit_use_double_quant=True, bnb_4bit_compute_dtype=torch.bfloat16)
8tok = AutoTokenizer.from_pretrained(BASE)
9m = AutoModelForCausalLM.from_pretrained(BASE, quantization_config=bnb, device_map="auto")
10m = PeftModel.from_pretrained(m, "William2390401/aime-gen-qwen3-4b-lora-v3")
11
12msgs = [{"role": "user", "content":
13 "Write an AIME-style problem. Difficulty: late (problems 11-15). Topic: number theory."}]
14text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
15out = m.generate(**tok(text, return_tensors="pt").to(m.device),
16 max_new_tokens=1600, do_sample=True, temperature=0.8, top_p=0.95)
17print(tok.decode(out[0], skip_special_tokens=True))<problem>…</problem><solution>…</solution><answer>N</answer> (integer 0–999).| Metric | Base (engineered) | Tuned (bare) | Δ |
|---|---|---|---|
| Format adherence | 28.9% | 63.9% | +35.0 |
| Self-duplication (lower=better) | 70.6% | 18.3% | −52.3 |
| Band accuracy | 60.0% | 64.3% | +4.3 |
| Novelty vs corpus+train | 87.8% | 71.1% | −16.7 |
| Validity (solver consensus) | 47.2% | 12.2% | −35.0 |
report_v3_analysis.md and BRAINLIFT_RESULTS.md in the project repo for full analysis.