Deep Learning Transformers and Attention 3 — Questions and Answers
Question 1: What is prompt engineering in the context of large language models?
- Modifying model weights to improve performance
- Crafting input text to elicit desired model behavior without changing model parameters (Correct answer)
- Designing the tokenization scheme for the model
- Engineering hardware prompts for GPU acceleration
Correct answer: Crafting input text to elicit desired model behavior without changing model parameters
Prompt engineering designs input prompts — including instructions, examples, and context — to guide a frozen LLM toward desired outputs without gradient-based fine-tuning.
Question 2: What is fine-tuning a pretrained Transformer on a downstream task?
- Retraining the model from scratch on task-specific data
- Continuing training of pretrained weights on labeled task data to adapt representations to the target domain (Correct answer)
- Using the pretrained model only as a feature extractor with a frozen backbone
- Replacing attention heads with task-specific modules
Correct answer: Continuing training of pretrained weights on labeled task data to adapt representations to the target domain
Fine-tuning updates the pretrained model's weights on labeled task data, adapting the general-purpose pretraining knowledge to the specific downstream task.
Question 3: What is the attention mask used for in Transformer models during batched training?
- Preventing attention to padding tokens to avoid polluting representations with pad token information (Correct answer)
- Masking gradient flow through specific attention heads
- Forcing all attention weights to be equal
- Preventing the model from attending to low-frequency tokens
Correct answer: Preventing attention to padding tokens to avoid polluting representations with pad token information
Attention masks indicate which positions are real tokens versus padding, preventing the model from incorporating meaningless padding information into its representations.
Question 4: What is a token in the context of Transformer language models?
- A single character of text
- A unit of text (word, subword, or character) that the model processes as a single input element (Correct answer)
- A single row in the embedding matrix
- A hyperparameter controlling vocabulary size
Correct answer: A unit of text (word, subword, or character) that the model processes as a single input element
Tokens are the discrete units of text that a language model processes, commonly subword units like BPE or WordPiece that balance vocabulary coverage and sequence length.
Question 5: What is RLHF (Reinforcement Learning from Human Feedback) used for in LLM training?
- Pretraining the base language model on internet text
- Aligning the model's outputs with human preferences by using human ratings as a reward signal (Correct answer)
- Improving the tokenizer's vocabulary using human-labeled text
- Optimizing inference speed based on human latency preferences
Correct answer: Aligning the model's outputs with human preferences by using human ratings as a reward signal
RLHF fine-tunes a language model using a reward model trained on human preference comparisons, steering the LLM toward helpful, harmless, and honest outputs.
Question 6: What does the term 'context window' refer to in a large language model?
- The model's training dataset size
- The maximum number of tokens the model can process in a single forward pass (Correct answer)
- The number of attention heads in the model
- The sliding window used during data preprocessing
Correct answer: The maximum number of tokens the model can process in a single forward pass
The context window is the maximum sequence length a model can handle at once; information outside the context window is not accessible to the model during generation.
What is prompt engineering in the context of large language models?