Reverse-Engineering Claude's Tokenizer: Smaller Vocab but Higher Inference Cost
kalomaze · x · 2026-08-14
A developer has successfully reverse-engineered and exactly reproduced Anthropic's Claude tokenizer (ctok). The tool accurately matches token counts across 500+ natural languages and 22 programming languages entirely offline.
Key Findings:
- Vocabulary Shrinkage: Claude v3 had an estimated vocabulary of 49,152 entries, but the newer v4.7 (Claude 5) drops to just 15,000 entries (including image tokens).
- The Cost Trade-off: While Claude 5's vocabulary is about 12× smaller than OpenAI's o200k, its token bill is 1.24× to 2.44× larger on identical samples.
- Pricing Impact: Since Claude Opus 5 and GPT-5.6 Sol both charge $5 per million input tokens, the larger token ratio directly translates to higher API costs for Claude users.
More from Models
- Perplexity's Decider models double as rerankers: 27B at $0.02 per 1M tokens — bo_wangbo · 2026-11-30
- DSArena: 779 humans vote on LLM data science agents, Claude Opus 5 tops the leaderboard — PolyUHK · 2026-11-30
- Claude Sonnet-Next reportedly built a Blender scene in 15 minutes, spooking AI watchers — teortaxesTex · 2026-11-30
- Bel-0 Claims First Fully Homomorphic Encryption for an LLM—Slow but Private — Wired AI · 2026-11-30
- Which free local AI model to download for your GPU, from 6GB to 24GB VRAM — alex_verem · 2026-11-30
- NeurIPS paper: buggy baselines hid that SFT-then-RL beats mixed-policy RL by up to +22.2 points — valentina__py · 2026-11-30