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.

Illustration of small token blocks on the left flowing into a layered network of connected nodes in the center, which outputs a highlighted next block on the right
Concept illustration: an LLM turns text into tokens, passes them through many layers, and predicts the next token.Image: Illustration by Newly Stack (not AI generated).

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:

TermWhat it isExample
LLM (model)The trained neural network that predicts textA 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 toolsChatGPT, Gemini, Claude
APIA way for developers to send text to a model and get a response in their own softwareThe 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.

Screenshot of the OpenAI Help Center article on tokens, section Use rough estimates for English text, listing that 1 token is approximately 4 characters, 1 token is approximately three-quarters of a word, and 100 tokens are approximately 75 words
OpenAI's rule of thumb for English: about 4 characters or three-quarters of a word per token. Other languages can differ.Screenshot of help.openai.com by Newly Stack, taken 2026-11-17.

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 typeWhat it means
Input tokensTokens you send to the model, also called prompt tokens
Output tokensTokens the model generates, also called completion tokens
Cached input tokensInput tokens reused through prompt caching, often priced differently
Reasoning tokensTokens 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.

Screenshot of the arXiv page for the paper Attention Is All You Need by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin, submitted on 12 June 2017, with the abstract proposing the Transformer architecture
The 2017 paper that introduced the transformer, the architecture nearly all of today's LLMs are built on.Screenshot of arxiv.org by Newly Stack, taken 2026-11-17.

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.

Screenshot of the IBM Think article on large language models, section Self-attention, explaining that transformer models introduced in 2017 use a self-attention mechanism to pay attention to different tokens and calculate relationships between them, and that each token is mapped to a vector called an embedding
IBM's explanation of self-attention: the model learns how strongly each token relates to the others, even distant ones.Screenshot of ibm.com by Newly Stack, taken 2026-11-17.

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.

Screenshot of the Google Machine Learning Crash Course page section Problems with LLMs, listing training problems such as gathering an enormous training set and consuming months of computation and electricity, and inference problems: LLMs hallucinate, consume enormous resources, and can exhibit bias
Google's own course lists the core problems: hallucination, heavy compute and electricity use, and bias.Screenshot of developers.google.com by Newly Stack, taken 2026-11-17.

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:

  1. Check facts, numbers, names and quotes against a primary source before using them.
  2. Give the model the source material (a document, a dataset, a link) instead of relying on what it remembers.
  3. Ask for uncertainty. Prompts like "say if you are not sure" or "list what you would need to verify" reduce overconfident answers.
  4. 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:

DeveloperModel familyWhere most people use it
OpenAIGPT modelsChatGPT and the OpenAI API
GoogleGemini modelsGemini, Google apps and the Gemini API
AnthropicClaude modelsClaude and the Anthropic API
DeepSeekDeepSeek modelsDeepSeek, with open-weight releases
Mistral AIMistral modelsMistral's assistant and open-weight releases
MetaLlama modelsMeta 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.

  1. Vaswani et al., Attention Is All You Need (arXiv:1706.03762)accessed November 17, 2026
  2. Google Machine Learning Crash Course, Introduction to Large Language Modelsaccessed November 17, 2026
  3. Google Machine Learning Crash Course, LLMs: What's a large language model?accessed November 17, 2026
  4. IBM, What Are Large Language Models (LLMs)?accessed November 17, 2026
  5. OpenAI Help Center, Understanding and counting tokensaccessed November 17, 2026