LLM AI Explained: What a Large Language Model Is and How It Works
On this page
Short answer
LLM AI is the technology behind ChatGPT, Gemini, Claude and almost every AI writing, coding and chat tool launched in the past few years. LLM stands for large language model: a model trained on enormous amounts of text that can understand and generate language. You do not need to know the maths to use one well, but knowing what an LLM is, and what it is not, explains a lot about why these tools are brilliant at some tasks and confidently wrong at others. This guide covers the definition, how tokens and transformers work, how models are trained and tuned, their known problems, the main model families, and how to choose one.

A note on how we work. Newly Stack is a directory and launchpad for AI and SaaS tools, and we run a public model leaderboard. Nobody paid to be mentioned here. Definitions and figures below come from the original transformer paper, Google's Machine Learning Crash Course, IBM and OpenAI's help center, all read on 17 November 2026. See our editorial policy for details.
What is an LLM?
IBM's definition is a good starting point: large language models are "a category of deep learning models trained on immense amounts of data, making them capable of understanding and generating natural language and other types of content to perform a wide range of tasks." IBM adds that LLMs are built on a type of neural network architecture called a transformer.
Google's Machine Learning Crash Course starts one level lower. It defines a language model as something that "estimates the probability of a token or sequence of tokens occurring within a longer sequence of tokens." Give it "The cat sat on the" and it can estimate that "mat" or "sofa" are far more likely next words than "volcano".
A large language model does the same job at a vastly bigger scale. Google's course says LLMs make much better predictions than older approaches such as N-gram models or recurrent neural networks because they contain far more parameters and gather far more context. Put simply, they have more internal knobs to learn patterns with, and they can look at much more of the surrounding text when making each prediction.
It helps to separate three terms that are often used interchangeably:
| Term | What it is | Example |
|---|---|---|
| LLM (model) | The trained neural network that predicts text | A model in OpenAI's GPT family, Google's Gemini family or Anthropic's Claude family |
| AI assistant (product) | An app built around one or more LLMs, with chat, memory, files and tools | ChatGPT, Gemini, Claude |
| API | A way for developers to send text to a model and get a response in their own software | The model APIs covered in our AI API guide |
When someone says "LLM AI", they usually mean the first, but they often experience it through the second.
Tokens: how an LLM reads text
LLMs do not read letters or words the way people do. They read tokens.

OpenAI's help center explains that a token can represent a character, part of a word, a whole word or punctuation, and that spaces affect how text is split. For English text it offers rough estimates:
- 1 token is approximately 4 characters.
- 1 token is approximately three-quarters of a word.
- 100 tokens are approximately 75 words.
OpenAI stresses that these are estimates and that other languages can have different relationships between characters, words and tokens. In practice, text in many non-English languages uses more tokens for the same meaning, which matters because tokens are how usage is limited and billed.
The same article lists the token types you will meet on any model's pricing page:
| Token type | What it means |
|---|---|
| Input tokens | Tokens you send to the model, also called prompt tokens |
| Output tokens | Tokens the model generates, also called completion tokens |
| Cached input tokens | Input tokens reused through prompt caching, often priced differently |
| Reasoning tokens | Tokens a reasoning model uses internally before its visible answer; not shown, but billed as output |
OpenAI's article also describes what happens to your text in three steps: the text is divided into tokens, the model processes those tokens, and the model generates output tokens. Google's crash course adds that an LLM predicts a token or a sequence of tokens, "sometimes many paragraphs worth of predicted tokens." In other words, a long answer from a chatbot is not written all at once. The model predicts one token, adds it to the text so far, then predicts the next one, and repeats until the answer is complete. This step-by-step generation is why answers appear word by word on screen, why a model can drift off course in a very long reply, and why stopping and regenerating sometimes gives a noticeably different result. It also explains why the same prompt can produce different wording each time: at every step the model chooses among several likely tokens rather than one fixed answer.
That last row of the table explains a common surprise: a short visible answer from a reasoning model can still use many tokens. If you are building with LLMs, our AI API guide shows how token pricing turns into real costs.
The transformer: the architecture behind LLMs
Almost every modern LLM is built on the transformer, an architecture introduced in a 2017 research paper.

