A mathematics-specialized instruction dataset designed to improve reasoning, structured problem solving, and educational AI assistants through supervised fine-tuning with Adaptation Labs AutoScientist.
objective:
description: "The adapted model minimizes the supervised language-modeling loss over the Adaptive Math 2 dataset."
equation: |
θ* = argmin_θ L(θ)
interpretation:
rank: "r = 16 controls the low-rank adaptation capacity."
scaling: "α/r = 2 controls the magnitude of the LoRA update."
regularization: "LoRA dropout = 0 and weight decay = 0."
stability: "Gradient norm is clipped at 2."
schedule: "Learning rate follows a linear schedule after a 3% warmup."
Training Interpretation
benchmark:
adaptation_strategy: "Parameter-efficient fine-tuning"
objective: "Improve mathematical reasoning while preserving the pretrained model."
full_parameter_update: false
low_rank_update: true
key_result:
statement: |
Adaptive Math 2 applies a low-rank parameter update rather than
retraining the complete 109B-parameter model.
mathematical_summary: |
W_adapted = W_base + 2BA
meaning:
- "W_base represents the pretrained model."
- "A and B are learned low-rank matrices."
- "r = 16 defines the adaptation rank."
- "α = 32 gives a scaling factor of 2."
- "Only the selected target modules receive LoRA updates."
The model was trained on 1,306 rows of adapted data with the following domain distribution: math (77%), code (8%), science (8%), academic-education (8%).
Model Evaluation
The model was evaluated on an in-distribution held-out test set as well as a broader domain-specific test set to measure generalization.
Win rates
Domain
Win rate vs. base model
math
66%
How to use
pip install torch transformers peft
python
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
45BASE ="meta-llama/Llama-4-Scout-17B-16E-Instruct"6ADAPTER ="<this-repo-id>"78device ="cuda"if torch.cuda.is_available()else"cpu"9dtype = torch.float32 if device =="cpu"else torch.bfloat16
1011base = AutoModelForCausalLM.from_pretrained(BASE, dtype=dtype).to(device)12model = PeftModel.from_pretrained(base, ADAPTER)13# Optional: merge the LoRA weights into the base for faster inference14model = model.merge_and_unload()15model.eval()1617tokenizer = AutoTokenizer.from_pretrained(BASE)18messages =[{"role":"user","content":"Hello!"}]19text = tokenizer.apply_chat_template(20 messages, tokenize=False, add_generation_prompt=True)21inputs = tokenizer(text, return_tensors="pt").to(device)2223with torch.inference_mode():24 out = model.generate(**inputs, max_new_tokens=512)25print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))