How Large Language Models Work

Final Exam

20 questions · 70% to pass
0 of 20 answered
1. What modern positional encoding technique does LLaMA use, and what is its key advantage?
Correct. LLaMA uses RoPE (Rotary Position Embeddings), which encodes relative rather than absolute position directly within the attention computation.
LLaMA uses RoPE — Rotary Position Embeddings — which encode relative positions within attention, enabling better generalization to sequence lengths beyond training.
2. LoRA (Low-Rank Adaptation) achieves parameter efficiency by:
Correct. LoRA keeps the base model weights frozen and adds small low-rank matrices (A and B, where the update is AB) to selected weight matrices. Only A and B are trained, representing the fine-tuning delta with far fewer parameters.
Incorrect. LoRA doesn't prune or quantize — it adds small low-rank matrices alongside the frozen base weights and trains only those. The result is a compact adapter that can be swapped in at inference time.
3. Which type of hallucination adds information not present in a provided source document?
Correct. Extrinsic hallucination adds unverifiable information beyond the provided context. Intrinsic hallucination contradicts the context. The npj Digital Medicine study found extrinsic hallucinations in ~30% of clinical trial summaries.
Extrinsic hallucination adds content not present in (and not verifiable against) the source document. Intrinsic hallucination contradicts the source. This distinction matters for RAG pipelines — both types must be addressed separately.
4. What was the Tay chatbot incident's primary lesson about model safety?
✓ Correct — Correct. Tay absorbed biases from its training data and conversation context. Adversarial users discovered they could elicit harmful outputs through targeted prompting — demonstrating how training distribution biases can be surfaced.
Not quite. Tay demonstrated that training on human-generated text encodes human biases, and adversarial users can systematically elicit those biases through targeted prompting.
5. "Confabulation" is preferred over "hallucination" by some researchers because it emphasizes that the model:
Correct. Confabulation in neuropsychology describes unconscious gap-filling in patients with memory disorders — no intent to deceive. This maps better onto LLM behavior than hallucination, which implies perceptual experience.
Confabulation emphasizes the absence of intent — the model fills gaps structurally, like patients with certain memory disorders who genuinely believe their fabricated memories. This framing directs attention to architecture rather than "wanting" to tell the truth.
6. What does Byte-Pair Encoding (BPE) do?
Correct.
BPE starts with characters and merges the most frequent adjacent pairs until reaching a vocabulary size limit.
7. Google's Bard launch video error (February 2023) involved a false claim that JWST:
Correct. Bard claimed JWST took the first pictures of an exoplanet, but the first direct exoplanet image was taken by the European Southern Observatory in 2004. The error contributed to Alphabet losing roughly $100 billion in market cap on launch day.
Bard falsely claimed JWST took the first-ever pictures of an exoplanet. The actual first direct image of an exoplanet was captured by the ESO in 2004 — about 17 years before JWST's 2021 launch.
8. Meta's LLaMA 2 paper found that for SFT quality vs. quantity, which mattered more?
Correct. LLaMA 2's instruction-tuned models used fewer than 30,000 carefully vetted SFT examples. The team found that one high-quality, rigorously reviewed example could be worth thousands of mediocre ones.
Incorrect. Meta's LLaMA 2 paper specifically highlighted that quality controlled, carefully reviewed SFT examples produced better results than larger quantities of lower-quality data — a finding consistent across multiple fine-tuning research programs.
9. The 2024 British Columbia tribunal ruling against Air Canada held that:
Correct. Air Canada argued the chatbot was a separate legal entity; the tribunal rejected this, establishing that companies are responsible for their AI agents' statements. Air Canada was ordered to pay Moffatt $812.02.
The tribunal ruled that Air Canada is responsible for what its chatbot says — it cannot treat the chatbot as a separate entity to avoid liability. This is a landmark precedent for AI deployment across all sectors.
10. What do "isomorphic problems" reveal about LLM math performance?
✓ Correct — Correct. Isomorphic problems have the same underlying structure but different surface cues. Performance drops when surface cues change, revealing that the model exploited textual patterns rather than reasoning through the structure.
Not quite. Performance drops on isomorphic variants, showing the model relied on surface-level pattern cues rather than genuine structural reasoning.
11. What does high temperature (e.g., T = 2.0) do to the probability distribution?
Correct. Dividing logits by a large T compresses differences, making the distribution more uniform.
Not quite. High T flattens the distribution — all tokens become more equally probable.
12. Which of the following is a genuine hard limit of prompting that fine-tuning can address?
Correct. Tone, format, and language are achievable through prompting. But if the model was never trained on a piece of knowledge, no prompt can manufacture it. Fine-tuning (or RAG) is required to address this knowledge gap.
Incorrect. The true knowledge gap — information the model was never trained on — is the genuine limit of prompting. Style and format problems are well within prompting's reach.
13. The KL divergence penalty in RLHF training serves to:
Correct. The KL penalty measures how much the current policy has diverged from the SFT starting point and adds a cost for large divergence. This keeps the model grounded in real language capability and prevents it from gaming the reward model with degenerate outputs.
Incorrect. The KL penalty's purpose is to constrain the policy from diverging too far from the SFT reference — preventing reward hacking while allowing genuine improvement in human-preferred behaviors.
14. Why do languages like Turkish or Finnish use more tokens than English for equivalent meaning?
Correct — agglutinative languages form complex words that BPE must split into many fragments, inflating token counts 40–60% above English.
Agglutinative languages form long compound words; BPE must split these into many fragments, increasing token count substantially.
15. BERT's masked language modeling objective differs from GPT's causal language modeling in that:
Correct. BERT is bidirectional — it attends to context on both sides to predict masked tokens. GPT is causal/autoregressive — it only uses tokens to the left when predicting the next token.
Incorrect. The key distinction is directionality: BERT uses bidirectional context for masked prediction; GPT uses only left-to-right context for next-token prediction.
16. Schaeffer et al. (2023) argued that many apparent emergent abilities:
Correct. Schaeffer et al. showed that continuous metrics often remove the apparent discontinuity, suggesting it is partly a measurement effect.
Schaeffer et al. argued that non-linear metrics (like exact-match) can make smooth improvements look discontinuous — a measurement artefact.
17. Anthropic's Constitutional AI (CAI) reduces dependence on human labelers by:
Correct. CAI uses RLAIF — the model evaluates its own outputs against a written constitution, revises them, and those revisions become training data. This generates alignment signal without requiring humans to rank every response pair.
Incorrect. CAI's innovation is self-critique: the model assesses its own outputs against a written constitution and revises them. These AI-generated preference labels replace much of the human labeling burden.
18. RLHF (Reinforcement Learning from Human Feedback) can worsen hallucination because:
Correct. RLHF creates a fluency-accuracy trade-off: raters reward confident, complete answers. This trains away the hedges and uncertainty signals that might otherwise help users identify shaky claims — amplifying the overconfidence of hallucinated content.
RLHF's problem is the incentive structure: human raters tend to prefer confident, detailed responses. This trains the model to sound authoritative, inadvertently suppressing uncertainty signals and amplifying overconfident hallucination.
19. How does min-p differ from top-p in its threshold calculation?
Correct. Min-p = min_p_value × p(top_token), so when the model is confident the absolute cutoff rises, and when uncertain it falls.
Not quite. Min-p scales its threshold relative to the top token's probability: threshold = min_p × max_token_probability.
20. Many-shot learning (Anil et al. 2024) extends ICL by using:
Correct. Gemini 1.5 Pro's 1M-token context window makes many-shot learning practical, narrowing the gap with fine-tuning.
Many-shot learning is enabled by long context windows — Gemini 1.5 Pro's 1M tokens can hold hundreds of examples in a single prompt.