Learned Embeddings
P10.text-representation.06 · Audience: guest, it-ml, language-pro · Prerequisites: Embeddings
From a masked token to a weight update — watching gradient descent teach the embedding table, one BERT-style training step traced end to end.
🗣️ From a linguist's perspective: why context changes meaning
ⓘ Concept: Two paradigms
Why it matters — The leap from static (T2) to learned + contextual is the leap from LSA-era NLP to BERT and GPT.
Reference: Devlin et al. 2018 — BERT
Computing…
🎓 Interview deep-dive
BERT vs GPT pretraining. BERT masks 15% of tokens (with the 80/10/10 trick: 80% [MASK], 10% random token, 10% unchanged) and predicts them bidirectionally; GPT predicts every next token left-to-right. GPT's objective yields a loss signal at every position (dense), BERT's only at masked ones (sparse) — one reason autoregressive scaling proved so effective. This page's variant feeds the true token (CBOW-with-attention) so the gradient reaches the true row directly — same dynamic, no special-token bookkeeping.
📚 Go further
- Devlin et al. 2018 — BERT
- Jay Alammar — The Illustrated BERT
- Andrej Karpathy — Let's build GPT
Check your understanding
What three components sum to form the BERT input embedding?
Why does dL/dlogits sum to exactly zero?
What happens to the update if you raise the learning rate from 0.01 to 0.5?
Ask the mentor about this module
Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.
Try it yourself
A scratch console for this page's ideas — ungraded, nothing you run here is recorded.
Scratch console
A scratch console with the scientific stack (pandas, numpy, scikit-learn). Runs on the server — no network, resource-limited and measured.
Output appears here.
Where next?
Go up a level