explainx.ai350K+ learn from us
TrendingAI News TodayExplainx for Business
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcpestacktoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • TL;DR
  • The one idea: predict the next token
  • How an LLM learns: pretraining
  • From text predictor to assistant
  • The model, the app and the agent
  • What an LLM is bad at, and why
  • What this means for how you use AI
  • Where to go next
  • Related reading
← Back to blog

explainx / blog

What Is a Large Language Model (LLM)? How ChatGPT and Claude Write an Answer

LLM, AI Basics, Generative AI, Guides

A large language model predicts the next piece of text, one token at a time, using patterns learned from huge amounts of writing. Here is how it works.

Dec 5, 2026·8 min read·Yash Thakker
add explainx.ai
go deep
What Is a Large Language Model (LLM)? How ChatGPT and Claude Write an Answer

You ask a chat assistant why the sky is blue, and a well-formed paragraph appears in a few seconds, as if someone wrote it for you. Nobody did. A program produced it one small piece at a time, each piece chosen because it was the most likely thing to come next.

That program is a large language model, or LLM. It is the engine inside ChatGPT, Claude, Gemini, Microsoft Copilot and most AI writing tools. You do not need the maths to use one well, but you do need the one idea behind it, because it explains why prompts matter, why answers vary and why a fluent answer can still be wrong. This lesson is part of the AI Foundations pathway.

TL;DR

table · 2 cols
QuestionShort answer
What is an LLM?A program that writes text by predicting the next piece, again and again
How does it learn?By reading huge amounts of text and adjusting itself to predict the next token better
Does it look things up?No, unless the app gives it a tool such as search or your documents
Why "large"?Billions to trillions of parameters, trained on a vast amount of text
How does it become a chat assistant?Extra training on instructions and human feedback, after the first training
Why does it get facts wrong?It produces likely text, not checked facts
What does that mean for me?Give it the facts, ask for one clear task, and check what it says

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

350K+ Students Already Joined

The one idea: predict the next token

Language models work on tokens: small chunks of text, often a word or part of a word. "Unbelievable" might be split into "un", "believ" and "able". Our guide to LLM tokens shows how that split works and why it matters for cost.

Given some text, the model computes a score for every token it knows and turns those scores into probabilities. For "The capital of France is", the token " Paris" gets a very high probability. The app picks a token, adds it to the text, and asks the model again. It repeats this until the answer is complete.

What is an LLM: layers of a neural network scoring every possible next tokenWhat is an LLM: layers of a neural network scoring every possible next token

That loop is the whole mechanism. There is no separate step where the model plans the full answer, looks it up or checks it. A long, well-structured reply is the result of thousands of next-token predictions, each one informed by everything written so far.

The part that makes this work is the transformer architecture, introduced in the 2017 paper "Attention Is All You Need". Its attention mechanism lets every new token take the whole preceding text into account, so the model can keep a topic, a name or an instruction in view across a long answer.

Play · how an answer gets written
You send a message to a chat assistant. Put the steps in the order they happen.

How an LLM learns: pretraining

Before a model can answer anything, it goes through pretraining. The training data is a very large collection of text: books, websites, code, articles and more. The task is simple: hide the next token, let the model guess, and nudge its internal numbers so the right token becomes a little more likely next time. Repeat that across trillions of tokens.

Those internal numbers are the model's parameters. They are where the learning is stored. A model with more parameters can hold more patterns, which is why "large" is in the name. OpenAI's GPT-3, published in 2020, had 175 billion parameters; current frontier models are larger still, and our guide to LLM parameters and model sizes compares them.

Predicting the next token sounds narrow, but to do it well across all that text, a model has to pick up grammar, facts, styles, reasoning patterns and the structure of code. Nobody programs those skills in. They emerge because they help the prediction.

Two consequences follow:

  • The model has a cut-off. It learned from text up to some date. It knows nothing after that unless the prompt or a tool tells it.
  • It stores patterns, not a list of facts. A famous fact appears thousands of times in training and is predicted reliably. A rare fact, such as one company's refund policy, may be blurred or missing.

From text predictor to assistant

A freshly pretrained model is not a helpful assistant. Ask it a question and it may continue with three more questions, because that is a likely continuation on a web forum.

The step from predictor to assistant is post-training:

  1. Instruction tuning. The model is trained on many examples of a request followed by a good answer, so it learns to respond rather than ramble.
  2. Learning from feedback. People (and increasingly other models) compare answers, and the model is trained to prefer the better one. The best-known method is reinforcement learning from human feedback (RLHF), which OpenAI described in its 2022 InstructGPT work. Our guide to RLHF and Constitutional AI explains how labs use it for safety as well as helpfulness.

