EXPERIMENTATION & A/B TESTING Β· INTERVIEW QUESTION
How do you approach hyperparameter tuning for large LLMs given the huge training cost?
π΄ advanced Β· Advanced Experimentation
Hint: Use proxy models, scaling laws, and known recipes rather than exhaustive search.
Answer
1. Scaling laws & prior research: Use Chinchilla/Kaplan scaling laws to determine:
- Optimal model size for compute budget
- Optimal data size
- Good LR ranges
Interview reasoning
Strategies for Cost-Effective Tuning
2. Proxy models:
Tune on 1B model β Scale best config to 7B β Fine-tune to 70B
Many hyperparameters transfer across scales (LR schedule shape, warmup ratio).
3. Known recipes:
| Hyperparameter | Typical Value |
|---|---|
| Optimizer | AdamW |
| Learning rate | 1e-4 to 3e-4 |
| LR schedule | Cosine with warmup |
| Warmup steps | 1-2% of total |
| Weight decay | 0.1 |
| Batch size | Large (millions of tokens) |
| Gradient clipping | 1.0 |
4. Limited search on critical params:
- LR and batch size matter most
- Try 3-5 LR values on proxy model
- Watch validation perplexity
5. Early stopping signals:
- If loss diverges, reduce LR and restart
- Monitor gradient norms for instability
For $1M+ training runs, you typically do minimal tuning and rely on proven recipes from published work.
LLM experiment results depend on data, prompts, model versions, decoding and compute budget. Preserve run manifests and artifacts; compare candidates on untouched task evaluations with cost and safety constraints. Expensive tuning should use staged smaller-budget evidence and repeated seeds or prompts where variation affects the conclusion.
Worked example. Use smaller pilots to eliminate poor configurations, then confirm finalists at the intended budget on independent task data. A setting that wins at a one-hour pilot may lose after full convergence; use scaling evidence before extrapolating its ranking.
Validation
Recreate selected runs, verify comparable evaluation inputs and budget accounting, and check sensitivity to stochastic generation. Test resumed versus uninterrupted runs with the saved optimizer, scheduler and data-position state. Retain failed trials and selection criteria so the winning run can be reviewed in the context of the complete search.
Common pitfalls
A tracking dashboard does not prevent test-set overfitting. Identical seeds do not reproduce mutable APIs or overwritten datasets.
Related questions
- What is CUPED and how does it reduce variance in A/B tests?
- How do you ensure reproducible experiments with LLMs?
- What is experiment tracking (MLflow, W&B) and why is it important for LLM projects?
- What is a p-value? Common misconceptions?
- What is the difference between statistical significance and practical significance?