Alibaba's Qwen3-8B-Base Matches 14B Models at Half the Training Cost
Alibaba's Qwen team released an 8B dense base model trained on 36 trillion tokens across 119 languages, matching Qwen2.5-14B quality.
Takeaways
- Qwen3-8B-Base is the raw pretrained checkpoint behind Qwen3, released under Apache 2.0 on Hugging Face.
- Pretrained on 36 trillion tokens across 119 languages using a three-stage curriculum.
- Matches Qwen2.5-14B-Base performance and beats it on STEM and coding benchmarks.
- Dense architecture: 36 layers, GQA with 32 Q / 8 KV heads, native 32k context, BF16.
- Full details in the Qwen3 Technical Report (arXiv:2505.09388).
- Ships without instruction tuning, intended for custom fine-tuning, continued pretraining, and RL post-training.
Alibaba’s Qwen team has released Qwen3-8B-Base, an 8.2-billion-parameter checkpoint saved after pretraining and before instruction tuning or reinforcement-learning post-training. It gives teams a clean starting point for continued pretraining, supervised fine-tuning, preference optimization, reinforcement learning, and task-specific model heads.
Qwen reports that the 8B checkpoint reaches aggregate benchmark performance comparable to Qwen2.5-14B-Base. The smaller parameter count reduces weight memory, training compute, and inference costs for teams that need control over the post-training recipe. Its Apache 2.0 license permits commercial use, modification, and redistribution subject to the license terms.
Why 8B changes the budget
The technical report pairs each Qwen3 dense base model with a larger Qwen2.5 predecessor that produced similar aggregate results:
| Qwen3 base model | Reported Qwen2.5 peer |
|---|---|
| 1.7B | 3B |
| 4B | 7B |
| 8B | 14B |
| 14B | 32B |
| 32B | 72B |
These pairings describe benchmark performance rather than weight compatibility or identical behavior. Qwen3-8B-Base beats Qwen2.5-14B-Base on more than half of the report’s evaluations, with its strongest relative results concentrated in mathematics, coding, STEM, and reasoning. Base-model scores remain sensitive to prompt format, few-shot examples, decoding settings, and domain data, so deployment decisions still require workload-specific evaluation.
Inside the 8.2B checkpoint
| Architecture | Dense, decoder-only causal Transformer |
|---|---|
| Parameters | 8.2B total, including 6.95B non-embedding parameters |
| Layers | 36 |
| Attention | 32 query heads and 8 key-value heads |
| Native context | 32,768 tokens |
| Released precision | BF16 |
| License | Apache 2.0 |
Grouped-query attention allows each set of four query heads to share one key-value head. Compared with full 32-head multi-head attention, that design cuts the attention key-value cache to roughly one quarter of the size for the same sequence length and precision. At the full 32,768-token context, one BF16 sequence requires about 4.5 GiB of key-value data before allocator and runtime overhead.
BF16 weights occupy about 16.4 GB, or 15.3 GiB, before framework buffers. A 24 GiB GPU therefore has limited headroom at maximum context, depending on the serving runtime. Quantization reduces weight memory, while shorter requests reduce the key-value cache. Full-parameter training needs substantially more memory for gradients, optimizer states, and activations; LoRA and QLoRA reduce that requirement.
Three stages across 36 trillion tokens
The Qwen3 family spans dense and mixture-of-experts models from 0.6B to 235B parameters. Its pretraining recipe uses about 36 trillion tokens across 119 languages and dialects, expanding Qwen2.5’s coverage of 29. The data mix places additional weight on code, mathematics, STEM material, reasoning examples, and synthetic data.
- Broad pretraining: General language modeling establishes multilingual ability, world knowledge, and basic code generation.
- Reasoning-heavy training: A more selective mix increases the share of mathematics, STEM, code, and synthetic reasoning data.
- Long-context adaptation: Training extends the usable context window to 32,768 tokens.
QK normalization constrains the query and key representations before attention scores are calculated, helping limit unstable attention-logit growth during training. Qwen also reports using scaling-law experiments to choose learning-rate schedules and batch sizes separately for dense and mixture-of-experts models.
Base behavior requires application controls
Qwen3-8B-Base predicts next-token continuations without instruction-following behavior, a chat template, or a post-training safety policy. Prompts written as conversations can drift into raw completion behavior, while production deployments need their own moderation, authorization, retrieval filtering, and task-level evaluation.
- Thinking controls: The thinking and non-thinking modes available in post-trained Qwen3 models come from alignment work and are absent from this checkpoint.
- Context limit: The native window ends at 32,768 tokens. Longer inputs require a separately tested context-extension method or truncation.
- Output format: Structured responses, tool calls, and conversational roles require fine-tuning or application-side constraints.
- Safety behavior: Domain-specific refusals and policy compliance require post-training and runtime safeguards.
Choose by training plan
| Workload | Recommended checkpoint | Reason |
|---|---|---|
| Chat, assistants, or agents | Post-trained Qwen3-8B | Includes instruction following, chat formatting, and reasoning controls |
| Continued pretraining on legal, biomedical, technical, or language-specific data | Qwen3-8B-Base | Preserves a clean pretrained starting point |
| Custom supervised fine-tuning followed by DPO or GRPO | Qwen3-8B-Base | Allows full control over alignment data and objectives |
| Reward modeling or classification with a custom head | Qwen3-8B-Base | Avoids inherited chat behaviors |
| Architecture or training research | Qwen3-8B-Base | Provides a documented baseline without instruction tuning |
Load it without the Qwen3 key error
Transformers 4.51.0 added the required Qwen3 architecture support. Older versions can raise KeyError: 'qwen3'; installations using device_map="auto" also need Accelerate.
pip install "transformers>=4.51.0" accelerate torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Qwen/Qwen3-8B-Base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype="auto",
)
prompt = "def fibonacci(n):"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output_ids = model.generate(
**inputs,
max_new_tokens=128,
do_sample=False,
)
continuation = output_ids[0, inputs["input_ids"].shape[1]:]
print(tokenizer.decode(continuation, skip_special_tokens=True))
Recent vLLM and SGLang releases also support the Qwen3 architecture, though production deployments should pin and test exact versions. Completion endpoints fit the untouched base checkpoint; chat endpoints require the template and behavior introduced during custom fine-tuning.