Ministral-3-3B Math-Hard Prefix-Consistency GRPO

This is a merged full-weight fine-tune of mistralai/Ministral-3-3B-Instruct-2512-BF16 for mathematical reasoning. The model was optimized with GRPO and a Prefix-Consistency reward signal, then merged into the base weights so it can be loaded directly with transformers.

Model Details

  • Base model: mistralai/Ministral-3-3B-Instruct-2512-BF16
  • Training data: lighteval/MATH-Hard
  • Training method: GRPO with Prefix-Consistency reward shaping
  • Model format: Full-weight model
  • Primary task: step-by-step math problem solving
  • Recommended precision: bfloat16

The full training configuration is included in this repository.

Intended Use

This model is intended for research and experimentation with mathematical reasoning. It is best suited for problems where a worked solution and a final boxed answer are expected.

The training prompt asks the model to reason step by step and finish with a final line containing only a boxed answer, for example \boxed{...}.

Usage

import torch
from transformers import AutoTokenizer, Mistral3ForConditionalGeneration

model_id = "atifquamar07/ministral3-3b-math-hard-prefix-consistency-grpo"

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = Mistral3ForConditionalGeneration.from_pretrained(
    model_id,
    dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True,
)

messages = [
    {
        "role": "system",
        "content": (
            "You are an expert math solver. Solve the given problem while "
            "giving step-by-step reasoning. End with exactly one final line "
            "containing only \\boxed{...}. Stop immediately after the boxed "
            "final answer."
        ),
    },
    {"role": "user", "content": "Problem:\\nFind the value of x if 2x + 5 = 17."},
]

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

outputs = model.generate(
    inputs,
    max_new_tokens=8192,
    temperature=0.6,
    top_p=0.95,
    do_sample=True,
)

print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))

Training Summary

The model was fine-tuned with a LoRA adapter and then merged into the base model weights for direct inference. The training setup used MATH-Hard examples, chat-formatted prompts, long-form completions, and a reward design that emphasizes both answer correctness and Prefix-Consistency.

See the included training configuration for implementation details.

Limitations

This model is specialized for math reasoning and may be less reliable outside that domain. It can still make algebraic mistakes, produce overlong reasoning, or give an incorrect final answer with confident wording. Outputs should be checked independently when correctness matters.

No benchmark claim is made in this card unless separate evaluation results are added.

License And Terms

This model is derived from mistralai/Ministral-3-3B-Instruct-2512-BF16. Use is subject to the base model license, dataset terms, and any applicable distribution requirements.

Downloads last month
42
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for atifquamar07/ministral-3-3b-math-hard-pc-grpo