Skip to main content
Browse Models

Alibaba Cloud

Qwen3 4B

Released

2025-04-28

Family

Qwen 3

Type

Foundation Model

Downloads

External Download

You are about to open a link to an external source. Verify the URL before continuing.

Download

4-bit GGUF (Q4_K_M)

GGUF · Qwen_Qwen3-4B-Q4_K_M.gguf

5-bit GGUF (Q5_K_M)

GGUF · Qwen_Qwen3-4B-Q5_K_M.gguf

6-bit GGUF (Q6_K)

GGUF · Qwen_Qwen3-4B-Q6_K.gguf

8-bit GGUF (Q8_0)

GGUF · Qwen_Qwen3-4B-Q8_0.gguf

Ollama Model (q4_K_M)

Ollama

Model Report

Overview

Qwen3-4B is a dense large language model (LLM) developed by Alibaba Cloud's Qwen team, constituting one of several open-weight models in the Qwen3 series. Released on April 29, 2025, and distributed under the Apache 2.0 License, Qwen3-4B incorporates advanced training techniques, supports a wide range of languages, and is notable for its dual-mode reasoning design. With a parameter count of 4.0 billion, it addresses diverse applications requiring both rapid inference and complex reasoning capabilities.

Benchmark comparison table for Qwen3-4B and other language models

Figure 1. Performance benchmarks comparing Qwen3-4B to other LLMs across tasks, including math, coding, critical reasoning, and multi-turn dialogue.

Architecture and Design

Qwen3-4B is architected as a 36-layer transformer model employing 4.0 billion total parameters (of which 3.6 billion are non-embedding). Its core architecture builds upon recent advancements and improvements made over previous Qwen models. Notable features include Grouped Query Attention (GQA) for efficient attention computation, the SwiGLU activation function, and pre-normalization using RMSNorm, all contributing to stable and scalable training.

The model utilizes byte-level byte-pair encoding (BBPE) for tokenization with a vocabulary of 151,669 entries, facilitating robust multilingual representation. Rotary positional embeddings (RoPE) are extended using the ABF technique for increased base frequency, supporting context lengths up to 32,768 tokens by default and up to 131,072 tokens through YaRN scaling. Attention stability is further bolstered by the introduction of QK-Norm, and the design omits QKV-bias for streamlined computation.

Training Methodology and Data

Qwen3-4B is pretrained on a vast corpus of approximately 36 trillion tokens sourced from diverse web documents, programming code, STEM content, and curated text from 119 languages and dialects, doubling the scale of its predecessor, Qwen 2.5. A three-stage pretraining regimen is implemented: an initial general language acquisition stage, a reasoning-focused phase targeting knowledge-intensive tasks, and a final long-context training phase to extend effective context window size.

During post-training, flagship models undergo four refinement steps: long chain-of-thought (CoT) cold start, reinforcement learning (RL) with reasoning-based rewards, thinking mode fusion to integrate instruction following and reasoning, and general RL on broad task sets. Due to their smaller sizes, models like Qwen3-4B use a strong-to-weak distillation pipeline, leveraging teacher models for knowledge transfer and efficient post-training. Both off-policy and on-policy distillation are applied to maximize performance in reasoning and general instruction following.

Qwen3 distillation diagram

Figure 2. Diagram of Qwen3 post-training processes: top section shows comprehensive RL-based refinement for flagship models, while the lower section illustrates strong-to-weak distillation used for smaller models like Qwen3-4B.

Unique Features and Capabilities

A defining innovation of Qwen3-4B and the broader Qwen3 series is the integration of dual "thinking modes" within a single model, allowing flexible adaptation between analytic reasoning and rapid response generation. The default "thinking mode" generates intermediate reasoning, wrapping it in <think>...</think> tags prior to emitting a final answer. This is suitable for complex problem-solving, logical reasoning, mathematics, and coding tasks. In contrast, the "non-thinking mode" offers near-instant responses for straightforward queries by disabling explicit step-by-step reasoning.

Users can dynamically control the mode via prompt tags such as /think and /no_think or via configuration, with the model adhering to the most recent directive in interactive contexts. This approach allows fine-grained budget management for reasoning-intensive workflows, enhancing computational efficiency and offering a unified solution for tasks of varying difficulty.

Qwen3-4B also supports task-specific alignment and agentic capabilities—such as tool-calling—through integration with frameworks like Qwen-Agent. The instruction set and chat template enable nuanced response formatting and tool interaction, supporting complex multi-turn dialogue and utility-oriented workflows.

Qwen3-4B showcased executing advanced agentic reasoning—demonstrating its dynamic tool-calling capability and 'thinking mode' output structure. · Source

Performance and Benchmarks

Evaluation across multiple benchmarks indicates that Qwen3-4B delivers competitive results relative to models with higher parameter counts. On tasks demanding logical reasoning, mathematics, coding, and multilingual understanding, Qwen3-4B matches or exceeds prior generations such as Qwen 2.5 7B, and demonstrates leadership among similarly sized models. Notable scores include 83.7 on MMLU-Redux, 77.5 on C-Eval, 97.0 on MATH-500, and 65.9 on MLogiQA, with strong showings in both thinking and non-thinking modes.

On extended context tasks, Qwen3-4B achieves an average RULER benchmark score of 85.2 in non-thinking mode, with performance gracefully diminishing as sequence lengths approach 128,000 tokens. Although thinking mode slightly reduces retrieval-oriented accuracy for long-range input, it maintains robust reasoning ability for tasks benefiting from detailed intermediate steps.

The model's multilingual performance reflects extensive pretraining coverage, enabling strong results in language understanding, translation, and multi-lingual benchmarks. STEM and code evaluation results are elevated through targeted data synthesis and alignment techniques.

Limitations

While Qwen3-4B offers diverse capabilities, certain limitations are observed. Performance on lengthy retrieval tasks is marginally reduced when operating in thinking mode, which may introduce extraneous generation not beneficial to information extraction. The use of greedy decoding strategies can result in repetitive or degraded responses, thus sampling parameters such as temperature and top-p should be carefully tuned as recommended. The static YaRN scaling, available in many open frameworks, can affect response quality for shorter sequences when enabled unnecessarily, so configuration should match application needs.

Strong-to-weak distillation, while computationally efficient, may result in modest reductions in specialized reasoning compared to full RL post-training, particularly for challenging problems introduced after thinking mode fusion. However, this is partially offset by overall gains in model versatility and general ability.

Model Family and Comparisons

Qwen3-4B belongs to a family of both dense and Mixture-of-Expert (MoE) models covering parameter scales from 0.6B up to 235B. Dense Qwen3 variants, such as Qwen3 0.6B, Qwen3 1.7B, Qwen3 8B, Qwen3 14B, and Qwen3 32B, are directly comparable to and often outperform previous Qwen2.5 models with larger footprints, highlighting architectural and scaling improvements. The MoE models, like Qwen3-30B-A3B and Qwen3-235B-A22B, further optimize performance-per-activation and minimize inference costs at larger scales.

Release Timeline

Qwen3-4B and the Qwen3 series were officially launched on April 29, 2025. The comprehensive technical report was published on arXiv on May 14, 2025, detailing methodologies, benchmarks, and best practices for deployment and research.

Further Reading and External Resources

More from Alibaba Cloud

Alibaba Cloud /

Qwen2.5 VL 3B

A 3B-parameter multimodal language model that processes images, videos, and text with capabilities for visual reasoning, document analysis, and computer interface interaction.
Alibaba Cloud /

Qwen2.5 VL 7B

A 7-billion parameter multimodal model capable of processing images, documents, and videos with native dynamic resolution support and structured output capabilities.
Alibaba Cloud /

Qwen2.5 VL 72B

A 72-billion parameter multimodal model that processes images, videos, and text for document analysis, object detection, and visual agent tasks.
Alibaba Cloud /

QwQ 32B Preview

Experimental research model focused on advancing AI reasoning capabilities by thinking through problems step by step, continuously questioning assumptions, and exploring different paths of thought. Impressive benchmark scores in math and coding tasks.
Alibaba Cloud /

QwQ 32B

A 32.5-billion parameter transformer model optimized for mathematical reasoning, coding, and complex problem-solving through reinforcement learning training.
Alibaba Cloud /

Qwen 2.5 Math 1.5B

A 1.5 billion parameter specialized model focused on mathematical reasoning and problem-solving capabilities in English and Chinese.
Alibaba Cloud /

Qwen 2.5 Math 7B

A 7.62-billion parameter mathematical reasoning model supporting English and Chinese with chain-of-thought and tool-integrated reasoning capabilities.
Alibaba Cloud /

Qwen 2.5 Math PRM 7B

A 7B parameter process reward model that evaluates mathematical reasoning steps individually rather than just final answers, achieving 67.6% accuracy on mathematical benchmarks.
Alibaba Cloud /

Qwen 2.5 Math 72B

A 72.7 billion parameter language model specialized for solving mathematical problems in English and Chinese using chain-of-thought and tool-integrated reasoning.
Alibaba Cloud /

Qwen 2.5 Math PRM 72B

A 72.8 billion parameter process reward model that evaluates intermediate mathematical reasoning steps using consensus filtering and achieves 78.3% F1 on ProcessBench.
Alibaba Cloud /

Qwen 2.5 Coder 7B

A 7.61 billion parameter transformer model designed for code generation and reasoning across 92 programming languages with a 128,000-token context window.
Alibaba Cloud /

Qwen 2.5 Coder 32B

Qwen2.5-Coder builds on Qwen2.5 by training on 5.5 trillion additional tokens of code data including source code, text-code grounding data, and synthetic data. This leads to significant improvements in code-related tasks.
Alibaba Cloud /

Qwen 2.5 7B

A 7.61-billion parameter transformer-based language model with 128K token context length, trained on 18 trillion tokens supporting 29+ languages.
Alibaba Cloud /

Qwen2.5 7B 1M

A 7-billion parameter transformer model with 1-million token context capacity utilizing Dual Chunk Attention for long-range text processing.
Alibaba Cloud /

Qwen 2.5 14B

A 14.7 billion parameter transformer model supporting 29 languages with 128K context window, designed as foundation for fine-tuning applications.
Alibaba Cloud /

Qwen2.5 14B 1M

A 14.7B parameter transformer model with 1-million token context capacity, utilizing dual chunk attention and progressive training for extended sequence processing.
Alibaba Cloud /

Qwen 2.5 32B

A 32.5 billion parameter multilingual transformer model trained on 18 trillion tokens with 128K context length supporting text generation, coding, and mathematical reasoning.
Alibaba Cloud /

Qwen 2.5 72B

This update to Qwen 2, pretrained on 18 trillion tokens, shows impressive performance in benchmarks (MMLU 85+, HumanEval 85+, MATH 80+), outperforming models of similar size. Qwen 2.5 has multilingual support for over 29 languages and can understand and generate structured data.
Alibaba Cloud /

Qwen 2 7B

A 7.6 billion parameter multilingual decoder-only Transformer model designed for further post-training with 32,000-token context and strong coding capabilities.
Alibaba Cloud /

Qwen 2 72B

A 72-billion parameter transformer model supporting extended context lengths up to 128K tokens and demonstrating strong multilingual capabilities across diverse benchmarks.
Alibaba Cloud /

Qwen 1.5 32B

Foundation 32B Qwen 1.5 model from Alibaba Cloud.
Alibaba Cloud /

Qwen 1.5 72B

Foundation 72B Qwen 1.5 model from Alibaba Cloud.