HomeLearnCoursesHackathonsAccount
NLP Fundamentals
From Arbitrary Symbols to Embeddings · 1/2

The problem with treating words as IDs

Once text is split into tokens, a computer needs to represent each one as numbers. The simplest approach is to assign every unique word an arbitrary ID: 'king' is 482, 'queen' is 1917, 'banana' is 55. This works in the sense that a program can now handle the data, but it throws away everything useful about the words themselves. To a model looking only at these IDs, 482 and 1917 are no more related to each other than 482 and 55 are. There's no built-in sense that 'king' and 'queen' share royalty, gender pairing, or any relationship at all, the numbers are just labels.

This matters because most useful language tasks depend on recognizing that words relate to each other in structured ways. A model that can't tell 'king' is closer in meaning to 'queen' than to 'banana' has no foundation for tasks like judging similarity, filling in a blank sensibly, or generalizing from one sentence to a similar one it has never seen. Arbitrary IDs give a model vocabulary, but not meaning.