Skip to main content
Back

Hugging Face's SmolLM2 Beats Llama and Qwen on a Phone

Hugging Face's 1.7B on-device model beats Llama-1B and Qwen2.5-1.5B on instruction following, trained on 11T tokens with a data-centric recipe.

Pro

  • Hugging Face released SmolLM2-1.7B-Instruct, an Apache 2.0 on-device chat model.
  • Trained on 11T tokens across FineWeb-Edu, DCLM, The Stack, FineMath, Stack-Edu, and SmolTalk.
  • Scores 56.7 on IFEval, beating Llama-1B-Instruct (53.5) and Qwen2.5-1.5B-Instruct (47.4).
  • Supports function calling with 27% on the Berkeley Function Calling Leaderboard.
  • Runs via transformers, transformers.js, vLLM, SGLang, Ollama, llama.cpp, and LM Studio.
  • Full recipe and datasets released; see the paper.

Hugging Face's Smol Models team has shipped SmolLM2-1.7B-Instruct, a compact instruction-tuned language model designed to run on a laptop or phone while competing with larger peers. The SmolLM2 family comes in three sizes, 135M, 360M, and 1.7B parameters, with the 1.7B Instruct variant as its flagship. All three are released under the Apache 2.0 license.

Beating bigger models at their own game

The 1.7B variant improves substantially over SmolLM1-1.7B in instruction following, knowledge, reasoning, and mathematics. Trained on 11 trillion tokens drawn from FineWeb-Edu, DCLM, The Stack, and curated math and coding datasets, it beats Llama-1B and Qwen2.5-1.5B on most general reasoning benchmarks: HellaSwag 68.7, ARC 60.5, MMLU-Pro 19.4. Qwen2.5-1.5B still leads on GSM8K math at the base level (61.3 vs 31.0 five-shot), but the instruct variant closes ground significantly, scoring 48.2 on GSM8K against the base model's 31.0. On IFEval instruction following, SmolLM2-1.7B-Instruct scores 56.7, ahead of Llama-1B-Instruct at 53.5 and Qwen2.5-1.5B-Instruct at 47.4.

Data curation as the core strategy

The accompanying paper frames the project as a study in data curation rather than architectural novelty. Rather than fixing a single dataset mixture and training end to end, the team ran ablations and retuned the mix throughout training. Four principles guided the design: adapting dataset mixtures to address specific capability gaps, upsampling high-quality math and code during annealing (reserving FineMath and parts of Stack-Edu for final stages), introducing mid-sized datasets like OWM, InfiMM-WebMath, and Stack-Edu mid-training to avoid dilution, and keeping data repetition below the 4 to 5 epoch threshold. New datasets, FineMath, Stack-Edu, and SmolTalk, were created where existing sources were too small or too noisy.

Post-training combined supervised fine-tuning on public and internal datasets with Direct Preference Optimization on UltraFeedback. The full recipe ran on 256 H100 GPUs using Hugging Face's nanotron framework in bfloat16 precision.

Beyond chat: what it actually handles

The instruct model was trained for several practical tasks using Argilla's curated datasets:

  • Text rewriting (adjusting tone for emails and similar content)
  • Summarization
  • Function calling, scoring 27% on the Berkeley Function Calling Leaderboard
  • General instruction following in English

Function calls use a structured <tool_call> format emitted inside the model's response, parseable with a simple regex. That makes it a reasonable orchestration layer for local agents where cloud API latency is a problem.

Running it locally

The model ships in Safetensors, ONNX, and transformers.js formats, with first-class support for llama.cpp, LM Studio, Jan, Ollama, vLLM, and SGLang. The quickest setup is a two-line pipeline:

from transformers import pipeline
pipe = pipeline("text-generation", model="HuggingFaceTB/SmolLM2-1.7B-Instruct")
pipe([{"role": "user", "content": "Who are you?"}])

For serving, vllm serve HuggingFaceTB/SmolLM2-1.7B-Instruct spins up an OpenAI-compatible endpoint. At roughly 2B parameters in BF16, the weights land around 3.4 GB. Quantized to 4-bit, that drops to a few hundred MB, well within phone-class memory.

Limitations worth knowing

SmolLM2 understands and generates English only, so multilingual use cases are out. Factuality is limited, math still trails Qwen2.5 at the base level, and the 8K context window is modest by current standards. These are trade-offs that come with the territory for narrow, well-scoped tasks.

Fully open and reproducible

The paper's central claim is that careful data staging can push a 1.7B model into territory usually occupied by models twice its size. Alongside SmolLM2, the team releases all datasets produced during the project, including SmolTalk, FineMath, and Stack-Edu. Full dataset releases at this scale are uncommon, and the combination gives anyone building on-device assistants, RAG pipelines, or fine-tuned domain models a clean, permissively licensed starting point they can actually inspect and reproduce.