Skip to main content

Quiz: QLoRA and Quantization

30 questions on QLoRA, 4-bit quantization, and memory-efficient training.


Question 1​

What does QLoRA combine?

A) Quantization and full fine-tuning
B) 4-bit quantization and LoRA
C) 8-bit and 16-bit training
D) Multiple models

Show Answer

Correct Answer: B

QLoRA combines 4-bit quantization of the base model with LoRA adapters for efficient fine-tuning.


Question 2​

What quantization format does QLoRA use by default?

A) INT8
B) FP4
C) NF4 (4-bit NormalFloat)
D) Binary

Show Answer

Correct Answer: C

QLoRA uses NF4 (4-bit NormalFloat), designed for normally distributed weights.


Question 3​

How much VRAM does QLoRA need for a 7B model?

A) ~28GB
B) ~14GB
C) ~6GB
D) ~1GB

Show Answer

Correct Answer: C

QLoRA requires approximately 6GB VRAM for a 7B parameter model.


Question 4​

What is double quantization?

A) Running quantization twice
B) Quantizing the quantization constants
C) Using two GPUs
D) Double precision training

Show Answer

Correct Answer: B

Double quantization quantizes the quantization constants themselves, saving additional memory.


Question 5​

What library provides BitsAndBytesConfig?

A) peft
B) transformers (using bitsandbytes)
C) torch
D) accelerate

Show Answer

Correct Answer: B

BitsAndBytesConfig is provided through transformers, which uses the bitsandbytes library.


Questions 6-30​

(Additional questions covering: prepare_model_for_kbit_training, gradient checkpointing, gradient accumulation, paged optimizers, NF4 vs FP4, memory calculations, compute dtype, optimization combinations, troubleshooting OOM errors, and practical implementation details)

Show All Remaining Answers

Q6-Q30 cover:

  • prepare_model_for_kbit_training purpose (B: prepares quantized model for training)
  • Gradient checkpointing trade-off (B: compute for memory)
  • Effective batch size calculation (C: batch_size × accumulation_steps)
  • Recommended compute dtype (C: bfloat16)
  • Double quantization savings (B: ~11%)
  • Paged optimizer purpose (B: pages to CPU on memory pressure)
  • QLoRA quality vs full FT (B: ~98%)
  • NF4 advantage (B: optimal for normally distributed weights)
  • Memory reduction from QLoRA vs LoRA (C: ~60%)
  • When to use QLoRA (B: limited GPU memory)

Results​

ScoreLevel
27-30Excellent
21-26Good
15-20Average
Below 15Review needed

Return to Module 5 | Continue to Module 6