Zubnet AIसीखेंWiki › Vocabulary
मूल सिद्धांत

Vocabulary

Vocab, Token Vocabulary
Tokens का fixed set जिसे एक model recognize और produce कर सकता है। एक vocabulary training के दौरान tokenizer द्वारा build होती है और typically 32K से 128K entries contain करती है — common words, subword fragments, individual characters, और special tokens। Model जो भी text process करता है उसे इस vocabulary के tokens की sequence के रूप में expressible होना चाहिए। Vocabulary में नहीं वो tokens smaller pieces में break होते हैं जो हैं।

यह क्यों matter करता है

Vocabulary determine करती है कि model क्या “देख” सकता है। ज़्यादातर English पर trained एक vocabulary English को efficiently handle करेगी (per word एक token) लेकिन Chinese, Arabic, या code को कई small tokens में fragment कर सकती है (expensive, slower, less context)। Vocabulary design model development में सबसे consequential और सबसे कम discussed decisions में से एक है।

Deep Dive

Building a vocabulary: the tokenizer algorithm (usually BPE) starts with individual bytes or characters and iteratively merges the most frequent pairs. After 32K–128K merges, you have a vocabulary where common words are single tokens ("the," "and," "function") and rare words are split into subword pieces ("un" + "common," "pre" + "process" + "ing"). Special tokens like <BOS> (beginning of sequence), <EOS> (end), and <PAD> (padding) are added explicitly.

The Size Trade-off

Larger vocabularies compress text better (fewer tokens per sentence = cheaper, fits more in context) but increase the model's embedding table size. A 128K vocabulary with 4096-dimensional embeddings adds ~500M parameters just for the token tables. For a 7B model, that's 7% of total parameters doing nothing but mapping tokens to vectors. For a 1B model, it would be 50%. This is why smaller models tend to use smaller vocabularies.

Multilingual Vocabulary

A vocabulary's language coverage depends on its training corpus. Llama's early tokenizer was trained predominantly on English and represented Chinese characters as 3–4 tokens each, making Chinese inference 3–4x more expensive than English. Llama 3's tokenizer was trained on more balanced multilingual data, dramatically improving non-English efficiency. This is a solvable problem, but it requires deliberate effort — the default is English-dominant.

संबंधित अवधारणाएँ

← सभी Terms
← vLLM Voice AI →