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 58 of 62 · Wider ML toolkit

MoE auxiliary losses: balance and router z-loss

Hard

Why can a sparse Transformer need losses beyond token cross-entropy?

Practice choosing loss functions · 10 scenarios ↓

1 · Start with the intuition

A router can send nearly every token to the same expert even while the language-model loss improves. That wastes capacity and overloads communication. A separate issue is the absolute size of router logits, which softmax probabilities alone do not reveal. Balancing and z-loss address these different problems.

2 · How the mechanism works

Mechanism step 1 of 3 · no question to answer

Measure expert traffic

For top-1 routing, compute f_i: the fraction of valid tokens dispatched to expert i; P_i: the mean soft routing probability for i.

Next, we will look at: Add a balancing term. Move on when this operation makes sense.

Visualizing the behavior

Toy dispatch fractions: useful capacity versus collapse

Derived

Balanced dispatch

expert 0
50%
expert 1
50%

Collapsed dispatch

expert 0
100%
expert 1
0%
Illustrative traffic only. Balanced load is a systems target; it does not establish expert quality or replace the language-model objective.