The paper, "Attention Is All You Need" by Ashish Vaswani and seven co-authors, was first submitted to arXiv on 12 June 2017. Its abstract proposes "a new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely." The authors tested it on machine translation and reported that it was better in quality while being more parallelizable and needing significantly less time to train. One result: a state-of-the-art single-model score on English-to-French translation after training for 3.5 days on eight GPUs.
The key idea is self-attention.

IBM explains it in plain terms. Self-attention lets the model "pay attention to" different tokens at different moments and calculate the relationships between tokens, especially ones far apart in the text. Before that happens, each token is mapped to a list of numbers called an embedding, and the transformer's many layers adjust those embeddings so they become richer, context-aware representations. Transformers also allow parallel processing, which IBM credits with letting LLMs train on unprecedentedly large datasets.
Here is an everyday example. In "The trophy did not fit in the suitcase because it was too big", the word "it" refers to the trophy. Self-attention is the mechanism that lets the model link "it" with "trophy" rather than "suitcase", by weighing the relationships between all the words in the sentence.
How LLMs are trained and tuned
Building a useful LLM happens in stages.
1. Pretraining. IBM describes training as starting with a massive amount of data: billions or trillions of words from books, articles, websites, code and other sources, cleaned to remove errors, duplicates and undesirable content. The model learns by predicting tokens over and over and adjusting its internal weights when it is wrong. These weights are one kind of parameter, and IBM notes that some LLMs contain billions of them.
2. Fine-tuning. A pretrained model knows a lot but is not yet a helpful assistant. IBM explains that fine-tuning adapts a general model to specific tasks such as summarization, classification or customer support, often with a much smaller labelled dataset. A general model can, for example, be fine-tuned on legal questions and answers to create a legal chatbot.
3. Alignment and instruction tuning. Chat assistants are further tuned to follow instructions and to behave safely, which is why ChatGPT answers a question rather than just continuing your sentence.
4. Prompting and distillation. Google's crash course also covers prompt engineering (shaping the input to get better output) and distillation (training a smaller model to imitate a larger one so it is cheaper to run).
There are also small language models. IBM describes them as smaller in scale and scope, with comparatively few parameters, suitable for smaller devices or resource-constrained environments. This is why some AI features now run directly on phones and laptops.
Not every company trains its own model. Many products are built on another company's model through an API, while others use open-weight models they can download and run themselves. Our guide to open-source AI explains the trade-offs.
Problems and limits of LLMs
LLMs are powerful, but their weaknesses are well documented, including by the companies that build them.

