What is a language model?

Definition

A language model learns statistical relationships among tokens from text or other language data. Given a sequence, it estimates likely continuations or produces representations that can support generation, classification, retrieval and other language tasks.

Building a model from scratch can teach core concepts, but practical products often use an existing trained model because training requires substantial data, compute and engineering. Developers can then focus on evaluation, tools, interfaces and the workflow where the model creates value.

Acronyms and aliases

LM acronym

Frequently asked questions

How does a language model generate text?

It repeatedly estimates a probability distribution for the next token from the preceding context, selects a token according to decoding rules and continues the sequence.

Do developers need to train language models from scratch?

Usually not. Many applications can use or adapt an existing model, while training from scratch is mainly justified by research, learning goals or specialized requirements.

Videos explaining language model