IT
LLM Engineering: Fine-Tuning, Alignment & Serving
Test your knowledge of transformer architectures, PEFT techniques (LoRA), RLHF, vLLM, and production deployment strategies.
This is a free, 16-question multiple-choice quiz. Answer each question to see whether you got it right, with an explanation for every answer. There is no sign-up and no time limit — take it as many times as you like, and scroll down for the full answer key once you are done.
Question 1 of 16
0 correct
How does Low-Rank Adaptation (LoRA) reduce the computational overhead of fine-tuning large language models?
Press A–D to choose · Enter to submit
Answer key & explanations
Every question in this quiz, with the correct answer marked and an explanation of why it is right. Use it to revise before or after taking the quiz above.
1.How does Low-Rank Adaptation (LoRA) reduce the computational overhead of fine-tuning large language models?
- AIt freezes the base model weights and injects trainable low-rank rank decomposition matrices into attention layers✓ Correct
- BIt prunes 90% of the attention heads permanently from the transformer layers
- CIt quantizes all model weights down to 1-bit binary representations
- DIt trains only the final softmax classification head of the language model
Correct answer: It freezes the base model weights and injects trainable low-rank rank decomposition matrices into attention layers
LoRA freezes the original pre-trained weights and adds pairs of low-rank matrices to attention projections, drastically reducing the number of trainable parameters and optimizer state memory.
2.What is the key difference between Direct Preference Optimization (DPO) and traditional RLHF using PPO?
- ADPO requires training on unlabelled raw text without preference pairs
- BDPO directly optimizes the policy network using preference data without training a separate reward model✓ Correct
- CDPO relies on evolutionary genetic algorithms instead of gradient descent
- DDPO eliminates the need for a reference model during alignment training
Correct answer: DPO directly optimizes the policy network using preference data without training a separate reward model
DPO mathematically reformulates the RL objective, directly updating the policy network from preferred/rejected human pairs without training a separate reward model or using complex PPO reinforcement learning.
3.What primary memory bottleneck does the PagedAttention algorithm in vLLM address during high-concurrency LLM serving?
- AFragmentation and overallocation of the Key-Value (KV) cache in GPU VRAM✓ Correct
- BCUDA kernel launch latencies during matrix multiplication
- CExcessive disk I/O when reading tokenizer configuration files
- DPCIe bus bandwidth saturation when streaming audio inputs
Correct answer: Fragmentation and overallocation of the Key-Value (KV) cache in GPU VRAM
PagedAttention treats the dynamically growing KV cache like virtual memory pages in an operating system, eliminating memory fragmentation and enabling efficient KV cache sharing across requests.
4.Why does speculative decoding accelerate token generation in LLM inference engines?
- AIt bypasses the self-attention mechanism completely for all tokens
- BA small, fast draft model generates candidate tokens verified in parallel by the target model in a single forward pass✓ Correct
- CIt caches the final answer of previous user queries in a Redis layer
- DIt computes attention weights on the CPU while the GPU runs activations
Correct answer: A small, fast draft model generates candidate tokens verified in parallel by the target model in a single forward pass
Speculative decoding uses a lightweight draft model to propose multiple tokens quickly; the larger, expensive model verifies or rejects them in parallel in one forward pass, boosting throughput.
5.What is FlashAttention primarily designed to optimize inside transformer layers?
- AMemory reads and writes between fast GPU SRAM and high-bandwidth memory (HBM)✓ Correct
- BToken vocabulary size inside the embedding layer
- CDisk read throughput when loading checkpoint safetensors
- DGradient backpropagation across distributed Ethernet networks
Correct answer: Memory reads and writes between fast GPU SRAM and high-bandwidth memory (HBM)
FlashAttention tiles the computation of softmax and attention matrices, reducing quadratic memory traffic between slow HBM and fast on-chip SRAM to make attention I/O-aware.
6.In QLoRA, what novel data type is utilized to quantize base model weights without significant performance degradation?
- ASigned Integer 4 (INT4)
- BNormalFloat 4 (NF4)✓ Correct
- CBfloat16 Floating Point
- DBinary 1-bit Sparse Matrix
Correct answer: NormalFloat 4 (NF4)
QLoRA introduced NormalFloat 4 (NF4), an information-theoretically optimal quantile quantization scheme designed specifically for normally distributed neural network weights.
7.What does the temperature parameter control during autoregressive token sampling?
- AThe maximum number of tokens the model is permitted to generate
- BThe sharpness of the probability distribution over the vocabulary prior to sampling✓ Correct
- CThe GPU clock frequency allocated to computing the forward pass
- DThe penalty applied to tokens that have already appeared in the output
Correct answer: The sharpness of the probability distribution over the vocabulary prior to sampling
Dividing logits by temperature scales the distribution: lower temperatures (<1.0) peak the distribution around high-probability tokens, while higher temperatures flatten it, increasing diversity.
8.What happens when an LLM inference request exceeds the context window capacity of a model with RoPE (Rotary Position Embeddings)?
- AThe model crashes with an unrecoverable CUDA out-of-memory error
- BPositions outside the trained frequency domain cause severe perplexity degradation unless position interpolation or scaling is applied✓ Correct
- CThe model converts earlier tokens into base64 strings
- DThe model shifts automatically into an encoder-only architecture
Correct answer: Positions outside the trained frequency domain cause severe perplexity degradation unless position interpolation or scaling is applied
RoPE encodes position via complex rotation angles; exceeding trained token lengths causes out-of-distribution rotation frequencies, degrading output quality unless scaled (e.g., via NTK-aware scaling).
9.What is Continuous Batching (or iteration-level scheduling) in modern LLM serving systems?
- AWaiting for all requests in a batch to complete before accepting new requests
- BScheduling and evicting individual requests at each token iteration rather than at the full sequence level✓ Correct
- CRunning training and inference steps concurrently on the same GPU cluster
- DBatching user prompts into flat files on disk before processing
Correct answer: Scheduling and evicting individual requests at each token iteration rather than at the full sequence level
Continuous batching inserts new requests and completes finished sequences at every single token generation step, maximizing GPU compute utilization compared to static request batching.
10.What does the repetition penalty parameter explicitly do during text generation?
- AIt truncates the prompt if it contains duplicate sentences
- BIt discounts the logits of tokens that have already been generated to discourage loops✓ Correct
- CIt forces the model to repeat every generated token twice for validation
- DIt rejects responses that match prior database queries
Correct answer: It discounts the logits of tokens that have already been generated to discourage loops
Repetition penalty reduces the logit value of previously generated tokens, making the sampling algorithm significantly less likely to select them again.
11.What constitutes the 'prefill' phase of transformer inference, and how does it differ from the 'decode' phase?
- APrefill processes the prompt tokens in parallel to generate the initial KV cache; decode generates one token at a time autoregressively✓ Correct
- BPrefill quantizes the weights from disk; decode runs the actual tokens on the GPU
- CPrefill runs the tokenizer on the CPU; decode compiles the Python code into C++
- DPrefill checks the user input for safety violations; decode writes the logs
Correct answer: Prefill processes the prompt tokens in parallel to generate the initial KV cache; decode generates one token at a time autoregressively
The prefill phase is compute-bound, ingesting the full prompt concurrently to populate the KV cache; the subsequent decode phase is memory-bandwidth-bound, emitting one token per step.
12.What is the primary role of a System Prompt in instruction-tuned language models?
- ATo define the root password for the underlying Linux container
- BTo establish high-priority behavioral constraints, persona, and guidelines that persist throughout the interaction✓ Correct
- CTo compile prompt templates into optimized byte streams
- DTo execute database migration scripts prior to token generation
Correct answer: To establish high-priority behavioral constraints, persona, and guidelines that persist throughout the interaction
System prompts provide foundational framing, safety boundaries, role-playing personas, and instructions that anchor model behavior throughout downstream conversation turns.
13.What is catastrophic forgetting in the context of LLM fine-tuning?
- AThe physical loss of model weights due to a persistent storage failure
- BThe loss of previously acquired general capabilities when a model is heavily trained on a narrow domain dataset✓ Correct
- CThe failure of the GPU driver to clear the KV cache between requests
- DThe model forgetting the user's prompt midway through token generation
Correct answer: The loss of previously acquired general capabilities when a model is heavily trained on a narrow domain dataset
Catastrophic forgetting occurs when gradient updates on a specialized task overwrite the general linguistic and reasoning representations learned during large-scale pre-training.
14.Which metric evaluates token generation speed from the user's perspective, representing perceived responsiveness?
- ATime to First Token (TTFT)✓ Correct
- BNormalized Discounted Cumulative Gain (NDCG)
- CArea Under the ROC Curve (AUC)
- DMean Reciprocal Rank (MRR)
Correct answer: Time to First Token (TTFT)
Time to First Token (TTFT) measures the latency between dispatching a prompt and receiving the very first streamed token, defining perceived interactive responsiveness.
15.What does GGUF format offer to the open-source local LLM community?
- AA high-performance file format designed for rapid loading and execution on CPUs and GPUs via llama.cpp✓ Correct
- BAn encrypted binary packaging standard for closed-source corporate models
- CA streaming protocol for sending audio tokens over WebSockets
- DA replacement for PyTorch during distributed multi-node pre-training
Correct answer: A high-performance file format designed for rapid loading and execution on CPUs and GPUs via llama.cpp
GGUF is a extensible binary format created by the llama.cpp project that encapsulates model metadata, tensor data, and quantized weights for cross-platform local execution.
16.What is the function of the KL-divergence penalty in traditional RLHF algorithms like PPO?
- ATo accelerate gradient descent steps on large batch sizes
- BTo prevent the policy model from drifting too far from the original reference model's generation distribution✓ Correct
- CTo penalize the model when generating grammatically incorrect punctuation
- DTo maximize the temperature during token exploration
Correct answer: To prevent the policy model from drifting too far from the original reference model's generation distribution
A Kullback-Leibler (KL) divergence penalty ensures that the policy being updated with RL does not deviate drastically from the unaligned base model, preventing reward hacking and gibberish outputs.
More free quizzes
- ITDistributed Systems: Consensus & Fault ToleranceDeep dive into distributed systems engineering, covering consensus protocols (Raft/Paxos), the CAP theorem, and vector clocks.16 questions
- ITApplied AI: Systems, Embeddings & RAGAssess your understanding of practical machine learning architectures, embedding spaces, and Retrieval-Augmented Generation systems.16 questions
- ITFrontend Architecture: Micro-Frontends & RenderingEvaluate your knowledge of Modern Frontend Architecture, SSR, SSG, Hydration mechanics, Islands Architecture, and Module Federation.16 questions