1. Home
  2. Explore
  3. Computer Science
  4. Where LLMs Store Facts

Study methods

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

Where LLMs Store Facts

  • 56Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Transformer Context

What does a language model’s correct prediction that Michael Jordan plays basketball suggest about the information encoded in its parameters?

56 questions

  1. 1

    What does a language model’s correct prediction that Michael Jordan plays basketball suggest about the information encoded in its parameters?

    Model answer

    It suggests that the model has encoded knowledge associating Michael Jordan with basketball somewhere within its learned parameters.

    Explanation

    The prediction indicates that the model has learned more than grammatical patterns; it has retained a specific factual relationship.

  2. 2

    What remains unsolved about factual knowledge in large language models?

    Model answer

    A complete mechanistic understanding of how facts are stored in the networks remains unsolved.

    Explanation

    Researchers have identified partial patterns, but they do not yet have a full explanation of how individual facts are represented.

  3. 3

    What high-level conclusion did the described research reach about where facts may be stored?

    Model answer

    The research suggested that facts may be stored primarily in the multi-layer perceptron, or MLP, components of the network.

    Explanation

    The MLPs make up a major portion of transformer networks and appear to have capacity for storing factual associations.

  4. 4

    What is the main task for which the language model in the example is trained?

    Model answer

    It is trained to take a piece of text and predict the next token.

    Explanation

    Next-token prediction provides the training objective underlying the language model’s behavior.

  5. 5

    What is a token in the context of a language model?

    Model answer

    A token is a small chunk of text, typically a word or part of a word, that is processed by the model.

    Explanation

    The input text is first divided into tokens before being converted into vectors.

  6. 6

    What happens to each token before it enters the transformer’s repeated processing blocks?

    Model answer

    Each token is associated with a high-dimensional vector containing a long list of numerical values.

    Explanation

    These vectors are the representations that flow through the transformer.

  7. 7

    What are the two main types of operations repeatedly applied to the sequence of token vectors?

    Model answer

    The sequence passes repeatedly through attention blocks and multi-layer perceptron blocks, with normalization steps also occurring between them.

    Explanation

    Attention enables communication between token positions, while MLPs perform independent transformations on the vectors.

  8. 8

    How does attention differ from an MLP in the way it processes token vectors?

    Model answer

    Attention allows vectors at different positions to exchange information, whereas an MLP processes each vector independently without vectors talking to one another.

    Explanation

    Attention incorporates information from other tokens, while the MLP applies the same local transformation separately to every position.

  9. 9

    Why must the final vector representations contain more than the meanings of their individual tokens?

    Model answer

    They must incorporate context and general model knowledge so that they contain enough information to predict the next token.

    Explanation

    A vector’s eventual role is next-token prediction, which requires information beyond the isolated meaning of one word.

  10. 10

    What does it mean for different directions in a high-dimensional vector space to encode different features?

    Model answer

    It means that alignment with a particular direction can represent the presence or degree of a particular concept or property.

    Explanation

    A vector’s relationship to a direction can indicate information such as gender, a name, or a sport.

  11. 11

    How does the word-embedding example illustrate a direction encoding gender?

    Model answer

    Subtracting the embedding of man from woman and adding that difference to uncle produces a vector close to the embedding of the corresponding feminine noun, aunt.

    Explanation

    The difference between woman and man functions as a gender-related direction that can be applied to another noun.

  12. 12

    How do transformer vectors acquire richer meanings as they pass through the network?

    Model answer

    They absorb information from the surrounding context and from knowledge encoded in the model’s learned weights.

    Explanation

    The representation associated with a token changes as attention and MLP blocks process it.

  13. 13

    What assumptions does the toy example make about the directions representing Michael Jordan and basketball?

    Model answer

    It assumes that separate directions represent the first name Michael, the last name Jordan, and basketball, with the name directions being nearly perpendicular.

    Explanation

    These assumed directions make it possible to describe factual associations using dot products and vector additions.

  14. 14

    What does a dot product of one with the Michael direction signify in the toy representation?

    Model answer

    It signifies that the vector encodes the idea of a person whose first name is Michael.

    Explanation

    The toy model treats a dot product of zero or less as indicating no meaningful alignment with that feature.

  15. 15

    What dot-product condition represents the full name Michael Jordan in the toy example?

    Model answer

    The vector must have a dot product of one with both the Michael direction and the Jordan direction.

    Explanation

    Encoding the full name requires alignment with both component name directions.

  16. 16

    Why is an earlier attention block needed in the toy example involving Michael Jordan?

    Model answer

    Because Michael Jordan spans two tokens, attention must pass information to the second vector so that it can encode both the first and last names.

    Explanation

    The MLP processes each position independently, so it relies on attention to combine information across the two name tokens.

  17. 17

    What is the overall input-output behavior of an MLP block for one token vector?

    Model answer

    It transforms an input vector through two matrix-based operations with a nonlinear function between them, producing an output vector of the same dimension that is added to the original vector.

    Explanation

    The addition of the transformed vector to the input is the block’s residual connection.

  18. 18

    Are the vectors at different token positions allowed to communicate inside an MLP block?

    Model answer

    No. Each vector is processed independently, and all token positions undergo the same computation in parallel.

    Explanation

    This independence makes it sufficient to understand the transformation of one vector to understand the operation at every position.

  19. 19

    What is the purpose of the first large matrix multiplication in an MLP?

    Model answer

    It maps the input embedding vector into a higher-dimensional intermediate space and computes many feature-related measurements.

    Explanation

    Each row of the matrix can be interpreted as a direction whose dot product with the input probes for a feature.

  20. 20

    How can the rows of the up-projection matrix be interpreted?

    Model answer

    Each row can be viewed as a vector that takes a dot product with the input embedding and asks whether a particular feature is present.

    Explanation

    Matrix multiplication is equivalent to carrying out these row-by-row dot products in parallel.

  21. 21

    What happens when a row of the up-projection matrix represents the sum of the Michael and Jordan directions?

    Model answer

    Its dot product with an input encoding both names produces a larger activation because the contributions from the two directions add together.

    Explanation

    This construction allows one intermediate component to respond strongly when both name features are present.

  22. 22

    What is the role of the up-projection bias vector?

    Model answer

    It adds learned parameter values to the components produced by the first matrix multiplication.

    Explanation

    In the toy example, a bias of negative one shifts the relevant feature measurement so that it is positive only when both names are encoded.

  23. 23

    Why does the toy example assign a negative one bias to the Michael-plus-Jordan detector?

    Model answer

    The bias makes the resulting value positive for the full name Michael Jordan and zero or negative when the input does not encode both names.

    Explanation

    This creates a threshold-like detector for the combined feature rather than for either name alone.

  24. 24

    What is the dimensional relationship between the up-projection output and the original embedding in the described MLP?

    Model answer

    The up-projection maps the embedding into a higher-dimensional space with many more components than the original embedding.

    Explanation

    The intermediate components provide a large collection of feature detectors or neurons.

  25. 25

    What is the purpose of the down-projection matrix?

    Model answer

    It maps the activated intermediate representation back down to the original embedding dimension.

    Explanation

    Its output is a vector that can be added to the input at the same token position.

  26. 26

    Why is it useful to interpret the down-projection matrix column by column?

    Model answer

    Each column has the same dimension as the embedding space and can therefore be interpreted as a direction added to the output when its corresponding neuron is active.

    Explanation

    Matrix multiplication combines rescaled columns according to the values of the intermediate vector.

  27. 27

    In the toy example, what happens when the neuron associated with Michael Jordan is active and its down-projection column represents basketball?

    Model answer

    The basketball direction is added to the vector at that position.

    Explanation

    The MLP therefore transforms a representation of Michael Jordan into one that also encodes basketball.

  28. 28

    What happens when a neuron is inactive in the down-projection calculation?

    Model answer

    Its corresponding column contributes nothing because the neuron’s value is zero.

    Explanation

    The column is scaled by the neuron activation before being added to the output.

  29. 29

    What is the role of the down-projection bias?

    Model answer

    It adds a learned vector to the down-projection output regardless of the neuron activation values.

    Explanation

    The exact function of this bias can be difficult to interpret, so it is treated as bookkeeping in the toy explanation.

  30. 30

    Why is a nonlinear function needed between the two matrix multiplications?

    Model answer

    A purely linear operation would respond to combinations such as Michael plus Phelps or Alexis plus Jordan, even though those combinations are conceptually unrelated; nonlinearity allows more selective feature detection.

    Explanation

    The nonlinear step prevents the MLP from behaving like one overall linear transformation.

  31. 31

    What does the ReLU function do to an input value?

    Model answer

    It changes negative values to zero and leaves positive values unchanged.

    Explanation

    ReLU is a simple term-wise nonlinear function applied to every intermediate component.

  32. 32

    How does ReLU make the toy Michael Jordan detector behave like an AND gate?

    Model answer

    It clips zero and negative values to zero, leaving a positive value only when the input contains the required combination of Michael and Jordan.

    Explanation

    The resulting neuron is active only for the combined feature rather than for either name independently.

  33. 33

    What is GELU, and how does it relate to ReLU?

    Model answer

    GELU is a smoother nonlinear activation function with a broadly similar shape and purpose to ReLU.

    Explanation

    The toy explanation uses ReLU because its behavior is simpler to illustrate.

  34. 34

    What do researchers mean by a transformer neuron?

    Model answer

    They generally mean one of the intermediate values produced after the linear transformation and nonlinear activation in an MLP.

    Explanation

    A neuron corresponds to a feature-related activation in the intermediate layer.

  35. 35

    When is a transformer neuron considered active or inactive?

    Model answer

    It is active when its value is positive and inactive when its value is zero.

    Explanation

    Under ReLU, negative intermediate values are also converted to zero and therefore count as inactive.

  36. 36

    What does the complete MLP operation consist of?

    Model answer

    It consists of an up-projection matrix multiplication with a bias, a nonlinear activation, a down-projection matrix multiplication with a bias, and addition of the result to the input vector.

    Explanation

    This sequence is the basic neural-network structure used inside the transformer’s MLP blocks.

  37. 37

    How many rows does the GPT-3 up-projection matrix have approximately, according to the example?

    Model answer

    It has just under 50,000 rows, specifically four times the embedding dimension.

    Explanation

    The number of rows determines the size of the intermediate neuron vector.

  38. 38

    What is the embedding dimension used in the GPT-3 example?

    Model answer

    The embedding dimension is 12,288.

    Explanation

    Each row of the up-projection matrix has this many parameters.

  39. 39

    Approximately how many parameters are in the GPT-3 up-projection matrix?

    Model answer

    It contains approximately 604 million parameters.

    Explanation

    This results from multiplying the approximately 50,000 rows by the embedding dimension of 12,288.

  40. 40

    How does the parameter count of the down-projection matrix compare with that of the up-projection matrix?

    Model answer

    It has the same number of parameters, approximately 604 million, although its dimensions are transposed.

    Explanation

    The two matrices together therefore contain about 1.2 billion parameters per MLP block.

  41. 41

    Approximately how many parameters do the two main matrices contribute to one GPT-3 MLP block?

    Model answer

    Together, they contribute about 1.2 billion parameters.

    Explanation

    The bias vectors add some parameters, but their contribution is small in comparison.

  42. 42

    How many distinct MLP blocks does the described GPT-3 architecture contain?

    Model answer

    It contains 96 distinct MLP blocks.

    Explanation

    The embedding vectors pass through these blocks repeatedly as part of the 96-layer transformer.

  43. 43

    Approximately how many total parameters are devoted to all the MLP blocks in the described GPT-3 model?

    Model answer

    Approximately 116 billion parameters are devoted to all the MLP blocks.

    Explanation

    This is the accumulated contribution of the two large matrices and small bias terms across 96 MLPs.

  44. 44

    What fraction of the total GPT-3 parameters do the MLP blocks represent?

    Model answer

    They represent approximately two-thirds of the model’s total parameters.

    Explanation

    The MLPs contain more parameters than the attention, embedding, and unembedding components combined.

  45. 45

    What is the approximate total parameter count of the GPT-3 model in the example?

    Model answer

    The model has approximately 175 billion parameters.

    Explanation

    This total includes the MLPs along with attention, embedding, unembedding, and relatively small normalization-related parameters.

  46. 46

    Why might individual MLP neurons rarely represent one clean feature such as Michael Jordan?

    Model answer

    The model may use superposition, representing many features through combinations of neurons rather than assigning one feature to one neuron.

    Explanation

    Evidence suggests that individual neurons often do not correspond neatly to single human-interpretable concepts.

  47. 47

    What is the basic idea of superposition in neural-network representations?

    Model answer

    Superposition is the use of nearly perpendicular directions to represent more features than could fit using strictly perpendicular directions.

    Explanation

    The model tolerates some interference or noise in exchange for substantially greater representational capacity.

  48. 48

    How many exactly perpendicular vectors can be used to represent independent features in an n-dimensional space?

    Model answer

    At most n mutually perpendicular vectors can be used.

    Explanation

    This limit follows from the definition of dimension: each independent perpendicular direction consumes one dimension.

  49. 49

    What changes when feature directions are allowed to be nearly perpendicular instead of exactly perpendicular?

    Model answer

    The space can contain far more feature directions, provided a small amount of overlap or noise is tolerated.

    Explanation

    In high-dimensional spaces, many vectors can be close to perpendicular even when their number greatly exceeds the number of dimensions.

  50. 50

    Why does allowing nearly perpendicular directions provide little additional capacity in two or three dimensions?

    Model answer

    In low-dimensional spaces, relaxing exact perpendicularity creates very little extra room for additional vectors.

    Explanation

    The dramatic increase in capacity occurs primarily as the number of dimensions becomes large.

  51. 51

    What pattern appears in the angles between many random high-dimensional vectors?

    Model answer

    Their angles are strongly concentrated near 90 degrees, meaning random high-dimensional vectors tend to be nearly perpendicular.

    Explanation

    This concentration becomes useful for packing many approximately independent directions into a high-dimensional space.

  52. 52

    What does the Johnson-Lindenstrauss lemma imply about nearly perpendicular vectors?

    Model answer

    It implies that the number of nearly perpendicular vectors that can fit in a space grows exponentially with the number of dimensions.

    Explanation

    This provides a mathematical basis for the large representational capacity of high-dimensional spaces.

  53. 53

    How could superposition help explain why language-model performance scales well with model size?

    Model answer

    Increasing the number of dimensions can permit far more than a proportional increase in the number of independent ideas the model can represent.

    Explanation

    A space with ten times as many dimensions may store vastly more than ten times as many features.

  54. 54

    Where in a transformer could superposition be relevant besides the embedding space?

    Model answer

    It could also be relevant in the intermediate neuron space inside each MLP.

    Explanation

    The neuron vector may encode many more features through combinations of activations than the visible neuron count suggests.

  55. 55

    How would individual features appear if an MLP used superposition extensively?

    Model answer

    A feature would appear as a particular combination of neurons activating rather than as a single neuron lighting up.

    Explanation

    The feature would be distributed across multiple neurons in a superimposed representation.

  56. 56

    What is a sparse autoencoder used for in interpretability research?

    Model answer

    It is used to help extract underlying features from representations in which multiple features are superimposed across neurons.

    Explanation

    Sparse autoencoders can make otherwise entangled or distributed features easier to identify.

1 of 56
Question 1 of 56

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent