TensoriumInterview preparation
← Home

Core concepts · 62 topics

A guided path through the ideas behind modern LLMs.

Read the stages in order: how text becomes a prediction, what happens inside the Transformer block, how a model learns, then serving, scale, and post-training. Every topic names what to know first, then gives the intuition, the math with concrete numbers, the common misconception, and a self-check. Already comfortable with the basics? Switch to By area and jump straight to a topic.

New to machine learning? Start here instead.

These topics work best as a refresher; they assume ideas like probability and loss. Begin with three short beginner lessons (tokens, embeddings, next-token prediction), then the visual walkthrough for attention and the Transformer.

Finish line: You can explain how text becomes a prediction and what training does to improve that prediction.

Topic 02 of 62 · Text in, prediction out

Vocabulary size and tokenizer fertility

Easy

What are the systems and modeling trade-offs of increasing vocabulary size (say from 32K to 128K+)?

Why this mattersVocabulary size trades sequence compression against embedding parameters and output-logit memory—often making the final logit tensor the largest single activation in training.

1 · Start with the intuition

Making the vocabulary larger packs more characters into each token (lowering **fertility**, the average number of tokens per word). Shorter token sequences mean faster prefill, fewer decode steps to generate the same text, and more real content fitting inside a fixed context window—especially for code and non-English languages. The price you pay is in memory and tail-token sparsity: the input embedding and output LM head matrices grow as `V × d`, the output logit tensor `[B, T, V]` becomes a massive activation in training, and rare tokens in a huge vocabulary get fewer gradient updates.

2 · How the mechanism works

Mechanism step 1 of 3 · no question to answer

Measure compression (fertility)

Compute tokens-per-word or bytes-per-token across every target language and code domain.

Next, we will look at: Budget embedding + LM head weights. Move on when this operation makes sense.

Visualizing the behavior

Parameters in one V × d matrix at d = 4,096

Derived
V = 32,000
131M
V = 50,257
206M
V = 128,256
525M
V = 262,144
1.07B
Double these values for untied input and output matrices. For a 1B-parameter model, a 256K vocabulary alone would be the size of the rest of the network.