Llama 3.2 1B Instruct Math SFT LoRA

This is a LoRA adapter fine-tuned from meta-llama/Llama-3.2-1B-Instruct for mathematical reasoning.

Training setup

  • Framework: Unsloth + TRL SFTTrainer
  • Launch: 2-GPU DDP via torchrun --nproc_per_node=2
  • GPUs: x2 H200
  • LoRA rank: 64
  • LoRA alpha: 128
  • Max sequence length: 2048
  • Epochs configured: 5
  • Early stopping: metric-based, not epoch-based
  • Metric early-stop rule: stop when combined GSM8K/MATH-500 probe score does not improve by at least 0.75 percentage points for 2 checks

Dataset mixture

  • 70% nvidia/OpenMathInstruct-2
  • 15% meta-math/MetaMathQA
  • 10% TIGER-Lab/MathInstruct
  • 5% AI-MO/NuminaMath-CoT

Exact decontamination was applied against GSM8K test and MATH-500 test question text hashes.

Final evaluation

Benchmark Accuracy
GSM8K test 50.57%
MATH-500 test 28.80%
Combined average 39.68%

Usage

from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="Kiffaz11/llama-3.2-1b-instruct-math-sft-lora",
    max_seq_length=4096,
    dtype=None,
    load_in_4bit=False,
)

FastLanguageModel.for_inference(model)

messages = [
    {
        "role": "user",
        "content": "Solve step by step. Put the final answer in \\boxed{}. What is 17*23?",
    }
]

inputs = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_tensors="pt",
    return_dict=True,
).to(model.device)

outputs = model.generate(
    **inputs,
    max_new_tokens=256,
    do_sample=False,
)

print(
    tokenizer.decode(
        outputs[0][inputs["input_ids"].shape[-1]:],
        skip_special_tokens=True,
    )
)
Downloads last month
122
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Kiffaz11/llama-3.2-1b-instruct-math-sft-lora

Adapter
(644)
this model

Datasets used to train Kiffaz11/llama-3.2-1b-instruct-math-sft-lora

Free AI Image Generator No sign-up. Instant results. Open Now