Skip to content
Other

Llama-3.2-3B-Thinking-SFT: A compact language model with step-by-step reasoning support

2 min readupdated

This model is a fully fine-tuned supervised fine-tuning (SFT) version of the base Llama-3.2-3B trained on a bilingual corpus (English and Chinese) with an internal reasoning mechanism added. Before providing the final answer, the model generates a hidden reasoning block inside special tags, which improves the logic of its responses. On simple tasks, the model can immediately output an empty block without unnecessary reasoning. This development will be useful for developers of local intelligent systems who need transparency in the AI's thought process on small hardware.

Key features

  • Reasoning mode: Responses are wrapped in reasoning tags that separate the internal monologue from the final result.
  • Bilingual training: The dataset includes high-quality annotated reasoning chains in English and Chinese.
  • Runtime integration: Full compatibility with the transformers, vLLM, and llama.cpp ecosystems via a special tokenizer config.
  • Training efficiency: The model was full-parameter fine-tuned on a single graphics card with a peak VRAM consumption of about 14.2 GB.

What you can do

  • Chat client integration: Run the model in Cherry Studio or other interfaces with support for displaying thought process blocks.
  • Logic problem solving: Use it to check precise reasoning, basic coding, and mathematical examples.
  • Local deployment via vLLM: Set up a fast local text generation server with chat template support.
  • Inference logic control: Flexibly disable the reasoning mode on the fly via generation parameters and logit bias.

Example

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

tok = AutoTokenizer.from_pretrained("wesjos/Llama-3.2-3B-Thinking-SFT")
model = AutoModelForCausalLM.from_pretrained(
    "wesjos/Llama-3.2-3B-Thinking-SFT", dtype=torch.bfloat16, device_map="auto"
)

messages = [{ "role": "user", "content": "what is 89x12" }]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(text, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**inputs, max_new_tokens=1024, do_sample=True, temperature=0.6, top_p=0.95)
print(tok.decode(out[0], skip_special_tokens=False))
Read moreDetails
Benchmarks (GSM8K): accuracy with reasoning is 57.62%, and with thinking forcibly disabled it is 56.94%.
Hardware requirements: Training was performed on a GPU with 24 GB VRAM (14.2 GB peak); a consumer graphics card is sufficient for running it.
Training details: 4 epochs, Unsloth, PagedAdamW8bit optimizer, LR 2e-5, maximum sequence length of 8192 tokens.
Limitations: An SFT version without an RL stage, the dataset contains training examples from benchmarks, and the model may make mistakes in long calculation chains.
Discuss Telegram 0 77

Will it run?

Runs in BF16

Fits without quantisation.

  • BF16weights 6.0 GB · ready files7.1 GB
  • FP8 / INT8recommendedweights 3.0 GB3.8 GB
  • 4-bitweights 1.7 GB2.4 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 2060 · BF16 — from RTX 5060 Ti 8GB

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # wesjos/Llama-3.2-3B-Thinking-SFT
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download wesjos/Llama-3.2-3B-Thinking-SFT --local-dir ~/models/Llama-3.2-3B-Thinking-SFT
    # The model is in ~/models. How to run it is in the model card (link above).
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b41from November 25, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of Llama-3.2-3B (quants, finetunes, LoRAs) will show up under the bell.

Quantised versions 12All on Hugging Face
Fine-tunes 12All on Hugging Face
LoRAs and adapters 8All on Hugging Face
Merges 3All on Hugging Face

About the model

wesjos/Llama-3.2-3B-Thinking-SFT
Author
wesjos
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

770

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments