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 16 of 62 · Inside the Transformer block

Mixture of Experts

Medium

How does a sparse MoE layer increase model capacity without using every parameter on every token?

Why this mattersFrontier models use sparse MoE to scale parameter capacity without scaling per-token FLOPs at the same rate—shifting the bottleneck to memory capacity, routing balance, and all-to-all communication.

1 · Start with the intuition

Suppose we want more parameters, but cannot afford to run every token through a much larger feed-forward network. Could we keep several networks and choose only a few for each token? That is the sparse MoE idea. A learned router chooses k experts from a bank of E, and we combine their outputs. We have increased the parameters available to the model without activating all of them for every token.

2 · How the mechanism works

Mechanism step 1 of 3 · no question to answer

Score & select top-k

The router projects the token’s hidden state to E logits and picks the k highest-scoring experts.

Next, we will look at: Dispatch to active experts. Move on when this operation makes sense.

Visualizing the behavior

One token’s routing decision (8 experts, top-2)

Illustrative

Router softmax

expert 1
0.05
expert 2
0.32
expert 3
0.08
expert 4
0.04
expert 5
0.21
expert 6
0.12
expert 7
0.10
expert 8
0.08

Top-2 weights renormalized (0.32 / 0.53, 0.21 / 0.53)

expert 2
0.604
expert 5
0.396
Only experts 2 and 5 run for this token, and their outputs are summed with these weights. Whether and how weights are renormalized depends on the architecture.

Stored vs active parameters (toy layer from the example)

Derived
Stored in memory1000 M
200
800
Active per token (top-2)400 M
200
200
  • Shared parameters
  • Expert parameters
Compute follows the active row; memory follows the stored row. Every expert must still be resident somewhere.