Quiz: Parameter-Efficient Fine-Tuning
Test your knowledge about PEFT methods, their trade-offs, and when to use each.
30 questions - Click on each question to reveal the correct answer.
Question 1
What does PEFT stand for?
A) Parallel Efficient Fine-Tuning
B) Parameter-Efficient Fine-Tuning
C) Pre-training Efficient Feature Training
D) Partial Embedding Fine-Tuning
Show Answer
Correct Answer: B
PEFT stands for Parameter-Efficient Fine-Tuning, a family of methods that train only a small subset of model parameters.
Question 2
What percentage of parameters does PEFT typically train?
A) 50%
B) 25%
C) Less than 1%
D) 10%
Show Answer
Correct Answer: C
PEFT methods typically train less than 1% of the total model parameters (often 0.01% to 0.5%).
Question 3
Why doesn't PEFT cause catastrophic forgetting?
A) It uses more data
B) The base model weights remain frozen
C) It trains for fewer epochs
D) It uses a special loss function
Show Answer
Correct Answer: B
PEFT keeps the base model weights frozen, so the original pre-trained knowledge is preserved. Only the small adapter parameters are modified.
Question 4
What is LoRA?
A) A model architecture
B) Low-Rank Adaptation, adding trainable matrices to frozen weights
C) A type of optimizer
D) A dataset format
Show Answer
Correct Answer: B
LoRA (Low-Rank Adaptation) adds trainable low-rank decomposition matrices (B and A) alongside frozen weight matrices.
Question 5
In LoRA, what does the rank (r) parameter control?
A) Training speed
B) The capacity and number of trainable parameters
C) Learning rate
D) Batch size
Show Answer
Correct Answer: B
The rank (r) determines the dimensionality of the low-rank matrices, controlling the adapter's capacity and the number of trainable parameters.
Question 6
What is the main difference between LoRA and QLoRA?
A) QLoRA uses a different loss function
B) QLoRA combines 4-bit quantization with LoRA
C) QLoRA trains more parameters
D) QLoRA is only for image models
Show Answer
Correct Answer: B
QLoRA (Quantized LoRA) loads the base model in 4-bit precision and adds LoRA adapters on top, dramatically reducing memory requirements.
Question 7
How much memory does QLoRA save compared to LoRA for a 7B model?
A) 10%
B) 30%
C) ~60% (from ~14GB to ~6GB)
D) 90%
Show Answer
Correct Answer: C
QLoRA reduces memory from approximately 14GB to 6GB for a 7B model, saving about 60% compared to LoRA.
Question 8
What quantization format does QLoRA use?
A) INT8
B) NF4 (4-bit NormalFloat)
C) Float16
D) Binary
Show Answer
Correct Answer: B
QLoRA uses NF4 (4-bit NormalFloat) quantization, designed to have equal numbers of values in each quantization bin for normally distributed weights.
Question 9
What is Prefix Tuning?
A) Training the first layer only
B) Adding trainable virtual tokens as prefixes to attention
C) Optimizing input prompts
D) A tokenization method
Show Answer
Correct Answer: B
Prefix Tuning adds trainable "virtual tokens" as prefixes to the key and value states in attention layers.
Question 10
Which PEFT method learns to rescale activations?
A) LoRA
B) Prefix Tuning
C) IA3
D) QLoRA
Show Answer
Correct Answer: C
IA3 (Infused Adapter by Inhibiting and Amplifying Inner Activations) learns scaling vectors to rescale activations rather than adding new weights.
Question 11
What function is used to apply PEFT to a model?
A) apply_peft()
B) get_peft_model()
C) create_adapter()
D) add_lora()
Show Answer
Correct Answer: B
The get_peft_model() function from the PEFT library wraps a base model with the specified PEFT configuration.
Question 12
What does model.merge_and_unload() do?
A) Saves the model to disk
B) Merges adapter weights into the base model and removes adapter overhead
C) Loads multiple adapters
D) Clears GPU memory
Show Answer
Correct Answer: B
merge_and_unload() merges the LoRA adapter weights into the base model weights, creating a standard model without adapter overhead at inference.
Question 13
How large is a typical LoRA adapter file compared to a full model?
A) Same size
B) 50% of full model
C) ~10-50MB vs ~15GB+
D) 10% of full model
Show Answer
Correct Answer: C
LoRA adapter files are typically 10-50MB, compared to full model files of 15GB+ for a 7B model.
Question 14
What is the LoRA alpha parameter used for?
A) Setting the learning rate
B) Scaling the contribution of LoRA weights
C) Determining batch size
D) Setting dropout rate
Show Answer
Correct Answer: B
LoRA alpha is a scaling factor that controls the magnitude of the LoRA adaptation's contribution to the output. The effective scaling is alpha/rank.
Question 15
Which weight matrices are commonly targeted for LoRA in transformers?
A) Embedding layers only
B) Query, Key, Value projections (q_proj, k_proj, v_proj)
C) Layer normalization
D) Output softmax
Show Answer
Correct Answer: B
The attention projection matrices (q_proj, k_proj, v_proj, o_proj) and feed-forward layers are commonly targeted for LoRA.
Question 16
What is Prompt Tuning?
A) Writing better prompts manually
B) Learning continuous embeddings prepended to inputs
C) Optimizing tokenization
D) A type of data augmentation
Show Answer
Correct Answer: B
Prompt Tuning learns continuous embedding vectors that are prepended to the input sequence, serving as learned "soft prompts."
Question 17
Which PEFT method uses the fewest trainable parameters?
A) LoRA
B) QLoRA
C) IA3 or Prompt Tuning
D) Prefix Tuning
Show Answer
Correct Answer: C
IA3 and Prompt Tuning use the fewest parameters (~0.01% of the model), even less than LoRA (~0.1-1%).
Question 18
What is double quantization in QLoRA?
A) Quantizing twice in sequence
B) Quantizing the quantization constants themselves
C) Using two different quantization formats
D) Quantizing weights and activations
Show Answer
Correct Answer: B
Double quantization additionally quantizes the quantization constants themselves, saving an extra ~0.4 bits per parameter.
Question 19
What is the advantage of adapter swapping?
A) Faster training
B) Using one base model with multiple task-specific adapters
C) Better quality
D) Smaller model size
Show Answer
Correct Answer: B
Adapter swapping allows you to use a single base model with multiple task-specific adapters that can be quickly swapped at runtime.
Question 20
When should you choose full fine-tuning over PEFT?
A) When memory is limited
B) When maximum possible quality is critical and resources are available
C) When you need quick iteration
D) When training multiple tasks
Show Answer
Correct Answer: B
Full fine-tuning is preferred when you need the maximum possible quality and have sufficient compute resources available.
Question 21
What does AdaLoRA do differently than standard LoRA?
A) Uses higher rank
B) Dynamically allocates rank based on layer importance
C) Only works with QLoRA
D) Doesn't require configuration
Show Answer
Correct Answer: B
AdaLoRA dynamically allocates rank to different weight matrices based on their importance, potentially using more rank for important layers and less for others.
Question 22
What library provides BitsAndBytesConfig for QLoRA?
A) peft
B) transformers (using bitsandbytes)
C) trl
D) datasets
Show Answer
Correct Answer: B
BitsAndBytesConfig is provided through the transformers library, which uses the bitsandbytes library for the actual quantization.
Question 23
What is the typical quality difference between LoRA and full fine-tuning?
A) LoRA is 20% worse
B) LoRA is 1-5% lower on most tasks
C) They're identical
D) LoRA is better
Show Answer
Correct Answer: B
LoRA typically achieves 90-99% of full fine-tuning quality, with differences of 1-5% on most tasks.
Question 24
How much faster is PEFT training compared to full fine-tuning?
A) Same speed
B) 10% faster
C) 2-3x faster
D) 10x faster
Show Answer
Correct Answer: C
PEFT training is typically 2-3x faster than full fine-tuning due to fewer gradient computations and weight updates.
Question 25
What happens after merging a LoRA adapter?
A) Quality decreases
B) Model becomes larger
C) Inference runs without adapter overhead
D) Adapter is lost permanently
Show Answer
Correct Answer: C
After merging, the adapter weights are integrated into the base model weights, so inference runs without any adapter overhead, identical to a natively fine-tuned model.
Question 26
What is the recommended starting rank for LoRA experiments?
A) r=1
B) r=16 or r=32
C) r=256
D) r=1024
Show Answer
Correct Answer: B
Starting with r=16 or r=32 is recommended as a good balance between capacity and efficiency. Adjust up or down based on results.
Question 27
Which compute dtype is commonly used with QLoRA?
A) float32
B) int8
C) bfloat16
D) int4
Show Answer
Correct Answer: C
QLoRA typically uses bfloat16 as the compute dtype for the forward/backward computations, even though weights are stored in 4-bit.
Question 28
What is the relationship between LoRA alpha and rank?
A) Alpha should be much smaller than rank
B) Alpha is typically 1.5-2x the rank
C) Alpha equals rank
D) They're unrelated
Show Answer
Correct Answer: B
Common practice is to set alpha to 1.5-2x the rank (e.g., r=16, alpha=32), as the effective scaling is alpha/rank.
Question 29
What does model.print_trainable_parameters() show?
A) Model size
B) Count and percentage of trainable parameters
C) Training progress
D) GPU memory usage
Show Answer
Correct Answer: B
print_trainable_parameters() displays the number of trainable parameters, total parameters, and the trainable percentage.
Question 30
For most use cases, which PEFT method is recommended to start with?
A) IA3
B) Prefix Tuning
C) LoRA
D) AdaLoRA
Show Answer
Correct Answer: C
LoRA is the most versatile and widely-used PEFT method, recommended as the default starting point for most fine-tuning tasks.
Results
| Score | Level |
|---|---|
| 27-30 | Excellent - Strong understanding of PEFT! |
| 21-26 | Good - Review specific methods as needed |
| 15-20 | Average - Revisit all chapters |
| Below 15 | Needs comprehensive review |