
How does a large language model work?
A large language model works by assigning probabilities to every possible next token and picking one, over and over. A token is a piece of text: a word, part of a word or a single character. Google’s machine learning course estimates that about 400 tokens equal 300 English words. Google describes the result as a very sophisticated autocomplete: the model continues a sentence, a paragraph or a reply one token at a time.
LLM architecture: the Transformer
Modern LLMs are built on the Transformer, an architecture based entirely on attention. Ashish Vaswani, Noam Shazeer and colleagues at Google introduced it in the paper “Attention Is All You Need”, posted on arXiv on 12 June 2017. The three ideas below explain why it replaced older recurrent networks.
Self-attention
Self-attention lets the model weigh how much every other token in the input affects the meaning of the current one. In the sentence about a tired animal that did not cross the street, attention links the word “it” to “animal”, not to “street”.
Encoders and decoders
Encoders turn text into numeric representations called embeddings, and decoders turn representations back into text. Chat assistants mostly use decoder-only models, while encoder models suit search and classification tasks.
Parameters and context window
Parameters are the learned weights of the network, and the context window is how many tokens the model reads at once. Anthropic’s current Claude models, for example, accept 1 million tokens of context.
How are LLMs trained?
LLMs are trained in several stages that move from raw text to helpful answers:
- Pre-training: the model learns to predict tokens on a massive text corpus, which takes months of compute.
- Instruction tuning: the model learns to follow instructions from example prompts and answers.
- Reinforcement learning from human feedback (RLHF): people rank answers and a reward model steers the LLM, the method OpenAI used for ChatGPT in November 2022.
- Retrieval and tools: the deployed model searches the web or a database to ground answers in current facts.
Examples of large language models
| Model family | Company | Product |
|---|---|---|
| GPT | OpenAI | ChatGPT |
| Claude | Anthropic | Claude |
| Gemini | Gemini app, AI Overviews, AI Mode | |
| PLLuM | Polish Ministry of Digital Affairs | Polish public sector models (8 to 70 billion parameters) |
LLMs in marketing, SEO and AI search
LLMs matter to marketers because they now write the answer before the user sees any link. Google’s AI Overviews and standalone assistants retrieve pages, summarise them and cite only a few sources. Optimising for that step is called Generative Engine Optimization.
In my SEO projects I see three practical rules that follow from how LLMs read pages:
- Answer the question in the first sentence under each heading, because retrieval systems cut pages into short passages.
- Name entities explicitly (companies, products, places), because models connect facts through entities.
- Publish exact numbers with their source, because LLMs prefer verifiable, quotable claims.
I build these rules into every AI SEO project, together with an entity SEO plan.
Limitations of large language models
The main limitation of an LLM is that it can produce fluent but false statements, known as hallucinations. Google’s course also lists high training and inference costs, bias inherited from training data and open questions about how well models generalise. For marketing teams this means every AI-written statistic needs a human fact check before publishing.
Frequently asked questions about LLM
What does LLM stand for?
LLM stands for large language model. It is an AI model trained on very large text datasets to predict and generate language.
Is ChatGPT an LLM?
ChatGPT is an application built on OpenAI's GPT large language models. The LLM generates the text, while the ChatGPT product adds the chat interface, tools and web search.
How do large language models learn?
Large language models learn by predicting tokens on huge text corpora during pre-training. They are then refined with instruction tuning and human feedback so that their answers follow requests.
Why do LLMs hallucinate?
LLMs hallucinate because they generate the most probable continuation of text, not a verified fact. Grounding answers in retrieved sources reduces, but does not remove, this risk.
Related terms
- LLMs: What's a large language model? · Google for Developers
- Introduction to Large Language Models · Google for Developers
- Attention Is All You Need · arXiv (Vaswani et al.)
- Introducing ChatGPT · OpenAI
- Models overview · Anthropic
- Ministerstwo Cyfryzacji ogłasza PLLuM, rodzinę polskich modeli sztucznej inteligencji · iMagazine







