Issue 11, Oct 26, 2026

The Causal Mask Leak

Senior ML Engineer interview at Google, and the interviewer asks:

“Your autoregressive model hits a suspiciously low training loss, but every generation is garbage. What’s the first thing you check in attention? And how can a −inf mask vs. a ‘large negative’ mask still give you NaNs or leaks under mixed precision?”

Don’t say: “Make sure the causal mask is applied with torch.triu and filled with −inf.”

Why low training loss and garbage generation mean your transformer is secretly reading the future and how FP16 precision quietly turns safe masks into NaNs or silent leaks.

Share this trapShare on LinkedIn

The full answer, with the mechanism and the arithmetic, is for paid subscribers on Substack.

Read it on Substack

Get the next one

Free on Substack. Unsubscribe in one click.

More traps set at Google