Google's Machine Learning Crash Course lists them plainly. Training an LLM requires gathering an enormous training set, consuming multiple months and enormous computational resources and electricity, and solving parallelism challenges. Using an LLM causes three more problems:
- Hallucination. "LLMs hallucinate, meaning their predictions often contain mistakes."
- Resource use. LLMs consume enormous amounts of computation and electricity when answering, not only when training. Our article on the AI data center covers what that means for power and infrastructure.
- Bias. Like all machine learning models, LLMs can exhibit all sorts of bias.
The course also makes a subtle point about apparent reasoning: an LLM trained on many maths word problems can give the appearance of sophisticated reasoning while basically autocompleting the problem. Modern reasoning models narrow this gap, but the underlying lesson holds. An LLM produces the most plausible continuation, and plausible is not the same as true.
Practical rules that follow from this:
- Check facts, numbers, names and quotes against a primary source before using them.
- Give the model the source material (a document, a dataset, a link) instead of relying on what it remembers.
- Ask for uncertainty. Prompts like "say if you are not sure" or "list what you would need to verify" reduce overconfident answers.
- Do not paste secrets into a public chatbot. Passwords, customer records and confidential business documents do not belong in a prompt unless your organisation has approved the tool for that data.
Our guide on how to use AI turns these into an everyday workflow.
Major LLM families and how to choose one
Most people meet LLMs through a handful of model families and the assistants built on them:
| Developer | Model family | Where most people use it |
|---|---|---|
| OpenAI | GPT models | ChatGPT and the OpenAI API |
| Gemini models | Gemini, Google apps and the Gemini API | |
| Anthropic | Claude models | Claude and the Anthropic API |
| DeepSeek | DeepSeek models | DeepSeek, with open-weight releases |
| Mistral AI | Mistral models | Mistral's assistant and open-weight releases |
| Meta | Llama models | Meta AI and open-weight downloads |
New versions arrive every few months, so any ranking goes stale quickly. For a wider map of who builds what, see artificial intelligence companies, Chinese AI for labs in China, and frontier AI for what "frontier model" means.
When choosing an LLM, ask four questions:
- What is the task? Coding, long documents, writing style, image understanding and agentic tool use each favour different models.
- What is the budget? Prices per million tokens differ widely between models, and reasoning models use extra output tokens.
- Does data need to stay with you? If so, an open-weight model you host yourself may matter more than raw quality. Several of the strongest open-weight options are Chinese LLM models from DeepSeek, Qwen and GLM.
- Which language do your users write in? Quality and token efficiency vary by language, so test with your own real examples.
Our model leaderboard compares models on price, speed and quality, and lets you check the trade-offs before committing. If you are building agents on top of LLMs, our AI agent examples show what works in practice.
Bottom line
An LLM is a large neural network, almost always a transformer, trained on huge amounts of text to predict the next token. That simple objective, scaled up with billions of parameters and self-attention, produces models that can write, summarise, translate and code. The same design explains their limits: Google's own course says LLMs hallucinate, consume enormous resources and can be biased. Use LLM AI for what it does well, give it good source material, check what matters, and pick the model that fits your task, budget and language rather than the one with the loudest launch.
Frequently asked questions
What does LLM mean in AI?
LLM stands for large language model. IBM describes LLMs as a category of deep learning models trained on immense amounts of data, which makes them capable of understanding and generating natural language and other content. ChatGPT, Gemini and Claude are chat products built on top of LLMs.
How does an LLM work?
An LLM splits text into tokens, passes them through a neural network called a transformer, and predicts the most likely next token, one step at a time. Google's Machine Learning Crash Course explains that a language model estimates the probability of a token or sequence of tokens occurring within a longer sequence.
What is a token in an LLM?
A token is the unit of text a model processes. It can be a character, part of a word, a whole word or punctuation. OpenAI's rough estimate for English is that one token is about 4 characters or three-quarters of a word, so 100 tokens are about 75 words. Other languages can differ.
What is the transformer in LLMs?
The transformer is the neural network architecture behind modern LLMs. It was introduced in the 2017 paper Attention Is All You Need by Vaswani and colleagues, which proposed an architecture based solely on attention mechanisms. Its self-attention lets the model weigh how tokens relate to each other, even when they are far apart.
Why do LLMs make things up?
Because they predict likely text rather than look up facts. Google's crash course states plainly that LLMs hallucinate, meaning their predictions often contain mistakes. That is why answers about facts, numbers and quotes should be checked against a reliable source.
What is the difference between an LLM and ChatGPT?
An LLM is the underlying model. ChatGPT is a product: an app with a chat interface, memory, file uploads, image tools and safety layers, built on top of OpenAI's models. The same is true of Gemini from Google and Claude from Anthropic.
What are parameters in an LLM?
Parameters are the internal values a model learns during training. IBM explains that the weights the model assigns to relationships between tokens are one type of parameter, and that some LLMs contain billions of them. Smaller models with fewer parameters, sometimes called small language models, can run on smaller devices.
Which LLM is best?
It depends on the task, budget and language. Some models lead on coding, others on writing, price or speed, and open-weight models let you run them yourself. Newly Stack's model leaderboard compares models on price, speed and quality so you can pick for your own use case.
Sources
Pages we read for this article, with the date we accessed each one.
- Vaswani et al., Attention Is All You Need (arXiv:1706.03762)accessed November 17, 2026
- Google Machine Learning Crash Course, Introduction to Large Language Modelsaccessed November 17, 2026
- Google Machine Learning Crash Course, LLMs: What's a large language model?accessed November 17, 2026
- IBM, What Are Large Language Models (LLMs)?accessed November 17, 2026
- OpenAI Help Center, Understanding and counting tokensaccessed November 17, 2026


