API glossary

Large language model (LLM)

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

A large language model (LLM) is an artificial-intelligence model trained on vast amounts of text to understand and generate human language. It learns the statistical patterns of language so it can predict and produce the next piece of text in a sequence, which (at sufficient scale) lets it answer questions, summarize, translate, write code, and hold a conversation.

In short: an LLM is a model trained on huge volumes of text, and that is able to generate language by predicting likely next words. An LLM is powerful and flexible, but bounded by what it was trained on and prone to hallucination without a retrieval layer.

How a large language model works

The model turns text into a prediction problem and solves it at enormous scale:

  1. Tokenization: Input text is broken into tokens (chunks that are typically shorter than a word; for example, “running” might become “run” and “ning”), giving the model a manageable vocabulary that covers rare and novel words.
  2. Transformer architecture: Most LLMs are built on the transformer, a neural network design that uses attention (a mechanism for weighing how relevant each token is to every other) to capture context across an entire passage rather than reading left to right one word at a time.
  3. Pre-training: The model learns from an enormous corpus of text (or multiple corpora) by repeatedly predicting the next token, adjusting billions of internal parameters to encode patterns of language and fact.
  4. Fine-tuning and alignment: Further training on curated examples, including reinforcement learning from human feedback (RLHF), teaches the model to follow instructions, decline harmful requests, and produce more reliable and useful responses.
  5. Inference: Given a prompt, the model generates a response token by token, each one conditioned on everything in its context so far.

The defining trait is that an LLM does not look up facts. Instead, it generates statistically likely text from patterns learned in training, which makes it powerful and flexible but not inherently grounded in any source.

Large language model vs. chatbots and search engines

  • A chatbot or AI assistant is a product built around an LLM, often adding memory, tools, and a conversational interface; the LLM itself is the underlying model that generates the responses.
  • A search engine retrieves and ranks existing documents; an LLM generates new text and may invent details unless it is connected to retrieval (a problem called a hallucination).
  • Traditional software follows explicit, deterministic rules; an LLM produces probabilistic outputs learned from data, so the same prompt might yield different responses.

Where large language models are used

  • Conversational AI: Chat assistants and customer support that respond in natural language.
  • Search and answer engines: Generating direct answers, usually grounded in retrieval to stay current and accurate.
  • Content and code: Drafting, summarizing, and translating text, and writing or explaining code.
  • Agents and tool use: Serving as the reasoning core that decides when to act through function calling.

An LLM is bounded by its context window and its knowledge cutoff, and it can hallucinate without grounding, which is why retrieval is so often paired with it to keep outputs current and accurate.

Context window, knowledge cutoff, hallucination, function calling, retrieval-augmented generation (RAG), embeddings, transformer, prompt engineering, tokenization.