---
title: How LLMs Work | Large Programs
description: Tokens, training and prediction explained with everyday examples.
canonical: https://www.largeprograms.com/category/how-llms-work/
---

35 articles

# How LLMs Work

Tokens, training and prediction explained with everyday examples.

[![](/img/hero/art-ai-art-and-music-basics.svg)](/ai-art-and-music-basics/)

How LLMs Work

### [How AI Makes Music: A Beginner's Look](/ai-art-and-music-basics/)

Models can generate melodies and songs by learning patterns in sound. What that means for musicians.

[![](/img/hero/art-backpropagation-how-neural-networks-learn-from-mistakes.svg)](/backpropagation-how-neural-networks-learn-from-mistakes/)

How LLMs Work

### [Backpropagation: How a Network Learns From Its Mistakes](/backpropagation-how-neural-networks-learn-from-mistakes/)

Backpropagation is the method that works out how to adjust each weight in a neural network after it makes an error. A simple explanation with a team analogy.

[![](/img/hero/art-chain-of-thought-prompting-showing-your-working.svg)](/chain-of-thought-prompting-showing-your-working/)

How LLMs Work

### [Chain-of-Thought Prompting: Showing the Steps](/chain-of-thought-prompting-showing-your-working/)

Asking a language model to show intermediate steps can improve its answers to hard problems. What the research found and how it is like showing your working in maths.

[![](/img/hero/art-computer-vision-how-computers-see.svg)](/computer-vision-how-computers-see/)

How LLMs Work

### [Computer Vision: How Computers Make Sense of Pictures](/computer-vision-how-computers-see/)

Computer vision is the field that teaches computers to get useful information from images and video. Tasks, examples and a reminder that a computer does not see like you.

[![](/img/hero/art-generative-adversarial-networks-two-ai-players.svg)](/generative-adversarial-networks-two-ai-players/)

How LLMs Work

### [Generative Adversarial Networks: Two AI Players in One Game](/generative-adversarial-networks-two-ai-players/)

A GAN trains two networks against each other, one that makes fakes and one that spots them. What the 2014 paper proposed and why people still talk about the idea.

[![](/img/hero/art-graphcast-ai-weather-forecasting.svg)](/graphcast-ai-weather-forecasting/)

How LLMs Work

### [GraphCast: Using AI to Forecast the Weather](/graphcast-ai-weather-forecasting/)

GraphCast is a machine learning system for ten-day weather forecasts. What its authors report, in numbers from the paper's abstract, and what that does and does not tell us.

[![](/img/hero/art-how-big-is-a-language-model.svg)](/how-big-is-a-language-model/)

How LLMs Work

### [How Big Is a Language Model? Size in Plain Terms](/how-big-is-a-language-model/)

Billions of parameters and trillions of tokens. What the numbers mean and how model size is measured.

[![](/img/hero/art-how-do-ai-image-generators-work.svg)](/how-do-ai-image-generators-work/)

How LLMs Work

### [How Do AI Image Generators Work? A Simple Explanation](/how-do-ai-image-generators-work/)

Image generators turn words into pictures. Here is the basic idea of diffusion models, explained simply.

[![](/img/hero/art-how-do-llms-learn.svg)](/how-do-llms-learn/)

How LLMs Work

### [How Do Large Language Models Learn?](/how-do-llms-learn/)

LLMs learn by reading huge piles of text and practising next-word guesses over and over. A step-by-step explanation without jargon.

[![](/img/hero/art-how-llms-run-on-computers.svg)](/how-llms-run-on-computers/)

How LLMs Work

### [How Do Language Models Run? GPUs and Data Centres](/how-llms-run-on-computers/)

Training and running big models needs special chips and lots of electricity. Here is the basic picture.

[![](/img/hero/art-knowledge-distillation-a-student-model-learns-from-a-teacher.svg)](/knowledge-distillation-a-student-model-learns-from-a-teacher/)

How LLMs Work

### [Distillation: A Small Model Learns From a Big One](/knowledge-distillation-a-student-model-learns-from-a-teacher/)

Distillation squeezes what a group of big models knows into one smaller model. What the 2015 paper by Hinton, Vinyals and Dean says, in plain words.

