AI AI Engineer: NLP and Large Language Models 2 — Questions and Answers
Question 1: What is 'hallucination' in the context of LLMs?
- The model generating extremely long outputs
- The model producing plausible-sounding but factually incorrect or fabricated information (Correct answer)
- The model refusing to answer sensitive questions
- The model outputting garbled text due to tokenization errors
Correct answer: The model producing plausible-sounding but factually incorrect or fabricated information
LLM hallucination refers to the model confidently generating false, invented information not grounded in training data or retrieved context.
Question 2: What is the context window in a large language model?
- The UI window showing model outputs
- The maximum number of tokens the model can process in a single input/output sequence (Correct answer)
- The time window used for model training
- The layer of attention that focuses on the current word
Correct answer: The maximum number of tokens the model can process in a single input/output sequence
The context window defines the maximum number of tokens (input + output) an LLM can process at once, limiting how much text it can consider.
Question 3: Which parameter-efficient fine-tuning technique adds low-rank decomposition matrices to model layers instead of updating all weights?
- Full fine-tuning
- LoRA (Low-Rank Adaptation) (Correct answer)
- RLHF (Reinforcement Learning from Human Feedback)
- Knowledge distillation
Correct answer: LoRA (Low-Rank Adaptation)
LoRA freezes pretrained weights and injects trainable low-rank matrices, drastically reducing the number of parameters updated during fine-tuning.
Question 4: What is 'zero-shot prompting' when using an LLM?
- Prompting the model with zero tokens
- Asking the model to perform a task without providing any examples in the prompt (Correct answer)
- Training the model on zero labeled examples
- Using a model that has never been fine-tuned
Correct answer: Asking the model to perform a task without providing any examples in the prompt
Zero-shot prompting asks the LLM to complete a task using only instructions, relying entirely on knowledge from pretraining without in-context examples.
Question 5: What is 'embedding' in NLP, as used by transformer models?
- Storing model weights in a database
- A dense, fixed-size vector representation of a token or text that captures semantic meaning (Correct answer)
- The process of tokenizing input text
- A technique for compressing the attention matrix
Correct answer: A dense, fixed-size vector representation of a token or text that captures semantic meaning
Embeddings map discrete tokens (or entire texts) to dense vectors in a continuous space where semantically similar items are geometrically close.
Question 6: What is RLHF (Reinforcement Learning from Human Feedback) used for in LLM development?
- Speeding up pretraining
- Aligning LLM outputs with human preferences and reducing harmful outputs (Correct answer)
- Expanding the model's vocabulary
- Compressing the model for edge deployment
Correct answer: Aligning LLM outputs with human preferences and reducing harmful outputs
RLHF uses human preference ratings to train a reward model, then fine-tunes the LLM with RL to produce outputs humans rate as better and safer.
What is 'hallucination' in the context of LLMs?