How an LLM becomes a chat assistant: post-training polishes a raw text predictorHow an LLM becomes a chat assistant: post-training polishes a raw text predictor

ChatGPT's launch in November 2022 showed what this step changes. The underlying kind of model had existed for a while; the instruction-following, conversational behaviour is what made it usable by everyone.

Some models get a further stage that trains them to work through a problem at length before answering. Those are reasoning models, and they trade time and cost for accuracy on hard tasks.

The model, the app and the agent

It helps to separate three things people often call "the AI":

table · 3 cols
LayerWhat it isExample
The modelThe trained network that predicts tokensA specific Claude, GPT or Gemini model
The appA product that sends your conversation to the model with its own instructionsChatGPT, Claude.ai, Microsoft Copilot
The agentAn app that lets the model call tools in a loop until a task is doneA coding agent that edits files and runs tests

The app adds a system prompt, your chat history, memory and sometimes tools such as web search. That is why the same model can behave differently in two products. When the app lets the model take actions, read results and decide the next step on its own, it becomes an AI agent.

What an LLM is bad at, and why

Every common failure follows from the next-token idea.

It states wrong facts confidently. The model is trained to produce likely text. When the answer is not in the prompt and the pattern from training is weak, it still produces something fluent. This is a hallucination, and the fix is to supply the facts or give the model a way to look them up.

It forgets the start of very long conversations. It can read only so much text at once: its context window. Past that limit, the app has to drop or summarise earlier parts.

It is not sure about recent events. Anything after its training cut-off is unknown unless a search tool or your prompt provides it.

It can be inconsistent. The app samples each token with some randomness, so two runs of the same question can differ. Our lesson on what a prompt is shows the other reasons answers vary.

Exact counting and arithmetic can slip. Tokens are chunks, not letters or digits, so tasks like counting characters are awkward for the model. Apps often hand maths to a code tool for this reason.

None of this makes LLMs less useful. It tells you where to put your effort: give context, ask for one clear task, and check what matters.

What this means for how you use AI

Four habits follow directly from how the model works:

  1. Give it the facts. It cannot know your situation. Paste the details it needs, and say "use only the information above" when accuracy matters.
  2. Ask for one thing at a time. Each answer is built token by token from your request. A focused request gives the prediction a clear direction.
  3. Say what good looks like. The default is the most average answer. Your audience, length and format move it away from average. The FROG in a Bowl checklist covers this.
  4. Check anything you will act on. Numbers, names, dates and quotes that were not in your prompt are claims, not facts.

Where to go next

You now have the core idea that the rest of AI builds on: a model that predicts the next token, trained on a huge amount of text, tuned to follow instructions, and wrapped in an app.

In the AI Foundations pathway, the next lessons go one level deeper into the pieces you just met: what tokens are, what a context window is and how the transformer works. If you would rather learn this hands-on with an instructor, the AI Basics workshop starts from exactly here.

Related reading

  • What is generative AI?
  • AI vs machine learning vs deep learning
  • What are LLM tokens?
  • What is a transformer?
  • What is a reasoning model?
  • Why AI models hallucinate, and how to catch it
  • What is fine-tuning an LLM?

Primary sources: Vaswani et al., "Attention Is All You Need" (2017) · Brown et al., "Language Models are Few-Shot Learners" (GPT-3, 2020) · Ouyang et al., "Training language models to follow instructions with human feedback" (InstructGPT, 2022)


Model sizes and products change quickly; the mechanism in this lesson does not. Accurate as of December 2026. Follow @explainx_ai for updates.

Spotted something out of date? Let us know.
Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

  • ✓ Free
  • ✓ One email a day, no spam
  • ✓ Unsubscribe anytime
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Share

LLM
Workshops

Learn by building

Live, hands-on workshops on Claude, agents, and AI tooling — taught by practitioners, not slides.

Explore workshops →

Related posts

Dec 5, 2026

What Is a Reasoning Model? When AI "Thinking" Is Worth the Wait

Reasoning models write out a long chain of working before their final answer, and they are trained to make that working pay off. This guide explains what they do differently, why the thinking costs money, which tasks benefit, and how to set the effort level instead of guessing.

Jun 27, 2026

What Is Generative AI? The Complete Beginner Guide for 2026

Generative AI is the technology behind ChatGPT, Midjourney, and GitHub Copilot — AI that creates new content rather than just analyzing existing data. This foundational guide explains what it is, how it works in plain English, and how to start using it practically, even if you have zero technical background.

Dec 5, 2026

What Is a Prompt? What the AI Actually Reads When You Type

A prompt is not just the line you type. It is the whole package the model reads before it answers: hidden instructions, earlier messages, files and your words. Knowing what is in that package explains most surprising AI answers.