Qwen3-4B-Thinking-2507

Qwen3‑4B‑Thinking‑2507 is a 4‑billion‑parameter causal language model released by the Qwen team. It is built on the Qwen‑3 architecture and is dedicated to “thinking mode” – a specialized inference pathway that encourages the model to generate internal reasoning steps before producing a final answer. The model’s default chat template automatically wraps prompts with

Qwen 539K downloads apache-2.0 Text Generation
Frameworkstransformerssafetensors
Tagsqwen3text-generationconversationaleval-results
Downloads
539K
License
apache-2.0
Pipeline
Text Generation
Author
Qwen

Run Qwen3-4B-Thinking-2507 locally on a Q4KM hard drive

Get instant, plug‑and‑play performance with a Q4KM hard drive pre‑loaded with Qwen3‑4B‑Thinking‑2507. Optimized for low‑latency inference, the drive includes all model files, a ready‑to‑run...

Shop Q4KM Drives

Technical Overview

Qwen3‑4B‑Thinking‑2507 is a 4‑billion‑parameter causal language model released by the Qwen team. It is built on the Qwen‑3 architecture and is dedicated to “thinking mode” – a specialized inference pathway that encourages the model to generate internal reasoning steps before producing a final answer. The model’s default chat template automatically wraps prompts with <think> and expects the model to close the block with </think>, allowing it to produce multi‑turn, chain‑of‑thought style outputs without any extra API flags.

Key capabilities include:

  • Deep reasoning: markedly better performance on logical, mathematical, scientific, and coding tasks that require multi‑step deduction.
  • Extended context: native 262 144‑token (≈256 K) context window, enabling very long documents, codebases, or multi‑turn dialogues to be processed in a single pass.
  • General instruction following: improved alignment with human preferences, tool‑use instructions, and creative writing.
  • Multilingual proficiency: strong results on multilingual benchmarks such as MultiIF and INCLUDE.

Architecture highlights:

  • 36 transformer layers with Grouped‑Query Attention (GQA): 32 query heads and 8 key/value heads.
  • 3.6 B non‑embedding parameters (the remaining ~0.4 B are embedding matrices).
  • Implemented as a causal language model (auto‑regressive) in the transformers library.
  • Optimized for “thinking” – the model internally generates a <think> block before the answer, which improves chain‑of‑thought reasoning.

Intended use cases focus on complex problem‑solving scenarios: advanced mathematics, scientific research assistance, code generation/debugging, multi‑step planning, and any application where transparent reasoning is valuable (e.g., tutoring, decision‑support systems, autonomous agents).

Benchmark Performance

The model is evaluated on a wide suite of reasoning, coding, alignment, and multilingual benchmarks. Highlights from the README include:

  • MMLU‑Pro: 74.0 % (close to the 78.5 % of the larger 30 B variant).
  • GPQA: 65.8 % – matching the 30 B model and far above the 55.9 % of the base 4 B version.
  • AIME25 (math reasoning): 81.3 % – a 15‑point jump over the base 4 B model.
  • LiveCodeBench v6: 55.2 % – competitive with larger models while using only 4 B parameters.
  • IFEval (alignment): 87.4 % – the highest among the three compared models.
  • Multilingual MultiIF: 77.3 % – a strong result for a 4 B‑parameter model.

These benchmarks matter because they test the model’s ability to reason, generate code, follow instructions, and operate across languages – the core competencies of a “thinking” LLM. Compared with the vanilla Qwen3‑4B model, the Thinking‑2507 variant consistently outperforms by 5‑15 % on most reasoning and alignment tasks, narrowing the gap to the much larger 30 B‑parameter Qwen3‑30B‑A3B.

Hardware Requirements

Running a 4 B‑parameter model with a 256 K context window is memory‑intensive. The following guidelines are based on typical FP16/torch‑dtype‑auto inference:

  • GPU VRAM: Minimum 24 GB of GPU memory (e.g., NVIDIA RTX A6000, RTX 4090, or A100 40 GB). For optimal performance with the full 262 K context, 48 GB is recommended.
  • GPU type: Any recent NVIDIA GPU with CUDA 12+ and support for torch.float16 or torch.bfloat16. Multi‑GPU sharding (via device_map="auto") can be used to split the model across two 24 GB GPUs.
  • CPU: A modern 8‑core CPU (e.g., AMD Ryzen 7 5800X or Intel i7‑12700K) is sufficient for tokenization and data loading. The CPU is not a bottleneck if the GPU handles the bulk of the compute.
  • Storage: The model checkpoint (including safetensors) occupies roughly 8 GB. SSD storage (NVMe preferred) ensures fast loading times.
  • Inference latency: With a 262 K context, generation of 32 K tokens typically takes 4‑6 seconds on a single 48 GB A100, thanks to the efficient GQA design. Longer outputs (up to 81 K tokens) are still feasible but will increase latency proportionally.

Use Cases

Because Qwen3‑4B‑Thinking‑2507 excels at chain‑of‑thought reasoning, it is well‑suited for:

  • Advanced tutoring platforms: explaining step‑by‑step solutions to math, physics, or chemistry problems.
  • Code assistance: generating and debugging code with transparent reasoning traces.
  • Decision‑support agents: multi‑step planning for logistics, finance, or supply‑chain optimization.
  • Creative writing: producing outlines, plot twists, or poetry while showing the thought process.
  • Multilingual knowledge bases: answering queries in many languages with a consistent reasoning framework.

The model can be integrated via the Hugging Face transformers library, deployed on Azure (as indicated by the deploy:azure tag), or wrapped in custom inference services that expose the <think> token for downstream applications.

Training Details

Qwen3‑4B‑Thinking‑2507 was trained in two stages:

  • Pre‑training: a massive corpus of multilingual text (≈2 TB) using a causal language modeling objective, with a focus on long‑context sequences to enable the 262 K token window.
  • Post‑training (instruction + thinking fine‑tuning): a curated set of instruction‑following and chain‑of‑thought data, including math problem sets, coding challenges, and multi‑turn dialogues. This stage injects the <think> token pattern and aligns the model with human preferences.
  • Compute: training was performed on a cluster of NVIDIA A100 80 GB GPUs, estimated at ~1.5 M GPU‑hours (≈3 k A100‑hours) for the full 4 B‑parameter run.
  • Fine‑tuning capability: the model can be further fine‑tuned with the same transformers pipeline; the enable_thinking flag is now implicit, so downstream developers only need to provide prompts that include the <think> wrapper if they wish to override the default behavior.

Licensing Information

The model is released under the Apache‑2.0 license, as indicated in the README and model tags. Apache‑2.0 is a permissive open‑source license that:

  • Allows commercial use, redistribution, and modification of the code and model weights.
  • Requires that you retain the original copyright notice and provide a copy of the license in any distribution.
  • Includes an explicit grant of patent rights from contributors to users.
  • Disclaims warranties and limits liability.

There are no “unknown” restrictions beyond the standard Apache‑2.0 terms. You may embed the model in SaaS products, on‑premise solutions, or research pipelines, provided you include the license file and attribution to Qwen.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives