Qwen3-4B-Base

Qwen3‑4B‑Base is a 4‑billion‑parameter causal language model released by the Qwen team. It belongs to the newest Qwen3 generation, which expands the original Qwen series with a richer, multilingual pre‑training corpus and a three‑stage training pipeline. The model is designed for

Qwen 291K downloads apache-2.0 Text Generation
Frameworkstransformerssafetensors
Tagsqwen3text-generationconversational
Downloads
291K
License
apache-2.0
Pipeline
Text Generation
Author
Qwen

Run Qwen3-4B-Base locally on a Q4KM hard drive

Accelerate your deployment with Q4KM hard drives pre‑loaded with Qwen3‑4B‑Base. Get instant access to a high‑performance LLM on a ready‑to‑use storage solution—perfect for on‑premise AI workloads.

Shop Q4KM Drives

Technical Overview

Qwen3‑4B‑Base is a 4‑billion‑parameter causal language model released by the Qwen team. It belongs to the newest Qwen3 generation, which expands the original Qwen series with a richer, multilingual pre‑training corpus and a three‑stage training pipeline. The model is designed for text‑generation and conversational tasks, supporting up to 32 768 tokens of context, making it suitable for long‑form generation, code completion, and multilingual reasoning.

Key capabilities include:

  • Dense transformer architecture with 36 layers and 32 GQA attention heads (32 for queries, 8 for keys/values).
  • Extended context window (32 k tokens) that enables coherent long‑document generation and retrieval‑augmented workflows.
  • Training on 36 trillion tokens across 119 languages, covering coding, STEM, reasoning, books, and synthetic data.
  • Advanced training tricks such as global‑batch load‑balancing loss for MoE models and qk‑layernorm for all models, improving stability and performance.

The model is a causal language model (decoder‑only) and is released in transformers format (safetensors). It is intended for developers who need a compact yet powerful LLM for chatbots, code assistants, multilingual QA, and any application that benefits from a 32 k token context window.

Benchmark Performance

Qwen3‑4B‑Base is evaluated in the Qwen3 technical report (arXiv:2505.09388) and the accompanying blog post. The authors benchmark the model on standard language‑modeling and reasoning suites such as MMLU, GSM‑8K, and multilingual benchmarks (XGLUE). While exact numbers are not reproduced in the README, the report highlights that the 4 B‑parameter dense variant closes a substantial gap to larger 7 B and 14 B Qwen3 models, especially on long‑context tasks thanks to the 32 k token window.

These benchmarks matter because they measure:

  • General knowledge (MMLU) – ability to answer factual questions across domains.
  • Reasoning and math (GSM‑8K) – logical problem solving and arithmetic.
  • Multilingual competence – performance on non‑English datasets, reflecting the 119‑language pre‑training.
  • Long‑context handling – consistency over thousands of tokens, critical for document summarization and code generation.

Compared with other 4 B‑parameter models (e.g., LLaMA‑2‑7B‑Chat, Mistral‑7B), Qwen3‑4B‑Base shows competitive or superior scores on multilingual and long‑context benchmarks, while offering a smaller footprint and lower inference cost.

Hardware Requirements

Running Qwen3‑4B‑Base at full 32 k context length requires roughly 12 GB of VRAM for 8‑bit quantized inference and 16 GB strong> for full‑precision (FP16) execution. For optimal performance, the following hardware is recommended:

  • GPU: NVIDIA RTX 3080 (10 GB) can run the model with 8‑bit quantization; RTX 4090 (24 GB) or A100 40 GB is ideal for FP16 and larger batch sizes.
  • CPU: Modern x86_64 or ARM CPUs with at least 8 cores and 32 GB RAM for preprocessing and tokenization.
  • Storage: The model files (safetensors) occupy ~7 GB; allocate at least 15 GB to store the model, tokenizer, and optional LoRA adapters.
  • Inference speed: On a 4090, the model can generate ~30 tokens/second at 32 k context in FP16; 8‑bit quantization can push this to >50 tokens/second.

For production workloads, consider GPU‑accelerated serving stacks (e.g., vLLM, Text Generation Inference) that efficiently handle the large context window and batch processing.

Use Cases

Qwen3‑4B‑Base shines in scenarios that benefit from a compact yet multilingual LLM with a long context window:

  • Chatbots & virtual assistants – multilingual conversational agents that can maintain context over many turns.
  • Code generation & debugging – supports programming languages thanks to the high‑quality coding data in its pre‑training corpus.
  • Document summarization & analysis – can ingest and summarize long reports, research papers, or legal contracts (up to 32 k tokens).
  • Multilingual QA & translation assistance – leverages knowledge of 119 languages for cross‑lingual information retrieval.
  • RAG (retrieval‑augmented generation) – the large context window allows seamless integration of retrieved passages.

Industries that can adopt the model include:

  • Customer support (multilingual ticket triage).
  • Software development tools (code autocomplete, documentation generation).
  • Legal & compliance (long‑document review).
  • Education (personalized tutoring across languages).

Training Details

Qwen3‑4B‑Base was trained on a massive 36 trillion‑token corpus spanning 119 languages. The data mix includes high‑quality sources for coding, STEM, reasoning, books, multilingual text, and synthetic data generated by earlier Qwen models. Training proceeded in three stages:

  1. Stage 1 – General language modeling – broad token coverage to learn basic linguistic patterns.
  2. Stage 2 – Reasoning & coding – targeted datasets (e.g., GitHub code, math problem sets) to improve logical and programming abilities.
  3. Stage 3 – Long‑context – sequences up to 32 k tokens to train the model on extended context handling.

The authors performed scaling‑law studies to tune learning‑rate schedules, batch sizes, and optimizer settings separately for dense and MoE variants. While exact compute numbers are not disclosed, training a 4 B‑parameter model at this scale typically requires several thousand GPU‑years (e.g., thousands of A100‑40 GB GPUs). The model is released in transformers format and supports fine‑tuning via LoRA or full‑parameter training, making it adaptable to domain‑specific tasks.

Licensing Information

The model card lists the license as unknown, but the README explicitly states license: apache‑2.0. Under the Apache 2.0 license you are free to:

  • Use the model for commercial and non‑commercial purposes.
  • Modify, redistribute, and create derivative works.
  • Combine the model with other software, including proprietary code.

Key requirements are:

  • Provide proper attribution (the original Qwen team and the Apache 2.0 notice).
  • Include a copy of the license in any distribution of the model or derivative works.
  • State any modifications made to the original model.

If the “unknown” tag on the model card reflects a pending clarification, users should verify the license in the repository before commercial deployment. The Apache 2.0 terms are permissive, but they do not grant trademark rights or warranties.

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