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

Study methods

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

Building Large Language Models

  • 30Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Pre-training Basics
The task of autoregressive language modeling is to predict the
token given the previous tokens.

30 questions

  1. 1
    The task of autoregressive language modeling is to predict the
    _____
    token given the previous tokens.
    Hint

    Think about what word comes after 'the' in a sequence.

    Answer

    next

  2. 2
    The loss function used for autoregressive language modeling is the
    _____
    loss.
    Hint

    It measures the difference between the predicted distribution and the true one-hot distribution.

    Answer

    cross-entropy

  3. 3
    In BPE tokenization, the tokenizer is trained by iteratively merging the most common
    _____
    of tokens.
    Hint

    Consider what two things are combined to form a new token.

    Answer

    pairs

  4. 4
    During tokenization, the smaller original tokens are kept so that typos or rare words can still be represented at the
    _____
    level.
    Hint

    Think about the most basic unit of text that can represent any word.

    Answer

    character

  5. 5
    Perplexity is computed as $2^{\text{average
    _____
    per token}}$.
    Hint

    It is the exponentiated average of a quantity you minimize during training.

    Answer

    loss

  6. 6
    The intuition behind perplexity is that it represents the average number of
    _____
    the model is unsure about at each step.
    Hint

    Think about the size of the set of possible next words the model considers.

    Answer

    tokens

  7. 7
    The MMLU benchmark evaluates models on multiple-choice questions by comparing the
    _____
    of each answer choice.
    Hint

    Language models assign a probability to each possible completion.

    Answer

    likelihood

  8. 8
    One trick to detect test set contamination is to check if the model assigns higher likelihood to examples in the original
    _____
    compared to a shuffled order.
    Hint

    Think about the natural sequence of examples in a dataset.

    Answer

    order

  9. 9
    After downloading the Common Crawl, the first step in data processing is to extract
    _____
    from the HTML.
    Hint

    Raw web pages contain markup; we need to strip that.

    Answer

    text

  10. 10
    To remove duplicate or boilerplate content, one common technique is
    _____
    filtering.
    Hint

    This process identifies and removes repeated data.

    Answer

    deduplication

  11. 11
    Model-based filtering uses a classifier trained on
    _____
    references to identify high-quality documents.
    Hint

    A well-known encyclopedia is often used as a source of high-quality text.

    Answer

    Wikipedia

  12. 12
    At the end of pre-training, models are often fine-tuned on very high-quality data with a decreased
    _____
    rate.
    Hint

    This hyperparameter controls how much the model updates its weights.

    Answer

    learning

  13. 13
    Scaling laws show that test loss decreases linearly with the logarithm of compute, data, and
    _____
    .
    Hint

    This refers to the number of weights in the model.

    Answer

    parameters

  14. 14
    The Chinchilla paper found that for compute-optimal training, you should use approximately
    _____
    tokens per parameter.
    Hint

    This number is between 10 and 30; the rule is about 20 tokens for every parameter.

    Answer

    20

  15. 15
    The approximate FLOPs required for training a model is $6 \times \text{parameters} \times \text{
    _____
    }$.
    Hint

    This quantity is the number of training examples (in units of subwords).

    Answer

    tokens

  16. 16
    Llama 3 400B was trained on 15.6 trillion tokens, used 16,000 H100 GPUs, and took approximately
    _____
    days.
    Hint

    Compute the time from FLOPs and GPU throughput.

    Answer

    70

  17. 17
    The goal of post-training is to align language models to follow
    _____
    and be helpful AI assistants.
    Hint

    We want the model to do what the user asks.

    Answer

    instructions

  18. 18
    Supervised fine-tuning (SFT) uses the same
    _____
    loss as pre-training but on desired human-written responses.
    Hint

    It's the next-token prediction objective.

    Answer

    language modeling

  19. 19
    The Lima paper showed that with only
    _____
    examples of SFT, performance does not improve much when scaling up to 32,000.
    Hint

    A few thousand examples are sufficient.

    Answer

    2000

  20. 20
    In RLHF, a
    _____
    model is trained to predict human preferences between two model outputs.
    Hint

    This model outputs a scalar score that quantifies how good an answer is.

    Answer

    reward

  21. 21
    PPO (Proximal Policy Optimization) requires multiple training stages and is considered
    _____
    to implement in practice.
    Hint

    Contrast with DPO, which is simpler.

    Answer

    complex

  22. 22
    DPO simplifies RLHF by directly maximizing the
    _____
    of the preferred output and minimizing that of the dispreferred output.
    Hint

    It uses the same language modeling objective but on preference data.

    Answer

    likelihood

  23. 23
    When humans label preferences, they often exhibit a bias towards
    _____
    outputs, which can skew model behavior.
    Hint

    Think about the verbosity of answers.

    Answer

    longer

  24. 24
    AlpacaEval uses an LLM as a judge to compare model outputs and achieves 98%
    _____
    with the Chatbot Arena human rankings.
    Hint

    This measures how well two sets of rankings agree.

    Answer

    correlation

  25. 25
    An LLM judge's bias towards longer outputs can be controlled using
    _____
    analysis to remove the length effect.
    Hint

    A statistical method to adjust for a confounding variable.

    Answer

    regression

  26. 26
    GPUs are optimized for high
    _____
    and fast matrix multiplication.
    Hint

    Contrast with CPUs, which are optimized for low latency.

    Answer

    throughput

  27. 27
    Model FLOP utilization (MFU) is the ratio of observed throughput to the
    _____
    maximum throughput of the GPU.
    Hint

    It measures how close actual performance is to peak performance.

    Answer

    theoretical

  28. 28
    Automatic mixed precision training stores weights in
    _____
    bits but performs computation in 16 bits.
    Hint

    Higher precision for storage, lower for speed.

    Answer

    32

  29. 29
    Operator fusion reduces memory traffic by combining multiple operations into a single
    _____
    kernel.
    Hint

    It's a programming platform for GPUs.

    Answer

    CUDA

  30. 30
    In PyTorch, simply calling
    _____
    on your model can apply operator fusion and double performance.
    Hint

    This function compiles the model into optimized kernels.

    Answer

    torch.compile

1 of 30
Question 1 of 30

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent