---
title: "What is a large language model (LLM)?"
description: "A large language model (LLM) is a neural network trained on text to predict the next token. Learn how LLMs work and how they relate to generative AI."
type: "glossary-term"
canonical_url: "https://theaiengineering.com/glossary/large-language-model"
markdown_url: "https://theaiengineering.com/glossary/large-language-model.md"
topic: "LLM models and benchmarks"
author: "The AI Engineering Editors"
publisher: "The AI Engineering"
updated: "2026-11-06"
keywords: ["Large language model (LLM)","LLM","LLMs","language model"]
citation: "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"
---

# What is a large language model (LLM)?

Also called LLM, LLMs, language model.

> **Definition of Large language model (LLM):** 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](https://theaiengineering.com/glossary/tokens) in a sequence of text. Modern LLMs are built on the [transformer](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/temperature) control how that sampling behaves, and the [context window](https://theaiengineering.com/glossary/context-window) caps how many tokens the model can process in one request.

Training happens in stages:

- **[Pretraining](https://theaiengineering.com/glossary/pretraining)**: the model learns next-token prediction on a large text corpus. The [GPT-3 paper](https://arxiv.org/abs/2005.14165) (Brown et al., 2020), describing a 175-billion-parameter model, showed that scaling this stage improves [few-shot](https://theaiengineering.com/glossary/few-shot-prompting) performance on tasks the model was not trained for.
- **Post-training**: supervised [fine-tuning](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/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](https://theaiengineering.com/topics/models) tracks releases and capabilities, and [LLM benchmarks](https://theaiengineering.com/articles/llm-benchmarks) explains how models are compared.

## Related terms

- [Transformer](https://theaiengineering.com/glossary/transformer): A transformer is a neural network architecture that processes sequences with self-attention, letting each token weigh information from other tokens in parallel; it is the basis of most modern large language models.
- [Tokens](https://theaiengineering.com/glossary/tokens): Tokens are the units of text a language model processes, typically whole words, word fragments, punctuation, or bytes, each mapped to an integer ID from the model's fixed vocabulary.
- [Context window](https://theaiengineering.com/glossary/context-window): A context window is the maximum number of tokens a language model can take into account in a single request, including the system prompt, conversation history, tool results, and the generated output.
- [Small language model](https://theaiengineering.com/glossary/small-language-model): A small language model (SLM) is a language model compact enough to run on a consumer device such as a laptop or phone, which in 2025 generally meant fewer than about 10 billion parameters.
- [Reasoning model](https://theaiengineering.com/glossary/reasoning-model): A reasoning model is a large language model trained, usually with reinforcement learning, to generate intermediate reasoning tokens before its final answer, spending more inference compute to solve multi-step problems.
- [Foundation model](https://theaiengineering.com/glossary/foundation-model): A foundation model is a large AI model trained on broad data, usually with self-supervised learning at scale, that can be adapted through prompting or fine-tuning to a wide range of downstream tasks.
- [Pretraining](https://theaiengineering.com/glossary/pretraining): Pretraining is the first stage of training a language model, in which it learns to predict the next token across a large unlabeled corpus of text and code, producing a general-purpose base model.
- [Open-weights model](https://theaiengineering.com/glossary/open-weights-model): An open-weights model is an AI model whose trained parameters are published for download, so anyone can run, fine-tune, or quantize it on their own hardware under the terms of its license.

## Guides that cover large language model (llm)

- [What is AI engineering? The discipline, the stack, and the work](https://theaiengineering.com/articles/what-is-ai-engineering): What is AI engineering? A plain definition, how it differs from ML and software engineering, the layers of the stack, and what AI engineers do day to day.
- [LLM benchmarks explained: what they measure and how to read them](https://theaiengineering.com/articles/llm-benchmarks): LLM benchmarks explained: what MMLU-Pro, GPQA, SWE-bench, LiveCodeBench, ARC-AGI, and LMArena measure, why scores saturate, and how to read a leaderboard.
- [Reasoning models: how they work and when to use them](https://theaiengineering.com/articles/reasoning-models): Reasoning models explained: how test-time compute and reinforcement learning produce chain-of-thought reasoning, when to use them, and their cost and latency.
- [AI coding agents: how they work and how the major tools compare](https://theaiengineering.com/articles/ai-coding-agents): AI coding agents compared: how they differ from autocomplete, the four main categories, a comparison table of major tools, and how to evaluate and secure them.
- [vLLM vs Ollama vs llama.cpp vs SGLang: which engine to use](https://theaiengineering.com/articles/vllm-vs-ollama): vLLM vs Ollama compared with llama.cpp, SGLang, LM Studio, and TensorRT-LLM: scope, hardware, APIs, concurrency, and which engine fits local or production use.
- [LLM inference optimization: a practical guide for engineers](https://theaiengineering.com/articles/llm-inference-optimization): LLM inference optimization guide: prefill vs decode, TTFT, KV cache and PagedAttention, continuous batching, quantization, speculative decoding, and GPUs.
- [LLM evaluation: a practical guide to evals, metrics, and judges](https://theaiengineering.com/articles/llm-evaluation): LLM evaluation for engineers: build eval datasets, pick metrics, calibrate LLM-as-a-judge, evaluate RAG and agents, and gate every release in CI.
- [What is the Model Context Protocol (MCP)? How it works](https://theaiengineering.com/articles/what-is-model-context-protocol): The Model Context Protocol (MCP) is an open standard for connecting AI apps to tools and data. Learn its architecture, transports, tool calls, and security.
- [What is retrieval-augmented generation (RAG)? How RAG works](https://theaiengineering.com/articles/what-is-rag): Retrieval-augmented generation (RAG) grounds LLM answers in your documents. Learn the RAG pipeline, hybrid search, agentic RAG, evaluation, and failure modes.

Part of the [LLM models and benchmarks](https://theaiengineering.com/topics/models) topic hub.

## 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: 2026-11-06
- URL: https://theaiengineering.com/glossary/large-language-model
- Markdown: https://theaiengineering.com/glossary/large-language-model.md
