Models & Evaluation

Small Language Models (SLM)

By Aditya Kumar Jha, Engineer

Small language models (SLMs) are compact transformer-based language models, loosely those under roughly 10 billion parameters, designed to run cheaply, on-device, or at low latency while retaining strong performance on many tasks.

What is a small language model?

A small language model (SLM) is a language model with a comparatively small parameter count, built to deliver useful task performance at a fraction of the compute, memory, and cost of frontier-scale systems. The label is a loose convention rather than an official standard. In common usage it covers models below roughly 10 billion parameters, with the most active range falling between about 1 billion and 8 billion, and a long tail of sub-1-billion models intended for phones and embedded hardware. There is no fixed numeric cutoff, and what counts as small shifts as hardware and training methods improve.

Architecturally an SLM is usually the same kind of decoder-only transformer used by large language models, just with fewer layers, narrower hidden dimensions, and fewer attention heads. The difference is one of scale and intended deployment, not of fundamental design. Because parameter count drives memory footprint and per-token compute, shrinking the model is the most direct lever for making generation fast and affordable.

The practical appeal is that many real tasks do not require a frontier model. Classification, extraction, summarization of short documents, routing, simple drafting, and tool-call formatting can often be handled well by a model in the 1B to 8B range, especially after task-specific fine-tuning. SLMs trade away some breadth of world knowledge and deep reasoning in exchange for speed, low cost, and the ability to run locally.

  • Parameter counts below roughly 10B, with a dense cluster from 1B to 8B and sub-1B models for mobile and embedded use.
  • Same transformer architecture as large models, scaled down in depth and width rather than redesigned.
  • The size threshold is a loose convention, not an official standard, and moves over time as methods improve.
  • Best suited to narrow, well-defined tasks where adequate quality at low cost beats maximal capability.

Why SLMs matter: cost, privacy, latency, edge

Cost is the most immediate driver. Serving a 3B model instead of a 70B model cuts the compute and memory per request by more than an order of magnitude, which lowers cloud bills and lets a single GPU serve far more concurrent users. For high-volume, repetitive workloads, the cheaper model can be the only economically viable option.

Privacy and latency follow from the ability to run an SLM locally. A model small enough to fit in a phone or laptop can process data on the device, so the input never leaves the user's hardware. That property matters for medical records, personal notes, and regulated data. Local inference also removes network round-trips, which can make a small on-device model feel more responsive than a larger remote one for short interactions.

Fine-tunability is a further advantage. Smaller models are cheaper and faster to adapt with techniques such as LoRA and other parameter-efficient methods, so teams can train task-specialized variants without the budget required to fine-tune a frontier model. This makes SLMs attractive as the workhorse tier in larger systems, often paired with a stronger model that handles only the hard cases.

  • Per-request compute and memory drop sharply, lowering serving cost and raising throughput.
  • On-device inference keeps sensitive data local and removes network latency for short tasks.
  • Cheaper to fine-tune, enabling many task-specific variants on a modest budget.
  • A natural fit as the default tier in a system that escalates only hard inputs to a larger model.

How small models are made competitive

A smaller model cannot store as much as a large one, so the quality of its training data matters more. Microsoft's Phi series is the best-known demonstration of this idea. The paper "Textbooks Are All You Need" (Gunasekar et al., 2023, arXiv:2306.11644) introduced phi-1, a 1.3-billion-parameter model trained on a mix of high-quality filtered web data and synthetically generated textbook-style content, and argued that data quality could substitute for raw scale on targeted tasks. Later entries phi-1.5, phi-2 (2.7B, released December 2023), and the phi-3 family (the phi-3-mini reported in arXiv:2404.14219 has 3.8B parameters) extended the same data-centric thesis.

Knowledge distillation is a second lever. A large teacher model produces outputs or output distributions that a smaller student model is trained to imitate, transferring much of the teacher's behavior into a cheaper network. Combined with synthetic data generated by strong models, distillation lets small students reach quality their parameter count alone would not predict. Careful training recipes, including extended token budgets, also help: TinyLlama (Zhang et al., arXiv:2401.02385) trained a 1.1B model on roughly 3 trillion tokens, far more than scaling rules would call optimal, to push a tiny model further.

Quantization is applied after training to shrink the deployed model. Storing weights in 8-bit or 4-bit integers instead of 16-bit floats reduces memory and can speed inference, usually with modest quality loss when done well. Together, high-quality and synthetic data, distillation, long training runs, and quantization explain how a sub-10B model can be competitive on narrow tasks despite its size.

memory_bytes ≈ params × bytes_per_param 7B model, FP16: 7e9 × 2 bytes ≈ 14 GB 7B model, 4-bit: 7e9 × 0.5 bytes ≈ 3.5 GB
A rough estimate of weight memory. FP16 uses 2 bytes per parameter, INT8 uses 1, and 4-bit quantization uses about 0.5 bytes. Actual runtime memory is higher because of activations and the KV cache.
  • Data quality over raw scale: the Phi series trains on filtered web plus synthetic textbook-style data.
  • Distillation transfers behavior from a large teacher into a small student model.
  • Longer-than-optimal training, as in TinyLlama's roughly 3T tokens on a 1.1B model, raises small-model quality.
  • Post-training quantization to 8-bit or 4-bit shrinks the deployed footprint with modest quality loss.

Verified example families

Several model families anchor the SLM landscape with documented, verifiable facts. Microsoft Phi spans phi-1 and phi-1.5 at 1.3B, phi-2 at 2.7B, and phi-3-mini at 3.8B, all emphasizing data quality. Mistral 7B ("Mistral 7B", Jiang et al., 2023, arXiv:2310.06825) is a widely used 7-billion-parameter open-weight model that reported strong results relative to larger Llama 2 models at the time of release. Meta's Llama line includes small variants, notably the Llama 3.2 1B and 3B text models released in September 2024 with a 128K-token context and an explicit on-device focus.

Google's Gemma family offers open-weight small models built from the same research as Gemini. Gemma 2 arrived in 2024 (the 9B and 27B in June, the 2B in August) in 2B, 9B, and 27B sizes under the Gemma license. Alibaba's Qwen series likewise ships small open variants in the 0.5B to 7B range. These families give developers a spread of sizes to match a model to a latency and memory budget.

At the smallest end, dedicated tiny models target phones and microcontrollers. TinyLlama is a 1.1B model following the Llama 2 architecture. Hugging Face's SmolLM2 ships in 135M, 360M, and 1.7B sizes under the Apache 2.0 license, trained on a large token budget for their scale. These sub-2B models illustrate how far careful data and training can push a very small network.

python
from transformers import AutoModelForCausalLM, AutoTokenizer

# A small, instruction-tuned model that fits on a laptop.
model_id = "HuggingFaceTB/SmolLM2-1.7B-Instruct"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

messages = [{"role": "user", "content": "Summarize photosynthesis in one sentence."}]
inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt"
)
outputs = model.generate(inputs, max_new_tokens=64)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Loading and running a verified small model (HuggingFaceTB/SmolLM2-1.7B-Instruct) with the Hugging Face transformers library.
  • Microsoft Phi: phi-1/1.5 at 1.3B, phi-2 at 2.7B, phi-3-mini at 3.8B, built on a data-quality thesis.
  • Mistral 7B and Meta's Llama 3.2 1B/3B (128K context, on-device) are widely deployed open-weight options.
  • Google Gemma 2 (2B, 9B, 27B) and Alibaba Qwen small variants cover the mid-small range.
  • TinyLlama (1.1B) and SmolLM2 (135M, 360M, 1.7B) target the sub-2B, on-device tier.

Tradeoffs versus frontier models

The central tradeoff is capability for cost. With fewer parameters, an SLM stores less factual world knowledge and tends to be weaker at multi-step reasoning, long-form synthesis, and tasks that depend on rare or specialized information. It is also more prone to hallucination when pushed beyond what its training covered. For open-ended problems and demanding reasoning, a frontier model remains the better choice.

Historically small models also shipped with shorter context windows, though this gap has narrowed: Llama 3.2's 1B and 3B models advertise a 128K-token context. Even so, attending over a long context on small on-device hardware is costly, and effective use of that window can lag behind larger systems. The right framing is that an SLM is adequate, not maximal: for many narrow, well-scoped tasks it is good enough and far cheaper.

A common architecture uses an SLM as the default and a larger model as a fallback. The small model handles the bulk of requests, and a router escalates inputs that exceed its competence, for example by confidence, input length, or task type. This pattern, increasingly used for on-device agents, keeps most traffic cheap and local while preserving access to frontier capability for the cases that need it.

  • Less stored world knowledge and weaker multi-step reasoning than frontier models.
  • Historically smaller context, though some recent SLMs reach 128K tokens.
  • Adequate and far cheaper for narrow tasks; not a replacement for frontier models on hard problems.
  • Often deployed behind a router that escalates only hard inputs to a larger model.

Key takeaways

  • An SLM is a compact language model, loosely under roughly 10B parameters, built for cheap, fast, or on-device inference.
  • The size threshold is a convention, not an official standard, and the dense range runs from about 1B to 8B with a sub-1B tail.
  • Their value is cost, privacy via local inference, low latency, edge deployment, and cheaper fine-tuning.
  • Data quality, distillation, long training runs, and quantization let small models stay competitive on narrow tasks.
  • Verified families include Microsoft Phi, Mistral 7B, Llama 3.2 1B/3B, Google Gemma 2, Qwen small, TinyLlama, and SmolLM2.
  • They trade away world knowledge and deep reasoning, so they are often paired with a larger fallback model.

Frequently asked questions

There is no official cutoff. By loose convention SLMs sit below roughly 10 billion parameters, with the most common range from about 1 billion to 8 billion and a sub-1-billion tail for phones and embedded devices. The boundary shifts over time as training methods and hardware improve, so the term describes intent and deployment as much as an exact number.
They share the same transformer architecture; the difference is scale and intended use. Large language models have many more parameters and stronger broad reasoning and world knowledge, while small language models trade some of that capability for lower cost, lower latency, and the ability to run locally. For narrow tasks an SLM is often adequate and far cheaper.
As a rough estimate, weight memory is about the parameter count times the bytes per parameter. A 7B model in FP16 needs roughly 14 GB, and about 3.5 GB when quantized to 4-bit. Real runtime memory is higher because of activations and the key-value cache, so leave headroom beyond the weight estimate.
Through high-quality and synthetic training data, knowledge distillation from a larger teacher model, longer-than-optimal training runs, and post-training quantization. The Phi series, introduced in the paper "Textbooks Are All You Need," showed that carefully curated data can substitute for raw scale on targeted tasks. These techniques together close much of the gap on narrow workloads.
Microsoft Phi (phi-2 at 2.7B, phi-3-mini at 3.8B), Mistral 7B, Meta's Llama 3.2 1B and 3B, Google Gemma 2 in 2B, 9B, and 27B sizes, Alibaba Qwen small variants, and tiny models such as TinyLlama (1.1B) and SmolLM2 (135M, 360M, 1.7B). These cover sizes from mobile-scale up to several billion parameters.
Use an SLM for high-volume, well-defined tasks such as classification, extraction, routing, or short summarization where cost, latency, or on-device privacy matter and the task does not need deep reasoning or broad world knowledge. A common pattern runs an SLM as the default and escalates only hard inputs to a larger fallback model.