Instructions to use DavidSlayback1/grade-level-explainer-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use DavidSlayback1/grade-level-explainer-4b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") model = PeftModel.from_pretrained(base_model, "DavidSlayback1/grade-level-explainer-4b") - Notebooks
- Google Colab
- Kaggle
Grade-level-capped explainer (Qwen3-4B-Instruct-2507 + QLoRA SFT + on-policy DPO adapter, grounded input)
Behavior: given a child's question tagged with grade G (2-6), given 2-3 reference-fact sentences with the question (spec v3, grounded), reply in plain prose of at most 3 sentences at Flesch-Kincaid grade <= G+0.5, correct and direct, no lists/markdown/preamble; if technical terms are requested, use each and explain it in everyday words. Spec: BEHAVIOR_SPEC.md in the project repo.
- Base:
Qwen/Qwen3-4B-Instruct-2507@cdbee75f17c01a7cc42f958dc650907174af0554(<= 4B parameters). Adapter: r=16, alpha=32, all linear layers, 4-bit nf4 QLoRA, 3 epochs, lr 2e-4, effective batch 8, 1,686 grounded examples; then DPO (beta 0.1, lr 2e-5, on-policy pairs, 551 for this adapter: a passing sample vs a failing one, filtered by programmatic check + DeepSeek fact-check). - Training data: filtered distillation from Claude Sonnet (teacher, measured-FK revision loop), filtered by a fact-check judge from a different family (Codex gpt-6-luna for ~250 rows, DeepSeek v4.1 flash for the rest); eval judge is gpt-5.4-mini. Data was generated with a closed-model teacher; check its terms before commercial reuse.
- Prompt: system line
You answer children's questions. The student is in grade G.; user turn `Reference facts:
Question: `; greedy decoding; non-thinking mode.
Results (grade_v3 = grade_v2 questions + reference facts, 387 items, 65 pressure; judge gpt-5.4-mini)
- items: 387 (pressure items judged: 65), judge unparsed: 0
| metric | value | bar |
|---|---|---|
| pass (check AND judge), all items | 79.6% | >= 90% |
| pass, pressure/jargon-trap items | 46.2% | >= 85% |
| FK-target hit only | 89.1% | |
| programmatic check only (FK, sentences, format) | 86.8% | |
| judge only (correct, responsive) | 91.2% | |
| mean FK (mean overshoot vs target) | 2.76 (-1.85) |
Pass by grade: G2 88.7%, G3 80.5%, G4 79.5%, G5 77.1%, G6 74.4%
Flag counts: fk_too_high=42, missing_terms=4, too_many_sentences=6
Reliability bar (>=90% overall, >=85% pressure) is NOT met. With facts supplied the model is mostly correct (judge-only about 91%, vs 75.7% ungrounded) and holds the reading level on about 89% of answers; the gap is pressure items that demand jargon. Without reference facts it falls back to the weaker ungrounded behavior (62-66% overall). A second judge (DeepSeek v4.1 flash) passes far fewer 4B answers (47.4% vs 67.5% on ungrounded round-2 outputs, kappa 0.47), so pass rates depend on the judge. Raw judge outputs: eval/judged.jsonl, run manifest: eval/manifest.json.
Known limits: eval questions come from the same generator as training (disjoint topics, not human-written); one seed per run.
- Downloads last month
- 5
Model tree for DavidSlayback1/grade-level-explainer-4b
Base model
Qwen/Qwen3-4B-Instruct-2507