Chapter 3: Ablation Studies
Understanding What Works and Why
Ablation studies systematically test components to understand their contribution.
What to Ablate
| Component | Variations to Test |
|---|---|
| LoRA Rank | 4, 8, 16, 32, 64 |
| Target Modules | Minimal → Full |
| Learning Rate | Log scale |
| Data Size | 100, 500, 1K, 5K |
| Epochs | 1, 2, 3, 5 |
Ablation Framework
def run_ablation(base_config, param_name, param_values):
"""Run ablation for a single parameter."""
results = []
for value in param_values:
config = base_config.copy()
config[param_name] = value
# Train
model = train_model(config)
# Evaluate
score = evaluate_model(model)
results.append({
param_name: value,
"score": score,
})
return results
Reporting Results
| LoRA Rank | Task Score | Training Time |
|---|---|---|
| 4 | 85.2% | 45 min |
| 8 | 87.1% | 50 min |
| 16 | 88.3% | 55 min |
| 32 | 88.5% | 65 min |
| 64 | 88.4% | 80 min |
Insight: Rank 16 offers best quality/efficiency trade-off.
Best Practices
- Change one thing at a time
- Use same seed for reproducibility
- Run multiple seeds for final results
- Document everything
- Focus on practical differences