Views
No views yet
| Base model | unsloth/Llama-3.2-1B |
| Method | LoRA (r=16, α=16, dropout=0) on all attention + MLP projections, merged to full weights |
| Dataset | MathLLMs/MathCodeInstruct, 5k training examples |
| Epochs | 1 |
| Effective batch size | 16 (batch 1 × grad. accum. 16) |
| Learning rate | 2e-4, cosine schedule, warmup ratio 0.03 |
| Hardware | 1× RTX 4060 (8GB) |
| Framework | Unsloth + TRL SFTTrainer |
| Benchmark | Llama-3.2-1B (base) | MathCodeInstruct-5k | Change |
|---|---|---|---|
| GSM8K | 5.8% | 7.4% | 🟢 +1.5% |
| ARC-Challenge | 36.9% | 36.8% | ⚪ -0.1% |
| HellaSwag | 64.2% | 63.8% | 🔴 -0.3% |
| WinoGrande | 60.8% | 62.4% | 🟢 +1.7% |

1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "OliverSundaram/Llama-3.2-1B-MathCodeInstruct-5k"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
6
7messages = [
8 {"role": "system", "content": "Below is a math problem. Please solve it step by step."},
9 {"role": "user", "content": "If a train travels 60 miles in 45 minutes, what is its speed in miles per hour?"},
10]
11inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
12output = model.generate(inputs, max_new_tokens=512, do_sample=False)
13print(tokenizer.decode(output[0], skip_special_tokens=True))