Main Point
A token ID selects a learned vector. Model computation then uses context and position to produce hidden states for the supplied input; a retrieval representation serves its own defined task.
Key Points
- Vocabulary size counts possible token entries; embedding dimension counts coordinates per entry.
- A fixed token ID can select the same input row while later contextual states differ.
- Sequence order matters, and architecture determines how position enters the computation.
- Coordinates do not automatically carry simple human labels.
- An internal token state and a sentence/document retrieval vector have different roles and evaluation needs.
1. Follow the lookup
Our supplied classroom tokenizer represents `bank` as 1 token with ID 417 in both “Sit beside the river bank” and “Deposit money at the bank.” These are teaching inputs; no model run is reported. The identifier selects a row in an embedding table. The selected row contains learned numerical coordinates.
| Selected classroom row | Token | Supplied vector |
|---|---|---|
| 416 | garden | (-0.6, 0.1, 0.3) |
| 417 | bank | (0.2, -0.4, 0.7) |
| 903 | believ | (0.5, 0.8, -0.2) |
Only selected rows are shown. The gap between row labels does not specify missing rows or semantic distance. ID 417 chooses `(0.2, -0.4, 0.7)` under these rules. The 3 coordinates are an ordered vector; none has been assigned the literal label “river” or “finance.”
2. Calculate the table's size
A simple table with 50,000 vocabulary entries and 1,000 coordinates per entry contains:
`50,000 × 1,000 = 50,000,000 scalar entries`.
The 50,000 is the row count; 1,000 is the number of coordinates in each row. This counts the specified embedding matrix. It excludes other model transformations and says nothing by itself about runtime memory. A diagram of 1 selected row must not be mistaken for the whole vocabulary or the full model.
3. Follow a representation through context
Keep the checkpoint and token ID fixed. The initial `bank` embedding can be identical in the 2 sentences, while later model computation incorporates their surroundings and yields different hidden states. A hidden state is an intermediate representation produced in that computation. It can change when the input changes without implying a permanent parameter update.
Information is distributed across coordinates and transformations. Finding a useful pattern does not justify treating every coordinate as a named concept. An interpretation claim needs evidence about the representation and method being studied.
4. Preserve order and inspect an actual architecture
“The dog chased the cat” and “The cat chased the dog” use the same words in different relationships. Position information helps distinguish their sequence order. Its implementation is part of the architecture.
Devlin and colleagues' BERT preprint appeared on 11 October 2018; the paper was published at NAACL in June 2019. It combines token, segment and position embeddings at input and uses a bidirectional encoder. The segment component marks which input text span a token belongs to. Its input construction and subsequent contextual states are distinct stages. This historical mechanism gives an inspectable example; causal generation will impose a different information boundary later in the course.
5. Choose the representation for its job
A query about erosion should retrieve the river document; a query about loan interest should retrieve the financial document. A sentence/document representation and comparison rule need evaluation for that retrieval task. An internal state at 1 `bank` token represents a different object in a different computation. Pooling, training objective, input unit and similarity rule can affect what is useful. Keep those choices explicit rather than assuming any available vector is suitable.
6. Closing
You can now trace an ID into its learned row, distinguish table axes, and explain how order and context enter later computation. You can also ask whether a vector represents a token or a whole retrieval item. The next lesson separates persistent learned values from values computed during a request.
7. Learning Checks
Attempt the questions before opening the explanations. Keep the separate worksheet blank during your attempt.
M14-L03-Q01
In our supplied classroom example, ID 417 selects the same initial `bank` row for 2 different sentences under the same checkpoint. Must the final hidden state also be identical? What does a 50,000 × 1,000 embedding table contain, and what does each axis count?
Your explanation and calculation: ____________________
Show explanation after your attempt
The initial lookup can match while later hidden states differ because context and position participate in subsequent computation. The table has 50,000 token entries with 1,000 coordinates each: 50,000,000 scalar values. This counts the defined embedding matrix rather than all model parameters or runtime state.
M14-L03-P01
A simple embedding table has 30,000 entries and 512 coordinates per entry. Calculate its scalar-entry count. A colleague claims ID 418 must be semantically closer to ID 417 than to ID 900. What would you need to investigate that claim?
Your calculation and evidence plan: ____________________
Show explanation after your attempt
The product is 15,360,000 scalar entries in this matrix. Numeric proximity of IDs establishes no semantic distance. Identify actual learned representations, a comparison rule and the relevant task, then test the relationship. The identifiers alone provide no such measurement.
Sources
- Devlin, Jacob; Chang, Ming-Wei; Lee, Kenton; Toutanova, Kristina. *BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding*. Google AI Language; NAACL-HLT, June 2019, pp. 4171–4186. Primary paper, model architecture and Input/Output Representations, Figure 2. Preprint history: submitted 11 October 2018, v2 revised 24 May 2019. Retrieved 30 October 2026. Used for the historical architecture mechanism, with no current model ranking or classroom test result claimed.