What Is a Large Language Model?

A large language model is a computer program that has learned patterns in language by studying enormous amounts of text. Give it a question or the start of a sentence, and it produces a likely continuation, one small piece at a time. Google’s Machine Learning Crash Course describes LLMs as essentially autocomplete systems that can predict thousands of pieces of text in a row.1

Each word in the name tells you something:

  • Large refers to the size of the model and the amount of text it learned from. Modern models contain hundreds of billions or even trillions of internal settings, called parameters.1
  • Language means its job is to work with text: reading it, predicting it and producing it.
  • Model means it’s a mathematical representation built from data, not a database of stored answers.

Large language models are one branch of artificial intelligence. If you’re new to the topic, our guide to what AI is explains how they fit into the wider field.

How Does a Large Language Model Work?

An LLM turns your text into tokens, works out which token is most likely to come next, adds it, and repeats. That loop, run very fast, is how a whole answer appears.

How a large language model writes a reply Four steps in a loop: your prompt is split into tokens, the model scores every possible next token, one likely token is chosen and added, and the loop repeats until the reply is complete. 1 · YOUR PROMPT “Why is the sky blue?” 2 · TOKENS [Why] [ is] [ the] [ sky] [ blue] [?] 3 · SCORE NEXT “Sunlight” 41% “The” 22% …thousands more 4 · ADD & REPEAT picks a likely token, then predicts again loop until the answer is complete
Simplified illustration. The percentages are made up to show the idea; real models score every token in their vocabulary.

Step 1: Text becomes tokens

Models don’t read whole words the way people do. They split text into tokens, which can be a whole word, part of a word or a single character.1 OpenAI’s rule of thumb for English is that one token is about four characters, or about three-quarters of a word, so 100 tokens is roughly 75 words.2 Other languages can split differently.2

Step 2: The model weighs context

The model looks at all the tokens so far and works out how they relate. In the sentence “The animal didn’t cross the street because it was too tired”, it needs to know that “it” means the animal, not the street. Google’s course uses exactly this example to show how a technique called self-attention links words that belong together.1

Step 3: It predicts the next token

The model gives every possible next token a probability. It doesn’t look the answer up. It calculates what is likely to come next, based on patterns it learned during training.1

Step 4: Add one token and repeat

A likely token is chosen and added to the text, and the process runs again with the longer text. A few hundred loops later, you have a paragraph. Because the choice usually involves a little randomness, asking the same question twice can give different wording.

The Transformer: The Breakthrough Behind Modern LLMs

Most of today’s large language models are built on a design called the Transformer, introduced by Google researchers in 2017. Their paper, “Attention Is All You Need”, described a way for a model to look at all the words in a passage at once rather than one after another.3

The key idea is attention. For each token, the model asks how much every other token should affect its meaning.1 That makes Transformers good at keeping track of context across long passages, and it lets training run efficiently on modern chips. Google’s course describes Transformers as the state-of-the-art design for a wide range of language tasks, such as translation.1

The “GPT” in ChatGPT stands for Generative Pre-trained Transformer, which tells you the design it’s built on.

A Short History of Language Models

Computers have predicted text for decades; what changed is scale and the Transformer design.

  1. N-gram models. Early systems counted how often short runs of words appeared together, then guessed the next word from the last one or two. They were useful for things like basic autocomplete but had almost no sense of context.
  2. Recurrent neural networks. These read text one word at a time and carried a running memory forward. They handled more context, but struggled to remember the start of long passages.
  3. Transformers (2017 onward). Attention let models consider a whole passage at once, and training could be spread across many chips.3
  4. Large language models. Researchers found that much bigger Transformers trained on much more text kept getting better. Google’s course notes that LLMs beat earlier approaches mainly because they have far more parameters and take in far more context.1

Parameters and Context Windows, Explained

Two numbers come up whenever people compare models: parameters and the context window.

Parameters are the internal settings a model adjusts during training. You can think of them as millions of tiny dials that together store the patterns the model has learned. More parameters generally let a model capture more patterns, and Google’s course says Transformers with more parameters have consistently outperformed smaller ones.1 But bigger also means more expensive to train and run, so companies often offer smaller, faster versions for simple tasks.

