Berk Bayri

Small language model

A language model small enough to run cheaply on modest hardware, sometimes on a laptop or phone, usually up to roughly ten billion parameters. There is no agreed size cut-off; the label is relative to the largest models of the day.

A small language model, or SLM, is a language model built to be cheap and fast to run rather than to be the most capable model available. It works the same way as a large one. It is usually a transformer that predicts the next token. It simply has far fewer parameters, which means less memory, lower inference cost and the option of running on a laptop, a phone or a single server inside your own network.

"Small" is a moving label. Microsoft's Phi-3 technical report, first published in April 2024, described a 3.8 billion parameter model trained on 3.3 trillion tokens and small enough to be deployed on a phone. A few years earlier a model that size would have been considered large. What stays constant is the trade: smaller models hold less general knowledge and handle long, open-ended reasoning less well.

Several techniques make small models more useful than their size suggests. Knowledge distillation trains them to imitate a bigger model. Quantization shrinks them further for cheap hardware. Fine-tuning adapts them to one narrow job.

When small is enough

Ask which model is good enough for this task, then prove it. Classifying tickets, extracting fields from forms, tagging content or routing requests often do not need a frontier model. Running a small model can cut cost per request, reduce latency and keep sensitive data on your own hardware, if it is an open-weight model.

The mistake is choosing by size or price alone. Build a test set from your own real cases, compare a small and a large model on it, and look at the failures, not only the average score. Many teams end up with model routing: a small model takes the routine traffic and the hard cases go to a larger one.

Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone

arXiv (Abdin et al., Microsoft) · 2024-04-22

Related terms