Llama-3.2-3B-Instruct · GSM8K-Aug-NL explicit CoT
Llama-3.2-3B-Instruct fine-tuned to write a natural-language chain of thought and then a final answer for grade-school math word problems. It was trained on zen-E/GSM8k-Aug-NL as the explicit-CoT teacher/baseline in a latent-reasoning study.
Training used LoRA. The adapter is merged into the weights here, so this is a standard LlamaForCausalLM checkpoint in bf16 with the original Llama 3.2 vocabulary.
Results
Greedy decoding, up to 256 new tokens. Scoring takes the last number in the generation and compares it with the reference answer.
| Benchmark | Accuracy |
|---|---|
| GSM8K test (1,319) | 71.34 (941) |
| GSM-Hard (1,319) | 21.38 (282) |
| SVAMP (1,000) | 75.40 (754) |
| MultiArith (180) | 100.00 (180) |
| Validation (518 held-out GSM8K train questions) | 76.45 (396) |
The checkpoint was chosen by validation accuracy alone (epoch 4 of 10). Test and OOD sets played no part in selecting it. All scores above come from the unmerged training checkpoint. Re-scoring this merged release on GSM8K test with model.generate gives 71.49 (943/1319), and 1,238 of 1,319 final answers match the original run. bf16 rounding after the merge accounts for the small difference.
Prompt format
Do not use the chat template. The model was trained on raw text: <|begin_of_text|> + question, then it generates the chain of thought, a newline, The answer is: <number>, and <|eot_id|>.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
name = "hanseungwook/Llama-3.2-3B-Instruct-gsm8k-aug-nl-explicit-cot"
tokenizer = AutoTokenizer.from_pretrained(name, padding_side="left")
model = AutoModelForCausalLM.from_pretrained(name, torch_dtype=torch.bfloat16, device_map="auto")
question = "Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?"
inputs = tokenizer([question], return_tensors="pt").to(model.device)
output = model.generate(**inputs, do_sample=False, max_new_tokens=256)
print(tokenizer.decode(output[0, inputs["input_ids"].size(1):], skip_special_tokens=True))
# ... 9 * $2 = $18 per day at the farmers' market.
# The answer is: 18
The evaluation strips each question and replaces double spaces with single spaces before tokenizing. The bundled generation_config.json is set to greedy decoding with 256 new tokens.
Training
| Base model | meta-llama/Llama-3.2-3B-Instruct (revision 0cb88a4f764b7a12671c53f0838cd831a0843b95) |
| Data | zen-E/GSM8k-Aug-NL train (revision e20551f); full CoT including its final step; examples over 256 tokens dropped |
| Target | question → cot + "\n" + "The answer is: N" + eos; loss on the CoT, answer and eos tokens only |
| Adapter | LoRA r=128, alpha=32, dropout 0.1 on q/k/v/o/gate/up/down projections; embeddings frozen |
| Optimization | AdamW, LR 3e-4, cosine schedule, 3% warmup, weight decay 0.1, grad-norm clip 2.0, bf16 |
| Batch | 128 (4 GPUs × 32), 10 epochs (2,983 steps/epoch); this is step 11,932 (end of epoch 4) |
| Validation | 518 GSM8K train questions that do not appear in GSM8k-Aug-NL, evaluated each epoch |
| Seed | 11 |
training_manifest.json records the full training contract (data pipeline, loss, LoRA config, runtime versions).
Export
The training checkpoint held the LoRA-wrapped model with three extra embedding rows (pad plus two reserved tokens) that no training sequence ever attends to. For this release, LoRA was merged in fp32 and cast to bf16. The three extra rows were dropped, leaving the stock 128,256-token vocabulary. <|finetune_right_pad_id|> serves as the pad token.
License
Built with Llama. This model is a derivative of Llama 3.2 and is distributed under the Llama 3.2 Community License, subject to the Acceptable Use Policy.