The context window is how much text, counted in tokens, a model can consider at one time. It includes your prompt, any documents you’ve pasted in and the conversation so far. When a conversation runs past the limit, the oldest parts drop out of view, which is why a long chat can seem to “forget” what you said at the start.

TermPlain-English meaningWhy it matters to you
ParametersThe learned settings inside the modelLarger models tend to handle harder tasks, but cost more
Context windowHow much text the model can consider at onceDecides how long a document or chat it can work with
TokenA small chunk of text, about ¾ of an English wordUsage limits and prices are often counted in tokens
PromptThe instructions and text you give the modelClearer prompts usually get better answers

How Are Large Language Models Trained?

Training happens in stages: first the model learns language in general, then it’s shaped to be a helpful assistant.

StageWhat happensWhat it gives the model
Pre-trainingThe model repeatedly predicts hidden or upcoming tokens across a huge collection of textGeneral knowledge of language, facts and patterns
Instruction tuningIt’s trained on examples of instructions paired with good responsesThe ability to follow requests rather than just continue text
Learning from human feedbackPeople rank different answers, and the model is adjusted toward the preferred onesMore helpful, clearer and safer replies

Google’s course explains that pre-training works by hiding some tokens and having the model predict them, and that instruction tuning is an optional later step that improves how well a model follows instructions.1 Learning from human feedback was described in a 2022 OpenAI paper on training models to follow instructions.4

Training a large model takes months and huge amounts of computing power and electricity.1 That’s why only a handful of organisations build the biggest models, while many more companies build products on top of them.

What Can Large Language Models Do?

Because so much work involves reading and writing text, LLMs are useful for a wide range of everyday tasks.

  • Drafting: emails, reports, product descriptions and first drafts of articles
  • Summarising: turning a long document or meeting transcript into key points
  • Explaining: breaking a difficult topic down into simple language
  • Translating between languages and adjusting tone
  • Writing and reviewing code
  • Brainstorming: headlines, ideas, outlines and questions to ask
  • Answering questions about your own documents, when the tool is connected to them

Popular tools built on LLMs include ChatGPT from OpenAI, Gemini from Google, Claude from Anthropic and Microsoft Copilot. Meta’s Llama models are released for developers to build with. You can find more explainers like this in our AI tools section.

Why Do LLMs Make Things Up?

LLMs generate text that sounds right, and sounding right isn’t the same as being right. Google’s course states plainly that LLMs hallucinate, meaning their predictions often contain mistakes.1

The US National Institute of Standards and Technology (NIST) calls this problem confabulation: the production of confidently stated but false content.5 It happens because the model’s goal is to produce a likely continuation. If it hasn’t learned the right fact, or the question is unusual, it can still produce a fluent answer that’s wrong, including invented quotes, numbers or sources.

Always check what matters. For anything involving money, health, law or safety, treat an AI answer as a starting point and confirm it with an official or expert source before you act on it.

Other known weaknesses include:

  • Bias: models can repeat biases present in their training text.1
  • Out-of-date knowledge: a model only knows what was in its training data, unless the tool lets it search or read current documents.
  • Limited memory per conversation: a model can only consider a certain amount of text at once, known as its context window.
  • Weak at exact maths: predicting likely text is different from calculating, so many tools hand sums to a calculator or code instead.

How Tools Reduce Mistakes

The best AI products don’t rely on the model’s memory alone. A common technique is retrieval-augmented generation, often shortened to RAG: before answering, the system searches trusted documents and gives the relevant passages to the model, so the answer is based on real text. The approach was described in a 2020 research paper.6

Other safeguards include letting the model use a web search or a calculator, showing the sources behind an answer, and having people review outputs in high-stakes uses. NIST’s guidance for organisations using generative AI recommends this kind of human oversight and testing.5

Large Language Models vs. Other AI

TypeWhat it doesEveryday example
Large language modelUnderstands and generates textA chatbot drafting an email
Image generatorCreates pictures from a descriptionMaking an illustration from a prompt
Recommendation systemPredicts what you’ll want nextSuggested videos or products
Classic machine learning modelSpots patterns in numbers to make one predictionFlagging a suspicious card payment

