Compare Perplexity Fairly Across Models With Different Tokenizers

Last updated: November 29, 2026

Quick Overview

Two language models report token-level perplexity on the same held-out text but use different vocabularies; explain why the numbers are not comparable and convert them to a tokenizer-independent metric.

Google
Machine Learning
Data Scientist
Google
November 29, 2026
Data Scientist
Onsite
Machine Learning
Medium

0

0

0 solved


Two language models report token-level perplexity on the same held-out text but use different vocabularies; explain why the numbers are not comparable and convert them to a tokenizer-independent metric.

Google teams compare internal checkpoints, open models, and multilingual variants whose tokenizers differ, and a naive perplexity table can send a launch decision the wrong way. The interviewer checks that you can derive perplexity from cross-entropy and normalize by a unit that does not depend on tokenization.

What the Interviewer Expects
  • Defines perplexity as the exponential of average negative log-likelihood per token
  • Explains that different tokenizers split the same text into different numbers of tokens
  • Converts to bits per byte or per character by total NLL over a fixed unit
  • Computes a numeric example correctly
  • Notes per-language differences for multilingual models
  • Mentions that perplexity is only one signal for downstream quality
Key Topics to Cover
Perplexity
Cross-entropy
Bits per byte
Tokenization
Language model evaluation
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 might a larger vocabulary raise token perplexity while improving the model?
  • How would you compare on Japanese text where bytes per character differ from English?
  • When is perplexity misleading as a proxy for instruction-following quality?
  • How do you handle documents that exceed the context window during evaluation?
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

Same held-out corpus of 4.2M UTF-8 bytes. Model A uses a 32k vocabulary and splits it into 1.0M tokens with perplexity 8.0. Model B uses a 256k vocabulary, splits it into 0.75M tokens, and reports per...

Approach

Perplexity is exp⁡(1N∑t−log⁡p(xt∣x<t))\exp\left(\frac{1}{N}\sum_t -\log p(x_t \mid x_{<t})\right) where NN is the number of tokens. The sum, total negative log-likelihood of the text, is what we care about: it is the code...


Submit Your Answer
Markdown supported