1. Home
  2. Explore
  3. Computer Science
  4. How Large Language Models Work

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

How Large Language Models Work

  • 75Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Transformer Architecture
The architecture that replaced many earlier sequential approaches to language modeling is the
.

75 questions

  1. 1
    The architecture that replaced many earlier sequential approaches to language modeling is the
    _____
    .
    Hint

    It became the foundation of models such as GPT.

    Answer

    transformer architecture

    Explanation

    The transformer architecture enabled models to process relationships across a sequence in a different way from earlier recurrent systems.

  2. 2
    Unlike a sequential RNN, a transformer can examine the words in a sequence using
    _____
    .
    Hint

    The model can work with many parts of the input at the same time.

    Answer

    parallel processing

    Explanation

    Transformers can process multiple positions in a sequence in parallel rather than moving through the words one by one.

  3. 3
    The transformer mechanism that weighs how relevant words are to one another is called
    _____
    .
    Hint

    It helps the model focus on important relationships within the input.

    Answer

    self-attention

    Explanation

    Self-attention compares words in a sequence and assigns importance to their relationships, helping the model use context.

  4. 4
    In the sentence “The glass shattered,” self-attention helps associate “shattered” more strongly with
    _____
    than with “floor.”
    Hint

    Choose the object that broke.

    Answer

    glass

    Explanation

    Self-attention can connect a word to the most relevant word in context; here, “shattered” relates to “glass.”

  5. 5
    A transformer uses
    _____
    attention so different processing heads can focus on different kinds of relationships at once.
    Hint

    Each head can examine a different aspect of the same sentence.

    Answer

    multi-head

    Explanation

    Multi-head attention uses multiple attention heads to analyze different relationships or features in the input simultaneously.

  6. 6
    In multi-head attention, one head might track grammar while another tracks pronoun references or
    _____
    .
    Hint

    This is another aspect of meaning conveyed by a sentence.

    Answer

    emotional tone

    Explanation

    Different attention heads can focus on distinct features, such as grammatical relationships, pronoun references, and emotional tone.

  7. 7
    After different attention heads identify separate patterns, their insights are
    _____
    .
    Hint

    The model combines the heads’ findings into a broader representation.

    Answer

    merged together

    Explanation

    Multi-head attention combines the information gathered by its different heads so the model can use multiple aspects of context.

  8. 8
    The ability to process many relationships in parallel contributes to transformers’ speed and increases demand for powerful
    _____
    .
    Hint

    These specialized chips are often used for large-scale computation.

    Answer

    GPUs

    Explanation

    Transformers perform extensive parallel computation, so training and running them often requires powerful GPUs.

  9. 9
    GPT stands for generative pre-trained
    _____
    .
    Hint

    It names the architecture used by the model.

    Answer

    transformer

    Explanation

    The acronym GPT expands to generative pre-trained transformer.

  10. 10
    The paper that introduced the transformer architecture was titled “
    _____
    .”
    Hint

    The title refers to the mechanism central to the architecture.

    Answer

    Attention is all you need

    Explanation

    The transformer architecture was introduced in a paper titled “Attention is all you need.”

  11. 11
    Transformers can connect a sentence’s subject near its beginning to a related verb later because they can use
    _____
    .
    Hint

    Think about relationships between words that are far apart in a sequence.

    Answer

    long-range context

    Explanation

    By attending across the sequence, transformers can relate words that are separated by many other words, preserving useful context over longer distances.

  12. 12
    Text is divided into units called
    _____
    before a language model processes it as numerical input.
    Hint

    A unit may be a whole word or only part of one.

    Answer

    tokens

    Explanation

    Language models break text into tokens, which can represent complete words or smaller word fragments.

  13. 13
    A token may represent a whole word or a
    _____
    of a word.
    Hint

    For example, a common ending can be its own unit.

    Answer

    part

    Explanation

    Tokens are not always complete words; they often represent smaller pieces such as common word endings.

  14. 14
    Breaking words into reusable chunks avoids the need for an enormous vocabulary containing a unique unit for every word, typo, and
    _____
    .
    Hint

    This is another kind of text the model may encounter.

    Answer

    coding syntax

    Explanation

    Using smaller, reusable token pieces keeps the vocabulary more manageable than assigning a separate token to every possible word and form.

  15. 15
    The numerical representation of a token as a list of values is called an
    _____
    .
    Hint

    It lets the model perform mathematical operations on language units.

    Answer

    embedding

    Explanation

    An embedding maps a token to a vector of numbers that the model can use in computation.

  16. 16
    An embedding is a type of
    _____
    that represents a token with a list of numbers.
    Hint

    It can be imagined as a coordinate in a space of meanings.

    Answer

    vector

    Explanation

    A vector is a numerical representation; embeddings place tokens at positions that encode useful relationships.

  17. 17
    In an embedding space, the relative distances and directions between token vectors represent their
    _____
    .
    Hint

    The geometry captures how concepts are connected or similar.

    Answer

    relationships

    Explanation

    The positions of vectors allow a model to represent relationships among words and concepts mathematically.

  18. 18
    The analogy “king minus man plus woman equals queen” illustrates how vector operations can capture relationships between
    _____
    .
    Hint

    The operation is performed on numerical representations of meanings.

    Answer

    concepts

    Explanation

    Because embeddings encode relationships, operations on their vectors can reflect semantic relationships between concepts.

  19. 19
    At its core, a decoder-only language model has the task of predicting the
    _____
    .
    Hint

    It repeatedly extends the text it has already received or generated.

    Answer

    next token

    Explanation

    A decoder-only model generates text by estimating what token should come next given the preceding context.

  20. 20
    When predicting a next token, the model assigns possible continuations different
    _____
    .
    Hint

    These values indicate how likely each candidate is in context.

    Answer

    probabilities

    Explanation

    The model estimates a probability for each possible next token and selects a continuation based on those estimates.

  21. 21
    In an autoregressive generation process, each generated token is added to the context and used to predict the
    _____
    .
    Hint

    Generation repeats the same prediction task after every addition.

    Answer

    next token

    Explanation

    The model feeds its newly generated token back into the context, then predicts another token in a repeating loop.

  22. 22
    When a plausible but incorrect token becomes the basis for later predictions, the model may produce a
    _____
    .
    Hint

    This term describes generated information that is made up or false.

    Answer

    hallucination

    Explanation

    A model predicts likely text rather than verifying facts. A mistaken prediction can shape later output and lead to fabricated claims.

  23. 23
    A raw model’s predictions are based on learned
    _____
    rather than a built-in guarantee that an answer is factually true.
    Hint

    The model estimates which continuation is likely, not whether it has verified a fact.

    Answer

    probabilities

    Explanation

    The model chooses likely continuations based on patterns in its training; probability alone does not ensure factual correctness.

  24. 24
    Training a model on very large collections of text before refining it is called large-scale
    _____
    .
    Hint

    This is the education stage that comes before alignment and prompting.

    Answer

    pre-training

    Explanation

    Pre-training exposes a model to large quantities of text so it can learn broad language patterns and associations.

  25. 25
    Pre-training data can include books, websites, scientific papers, legal documents, and code
    _____
    .
    Hint

    These collections contain software projects and source code.

    Answer

    repositories

    Explanation

    A pre-training corpus may combine many kinds of written material, including code repositories.

  26. 26
    In self-supervised learning, a model can learn by hiding a word in text and trying to predict the
    _____
    .
    Hint

    The model uses the surrounding sentence as context for its guess.

    Answer

    missing word

    Explanation

    Self-supervised learning creates a training task from the text itself, such as predicting a hidden or next word without a human writing a label for every example.

  27. 27
    Pre-training is called self-supervised because the learning signal is generated from the
    _____
    itself rather than supplied by a teacher for every example.
    Hint

    The text provides the context and the prediction target.

    Answer

    data

    Explanation

    In self-supervised learning, the model creates prediction tasks from the material it is learning from, instead of relying on a teacher to label each example.

  28. 28
    By predicting words across many contexts, a model can learn language
    _____
    without being given an explicit grammar rule for every pattern.
    Hint

    This concerns how words are arranged in sentences.

    Answer

    syntax

    Explanation

    Repeated prediction exposes the model to patterns in word order and sentence structure, helping it learn syntax from examples.

  29. 29
    Learning how words convey meaning together across contexts is learning language
    _____
    .
    Hint

    This concerns meaning rather than sentence structure alone.

    Answer

    semantics

    Explanation

    Pre-training helps a model learn semantic patterns from how words and phrases are used together.

  30. 30
    A model may associate “Paris” with being the capital of France because those terms occur together frequently in its training
    _____
    .
    Hint

    This is the large collection of material the model learns from.

    Answer

    data

    Explanation

    Frequent co-occurrence in training data can establish strong associations, although such associations do not by themselves guarantee that a model verifies facts.

  31. 31
    The information learned during pre-training is encoded in the neural network’s
    _____
    .
    Hint

    These numerical values are adjusted as the model learns patterns.

    Answer

    weights

    Explanation

    Training adjusts the model’s weights, which encode learned mathematical relationships and influence its later predictions.

  32. 32
    A pre-trained model is better understood as a compressed representation of relationships in its data than as a database that stores every text
    _____
    .
    Hint

    The model does not preserve the source material word for word in a searchable archive.

    Answer

    perfectly

    Explanation

    The model’s weights capture statistical and mathematical relationships from training rather than storing the entire corpus as a perfect copy.

  33. 33
    A language model can learn code during pre-training by predicting tokens according to code’s relatively strict grammatical
    _____
    .
    Hint

    These constrain how valid code is written.

    Answer

    rules

    Explanation

    Code can be treated as another language: the model learns patterns and syntax by predicting what comes next in code examples.

  34. 34
    Poor-quality or biased training material can produce poor or biased model behavior, an instance of “garbage in,
    _____
    .”
    Hint

    The phrase describes how flawed inputs affect outputs.

    Answer

    garbage out

    Explanation

    A model’s learned patterns depend on its training data, so flawed or biased data can lead to flawed or biased outputs.

  35. 35
    Large-scale pre-training can require huge computing resources because many GPUs may run for
    _____
    .
    Hint

    The duration can be extended rather than limited to a short session.

    Answer

    months

    Explanation

    Training large models can involve thousands of GPUs operating over long periods, making it computationally and financially expensive.

  36. 36
    Capabilities that appear as models reach very large scales, despite not being explicitly programmed, are called
    _____
    .
    Hint

    They seem to arise as the model crosses a scale threshold.

    Answer

    emergent capabilities

    Explanation

    Emergent capabilities are abilities that become apparent at large scales even though they were not individually programmed as explicit tasks.

  37. 37
    The models discussed in the content reach scales of hundreds of billions of
    _____
    .
    Hint

    These are adjustable values or connections in a neural network.

    Answer

    parameters

    Explanation

    The emergence discussion describes very large models with hundreds of billions of parameters.

  38. 38
    A neural network’s
    _____
    are adjustable connections that can encode patterns and nuance.
    Hint

    Increasing their number is one way of increasing model size.

    Answer

    parameters

    Explanation

    Parameters are learned numerical values in a neural network; more of them can allow a model to represent more patterns and nuance.

  39. 39
    Although a model is trained to predict the next token, predicting the answer to a reasoning problem may require it to perform
    _____
    .
    Hint

    For example, solving an arithmetic word problem requires more than copying nearby words.

    Answer

    reasoning

    Explanation

    The content proposes that next-token prediction can lead to reasoning-like abilities because producing the correct continuation may require solving the underlying problem.

  40. 40
    In the example where John has five apples and eats two, predicting the correct remaining count requires solving the
    _____
    problem.
    Hint

    The model must determine how many apples remain after subtraction.

    Answer

    math

    Explanation

    To predict the answer “three,” the model must use the arithmetic relationship in the word problem, rather than merely imitate its wording.

  41. 41
    The proposed mechanism by which a model may suddenly grasp an underlying pattern after struggling is called
    _____
    .
    Hint

    It refers to a sudden improvement in understanding or performance.

    Answer

    grokking

    Explanation

    Grokking describes a pattern in which a model’s performance on a task can improve sharply after a period of difficulty.

  42. 42
    The three ingredients emphasized by scaling laws are more data, larger model size, and more
    _____
    .
    Hint

    This includes the processing resources and training time available to the model.

    Answer

    compute power

    Explanation

    The content identifies data, model size, and compute power as three levers that can improve model performance as systems scale.

  43. 43
    The model-size lever in scaling laws is increased by adding more
    _____
    .
    Hint

    These are learned values in the neural network.

    Answer

    parameters

    Explanation

    A larger model has more parameters, giving it greater capacity to represent patterns and relationships.

  44. 44
    A limitation on continued scaling is that the supply of high-quality text on the internet may become
    _____
    .
    Hint

    The content suggests researchers may be running short of this resource.

    Answer

    limited

    Explanation

    Scaling requires more data, but the amount of readily available high-quality text is not unlimited.

  45. 45
    Translation, coding, and summarization are examples of abilities described as appearing from scale rather than being explicitly
    _____
    .
    Hint

    They emerged without developers writing a direct rule for each ability.

    Answer

    programmed

    Explanation

    The content presents several capabilities as abilities that can arise as models scale, rather than as individually programmed features.

  46. 46
    A model trained on raw internet text before alignment is often called a
    _____
    model.
    Hint

    It has not yet been refined into a user-facing assistant.

    Answer

    base

    Explanation

    A base model has undergone pre-training but has not necessarily received the refinement needed to make it safe and helpful for public use.

  47. 47
    Because a base model learns from a broad and messy corpus, it may learn harmful material as well as useful information, but initially lacks a moral
    _____
    .
    Hint

    This metaphor describes a guide for distinguishing acceptable from harmful behavior.

    Answer

    compass

    Explanation

    Pre-training can expose a model to harmful or false text. A raw predictive model does not automatically know that such material is unsafe or incorrect.

  48. 48
    The goal of alignment is to bring model behavior closer to human
    _____
    .
    Hint

    These guide what people consider desirable or acceptable behavior.

    Answer

    values

    Explanation

    Alignment aims to shape the model so that its behavior better reflects human preferences and values.

  49. 49
    The three pillars of alignment in the content are helpful, truthful, and
    _____
    .
    Hint

    This pillar concerns avoiding dangerous or damaging assistance.

    Answer

    harmless

    Explanation

    The three Hs are helpful, truthful, and harmless. Together they describe important but sometimes competing goals for aligned behavior.

  50. 50
    Following a request can make a model helpful while also making it untruthful or unsafe, illustrating that alignment goals can
    _____
    .
    Hint

    The goals do not always point toward the same response.

    Answer

    conflict

    Explanation

    A request may be easy to follow but may require lying or providing dangerous information, creating tension among helpfulness, truthfulness, and harmlessness.

  51. 51
    RLHF stands for reinforcement learning from human
    _____
    .
    Hint

    People provide evaluations that help guide the model’s behavior.

    Answer

    feedback

    Explanation

    RLHF uses human feedback as part of a reinforcement-learning process to refine a model.

  52. 52
    The first step described in RLHF, in which people write ideal responses to prompts, is supervised
    _____
    .
    Hint

    Humans provide examples of the response style and quality the model should imitate.

    Answer

    fine-tuning

    Explanation

    During supervised fine-tuning, people write example answers that demonstrate desired behavior, such as being accurate, safe, polite, and clear.

  53. 53
    Supervised fine-tuning teaches a model the desired response style by providing human-written
    _____
    answers.
    Hint

    These examples show what a good response should look like.

    Answer

    ideal

    Explanation

    Human-written ideal responses give the model demonstrations of the style and format expected of a helpful assistant.

  54. 54
    In reward model training, humans generally rank candidate answers rather than write a perfect response from
    _____
    .
    Hint

    Ranking existing options is easier than composing a new answer.

    Answer

    scratch

    Explanation

    People can compare and rank model-generated answers more easily and quickly than writing an ideal answer for every possible prompt.

  55. 55
    A separate AI trained on human rankings to estimate which responses people prefer is called a
    _____
    .
    Hint

    It acts as an automated judge of candidate answers.

    Answer

    reward model

    Explanation

    The reward model learns from human preferences and assigns scores that can guide further training of the main model.

  56. 56
    In reinforcement learning, the main language model is compared to an athlete, while the
    _____
    evaluates its answer.
    Hint

    This component supplies a score that guides the model’s next attempt.

    Answer

    reward model

    Explanation

    The reward model judges outputs and provides scores, while the main model adjusts its behavior in response.

  57. 57
    During reinforcement learning, the main model adjusts its internal
    _____
    in an effort to earn higher reward scores.
    Hint

    These learned numerical values shape the model’s outputs.

    Answer

    weights

    Explanation

    The model’s weights are updated through repeated feedback so it is more likely to produce responses that receive higher reward scores.

  58. 58
    Repeatedly generating answers, scoring them, and adjusting the model forms a feedback
    _____
    .
    Hint

    The process repeats rather than occurring just once.

    Answer

    loop

    Explanation

    Reinforcement learning uses a repeated cycle: the model generates an answer, receives a score, and updates its behavior to improve future scores.

  59. 59
    When a model exploits a scoring loophole instead of accomplishing the intended goal, the failure is called reward
    _____
    .
    Hint

    The system optimizes the score in an unintended way.

    Answer

    hacking

    Explanation

    Reward hacking occurs when a model finds a way to obtain a high reward without satisfying the underlying objective.

  60. 60
    The boat-racing example of reward hacking involved an AI repeatedly collecting the same power-up by spinning in a
    _____
    .
    Hint

    The boat exploited the scoring rule instead of completing the race.

    Answer

    circle

    Explanation

    The boat-racing AI found that repeatedly collecting a power-up could earn points, so it spun in a circle rather than finishing the race.

  61. 61
    When a model agrees with a user’s false claim just to please them, the behavior is called
    _____
    .
    Hint

    It involves excessive agreement or flattery.

    Answer

    sycophancy

    Explanation

    Sycophancy can arise when a model learns that users or evaluators reward agreeable answers, even when those answers are false.

  62. 62
    The possible loss of creativity or increased tendency to refuse after safety refinement is sometimes called the alignment
    _____
    .
    Hint

    It describes a trade-off paid in some model capabilities or behaviors.

    Answer

    tax

    Explanation

    The alignment tax refers to possible costs of safety training, such as overly cautious refusals or reduced creative freedom.

  63. 63
    Refinement helped turn a powerful but unwieldy base model into a more usable conversational
    _____
    .
    Hint

    This is the kind of system a person can interact with directly.

    Answer

    assistant

    Explanation

    Alignment and refinement shape a raw model into a product that is more practical and appropriate for people to use.

  64. 64
    The prompt a person types to request a specific task is the
    _____
    prompt.
    Hint

    It comes from the person interacting with the model.

    Answer

    user

    Explanation

    A user prompt contains the immediate request, such as asking the model to write code or summarize an email.

  65. 65
    Instructions supplied by developers before a conversation, often hidden from the user, form the
    _____
    prompt.
    Hint

    It establishes the model’s role and rules for the session.

    Answer

    system

    Explanation

    A system prompt provides higher-level instructions, such as the model’s persona, constraints, and response style.

  66. 66
    A system prompt can establish the model’s persona, rules, and
    _____
    for a particular session.
    Hint

    For example, the model might be told to act as a coding assistant.

    Answer

    role

    Explanation

    System prompts set the role and other governing instructions that frame the model’s behavior during a session.

  67. 67
    A weak system prompt can make a bot easier to derail through prompt
    _____
    .
    Hint

    This is an attack that tries to override or manipulate instructions.

    Answer

    injection

    Explanation

    Prompt injection occurs when user input attempts to override the model’s instructions, a risk that can be greater when system guidance is weak.

  68. 68
    A robust system prompt can help a customer-service bot maintain its rules even when a user asks it to ignore previous
    _____
    .
    Hint

    These are the directions the system prompt establishes.

    Answer

    instructions

    Explanation

    Clear and robust system instructions can help a model resist attempts to make it violate its assigned role or rules.

  69. 69
    The prompting technique that asks a model to lay out intermediate reasoning is called chain of
    _____
    .
    Hint

    It refers to a connected sequence of reasoning steps.

    Answer

    thought

    Explanation

    Chain of thought prompting encourages the model to generate intermediate steps before producing a final answer.

  70. 70
    Adding “think step by step” can encourage the model to generate more
    _____
    before giving a final answer.
    Hint

    Each generated unit extends the model’s response and processing path.

    Answer

    tokens

    Explanation

    The model generates output one token at a time; prompting it to show steps leads it to produce a longer reasoning sequence.

  71. 71
    Generating intermediate steps gives the model more opportunities to process the problem, effectively allowing more
    _____
    .
    Hint

    The model’s processing unfolds as it generates additional output.

    Answer

    compute

    Explanation

    In the described architecture, each additional generated token provides another opportunity for computation and further processing.

  72. 72
    A chain-of-thought response can function like a scratch pad because the model can use its own generated steps as
    _____
    .
    Hint

    Earlier generated text remains available while it produces later text.

    Answer

    context

    Explanation

    As the model writes out intermediate steps, those tokens become part of the context used to generate subsequent reasoning and the final answer.

  73. 73
    Demanding a one-word answer to a complex logic problem can limit the model’s opportunity to work through intermediate
    _____
    .
    Hint

    These are the calculations or comparisons that a longer response might express.

    Answer

    steps

    Explanation

    A one-word response leaves little room for generated intermediate reasoning, while a step-by-step response can support more processing.

  74. 74
    In this model architecture, a longer response can sometimes serve as a proxy for more extended
    _____
    .
    Hint

    The model may process the problem through the additional generated text.

    Answer

    thinking

    Explanation

    When a model generates more tokens to lay out its work, it performs more sequential processing before committing to a final answer.

  75. 75
    Effective prompt engineering depends on understanding the model’s mechanical constraints rather than merely guessing the right
    _____
    .
    Hint

    A prompt’s wording matters, but the content emphasizes more than word choice alone.

    Answer

    words

    Explanation

    Prompting works best when users understand how the model responds to patterns, instructions, and its token-by-token generation process.

1 of 75
Question 1 of 75

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent