What is a large language model (LLM)?

Also called LLM, LLMs, language model

Definition

A large language model (LLM) is a neural network, usually a transformer with billions of parameters, trained on web-scale text to predict the next token and then adapted to follow instructions.

A large language model (LLM) is a neural network trained to predict the next token in a sequence of text. Modern LLMs are built on the transformer architecture and have billions of parameters. Next-token prediction at that scale yields models that can answer questions, write code, summarize documents, and call tools.

How large language models work#

A large language model works by converting input text into tokens, processing them through stacked transformer layers, and producing a probability distribution over the next token. The application samples one token from that distribution, appends it to the input, and repeats until a stop condition. Settings such as temperature control how that sampling behaves, and the context window caps how many tokens the model can process in one request.

Training happens in stages:

  • Pretraining: the model learns next-token prediction on a large text corpus. The GPT-3 paper (Brown et al., 2020), describing a 175-billion-parameter model, showed that scaling this stage improves few-shot performance on tasks the model was not trained for.
  • Post-training: supervised fine-tuning on instruction examples, followed by preference optimization such as reinforcement learning from human feedback, turns a text predictor into an assistant that follows instructions.
  • Specialization (optional): further training for reasoning, tool use, or a specific domain.

An LLM has no built-in access to information created after its training cutoff, or to private data it never saw. Applications supply that information at inference time through the prompt, through tool calls, or through retrieval-augmented generation.

Large language model vs generative AI#

Generative AI is the broader category of models that produce new content, including images, audio, and video; a large language model is the subset that generates text and code. Many current LLMs also accept images, audio, or documents as input, which blurs the boundary, but their defining trait remains generating output one token at a time.

The distinction matters for engineering because LLM behavior is shaped by text-specific factors: tokenization, prompt structure, context length, and decoding settings. Those factors drive most of the cost, latency, and quality trade-offs in an LLM application.

The models hub tracks releases and capabilities, and LLM benchmarks explains how models are compared.

Cite this definition

The AI Engineering Editors. "What is a large language model (LLM)?" The AI Engineering, updated Nov 06, 2026. https://theaiengineering.com/glossary/large-language-model

Title
What is a large language model (LLM)?
Author
The AI Engineering Editors
Publisher
The AI Engineering
Updated
View as Markdown

Part of the LLM models and benchmarks hub · Updated