Home / Insights / AI Foundations
What Is a Large Language Model?
Pre-training, tokens and next-word prediction: what these systems are, and what they are not.
A large language model, or LLM, is a neural network, usually a transformer, trained to predict text. Given the beginning of a passage it estimates which token is likely to come next. Repeating that step produces sentences, code or tables.
Pre-training
The first and most expensive stage trains the model on a very large body of text. No one labels it by hand: the next token in the data is the answer. To predict well across many kinds of writing, the model picks up grammar, facts, styles and patterns of reasoning.
In 2020 the GPT-3 paper showed that a sufficiently large model could perform new tasks from a few examples placed in its input, without any change to its weights. This is called in-context learning.
Diagram by O&O Consulting.
Instruction tuning
A raw pre-trained model continues text; it does not necessarily answer questions helpfully. Developers fine-tune it on examples of instructions and good responses, and on human judgements about which of two answers is better. Work published as InstructGPT found that people preferred the outputs of a 1.3 billion parameter model tuned this way to those of an untuned model more than a hundred times larger.
What the model knows
Knowledge is spread across billions of weights rather than stored as records. The model has no built-in index of sources and may not know about events after its training data was collected. When asked about something it has little information on, it can still produce a confident, plausible and wrong answer.
Connecting a model to search or a company database, so that relevant text is placed in its input, addresses part of this.
Limitations and open questions
Researchers disagree about how far these systems reason as opposed to recombining patterns, and the answer may differ by task. Training data raises questions of copyright and privacy. Behaviour can change when a provider updates a model, so an application that worked last month needs retesting.
References
- Brown, T. et al. (2020). "Language Models are Few-Shot Learners." arxiv.org/abs/2005.14165
- Ouyang, L. et al. (2022). "Training language models to follow instructions with human feedback." arxiv.org/abs/2203.02155
- Bommasani, R. et al. (2021). "On the Opportunities and Risks of Foundation Models." arxiv.org/abs/2108.07258
This article is general information, not financial, legal or investment advice. AI research and rules change quickly; check the cited sources for the current position.