How Large Language Models Work
- 67Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What does GPT stand for?
Generative pre-trained transformer.
Or swipe the card
67 cards
What does GPT stand for?
Generative pre-trained transformer.
What key limitation did recurrent neural networks (RNNs) have when processing long text?
They processed text sequentially, making them slow and prone to losing information from earlier in a long sequence.
How does a transformer differ from an RNN in how it processes a sequence?
A transformer can process the sequence in parallel, considering many tokens at once rather than reading them one by one.
What is self-attention?
A mechanism that evaluates how much each token in a sequence should attend to other tokens, helping the model represent context and relationships.
How can self-attention help resolve which object a word refers to?
It assigns stronger attention to contextually related words. For example, in “the glass shattered,” it can associate “shattered” more strongly with “glass” than with “floor.”
What is multi-head attention?
A method that uses multiple attention processes in parallel, allowing the model to capture different kinds of relationships in the same text.
What different kinds of information might separate attention heads capture?
Different heads may focus on patterns such as grammar, pronoun references, or emotional tone.
Why is parallel processing useful in transformer models?
It allows the model to process many parts of a sequence at once, supporting faster and more powerful computation.
Why do transformer models require substantial computing power?
Their parallel attention operations involve large amounts of computation, often requiring powerful GPUs.
What does self-attention determine for each token?
Which other tokens in the sequence are most relevant to it in the current context.
What is a token in a language model?
A unit of text processed by the model; it may be a whole word or a smaller piece of a word.
Why do language models use subword tokens instead of assigning a unique token to every possible word?
Subword tokens create a smaller, more manageable vocabulary that can represent many words, including unfamiliar terms and variations.
How can subword tokens represent a word such as “running”?
The word can be constructed from smaller token pieces, such as “run” and “ing.”
What is an embedding?
A numerical vector representation of a token that lets a model perform mathematical operations on language.
How do embeddings represent relationships between concepts?
They place tokens in a numerical space where distances and directions can represent patterns of similarity or relationship.
What does the analogy “tokens are Lego bricks” illustrate?
A relatively small set of token pieces can be combined to represent many words and text patterns.
What does the decoder-only framework do at its core?
It predicts the next token based on the tokens that came before it.
How does a decoder-only model generate a sequence of text?
It predicts one token, adds that token to the sequence, and uses the expanded sequence to predict the next token.
What does it mean to describe a language model as an autoregressive system?
Each generated token becomes part of the input used to generate subsequent tokens.
How does a model choose the next token?
It calculates probabilities for possible next tokens and selects one based on those probabilities.
Why can an early incorrect prediction lead to an increasingly mistaken response?
Later predictions are based on the model’s earlier output, so an incorrect token can steer the rest of the sequence in the wrong direction.
What is a hallucination in a language model?
A plausible-sounding but incorrect or invented output, which can occur because the model predicts likely text rather than directly verifying facts.
What is large-scale pre-training?
The initial training phase in which a model learns from vast amounts of text and other data by predicting tokens.
What is self-supervised learning in language-model pre-training?
A training approach where the text itself supplies learning targets, such as hiding a later token and having the model predict it.
How does next-token prediction provide a learning signal during pre-training?
The model predicts a token from its context, compares its prediction with the actual text, and adjusts its internal parameters to improve.
What kinds of material can be included in a language model’s pre-training data?
Books, internet text, scientific papers, code repositories, legal documents, and other written material.
What does a model learn from seeing words used in many contexts?
Patterns in language, including syntax, meaning, and associations between concepts.
How can a model acquire information such as the fact that Paris is the capital of France during pre-training?
It learns statistical associations from repeated patterns in its training data, including the frequent association between those terms.
How does pre-training on code relate to pre-training on natural language?
The model learns code by predicting its next tokens, much as it predicts tokens in ordinary text, while also learning code’s more rigid patterns.
Why is a pre-trained model compared to a compressed representation of the internet rather than a database?
It does not store all its training text exactly; its learned parameters encode statistical relationships and patterns from the data.
Why does data quality matter in pre-training?
The model learns patterns from its data, so flawed or biased training material can contribute to flawed or biased outputs.
Why is large-scale pre-training expensive?
It requires extensive computing hardware, electricity, and training time, often involving many GPUs running for long periods.
What is emergence in the context of large language models?
The appearance of capabilities at large model scales that were not explicitly programmed or directly trained as separate abilities.
What kinds of abilities were described as emerging at very large model scales?
Capabilities such as reasoning, problem solving, translation, coding, and summarization.
How might next-token prediction encourage a model to develop reasoning-like behavior?
Predicting the correct continuation of complex text can require modeling the logic or concepts behind it, so reasoning-like patterns may emerge as a by-product.
What is meant by a “tipping point” in model capability?
A scale at which new capabilities become apparent after more gradual improvement at smaller scales.
What three factors are commonly emphasized in scaling laws?
The amount of training data, the size of the model, and the amount of computing power used for training.
What are model parameters, and why can increasing their number matter?
Parameters are learned values in a neural network. More parameters can allow a model to represent more patterns and nuance.
What does increasing compute mean in the context of model scaling?
Using more computing resources, such as faster hardware or longer training, to process data and update the model.
What potential data constraint on continued model scaling is mentioned?
The supply of high-quality text on the internet may be limited.
What is a base model?
A model after pre-training but before refinement to make its behavior more aligned with human expectations.
Why can a raw pre-trained base model be unsafe to release as a public assistant?
It may reproduce harmful, false, or dangerous material from its training data without having reliable safeguards or a moral understanding.
What are the three stated pillars of alignment?
Helpful, truthful, and harmless behavior.
Why can the goals of helpfulness, truthfulness, and harmlessness conflict?
Following a request may be helpful but untruthful or harmful—for example, generating a convincing lie or providing dangerous instructions.
What does RLHF stand for?
Reinforcement learning from human feedback.
What is supervised fine-tuning in the RLHF process?
Humans write examples of ideal responses to prompts, and the model is trained to imitate those responses.
What does supervised fine-tuning teach a language model?
It teaches the model preferred response styles and formats, such as being helpful, polite, and clear.
Why is ranking model-generated answers useful for reward-model training?
Ranking existing answers is often easier and faster for people than writing ideal answers from scratch.
How is a reward model trained?
Humans rank alternative responses, and a separate model is trained on those preferences to score responses.
What does a reward model represent?
An approximation of human preferences used to score the main model’s responses.
How does the reinforcement-learning stage use the reward model?
The main model generates responses, receives scores from the reward model, and adjusts its parameters to increase future scores.
What behavior can reinforcement learning from human preferences encourage?
Responses that receive higher scores for qualities such as politeness, accuracy, and safety.
Does a model trained with RLHF necessarily understand human morality?
No. It is optimized to receive higher reward scores; that is not the same as human moral understanding.
What is reward hacking?
When a model exploits a weakness in the reward system to earn a high score without achieving the intended goal.
What did the boat-racing AI example illustrate about reward hacking?
An AI rewarded for collecting power-ups found that repeatedly collecting one power-up could score better than actually finishing the race.
What is sycophancy in a language model?
A tendency to agree with or flatter the user, even when the user is wrong, potentially because agreement is rewarded.
What is meant by the alignment tax?
The possibility that safety constraints can reduce some other desirable behavior, such as creativity or willingness to answer benign requests involving sensitive topics.
What is a user prompt?
The prompt a user provides to request a specific task, such as writing code or summarizing text.
What is a system prompt?
A developer-provided instruction, often hidden from the user, that sets the model’s role, rules, and style for a session.
How can a system prompt shape an assistant’s responses?
It can specify the assistant’s role and constraints, such as being a concise coding assistant or a family-friendly customer-service bot.
Why is a strong system prompt important when building an AI application?
It establishes the assistant’s behavior and can make it harder for user instructions to derail that behavior.
What is prompt injection?
An attempt to use a user prompt to override or undermine the system’s higher-priority instructions.
What is chain-of-thought prompting?
A prompting technique that asks the model to work through a problem in intermediate steps, often using an instruction such as “think step by step.”
Why can asking a model to work step by step improve its answer to a complex problem?
It encourages the model to generate intermediate tokens that lay out its work, giving it more opportunities to process the problem before producing a final answer.
How does a one-word answer constraint affect a model solving a complex problem?
It limits the opportunity to generate intermediate reasoning, so the model may have to produce an answer with less processing through generated steps.
Why is prompting more than simply choosing persuasive wording?
Effective prompting takes account of how the model processes tokens and follows patterns, helping guide its output within its mechanical constraints.
What is the overall sequence of stages in the language-model pipeline described?
Transformer architecture and token representations, pre-training, emergence of capabilities, alignment and refinement, then prompting and interaction.

Ask anything
We've read this whole study set, so questions about it get the best answers.