Articles

What Is a Small Language Model (SLM)?

A small language model runs cheaply on-device, trading some capability for speed, privacy, and cost. When SLMs beat frontier models and how they're built.

Chisato Chisato · · 3 min read
Abstract machine-learning data and trend curve

A small language model (SLM) is a compact language model — roughly hundreds of millions up to around ten billion parameters — designed to run cheaply, quickly, and often on-device. Where a frontier LLM might require a data center full of GPUs to serve, an SLM can run on a laptop, a phone, or an edge server without a network call. The trade-off is raw general capability, but for many real tasks that’s a trade worth making.

Why small models matter

The assumption that bigger is always better breaks down quickly when you look at real deployment needs. Most production AI tasks are narrow and well-defined: classify this document, extract these fields, rewrite this sentence in a formal tone, answer questions about this product catalog. For those jobs, a 3B-parameter model that runs locally often delivers the same result as a 100B frontier model — faster, cheaper, and without sending user data to an external API.

SLMs also enable use cases that large models simply can’t serve:

  • On-device inference — running on a phone or laptop without a network connection, which is critical for privacy-sensitive applications and offline use
  • Edge deployment — running on hardware close to where data is generated, rather than routing everything to a central cloud endpoint
  • Low-latency applications — smaller models produce tokens faster, which matters for real-time interfaces
  • Cost at scale — for high-volume tasks, the difference in inference cost between a small and large model is substantial

What makes a small model good

Raw parameter count is only part of the story. Several techniques make SLMs competitive despite their size:

Knowledge distillation trains a small student model to mimic the outputs of a large teacher model, not just the training labels. The student learns from the teacher’s probability distributions over outputs, which carry more signal than hard labels alone. This is how models like Phi-3 and Gemma get performance that would surprise you given their size.

Quantization reduces the numerical precision of model weights — from 32-bit floats to 8-bit or 4-bit integers — shrinking memory footprint and speeding up inference with minimal quality loss. Quantization is almost universal for models intended to run locally; it’s often what makes the difference between fitting on a phone and not.

High-quality curated training data may matter more than any architectural trick. Models like Phi-2 and Phi-3 from Microsoft demonstrated that small models trained on carefully filtered, high-quality datasets — including synthetic data generated by larger models — could punch well above their weight class on reasoning benchmarks. Garbage data scales badly; clean data scales well.

When to choose an SLM over a large model

A useful decision framework:

SituationReach for
Narrow, well-defined taskSLM
Requires general world knowledgeLarge model
Privacy-sensitive dataSLM (local)
Variable, open-ended tasksLarge model
High-volume, cost-sensitiveSLM
Complex reasoning over long contextLarge model
Offline or edge deploymentSLM

The sweet spot for SLMs is structured, repetitive work — classification, extraction, summarization with a fixed schema, translation between known formats. The more open-ended and unpredictable the task, the more you need a frontier model’s breadth.

Running SLMs locally

Tools like Ollama and the broader local inference ecosystem have made running SLMs accessible to any developer with a modern laptop. Models like Mistral 7B, Phi-3 Mini, Gemma 2B, and Llama 3.2 3B are widely available and run well on consumer hardware. This pairs naturally with local-first software design, where keeping computation on-device is an explicit goal.

Fine-tuning an SLM on your specific task is also feasible on consumer hardware — something that isn’t practical with frontier models. A fine-tuned 7B model often outperforms a much larger general model on the narrow task it was tuned for.

The takeaway

Small language models are not inferior large models — they’re a different tool for a different set of constraints. When your task is narrow, your data is sensitive, your hardware is limited, or your volume is high, an SLM is often the right call. Distillation, quantization, and quality data have made modern SLMs far more capable than their parameter count suggests, and the local inference ecosystem has made them easy to deploy. The question isn’t just “how capable is this model?” — it’s “how capable does it need to be, and at what cost?”

Chisato Chisato · · 4 min read

What Is Semantic Caching for LLM Applications?

Semantic caching reuses an LLM's past response for a new prompt that means the same thing, by comparing embeddings instead of exact text.

#AI #LLMs #Performance
Chisato Chisato · · 4 min read

What Is a KV Cache? Why LLM Inference Speeds Up

A KV cache stores past attention keys and values during LLM inference so each new token reuses prior work instead of recomputing it from scratch.

#AI #LLMs #Performance