Contrast Masked Language Modeling With T5 Span Corruption Pretraining

Last updated: November 29, 2026

Quick Overview

Explain the BERT masked language modeling objective and T5's span corruption objective, compute how much each costs per training example, and discuss what each teaches the model.

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

0

0

0 solved


Explain the BERT masked language modeling objective and T5's span corruption objective, compute how much each costs per training example, and discuss what each teaches the model.

Both objectives came out of Google research, and they still matter for encoder and encoder-decoder models used in Search and Ads. The interviewer checks that you can describe the corruption procedures precisely and reason about sample efficiency and the mismatch between pretraining and downstream use.

What the Interviewer Expects
  • Describes BERT masking with the 80/10/10 replacement scheme
  • Explains the pretrain-finetune mismatch caused by the mask token
  • Describes span corruption with sentinel tokens and short targets
  • Computes sequence lengths and fraction of tokens trained on
  • Compares sample efficiency with next-token prediction
  • Mentions mixtures of denoisers or prefix language modeling as extensions
Key Topics to Cover
Masked language modeling
Span corruption
T5
BERT
Pretraining objectives
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
  • Why does BERT replace some selected tokens with random words instead of the mask token?
  • How does mean span length change difficulty and compute?
  • Why does next-token prediction use the data more efficiently per step?
  • How would you adapt span corruption for code?
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

Input: a 512-token passage. I will describe each corruption procedure, what the model predicts, and how many tokens provide training signal per example....

Approach

BERT MLM: pick 15% of positions; of those, replace 80% with [MASK], 10% with a random token, 10% unchanged; predict the original token at those positions using bidirectional context. T5 span corrupt...


Submit Your Answer
Markdown supported