Distill a Server Ranker Into a Small On-Device Gboard Model
Last updated: November 29, 2026
Quick Overview
Gboard needs a small on-device model to rank next-word suggestions, and a large server model is much more accurate. Explain how knowledge distillation transfers that quality, why soft targets act as regularization, and how you would set it up.
0
0
0 solved
Gboard needs a small on-device model to rank next-word suggestions, and a large server model is much more accurate. Explain how knowledge distillation transfers that quality, why soft targets act as regularization, and how you would set it up.
Gboard runs under tight memory, latency and privacy limits, so Google commonly trains small on-device models from larger teachers. The interviewer checks that you understand what extra information soft labels carry and the practical knobs of temperature and loss mixing.
What the Interviewer Expects
- Explain the teacher-student setup and the distillation loss
- Explain temperature and why it reveals the teacher's relative preferences among wrong answers
- Explain why soft targets regularize: richer signal per example, less overfitting to one-hot labels
- Write a combined loss with hard labels and the $T^2$ scaling
- Discuss on-device constraints: vocabulary size, quantization after distillation, evaluation on device
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- Why multiply the soft loss by $T^2$?
- What if the teacher is wrong on a slice, such as a less common language?
- How would you combine distillation with federated learning on user data?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Ask the size budget, latency target, vocabulary size, which languages are in scope, and whether the teacher can be run over a large unlabeled text corpus to produce soft labels....
Approach
Define the losses, explain why they help, then cover the practical pipeline....