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

Binary and multi-label loss: BCE with logits

Easy

When should a Transformer head use binary cross-entropy instead of softmax cross-entropy?

Practice choosing loss functions · 10 scenarios ↓

1 · Start with the intuition

First ask whether the answers exclude one another. A next token is one choice from a vocabulary, so softmax makes sense. A document can be both “finance” and “legal”, so its labels should not compete for a single unit of probability. Give each label a separate Bernoulli prediction.

2 · How the mechanism works

Mechanism step 1 of 3 · no question to answer

Match the target structure

Use categorical CE for one of C classes. Use BCE for a binary decision or C independent multi-label decisions.

Next, we will look at: Pass raw logits. Move on when this operation makes sense.

Visualizing the behavior

Three independent label probabilities, not one distribution

Derived

Target labels [1,0,1]

finance: yes
0.80
sports: no
0.20
legal: yes
0.70
All three sigmoid outputs are independent decisions. There is no requirement for the bars to sum to one.