For a genomics tokenizer with a 4-character DNA alphabet, what vocabulary size range is likely sufficient?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
DNA's four-letter alphabet yields at most 4^6 = 4,096 useful 6-mers, so a 4k-8k vocabulary covers the meaningful patterns without wasting embedding rows.
Imagine a language that only ever uses four letters: A, C, G, and T. If you try to build a dictionary of useful 'words' from those letters, the longest ones that carry real meaning are about six letters long, and there are only 4 × 4 × 4 × 4 × 4 × 4 = 4,096 of those. Now imagine ordering a 100,000-word dictionary for a language that can only ever make a few thousand words. Almost every page would stay blank forever. Picking a 4,000 to 8,000 word dictionary instead fits the language exactly: enough room for every useful pattern, and almost no wasted pages.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
2 min: four-letter alphabet + 4^k k-mer count + 6-mer ceiling at 4,096 + 4k-8k target + wasted rows at 100k + protein analogy.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Copying NLP vocabulary sizes of 50k-100k onto a four-letter alphabet, which leaves over 90% of the embedding table permanently empty and untrained.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.