Archive of AI

Source Snapshot / 2025-07-08-huggingface-smollm3-1

SmolLM3: smol, multilingual, long-context reasoner

Linked event: 2025-07-08 · Hugging Face Open-Sources 3B Dual-Mode Edge Model SmolLM3

Publisher
Hugging Face
Archived
2026-11-23
Capture Method
Direct page capture
HTTP / SHA-256
200 / 376604c17624f677
Original URL
Open source ↗
Wayback Backup
Not archived
This page preserves a plain-text static snapshot against link rot. When citing figures, tables, or full legal terms, verify against the original URL and Wayback Machine archive.

Hugging Face

Search models, datasets, users... ⌘K

Back to Articles

SmolLM3: smol, multilingual, long-context reasoner

July 8, 2025

Update on GitHub

Elie Bakouch

Carlos Miguel Patiño

Anton Lozhkov

Edward Beeching

Aymeric Roucher

Nouamane Tazi

nouamanetazi

Aksel Joonas Reedi

Guilherme Penedo

Hynek Kydlicek

Clémentine Fourrier

Nathan Habib

Kashif Rasul

Quentin Gallouédec

Hugo Larcher

Mathieu Morlon

Vaibhav Srivastav

Xuan-Son Nguyen

Colin Raffel

Lewis Tunstall

Loubna Ben Allal

Leandro von Werra

This article is also available in Chinese 简体中文.

Small language models are becoming increasingly important as users seek capable models that can be deployed efficiently. The community has produced a fascinating range of capable small models, each pushing the boundaries of what's possible at this scale. With SmolLM3, we're excited to contribute a new competitive fully open 3B model:

Base model: https://hf.co/HuggingFaceTB/SmolLM3-3B-Base

Instruct and reasoning model: https://hf.co/HuggingFaceTB/SmolLM3-3B

SmolLM3 sits in the efficiency sweet spot. Our 3B model outperforms Llama-3.2-3B and Qwen2.5-3B while staying competitive with larger 4B alternatives (Qwen3 & Gemma3). Beyond the performance numbers, we're sharing exactly how we built it using public datasets and training frameworks.

Model summary:

3B model trained on 11T tokens, SoTA at the 3B scale and competitive with 4B models

Instruct model with dual mode reasoning, supporting think/no_think modes

Multilingual support for 6 languages: English, French, Spanish, German, Italian, and Portuguese

Long context up to 128k with NoPE and using YaRN

The complete recipe: We're releasing SmolLM3 with our engineering blueprint. It includes architecture details, exact data mixtures showing how we progressively boost performance across domains in a three-stage pretraining approach, and the methodology for building a hybrid reasoning model. Usually, achieving these results would require months of reverse engineering. Instead, we're providing the full methodology.

Whether you're building your own models or want to understand what drives performance at this scale, this blueprint shows the engineering story behind competitive 3B performance.

Let’s have a look at the pretraining stage.

SmolLM3 both changed the architecture and data mixture over its predecessors. Let’s have a look at the architecture and training configurations first!

Architecture and training details

SmolLM3 follows a transformer decoder architecture with tied embedding similar to SmolLM2, building on Llama architecture with some key modifications optimized for efficiency and long context performance.

Grouped Query Attention (GQA): We replaced multi-head attention with grouped-query attention using 4 groups. Our ablations on a 3B model trained with 100B tokens from FineWeb-Edu showed that GQA matches the performance of multi-head attention while significantly reducing the KV cache size during inference.

NoPE: We implemented NoPE from "RoPE to NoRoPE and Back Again: A New Hybrid Attention Strategy" (Yang et al., 2025), selectively removing rotary position embeddings from every 4th layer. This approach improves long context performance without affecting short context capabilities, as confirmed by our ablations.

Intra-Document Masking: Following "Analysing The Impact of Sequence Composition on Language Model Pre-Training", during training, we use attention masking to ensure tokens from different documents in the same training sequence don't attend to each other. Similar to Llama 3, this helps with faster and more stable long context training while maintaining short context performance.

