Live Server-Side Inference • Step-by-step walkthrough on how the model fills the [MASK] word
Pre-loading BERT-Base (~65MB)...
๐ก Instruction: Type a sentence within 70 chars (to enter mask just press Enter or click the ghost tag) or choose from Preset examples.Auto-Complete Enabled
Input:
๐ฏ
Ready to trace the [MASK] embedding
Click "Run BERT-Base" above to tokenize your input, extract 768-dimensional vectors, and watch self-attention resolve the missing context in real time.
Stage 1 • Layer 0
Tokenization & Static Initial Embedding
Vector Shape: [1, 768]
The sentence is split into WordPiece tokens. At Layer 0, the [MASK] token gets a static initial vector with zero contextual knowledge.
Layer 12: Final semantic lock matching vocabulary dictionaryTarget Locked โ
Stage 5 • The Climax (Layer 12 Output)
LM Head: Dot-Product Vocabulary Matching
30,522 Vocab Matrix
The [MASK] embedding vector has physically shifted through high-dimensional space. We now compute its dot product (h_mask • E_vocab) against every word in BERT's vocabulary dictionary. Higher geometric similarity equals a higher raw logit score.
๐ก What is a logit? A logit is the raw prediction score that BERT assigns to each word in its vocabulary before converting the scores into probabilities using Softmax.
Rank
Candidate Token
Vector Alignment (Dot Product Visualization)
Raw Logit Score (zi)
Stage 6 • Mathematical Resolution
Softmax Calculation: Logits to Probabilities
P(xi) = ezi / ∑ ezj
Converting unbounded logits into confidence percentages summing to 100% using Softmax.
Candidate
Step 1: Logit (z)
Step 2: Exp (ez)
Step 3: Division (∑ ez)
Confidence %
Denominator (∑ ez):Calculating...
Resolved [MASK] Prediction
--
The uncontextualized vector successfully navigated 12 layers, aligned its dimensions with the vocabulary matrix, and resolved the missing word!