Qwen3-4B-Thinking-2507

Updated
05.10.2026
Thinking
Reasoning
Code
Tools
Multilingual

A 4B reasoning-focused LLM from Alibaba’s Qwen3 series that always thinks step by step, with a 256K context and strong math, coding, and agentic scores.

At a glance

  • License: Apache 2.0
  • Parameters: 4.0B (3.6B non-embedding)
  • Context length: 262,144 tokens
  • Modalities: Text input and output
  • Minimum hardware: 4 GB of memory with the 1.70 GB UD-Q2_K_XL build

What is Qwen3-4B-Thinking-2507?

Qwen3-4B-Thinking-2507 is a 4 billion parameter reasoning model from the Qwen team, an updated build of the Qwen3-4B thinking variant published on Hugging Face on August 5, 2025. It runs in thinking mode only: every answer starts with a reasoning trace, and the chat template enforces it. The local appeal is the size: the Q4_K_M build is a 2.50 GB file with a native 262,144 token context.

SpecificationQwen3-4B-Thinking-2507
Total parameters4.0B (3.6B non-embedding)
Model typeCausal language model
Layers36
AttentionGQA, 32 query heads and 8 key/value heads
Context window262,144 tokens natively
ModalitiesText input and output
ReasoningThinking only, cannot be switched off
Training stagePretraining and post-training
Recommended output length32,768 tokens, 81,920 for competition math and coding
Release dateAugust 5, 2025
LicenseApache 2.0

Qwen presents the 2507 build as three more months of work on the thinking capability of the original Qwen3-4B, aimed at both the quality and the depth of the reasoning. The claims on the model card are specific: significantly improved performance on logical reasoning, mathematics, science, coding and academic benchmarks that typically require human expertise, markedly better general capabilities in instruction following, tool usage, text generation and alignment with human preferences, and enhanced 256K long-context understanding. Qwen is blunt about the cost: this version has an increased thinking length, and the team strongly recommends it for highly complex reasoning tasks.

The thinking budget is the point of the update. Qwen recommends a 32,768 token output length for most queries and 81,920 tokens for competition math and programming, with sampling at temperature 0.6, top-p 0.95, top-k 20 and min-p 0. A presence penalty between 0 and 2 cuts endless repetition, at the risk of language mixing and a slight quality loss at the top of that range. The template opens the reasoning block itself, so responses carry only a closing </think> tag, and it drops thinking content from earlier turns automatically. For serving, Qwen names sglang 0.4.6.post1 or newer and vllm 0.8.5 or newer, both with the deepseek-r1 reasoning parser, and points local users at Ollama, LMStudio, MLX-LM, llama.cpp and KTransformers.

Qwen3-4B-Thinking-2507 benchmarks

The numbers Qwen publishes on the model card compare the 2507 refresh with the original Qwen3-4B Thinking and the much larger Qwen3-30B-A3B Thinking:

BenchmarkQwen3-4B-Thinking-2507Qwen3-4B ThinkingQwen3-30B-A3B Thinking
MMLU-Pro
Academic knowledge
74.070.478.5
GPQA
Expert science
65.855.965.8
AIME25
Competition math
81.365.670.9
HMMT25
Olympiad math
55.542.149.8
LiveCodeBench v6
Competitive coding
55.248.457.4
IFEval
Instruction following
87.481.986.5
BFCL-v3
Tool calling
71.265.969.1
TAU2-Retail
Retail agents
53.538.634.2

The refresh beats the original 4B on every row and takes five of the eight from Qwen3-30B-A3B Thinking, all the math and agent rows among them, plus a tie on GPQA. The 30B keeps the lead on broad knowledge and competitive coding. The wider vendor table follows the same split: the 4B pulls ahead on multilingual instruction following (MultiIF 77.3 against 72.2) and on WritingBench (83.3 against 77.0), while the 30B stays in front on MMLU-Redux, SuperGPQA, Arena-Hard v2 and the knowledge-heavy multilingual sets MMLU-ProX and INCLUDE.

Qwen3-4B-Thinking-2507 hardware requirements

The system requirement to check is memory. The builds below are real file sizes from unsloth/Qwen3-4B-Thinking-2507-GGUF.

