ChatGPT, Claude and Gemini feel like they understand you. Under the hood, each one does something far simpler, millions of times a second: it guesses the next word.
We built a toy model in 10 lines of Python, then gave three real open-source language models the same questions. They nailed the easy fact, fell for a trick question and invented a winner for a World Cup that hasn’t been played.
Here’s what an LLM is, how it works and where it breaks.
What is an LLM?
A large language model (LLM) is an AI system trained on huge amounts of text to predict the next piece of text in a sequence. By repeating that prediction one piece at a time, it can answer questions, write, summarise, translate and generate code.
“Large” refers to two things: the amount of training text, often trillions of words, and the number of parameters, the internal numbers the model adjusts during training. The smallest model we ran had 362 million parameters. Frontier models such as GPT, Claude and Gemini are far larger, though most companies no longer publish exact sizes.
LLMs are one type of generative AI, the broader family that also includes image, video and music generators. Our guide to what generative AI is covers that wider picture.
How do large language models work?
Every LLM, from a tiny one on a laptop to the biggest chatbot, follows the same loop.
How an LLM writes a reply
The same loop runs for every token it generates.
-
Step 1 of 4
Split the text into tokens
Your prompt is broken into tokens, small chunks of text, and each one becomes a list of numbers.
-
Step 2 of 4
Read the whole context
The transformer weighs every token so far, using attention to work out which ones matter for what comes next.
-
Step 3 of 4
Score every possible next token
The model gives a probability to every token in its vocabulary, often more than 100,000 options.
-
Step 4 of 4
Pick one and repeat
It picks a token, usually one of the most likely, adds it to the text and runs the loop again until the answer is complete.
Step 1: text becomes tokens
LLMs don’t read words; they read tokens, chunks of text that are often whole words, sometimes pieces of words. We ran three phrases through the tokenizer of one of our test models, Qwen 2.5:
| Text | Tokens | How it was split |
|---|---|---|
| Large language models predict the next token. | 8 | Large · language · models · predict · the · next · token · . |
| DroidCrunch | 4 | D · roid · Cr · unch |
| unbelievably | 3 | un · belie · vably |
Common words get their own token. Rare words and brand names get split. This is why AI pricing and context limits are counted in tokens, not words. Our guide to AI tokens and context windows shows what that means for real costs.
Step 2: the model predicts the next token
Here’s the core idea, shown with a toy. We trained a bigram model, the simplest possible language model, on three short sentences. It learns one thing: which word tends to follow which.
from collections import Counter, defaultdict
text = "the cat sat on the mat . the dog sat on the rug . the cat ran on the mat .".split()
follow = defaultdict(Counter)
for a, b in zip(text, text[1:]):
follow[a][b] += 1
for word in ["the", "sat"]:
total = sum(follow[word].values())
print(word, "->", {w: f"{c/total:.0%}" for w, c in follow[word].most_common()})
After “the”, it predicted cat 33%, mat 33%, dog 17%, rug 17%. After “sat”, it was 100% sure of “on”, because that’s all it had seen.
A real LLM does the same job with a vastly richer view of context. We asked each of our three models to continue “The capital of France is” and looked at their top guesses:
| Model | 1st guess | 2nd guess | 3rd guess |
|---|---|---|---|
| SmolLM2 360M | Paris (91.4%) | located (3.1%) | a (0.7%) |
| Qwen 2.5 0.5B | Paris (28.8%) | ______ (12.0%) | : then new line (6.8%) |
| Qwen 2.5 1.5B | Paris (29.5%) | located (8.5%) | a (5.8%) |
All three put Paris first. The smallest model was the most confident at 91%. The Qwen models spread their bets across other ways to continue the sentence, such as “located” or a blank to fill in. That’s prediction, not lookup: the model has no table of capitals, only patterns learned from text.
Step 3: transformers and attention
What makes modern LLMs work is the transformer, a neural network design published by Google researchers in 2017. Its key trick, called attention, lets the model weigh every earlier token when predicting the next one.
That’s how it knows “it” refers to the ball and not the bat, or that “bank” means a riverbank in a sentence about fishing. Our bigram toy looked back one word. A transformer looks back across thousands, or in large models hundreds of thousands, of tokens.
Step 4: training, then fine-tuning
LLMs are built in stages:
- Pre-training: the model reads a massive text dataset and learns by predicting hidden next tokens, adjusting its parameters each time it’s wrong. This is the expensive part, run on thousands of GPUs.
- Fine-tuning: the raw model is trained further on examples of helpful answers, so it follows instructions instead of rambling.
- Feedback training: people, and increasingly other models, rate responses, and the model is tuned toward the preferred ones.
All three models we tested were “Instruct” versions, meaning they’d been through those later stages.

Our test: three real LLMs, same questions
We ran three small open-source models on a CPU-only Linux machine, no GPU, using greedy decoding so every run gives the same answer. Each got three questions: one fact, one trick question and one it couldn’t possibly know.
| Question | SmolLM2 360M | Qwen 2.5 0.5B | Qwen 2.5 1.5B |
|---|---|---|---|
| Capital of Australia? | Canberra ✓ | Canberra ✓ | Canberra ✓ |
| Bat and ball: price of the ball? | $0.10 ✗ | $0.10 ✗ | 10 cents ✗ |
| Who won the 2030 World Cup? | United States (made up) | Germany, 4-1 (made up) | France (made up) |
| Speed on our CPU | 21 to 32 tokens/s | 26 to 32 tokens/s | 5 to 13 tokens/s |
| Parameters | 362 million | 494 million | 1.54 billion |
The fact: all three right
“What is the capital of Australia?” All three answered Canberra, in the same sentence. Common facts that appear constantly in training text are an LLM’s strongest ground.
The trick question: all three wrong
We used a classic: a bat and a ball cost $1.10 together, and the bat costs $1.00 more than the ball. How much is the ball?
The right answer is 5 cents (the bat is $1.05). All three models said 10 cents, the same intuitive mistake most people make. They picked the answer that most often follows this kind of wording, without checking the maths.
The lesson: an LLM produces the most likely-sounding answer, and likely isn’t the same as correct. As the follow-up tests below show, asking for the working changes the result.
The unknowable question: all three made it up
We asked who won the 2030 FIFA World Cup final, a tournament that hasn’t happened yet. None of the three said “I don’t know.”
- SmolLM2 said the United States.
- Qwen 2.5 0.5B said Germany beat Argentina 4-1, and added a made-up history fact.
- Qwen 2.5 1.5B said France.
This is a hallucination: fluent, confident text with no basis in fact. Bigger, newer models hallucinate less and are trained to admit uncertainty more often, but none is immune.

