- LLMs process text as tokens and learn statistical relationships between them.
- Transformer architectures use attention to model relationships across a sequence.
- Training creates model parameters; inference uses those parameters to generate new output.
- Context windows, retrieval and prompting shape what information a model can use at response time.
Large language models are neural networks trained to model language at enormous scale. They do not store a simple database of answers. Instead, training adjusts billions of parameters so the model becomes better at predicting and generating sequences of tokens.
The result is a system that can perform many language tasks through the same underlying model, including writing, summarization, translation, coding and question answering.
What is a token?
Models do not usually process text as complete sentences or even complete words. Text is split into smaller units called tokens. A token may represent a word, part of a word, punctuation or another text fragment.
The model maps tokens into numerical representations called embeddings. These representations allow the neural network to work with relationships and patterns mathematically.
Why transformers changed language models
Modern LLMs are largely built on transformer architectures. Their key mechanism, attention, helps the model determine which parts of an input are relevant to other parts while processing a sequence.
This makes transformers effective at learning long-range relationships in language and allows training to scale efficiently across large datasets and compute clusters.
What happens during training
During pretraining, the model repeatedly sees sequences of tokens and learns to predict missing or next tokens. Each error produces a signal that slightly adjusts the model's parameters.
This process is repeated across vast datasets. Additional stages can then improve instruction following, safety or task performance using supervised examples, preference optimization and other alignment techniques.
What happens during inference
Inference is the stage when a trained model answers a prompt. The prompt is tokenized, processed through the model and converted into probabilities for possible next tokens.
A decoding strategy then selects a token, appends it to the sequence and repeats the process. This is why generated responses emerge token by token rather than being retrieved as one complete stored sentence.
Context windows and retrieval
A context window defines how much information the model can consider in one interaction. Longer context can help with large documents or extended conversations, but simply adding more text does not guarantee better answers.
Retrieval-augmented generation can supply relevant external documents at runtime. This is useful when an application needs fresh, private or domain-specific information that was not reliably encoded during training.
Why LLMs can hallucinate
An LLM is optimized to generate plausible sequences, not to act as a perfect database of verified facts. If the prompt or context does not contain enough reliable information, the model may still generate a confident-looking answer.
Grounding, retrieval, evaluation and human verification are therefore important for high-stakes or factual workflows.
Understand the system behind the headline.
The useful question is not only what a technology or market concept is, but what problem it solves, which incentives shape it, what trade-offs it introduces and when those trade-offs matter.
Questions readers often ask.
Does an LLM understand language like a human?
LLMs can perform sophisticated language tasks, but their internal process is different from human cognition and should not be assumed to involve human-like understanding or consciousness.
What is a context window?
It is the amount of tokenized information a model can consider in one request or interaction.
Why are GPUs used for LLMs?
Training and inference involve large amounts of matrix computation that GPUs and other accelerators can process efficiently in parallel.