Quality work (v2 → v3 → v4)
An Opus-4.8 content audit drove three rounds of fixes — structural validity ≠ correct numbers:
- v2: 100% schema-valid but 3/6 number-heavy cases had severe numeric/logic errors
and all 6 fabricated sources.
- v3: added internal-consistency rules + a ban on fabricated citations + a teacher
numeric-audit pass on the corpus. Fabricated sources and severe errors → 0/6.
Residual: projection tables (e.g. elasticity → demand → revenue) still slipped.
- v4: corpus regenerated with (a) a rule that exhibits show given data only — no
computed projection tables, and (b) a code-sandbox auditor agent: the teacher
writes a Python script that recomputes each derived number, the script is executed
(arithmetic owned by code, not the LLM), then the case is rewritten to those values.
The dangerous projection-table errors are largely eliminated; elasticity→impact math is
mostly correct.
Numbers are illustrative/fictional for teaching; the app shows a "verify before class"
note. A ≤4B model generating freehand still slips occasionally — fully guaranteeing tables
would require computing them in code at inference (a planned enhancement).
Output contract
JSON with case (hook, protagonist, decision_point, context, illustrative data, exhibits
= given data, alternatives, a closing that stops at the decision point) and
teaching_note (summary, audience, ≤4 measurable objectives, theory anchor, timed
discussion plan, questions, analysis, closure, epilogue).
Training
LoRA r=16, α=32, dropout=0.05 on q/k/v/o + gate/up/down, 3 epochs, on Modal (H100).
Corpus: 611 synthetic case+note pairs, code-sandbox numeric-audited. Final loss ≈ 0.51.
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "Qwen/Qwen3-4B-Instruct-2507"
tok = AutoTokenizer.from_pretrained(base)
m = AutoModelForCausalLM.from_pretrained(base, device_map="cuda", torch_dtype="bfloat16")
m = PeftModel.from_pretrained(m, "build-small-hackathon/case-forge-qwen3-4b")
License
Apache-2.0 (matches the base model).