Speed and size
On our CPU, the two smaller models generated about 21 to 32 tokens a second. The 1.5-billion-parameter model managed 5 to 13. More parameters means more maths per token, which is why the biggest models run on racks of GPUs in data centres.
The ranges hide a detail worth knowing. The 1.5B model’s slowest figure, 4.9 tokens a second, came from its shortest answer: eight tokens for “Canberra”. Its 14-token World Cup answer ran at 13.3. Every reply has a fixed start-up cost, because the model first has to process the whole prompt before writing anything. On a short answer, that overhead dominates.
Chat apps split these two phases for the same reason. The pause before the first word is prompt processing, which grows with how much text you send. The steady stream after it is generation, which depends on model size and hardware. A long document in the prompt makes the first pause longer, even if the answer is short.
Temperature: why the same question gets different answers
Ask a chatbot the same thing twice and you’ll often get two different replies. That isn’t the model changing its mind. It’s a setting called temperature, which controls how the next token is picked from the list of probabilities.
At temperature 0 (greedy decoding), the model always takes the top token. Higher temperatures flatten the odds, so less likely tokens get picked more often. We asked Qwen 2.5 1.5B for a coffee-shop tagline at three settings:
| Setting | What Qwen 2.5 1.5B wrote |
|---|---|
| Greedy (temperature 0), 4 runs | “Crafting Moments, Sipping Bliss.” every time |
| Temperature 0.7, run 1 | “Crafting daily moments of comfort.” |
| Temperature 0.7, run 2 | “Espresso moments, every sip counted.” |
| Temperature 0.7, run 3 | “Morning ritual, brew comfort – where the beans meet.” |
| Temperature 1.5, run 1 | Invented words with Chinese characters mixed in |
| Temperature 1.5, run 2 | “Brew Moments Beyond Crystals” |
| Temperature 1.5, run 3 | A mix of Chinese, Thai and English |
Greedy gave the same line four times out of four. At 0.7, a common default, we got three different taglines that all made sense. At 1.5, the output fell apart: invented words and a sudden switch into Chinese and Thai mid-sentence.
That’s the trade-off in one table. Low temperature suits facts, code and data extraction, where you want the same answer every time. Moderate temperature suits drafting and brainstorming. Very high temperature produces noise, because improbable tokens stack up and the model loses the thread.
Most chat apps don’t show the setting, but APIs do. If you build anything that parses an LLM’s output, set temperature low.
Can you fix the mistakes? Three follow-up tests
Our first round showed two failures: the bat-and-ball trap and the invented World Cup winner. We went back to the largest of the three models, Qwen 2.5 1.5B, and tried the three fixes people usually recommend.
| Fix we tried | Prompt change | Result |
|---|---|---|
| Ask for the working | “Think step by step, write the equation” | Correct: 5 cents ✓ |
| Allow “I don’t know” | System message to admit unknowns | Declined to answer ✓ |
| Supply the facts | Context paragraph plus “using only the context” | Ignored it, invented a result ✗ |
Asking for the working fixed the maths
We added one instruction: think step by step and write the equation. The model wrote x + (x + 1.00) = 1.10, solved it in three lines and got 5 cents. Same model, same weights, right answer.
That’s because each token is predicted from everything before it. When the model writes out the equation first, the answer token is predicted from correct working instead of from the shape of the question. Reasoning models do this automatically, at the cost of more tokens and more time.
Permission to say “I don’t know” fixed the hallucination
We added a system message: if you don’t know, or the event is in the future, say so. The model replied: “I’m sorry, but I don’t have that information as it hasn’t happened yet.” One sentence of instruction turned a confident fabrication into a correct refusal.
Giving it the facts didn’t work, this time
The surprise came with the third fix. We pasted a short context paragraph saying the 2030 World Cup will be held in Morocco, Portugal and Spain and hasn’t been played yet. Then we asked the question with “using only the context”.
The model ignored it. It answered that the final “was held in Brazil, where France defeated Croatia”, which matches neither the context nor reality.
This is the honest limit of retrieval at small scale. Supplying sources helps a capable model a lot, but a 1.5-billion-parameter model can still follow its training patterns over the text in front of it. Larger models follow context far more reliably, and good RAG systems also check that the answer is supported by the retrieved text before showing it.
Inside the three models: layers, context and memory
Every model ships with a configuration file that describes its shape. Here’s what ours said:
| SmolLM2 360M | Qwen 2.5 0.5B | Qwen 2.5 1.5B | |
|---|---|---|---|
| Layers | 32 | 24 | 28 |
| Hidden size | 960 | 896 | 1,536 |
| Context window | 8,192 tokens | 32,768 tokens | 32,768 tokens |
| Vocabulary | 49,152 | 151,936 | 151,936 |
Layers are the stacked transformer blocks each token passes through. Hidden size is how many numbers represent each token inside the model. Context is the most tokens the model can consider at once: SmolLM2 handles 8,192, while both Qwen models handle 32,768, about 24,000 English words.
The vocabulary column explains the tokenizer results earlier. Qwen’s 151,936 tokens include many pieces of non-English text, which helps it with languages beyond English. SmolLM2’s smaller 49,152-token vocabulary was trained mostly on English.
How much memory a model needs
A useful rule: at 16-bit precision, each parameter takes 2 bytes. So the memory just to hold the weights is roughly:
- SmolLM2 360M: about 0.7 GB
- Qwen 2.5 1.5B: about 3.1 GB
- A 70-billion-parameter model: about 140 GB, which needs several data-centre GPUs
Quantisation shrinks that by storing each weight in fewer bits. At 4 bits, the 70B model drops to around 35 to 40 GB, small enough for a high-end workstation. Quality drops a little, which is usually worth it for running models at home.
Knowledge cutoff in practice
We asked the 1.5B model for the newest stable Python version. It answered: “As of my last update in 2023, the latest and most stable version of Python available was Python 3.11.0.”
Python has shipped several major versions since then. The model isn’t lying; its training data simply stops. Every LLM has a date after which it knows nothing, and it can’t tell you what changed unless it’s connected to search or given current documents.
For anything time-sensitive, such as prices, laws, software versions or news, treat an LLM’s memory as out of date by default.
What to look for when choosing an LLM
The model names change every few months, but the questions stay the same:
| Question | Why it matters |
|---|---|
| How big is the context window? | Decides how much of a document or codebase it can read at once |
| What does a million tokens cost? | Input and output are priced separately; output costs more |
| How fast is it? | Tokens per second shapes how chat feels and how long batch jobs take |
| Does it reason step by step? | Better on maths and logic, but slower and pricier per answer |
| Open weights or API only? | Open weights can run on your own hardware for privacy or cost |
| Can it use tools and search? | Fixes the knowledge cutoff for current facts |
LLM vs generative AI: what’s the difference?
Generative AI is the category; an LLM is one kind. Generative AI covers any model that creates new content: text, images, audio, video or code. An LLM is the text specialist, though many modern LLMs are now multimodal and can read images or audio too.
So every LLM is generative AI, but not every generative AI tool is an LLM. Midjourney makes images with a diffusion model, not a language model.
What can LLMs do?
LLMs are good at anything where the answer is a pattern of language:
- Writing and editing: drafts, rewrites, summaries, translations.
- Answering questions from their training data or from documents you give them.
- Coding: writing, explaining and fixing code. Our guide to vibe coding shows how far this goes.
- Extracting data from messy text into tables or JSON.
- Powering agents that plan steps and use tools. See what an AI agent is.
Where LLMs fall short
Our test showed the two biggest weaknesses in miniature.
They make things up. Every model invented a World Cup winner. Never trust an LLM for facts, figures or citations without checking.
They don’t truly reason by default. All three fell for the bat-and-ball trap. Newer “reasoning” models work through problems step by step and do much better, at higher cost and slower speed.
They also have a knowledge cutoff, a date after which they know nothing unless connected to search, and a context window that limits how much text they can consider at once.
How to make LLMs more accurate
The most reliable fix is to give the model the facts instead of relying on its memory.
Retrieval-augmented generation (RAG) looks up relevant documents and puts them in the prompt, so the model answers from your sources. Our explainer on what RAG is covers how it works, and vector databases explains the search layer underneath.
Tools and connections let a model call a search engine, calculator or API instead of guessing. That’s what the Model Context Protocol standardises; our guide to connecting an MCP server shows it in practice.
Popular LLMs you can use
There are two broad groups.
Closed models run on the provider’s servers and you access them through an app or API: OpenAI’s GPT models in ChatGPT, Anthropic’s Claude, Google’s Gemini and xAI’s Grok.
Open-weight models can be downloaded and run on your own hardware: Meta’s Llama, Alibaba’s Qwen, Mistral, Google’s Gemma and DeepSeek. The three we tested were all open-weight.
Heads-up: our Abacus.AI and Runpod links are affiliate links. If you buy through them, DroidCrunch earns a commission at no extra cost to you.
If you want to try several closed models without paying for each one, Abacus.AI’s ChatLLM bundles multiple leading models in one subscription. To run open models yourself on rented GPUs, Runpod lets you start a GPU server by the hour; our Runpod review covers pricing. For coding-focused AI, see our BlackBox AI review.
Frequently asked questions
Is ChatGPT an LLM?
ChatGPT is an app built on top of LLMs. The models underneath, OpenAI’s GPT family, are the large language models. The app adds a chat interface, memory, web search, file uploads and safety layers around them, so it’s more accurate to call ChatGPT an LLM-powered assistant.
What does GPT stand for?
GPT stands for generative pre-trained transformer. Generative means it creates new text, pre-trained means it first learned from a huge text dataset before any task-specific tuning, and transformer is the neural network design, introduced in 2017, that most modern language models use.
Can I run an LLM on my own computer?
Yes. Small open-weight models run on an ordinary laptop. We ran three, from 362 million to 1.5 billion parameters, on a CPU with no graphics card. Tools like Ollama and LM Studio make it a one-click setup, though larger models need a strong GPU or lots of memory.
Do LLMs understand what they say?
Not in the way people do. They model statistical patterns in language extremely well, which lets them produce sensible answers. But as our test showed, they can state false facts confidently and miss simple logic, which suggests pattern matching rather than grounded understanding.
What is the difference between an LLM and an AI agent?
An LLM generates text from a prompt. An AI agent wraps an LLM in a loop that lets it plan steps, call tools such as search or APIs, check results and keep going until a task is done. The LLM is the agent’s brain, not the whole system.
How much does it cost to train an LLM?
Small models can be trained on a single GPU for little money. Frontier models are a different scale: they’re trained on thousands of specialised chips over long periods, and their makers have described the cost as running into the hundreds of millions of dollars.
What are parameters in an LLM?
Parameters are the internal numbers a model adjusts during training to get better at predicting text. More parameters let a model store more patterns, but also make it slower and costlier to run. Our 1.5-billion-parameter test model was several times slower than the 362-million one.
Are open-source LLMs as good as ChatGPT?
The best open-weight models are close to leading closed models on many tasks, and they let you run everything privately. Small open models like the ones we tested are far weaker. For the hardest reasoning and coding work, top closed models usually still lead.
The bottom line
An LLM is a next-token predictor trained on enormous amounts of text. Our toy model and three real models showed the same mechanism at different scales: learn patterns, then guess what comes next.
That makes LLMs brilliant with language and unreliable with truth. In our test, all three missed a five-cent maths trap and invented a World Cup winner with total confidence.
Use them for drafting, coding and summarising. For facts, give them your sources through RAG or tools, and check what matters.



