forked from rohitg00/ai-engineering-from-scratch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz.json
More file actions
37 lines (37 loc) · 2.82 KB
/
Copy pathquiz.json
File metadata and controls
37 lines (37 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[
{
"question": "What is the core insight behind LoRA (Low-Rank Adaptation)?",
"options": ["Most weights don't matter", "Weight updates during fine-tuning have low intrinsic rank, so they can be approximated by two small matrices instead of updating the full weight matrix", "Fine-tuning only needs the last layer", "Smaller models are always better"],
"correct": 1,
"explanation": "Aghajanyan et al. showed that fine-tuning updates occupy a low-dimensional subspace. LoRA exploits this by representing the update as W + BA where B (d x r) and A (r x d) have small rank r, typically 8-64.",
"stage": "pre"
},
{
"question": "How much memory does LoRA save compared to full fine-tuning of an 8B model?",
"options": ["No savings", "From ~56GB down to ~6GB by training <1% of parameters while keeping base weights frozen", "50% reduction", "Only saves disk space"],
"correct": 1,
"explanation": "Full fine-tuning needs gradients and optimizer states for all 8B parameters (~56GB). LoRA freezes base weights and only trains adapter matrices (~80M parameters at rank 16), needing ~6GB total.",
"stage": "pre"
},
{
"question": "What is QLoRA?",
"options": ["Quantized LoRA: the base model is loaded in 4-bit precision while LoRA adapters train in 16-bit, combining memory savings from both techniques", "A faster version of LoRA", "LoRA applied to quantized activations", "A different fine-tuning algorithm"],
"correct": 0,
"explanation": "QLoRA (Dettmers et al.) loads the frozen base model in 4-bit (NF4 quantization) while training LoRA adapters in FP16/BF16. This allows fine-tuning a 7B model on a single consumer GPU with 6GB VRAM.",
"stage": "post"
},
{
"question": "What does the 'rank' parameter (r) in LoRA control?",
"options": ["The number of training epochs", "The capacity of the adapter: higher rank captures more complex adaptations but uses more parameters and memory", "The learning rate", "The number of layers to fine-tune"],
"correct": 1,
"explanation": "Rank r determines the size of adapter matrices A (r x d) and B (d x r). Rank 4 trains very few parameters (fast, cheap). Rank 64 trains more parameters (more expressive). Most tasks work well with rank 8-32.",
"stage": "post"
},
{
"question": "What happens when you merge LoRA weights back into the base model?",
"options": ["The model becomes larger", "The adapter matrices are added to the base weights (W_merged = W_base + B*A), producing a standard model with no inference overhead", "The model needs to be retrained", "Merging is not possible"],
"correct": 1,
"explanation": "Since LoRA adds W_base + B*A, you can compute B*A once and add it to W_base permanently. The merged model has the same architecture and inference speed as the original, with no adapter overhead.",
"stage": "post"
}
]