Large language model (LLM) definition
A large language model (LLM) is a neural network trained on very large amounts of text to predict the next piece of text in a sequence. That single ability, applied repeatedly, lets it answer questions, summarize, translate, classify, and write code in response to a prompt written in ordinary language.
A large language model is a neural network trained on enormous volumes of text to predict what token comes next, which is enough to make it answer questions, summarize documents, and write code when prompted in plain language. What it cannot do is know facts it was never trained on, so production systems feed it current material at request time. In Sanity, that material is structured content held in the Content Lake and queried per request, so the model reads the published version rather than a stale copy.

How does a large language model actually work?
A large language model works by repeatedly predicting the next token (a word or a fragment of a word) given everything that came before it. Ask it a question and it does not look up an answer. It calculates which token is most likely to follow your question, appends that token, then calculates the next one, and continues until it produces a stopping signal.
The machinery underneath is the transformer architecture, introduced in the 2017 paper Attention Is All You Need. Its central mechanism, self-attention, lets the model weigh how much every token in the input should influence the interpretation of every other token. That is how it keeps track of which noun a pronoun refers to across several paragraphs, and it is what made it practical to train on far more text than earlier approaches allowed.
Training happens in stages. First comes pretraining, where the model reads a vast corpus of text and adjusts billions of internal numbers, called parameters, to get better at next-token prediction. Then comes alignment, often instruction tuning followed by reinforcement learning from human feedback, which teaches the model to respond to requests rather than simply continue the text it was given.
What makes a language model "large"?
A language model is called large because of the scale of three things: the number of parameters it holds, the volume of text it was trained on, and the compute spent training it. Parameters are the adjustable numbers inside the network, and modern frontier models are described in the billions or hundreds of billions of them.
Scale matters because capabilities tend to improve predictably with it. The 2020 paper Scaling Laws for Neural Language Models from OpenAI found that model performance improves as a smooth power-law function of parameters, dataset size, and compute, which is a large part of why the field kept building bigger models.
Size is not the only axis that matters in practice. A
What can a large language model not do?
A large language model cannot know anything that was not in its training data, and it cannot reliably tell you when it does not know. Both limits follow directly from how it works.
The first limit is the knowledge cutoff. A model's training data stops at a particular date, so anything published after that date, plus anything private to your organization, is invisible to it. Asking about your current pricing or last week's product launch produces an answer built from general patterns rather than facts.
The second limit is hallucination, the term for output that is fluent, confident, and wrong. Because the model is optimizing for plausible next tokens rather than for truth, a fabricated citation and a real one are equally easy for it to produce. There is no internal flag that separates the two.
There are also things a model has no mechanism for at all. It cannot take an action in another system unless you give it tools to call, it has no memory of a previous conversation unless that conversation is resupplied in the prompt, and it cannot perform reliable arithmetic on long numbers the way a calculator does.
How do you give a large language model facts it was not trained on?
You give a large language model current or private facts by putting them into the prompt, a technique usually called retrieval-augmented generation, or RAG. The model reads the supplied text as part of its input and answers from it, which sidesteps the knowledge cutoff without retraining anything.
The typical sequence has four steps. First, the user's question is used to search a content store, either by keyword, by semantic similarity over embeddings (numerical representations of meaning), or both. Second, the most relevant passages are retrieved. Third, those passages are inserted into the prompt alongside the question and an instruction to answer only from the supplied material. Fourth, the model generates an answer, ideally with citations pointing back at the retrieved sources.
The quality ceiling here is set by retrieval, not by the model. If the passage handed to the model is outdated, truncated mid-sentence, or scraped out of rendered HTML with navigation menus attached, a strong model will summarize that mess accurately. Content stored as structured fields, with a query layer that returns the current published version, gives retrieval clean units to work with, which is the shape Sanity's Content Lake and GROQ query language are built around.
The alternatives to retrieval are fine-tuning, which adjusts model weights on your own examples and suits teaching style or format more than teaching facts, and tool use, where the model calls an external function or API and reads the result.
How do LLMs, generative AI, and AI agents relate to each other?
A large language model is the component, generative AI is the broader category it belongs to, and an AI agent is a system built on top of one. Generative AI covers any model that produces new content, including image, audio, and video models, and LLMs are the text branch of that family.
An AI agent wraps a language model in a loop. The model is given a goal, a set of tools it can call (a search function, a database query, an API request), and the results of whatever it called last. It decides the next step, the surrounding program executes it, and the cycle repeats until the goal is met or a limit is hit. The reasoning happens in the model, but the agent is the code around it that gives the model somewhere to act.
That shape is why content systems increasingly expose their material to models directly rather than only to browsers. The Model Context Protocol, published by Anthropic in November 2024, is an open standard for connecting models to external tools and data sources, and it has become a common way for an agent to reach a content repository, a ticketing system, or a codebase without bespoke integration code for each one.
Unlock New Possibilities with Sanity
With large language model under your belt, it's time to see what Sanity can do for you. Explore our features and tools to take your content to the next level.
Last updated: