Explain bfloat16 Mixed-Precision Training on TPUs and Its Failure Modes

Last updated: November 29, 2026

Quick Overview

Explain why TPU training uses bfloat16, what must stay in float32, and demonstrate with a small example why keeping the weights themselves in bfloat16 silently stops learning.

Google
Machine Learning
Machine Learning Engineer
Google
November 29, 2026
Machine Learning Engineer
Technical Screen
Machine Learning
Medium

0

0

0 solved


Explain why TPU training uses bfloat16, what must stay in float32, and demonstrate with a small example why keeping the weights themselves in bfloat16 silently stops learning.

bfloat16 was designed at Google for TPUs, so Google interviewers expect candidates to know the format and its practical rules rather than generic fp16 advice. They check exponent versus mantissa reasoning, which tensors need float32, and how precision bugs show up in a run.

What the Interviewer Expects
  • Compares bit layouts of float32, float16, and bfloat16
  • Explains why bfloat16 usually needs no loss scaling while float16 does
  • Identifies master weights, optimizer moments, and reductions as float32
  • Shows that small updates are lost when added to bfloat16 weights
  • Mentions stochastic rounding or Kahan summation as alternatives
  • Describes symptoms of precision problems in training curves
Key Topics to Cover
bfloat16
Mixed precision
TPUs
Numerical precision
Optimizer state
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • Where exactly should the softmax and layer norm computations run in float32?
  • How does stochastic rounding make pure bfloat16 training viable?
  • What changes with 8-bit floating-point formats for matmuls?
  • How would you test a model for precision sensitivity before a big run?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Formats: float32 has 8 exponent bits and 23 mantissa bits; float16 has 5 and 10; bfloat16 has 8 and 7. The question is why bfloat16 is the TPU default, what precision each tensor should use, and what ...

Approach

bfloat16 keeps float32's exponent range (about 10−3810^{-38} to 103810^{38}), so gradients and activations rarely overflow or underflow, which is why it typically needs no loss scaling, unlike float16 whos...


Submit Your Answer
Markdown supported