Three Words, Fifty Thousand Slots

Sequential DataMedium+20 XP+20

Three Words, Fifty Thousand Slots

A tokenizer with a vocabulary of V=50,000V = 50{,}000V=50,000 has handed out these IDs:

tokenID
cat412
car411
dog87

Each token is then one-hot encoded: a vector of length 50,00050{,}00050,000 that is 000 everywhere except for a single 111 at the position given by its ID. Call these vectors ccat\mathbf{c}_{\text{cat}}ccat​, ccar\mathbf{c}_{\text{car}}ccar​ and cdog\mathbf{c}_{\text{dog}}cdog​.

The straight-line (Euclidean) distance between two vectors is

∥u−v∥=∑i=1V(ui−vi)2\lVert \mathbf{u} - \mathbf{v} \rVert = \sqrt{\sum_{i=1}^{V} (u_i - v_i)^2}∥u−v∥=∑i=1V​(ui​−vi​)2​

What are the two distances ∥ccat−ccar∥\lVert \mathbf{c}_{\text{cat}} - \mathbf{c}_{\text{car}} \rVert∥ccat​−ccar​∥ and ∥ccat−cdog∥\lVert \mathbf{c}_{\text{cat}} - \mathbf{c}_{\text{dog}} \rVert∥ccat​−cdog​∥?

1
0
0
0
0

One-hot encoding: a list as long as the vocabulary, with a single 1 in this word's slot. Exactly the one-hot targets you met with cross-entropy.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.

Select all that apply.