MemoryBuild to pickFile size
4 GBUD-Q2_K_XL1.70 GB
6 GBUD-Q3_K_XL2.13 GB
8 GBQ4_K_M2.50 GB
10 GBQ5_K_M2.89 GB
12 GBQ6_K3.31 GB
16 GBQ8_04.28 GB
24 GB and upF168.05 GB

The repo goes below the table too, down to UD-IQ2_M at 1.53 GB and UD-IQ1_S at 1.08 GB, which is where quality falls fastest: those files cut the weights harder than the rest of the ladder while saving only a few hundred megabytes over UD-Q2_K_XL. From Q4_K_M up the whole ladder to Q8_0 spans 1.8 GB, so a step up is cheap, and when two builds both fit, take the larger one. Leave more headroom than usual for context, since the model reasons at length: Qwen recommends keeping the context above 131,072 tokens where you can, and only shrinking it if you hit out of memory errors. If the format is new to you, start with what GGUF is, and see the best local LLMs for a 16 GB Mac for what else fits alongside it.

How to run Qwen3-4B-Thinking-2507 in Atomic Chat

Atomic Chat is a free local app for macOS, Windows and Linux. It includes a Hugging Face model browser and a built-in chat, with no manual llama.cpp build required.

  1. Download Atomic Chat for your platform and open it.
  2. Search for Qwen3-4B-Thinking-2507 in the model browser and open Download Options.
  3. Pick the build that fits the memory you have, then start a chat.

For the rest of the lineup, see every Qwen model you can run locally.

Qwen3-4B-Thinking-2507 license

Qwen3-4B-Thinking-2507 is released under Apache 2.0. That permits commercial use, modification and redistribution with no royalties, so you can ship products built on the model and run it on your own hardware without a usage fee.

Get the weights from Hugging Face

pip install -U "transformers>=4.51.0"
huggingface-cli download Qwen/Qwen3-4B-Thinking-2507
# or via Ollama:
ollama run qwen3:4b-thinking-2507
curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3-4B-Thinking-2507",
    "messages": [{"role": "user", "content": "Prove that sqrt(2) is irrational."}],
    "temperature": 0.6,
    "top_p": 0.95
  }'
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Qwen/Qwen3-4B-Thinking-2507"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "Solve: what is 17 * 23?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=32768)
print(tokenizer.decode(out[0][len(inputs.input_ids[0]):], skip_special_tokens=True))
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "http://localhost:8000/v1", apiKey: "EMPTY" });
const res = await client.chat.completions.create({
  model: "Qwen/Qwen3-4B-Thinking-2507",
  messages: [{ role: "user", content: "Explain the proof of the Pythagorean theorem." }],
  temperature: 0.6,
  top_p: 0.95,
});
console.log(res.choices[0].message.content);
Desktop
macOS
(Intel and Apple Silicon)
Download
Windows
(x64)
Download
Windows
(ARM64)
Download
Linux
(x86_64)
Download

Frequently asked questions

Qwen3-4B-Thinking-2507 is a 4-billion-parameter causal language model from Alibaba's Qwen team, released in 2507 (July 2025). It runs exclusively in thinking mode, generating an explicit reasoning trace inside <think> tags before the final answer. It is built for complex reasoning across math, science, coding, and agentic tool use.

At 4B parameters, the model runs on modest hardware. A 4-bit quantized GGUF needs roughly 4-6 GB of VRAM or unified memory, so it works on an 8 GB GPU or an Apple Silicon Mac. Full bf16 weights are about 8 GB. Note that because the model reasons at length, the team recommends a context window above 131K, which raises KV-cache memory use during long generations.

Yes. Qwen3-4B-Thinking-2507 is released under the Apache 2.0 license, which permits free use, modification, redistribution, and commercial deployment without royalties. You can download the weights from Hugging Face and run them locally through transformers, vLLM, SGLang, Ollama, LM Studio, or llama.cpp.

The model supports a native context length of 262,144 tokens (256K). This 2507 release specifically enhances long-context understanding over the original Qwen3-4B. The Qwen team recommends keeping the context above 131,072 tokens when possible, since the model often needs long token sequences for its extended reasoning.

The Thinking variant runs only in reasoning mode and always emits a chain-of-thought before answering, which makes it stronger on hard math, science, and coding problems (for example, 81.3 on AIME25). The Instruct-2507 sibling responds directly without a visible thinking trace, so it is faster and better suited to straightforward chat and instruction-following where deep reasoning is not needed.