SmolLM2-1.7B: A next-generation compact language model
2 min readupdated
SmolLM2 is a family of lightweight language models optimized to run on various devices. The 1.7-billion-parameter version shows significant progress over the first version in instruction following, reasoning, math, and coding. The model was trained on a massive 11 trillion tokens using high-quality datasets like FineWeb-Edu and DCLM. It is well-suited for developers who need an efficient and fast local model for basic text tasks.
Key features
- Significant quality gains in math, reasoning, and instruction-following compared to its predecessor.
- Trained on a large-scale dataset of 11 trillion tokens with an emphasis on educational and code materials.
- Support for useful features like text rewriting, summarization, and function calling.
- Low hardware requirements: the model runs easily on local CPU or GPU.
What you can do
- Apply it to automated summarization of long texts and document rewriting.
- Integrate the model into local bots or applications for function calling tasks.
- Use it for solving basic math problems and generating simple code.
- Deploy a lightweight assistant on a user's local device.
Example
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "HuggingFaceTB/SmolLM2-1.7B"
device = "cuda"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
inputs = tokenizer.encode("Gravity is", return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))Read more
DetailsArchitecture: Transformer decoder
Training tokens: 11 trillion
Benchmarks (Base): HellaSwag — 68.7, ARC — 60.5, PIQA — 77.6
VRAM requirements: ~3.4 GB of memory (fp32/bfloat16)
License: Apache 2.0










Comments