The difference matters when you choose a tool. A bank checking for fraud needs a model that makes one precise, testable prediction from numbers, and an LLM would be the wrong choice. A marketing team turning a long report into a short summary needs flexible language skills, which is exactly where LLMs are strongest. Matching the type of AI to the job is usually more important than picking the newest model.

Some newer models handle text, images and audio together. They’re often called multimodal models, but the language part still works on the token-prediction idea described above.

How to Get Better Answers From an LLM

Clear instructions get better results, because the model only has your words to go on.

  1. Give context. Say who the answer is for and why: “Explain inflation to a 12-year-old” works better than “Explain inflation”.
  2. Be specific about the format. Ask for a table, five bullet points or a 100-word summary.
  3. Provide the material. Paste the document you want summarised instead of asking the model to recall it.
  4. Ask for sources, then check them. Open the links yourself. A cited source that doesn’t exist is a sign of confabulation.
  5. Iterate. Treat the first answer as a draft and ask for changes.

Never paste passwords, bank details or other people’s private information into an AI tool. Check the tool’s privacy settings to see how your conversations are stored and used.

Using LLMs Safely at Work

Large language models can save real time at work, as long as you treat them like a capable new assistant whose work you check. A few habits keep the risks low:

  • Follow your organisation’s AI policy. Many employers specify which tools are approved and what information may be shared with them.
  • Keep confidential data out. Customer records, financial details and unreleased plans shouldn’t go into a tool unless it’s approved for that kind of data.
  • Check facts, figures and quotes. Confabulation is the biggest practical risk, so verify anything you’ll publish or rely on.5
  • Be open about AI use where it matters. If a client, reader or teacher would expect to know, tell them.
  • Keep a human decision-maker. Use AI to prepare options and drafts, and leave final decisions about people, money and safety to a person.

Key Terms Explained

Five words explain most of how these models work.

  • Token: a small chunk of text, often part of a word, that the model reads and writes.
  • Parameter: one of the billions of internal settings the model adjusts while learning.
  • Transformer: the model design, introduced in 2017, that uses attention to relate words to each other.
  • Context window: the maximum amount of text the model can consider at once.
  • Retrieval-augmented generation (RAG): a technique that feeds the model trusted documents so its answers are grounded in them.

The Bottom Line

A large language model is a powerful text predictor: it has learned so many patterns in language that its predictions read like understanding. That makes LLMs excellent assistants for drafting, explaining and summarising. It also means they can be confidently wrong, so the right way to use them is as a fast first draft that a person checks. For the wider picture, read our explainer on artificial intelligence or browse more Tech & AI guides.

To go deeper, read how retrieval-augmented generation grounds answers in documents, and how ChatGPT, Claude and Gemini compare.

To get better answers from these models, see our explainers on prompt engineering and generative AI.

Frequently Asked Questions

ChatGPT is a chatbot product built on OpenAI’s large language models. The model does the language work, while the product adds the chat window, safety features and tools such as web search.

Not in the way people do. They learn statistical patterns in language that let them produce well-formed answers, but they don’t check facts, which is why they can be fluent and wrong at the same time.

A token is the small unit of text a model reads and writes, such as a word, part of a word or a punctuation mark. In English, one token is roughly four characters, so 100 tokens is about 75 words.

When choosing each next token, most chatbots include a little randomness so replies don’t sound robotic. Small differences early on lead to different wording later, even when the meaning is similar.

Treat them as a starting point. LLMs can produce confident but false statements, so check anything important against an official or expert source, especially for money, health and legal questions.

Artificial intelligence is the broad field of making computers perform tasks that normally need human intelligence. A large language model is one type of AI that specialises in language.

Sources

  • 1Google Machine Learning Crash Course: What’s a Large Language Model?
  • 2OpenAI Help Center: What Are Tokens and How to Count Them
  • 3Vaswani et al.: Attention Is All You Need (2017)
  • 4Ouyang et al.: Training Language Models to Follow Instructions With Human Feedback (2022)
  • 5NIST AI 600-1: Generative Artificial Intelligence Profile (2024)
  • 6Lewis et al.: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (2020)

Every figure in this article is checked against the sources above. How we research and fact-check →