[![](/img/hero/art-lora-teaching-a-big-model-with-a-few-new-numbers.svg)](/lora-teaching-a-big-model-with-a-few-new-numbers/)

How LLMs Work

### [LoRA: Teaching a Big Model With a Few New Numbers](/lora-teaching-a-big-model-with-a-few-new-numbers/)

LoRA adapts a large model by training a tiny set of added numbers instead of all of them. What the 2021 paper reports, with exact figures from its abstract.

[![](/img/hero/art-machine-translation-how-it-works.svg)](/machine-translation-how-it-works/)

How LLMs Work

### [How Does Machine Translation Work?](/machine-translation-how-it-works/)

From word-for-word dictionaries to neural networks: how computers translate between languages, and why people still check the results.

[![](/img/hero/art-mixture-of-experts-a-team-of-small-networks.svg)](/mixture-of-experts-a-team-of-small-networks/)

How LLMs Work

### [Mixture of Experts: A Team of Specialists Inside One Model](/mixture-of-experts-a-team-of-small-networks/)

A mixture-of-experts model uses only a few of its many sub-networks for each input. What the 2017 paper proposed, what its numbers were and why it matters.

[![](/img/hero/art-neural-networks-simple-guide.svg)](/neural-networks-simple-guide/)

How LLMs Work

### [What Is a Neural Network? A Simple Guide](/neural-networks-simple-guide/)

Neural networks are the layered number machines behind modern AI. Learn the idea with a team-of-voters analogy.

[![](/img/hero/art-overfitting-memorising-instead-of-learning.svg)](/overfitting-memorising-instead-of-learning/)

How LLMs Work

### [Overfitting: When a Model Memorises Instead of Learning](/overfitting-memorising-instead-of-learning/)

A model that matches its training examples too closely can fail on new ones. A simple explanation of overfitting, with a study-for-the-test comparison.

[![](/img/hero/art-quantization-fitting-big-models-in-less-memory.svg)](/quantization-fitting-big-models-in-less-memory/)

How LLMs Work

### [Quantization: Fitting a Big Model Into Less Memory](/quantization-fitting-big-models-in-less-memory/)

Quantization stores a model's numbers with fewer digits so it needs less memory. What the 2022 LLM.int8() paper reports and why memory limits who can run big models.

[![](/img/hero/art-scaling-laws-bigger-models.svg)](/scaling-laws-bigger-models/)

How LLMs Work

### [Scaling Laws: Why Bigger Models Kept Getting Better](/scaling-laws-bigger-models/)

In 2020 researchers showed that language model error falls in a predictable pattern as models, data and computing grow. What that says, and what it does not.

[![](/img/hero/art-speech-recognition-and-voice-assistants.svg)](/speech-recognition-and-voice-assistants/)

How LLMs Work

### [How Do Voice Assistants Understand Speech?](/speech-recognition-and-voice-assistants/)

Speech recognition turns sound into text, then other software decides what to do.

[![](/img/hero/art-the-transformer-explained-simply.svg)](/the-transformer-explained-simply/)

How LLMs Work

### [The Transformer Explained Simply](/the-transformer-explained-simply/)

The Transformer is the idea behind modern chatbots. Learn what attention means with a classroom example.

[![](/img/hero/art-vision-transformer-cutting-pictures-into-patches.svg)](/vision-transformer-cutting-pictures-into-patches/)

How LLMs Work

### [Vision Transformer: Reading a Picture as a Row of Patches](/vision-transformer-cutting-pictures-into-patches/)

The Vision Transformer cuts an image into patches and treats them like words in a sentence. What the 2020 paper says it showed about image recognition.

[![](/img/hero/art-what-are-embeddings.svg)](/what-are-embeddings/)

How LLMs Work

### [What Are Embeddings? How AI Turns Meaning into Numbers](/what-are-embeddings/)

Embeddings place words on a map of meaning so that similar ideas sit close together. A friendly explanation.

[![](/img/hero/art-what-are-parameters-in-ai.svg)](/what-are-parameters-in-ai/)

How LLMs Work

