Views
No views yet
mistralai/Mathstral-7B-v0.1, trained with Dr. GRPO as the No draft (GRPO baseline) condition in "Weak-to-Strong Elicitation via Mismatched Wrong Drafts" (Wei Deng, arXiv:2605.17314).mistralai/Mathstral-7B-v0.1 (Apache-2.0)no_draft of hugruby/mismatched-wrong-drafts — 8,888 Level 3–5 MATH problems (MATH-500 held out)1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5BASE = "mistralai/Mathstral-7B-v0.1"
6ADAPTER = "hugruby/mathstral-7b-grpo-no-draft"
7
8tok = AutoTokenizer.from_pretrained(ADAPTER)
9model = PeftModel.from_pretrained(
10 AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.bfloat16, device_map="auto"),
11 ADAPTER,
12).eval()
13
14problem = "If $x+y=6$ and $xy=5$, find $x^2+y^2$."
15gen = dict(max_new_tokens=4096, do_sample=False)
16
17# CANONICAL — the plain draft-free prompt the model was trained and evaluated on (no [INST]):
18PROMPT = (
19 "Problem: " + problem + "\n\n"
20 "Thinking: N/A\n\n"
21 "The thinking section may contain errors. Solve the math problem step by step. "
22 "Write your own correct solution. Put your final answer within \\boxed{}.\n\n"
23 "Correct Solution:"
24)
25ids = tok(PROMPT, return_tensors="pt").to(model.device)
26print(tok.decode(model.generate(**ids, **gen)[0][ids.input_ids.shape[1]:], skip_special_tokens=True))[INST] chat format (out-of-distribution)chat_template.jinja is Mathstral's original [INST] chat template. This adapter was not trained in that format, so apply_chat_template(...) is out-of-distribution and generally underperforms the plain prompt above — it is included only so you can A/B both:1ids = tok.apply_chat_template(
2 [{"role": "user",
3 "content": problem + "\n\nPlease reason step by step, and put your final answer within \\boxed{}."}],
4 add_generation_prompt=True, return_tensors="pt").to(model.device)
5print(tok.decode(model.generate(ids, **gen)[0][ids.shape[1]:], skip_special_tokens=True))loss_type=dr_grpo, scale_rewards=False) using TRL GRPOTrainer on top of Unsloth FastLanguageModel, on the no_draft data config. The reward is binary mathematically_quasi_correct. The correction-bonus, copy-penalty, and corrupt-penalty terms are all 0, and the reward is pure binary.1python scripts/train.py \
2 --model mistralai/Mathstral-7B-v0.1 \
3 --dataset-path data/no_draft \
4 --output-dir outputs/no_draft \
5 --max-steps 2222 \
6 --gradient-accumulation-steps 4 \
7 --max-completion-length 4096 \
8 --max-seq-length 7168 \
9 --learning-rate 5e-6 --lr-scheduler-type constant \
10 --beta 0 \
11 --correction-bonus 0.0 --copy-penalty 0.0 --corrupt-penalty 0.0 \
12 --adam-beta2 0.99 \
13 --save-steps 50 --gpu-mem-util 0.5| Hyperparameter | Value |
|---|---|
| Base model | mistralai/Mathstral-7B-v0.1 |
| Method | Dr. GRPO (loss_type=dr_grpo, scale_rewards=False) |
| LoRA rank / alpha | r = 16, α = 32 → scaling γ = α/r = 2 |
| LoRA targets / dropout | q,k,v,o,gate,up,down (7 projections) / 0.0 |
| KL coefficient β | 0 |
| Reward bonuses | correction 0, copy-penalty 0, corrupt-penalty 0 |
| Generations per prompt | 16 |
| Per-device batch | 1 |
| Gradient accumulation | 4 → 4 problems × 16 = 64 completions/step |
| Learning rate | 5e-6, constant schedule |
| Adam β₂ | 0.99 |
| Max completion length | 4096 |
| Max sequence length | 7168 |
| Max prompt tokens | Disabled and no truncation. Since no drafts, prompts are short — longest 1,899 tok, well under the implicit 3,072 = 7,168 − 4,096 budget. As a result, disabling is equivalent to setting it to 3,072. |
| Max steps | 2222 |
| Released checkpoint | global step 2000 (epoch 0.900) |
| Random seed | 42 |
adapter_model.safetensors, adapter_config.json — the LoRA adapter (load with PEFT on the base model)tokenizer.json, tokenizer.model, tokenizer_config.json, special_tokens_map.json — tokenizerchat_template.jinja — Mathstral's [INST] template (see the out-of-distribution note above)1@article{deng2026mismatched,
2 title = {Weak-to-Strong Elicitation via Mismatched Wrong Drafts},
3 author = {Deng, Wei},
4 journal = {arXiv preprint arXiv:2605.17314},
5 year = {2026},
6 url = {https://arxiv.org/abs/2605.17314}
7}Mathstral-7B-v0.1) and the draft model (Qwen2.5-Math-1.5B) are both Apache-2.0.