Training Stability: Following OLMo 2, we remove weight decay from embedding layers to improve training stability. This modification contributed to more stable training dynamics, with embedding norms naturally stabilizing at healthier values during training without impacting overall performance in our ablations.

All these changes were validated through ablations using the same 3B architecture trained on 100B tokens from FineWeb-Edu, ensuring each modification either improved performance or maintained it while offering other benefits.

Training Configuration: We use a global batch size of 2.36M tokens with 4096 sequence length, a learning rate of 2e-4, and the AdamW optimizer (beta1: 0.9, beta2: 0.95) with weight decay of 0.1 and gradient clipping of 1. We use the WSD (Warmup-Stable-Decay) scheduler, with 2000  warmup steps, and a linear decay to 0 in the final 10% training steps. We use nanotron framework for the training, datatrove for data processing and lighteval for evaluation. The model was trained on 384 H100 GPUs for 24 days. You can see the distributed training setup in the following figure.

In addition to architecture changes we also ablated and improved the training recipe. Let’s have a closer look.

Data mixture and training stages

Following SmolLM2's multi-stage approach, we train SmolLM3 on 11.2T tokens using a three-stage training strategy that mixes web, math, and code data with evolving proportions. We conducted extensive ablations on 3B models trained on 50B to 100B tokens to determine the data mixture and ratios.

The pretraining consists of these stages, also shown in the figure above:

Stage 1: Stable phase (0T → 8T tokens) This foundation stage establishes strong general capabilities with our core dataset mixture:

Web: 85% (12% multilingual) - FineWeb-Edu, DCLM, FineWeb2 and FineWeb2-HQ

Code: 12% - The Stack v2 (16 programming languages), StarCoder2 pull requests, Jupyter and Kaggle notebooks, GitHub issues, and StackExchange.

Math: 3% - FineMath3+ and InfiWebMath3+

Stage 2: Stable phase (8T → 10T tokens) We introduce higher quality math and code datasets while maintaining good web coverage:

Web: 75% (12% Multilingual)

Code: 15% - Adding Stack-Edu

Math: 10% - Introducing FineMath4+, InfiWebMath4+, and MegaMath (including Qwen Q&A, Pro synthetic rewrites, and text-code interleaved blocks)

Stage 3: Decay Phase (10T → 11.1T tokens) The final stage further upsamples math and code data

Web: 63% (12% Multilingual)

Code: 24% - upsampling of high-quality code data

Math: 13% - upsampling math data and introducing instruction and reasoning datasets such as OpenMathReasoning

With these stages and mixtures we achieved very competitive performance for the base model. More on that in the evaluation section. The nanotron training configs with exact data weights can be found here. We will also share our training logs along with intermediate checkpoints.

After the main pretraining we improved the model in a mid-training stage for long context and reasoning.

Mid-training

We call the long context adaptation and reasoning adaptation “mid-training”. They are much shorter than the main pretraining but still somewhat general and aimed at improving the model in those two domains. Let’s first have a look at long context training.

Long Context extension

After the main pretraining, we trained SmolLM3 on an additional 100B tokens to extend its context length. We sequentially extended the context window in two stages for 50B tokens each: first transitioning from 4k to 32k context with RoPE theta increased to 1.5M, then from 32k to 64k context with RoPE theta increased to 5M. Both stages upsampled math, code, and reasoning data. During ablations, we found that upsampling specific long context data such as code repositories, books, and long web pages (beyond the naturally long samples in our mixture) didn't further boost performance on RULER and HELMET benchmarks. Using NoPE and training on the decay mixture with longer sequences and increased RoPE theta values was sufficient to achieve competitive long context performance up to 64k.

Following Qwen2.5, we use YARN to extrapolate beyond the training context length. During inference, the model can handle up to  128k context (2x extension beyond the 64k training length).

[...内容已截断,完整版请查看原文或 Wayback 快照]