### [What Are Parameters in an AI Model?](/what-are-parameters-in-ai/)

When you hear that a model has billions of parameters, what does that mean? A knob-and-dial explanation.

[![](/img/hero/art-what-is-a-context-window.svg)](/what-is-a-context-window/)

How LLMs Work

### [What Is a Context Window? The AI's Short-Term Memory](/what-is-a-context-window/)

A context window is how much text a language model can look at at once. Understand it with a simple desk analogy.

[![](/img/hero/art-what-is-a-token.svg)](/what-is-a-token/)

How LLMs Work

### [What Is a Token? How AI Reads Words](/what-is-a-token/)

Tokens are the small pieces of text that language models read and write. Learn how a sentence is chopped up, with simple examples.

[![](/img/hero/art-what-is-fine-tuning.svg)](/what-is-fine-tuning/)

How LLMs Work

### [What Is Fine-Tuning? Teaching a Model a Special Skill](/what-is-fine-tuning/)

Fine-tuning adapts a pre-trained model to a narrower job. What gets changed, why it is cheaper than starting again, what LoRA is, and the risks.

[![](/img/hero/art-what-is-multimodal-ai.svg)](/what-is-multimodal-ai/)

How LLMs Work

### [What Is Multimodal AI? Text, Images and Sound Together](/what-is-multimodal-ai/)

Multimodal models work with more than one kind of information, such as words, pictures, sound and video. How they join them together.

[![](/img/hero/art-what-is-rag-retrieval-augmented-generation.svg)](/what-is-rag-retrieval-augmented-generation/)

How LLMs Work

### [What Is RAG? Giving a Chatbot a Library to Check](/what-is-rag-retrieval-augmented-generation/)

Retrieval-augmented generation lets a language model look up documents before it answers. How it works step by step, a school example, what it fixes and what it does not.

[![](/img/hero/art-what-is-reinforcement-learning.svg)](/what-is-reinforcement-learning/)

How LLMs Work

### [Reinforcement Learning: Learning From Rewards](/what-is-reinforcement-learning/)

In reinforcement learning an AI learns by trying actions and getting rewards. What explore and exploit mean, and how it connects to AlphaGo and chatbots.

[![](/img/hero/art-what-is-rlhf.svg)](/what-is-rlhf/)

How LLMs Work

### [What Is RLHF? Teaching AI with Human Feedback](/what-is-rlhf/)

Reinforcement learning from human feedback uses people's rankings to train a reward model, which then guides a chatbot toward answers people prefer. Steps, an analogy and the limits.

[![](/img/hero/art-what-is-supervised-learning.svg)](/what-is-supervised-learning/)

How LLMs Work

### [Supervised Learning: Learning With an Answer Key](/what-is-supervised-learning/)

In supervised learning a model learns from examples that come with the right answers. How it works with a cats-and-dogs example, and where you meet it.

[![](/img/hero/art-what-is-temperature-in-ai.svg)](/what-is-temperature-in-ai/)

How LLMs Work

### [What Is "Temperature" in an AI Model?](/what-is-temperature-in-ai/)

Temperature controls how adventurous or careful a language model is when choosing words.

[![](/img/hero/art-what-is-unsupervised-learning.svg)](/what-is-unsupervised-learning/)

How LLMs Work

### [What Is Unsupervised Learning?](/what-is-unsupervised-learning/)

Unsupervised learning finds patterns in data that has no labels. How it differs from supervised learning, and why it matters for large language models.

[![](/img/hero/art-why-ai-is-bad-at-counting-letters.svg)](/why-ai-is-bad-at-counting-letters/)

How LLMs Work

### [Why Do Chatbots Struggle to Count Letters in a Word?](/why-ai-is-bad-at-counting-letters/)

Researchers have several ideas for why chatbots miscount letters, and they have not settled on one. A look at the evidence.

[![](/img/hero/art-why-ai-makes-math-mistakes.svg)](/why-ai-makes-math-mistakes/)

How LLMs Work

### [Why Do Language Models Make Maths Mistakes?](/why-ai-makes-math-mistakes/)

LLMs predict text, they do not calculate by default. When to trust them and when to use a calculator.
