Explore the research collection
2 entries · Follow this search
- Thread
Hand-crafted pretokenizer regexes are part of every frontier LLM and doing heavy lifting (Albert Gu, X thread)
A short illustrated explainer — framed as preparation for an unnamed, undated Cartesia "upcoming release" (pure teaser; nothing about it is verifiable from the thread) — arguing that the regex PRETOKENIZER is the one part of a modern LLM stack still hand-designed rather than learned, and that it does "pretty heavy lifting." Content is a lineage tour of the pretokenizer patterns shipped in well-known public BPE tokenizers, each shown as a screenshot and verified for this entry against the public tokenizer configs (NO errors found): (1) GPT-2's original pattern — contractions case-SENSITIVE and listed individually ('s|'t|'re|'ve|'m|'ll|'d), digits UNGROUPED (\p{N}+). (2) GPT-4 / cl100k_base — contractions become case-insensitive ((?i:…)) and digits are chunked in groups of 1–3 (\p{N}{1,3}) — a deliberate choice with arithmetic consequences (fixed-width digit chunking; a reply in-thread notes left-to-right chunking turns 12345 into 123|45). (3) GPT-4o / o200k_base — the letter branch forks by case (separate uppercase/titlecase-initial and lowercase-initial word patterns), roughly doubling the pattern's complexity; Gu's caption is candid ("honestly i have no idea, something about additional rules around upper/lower case") and the case-handling reading is correct. (4) DeepSeek — the pattern balloons into many script- and punctuation-specific branches, including a dedicated CJK range branch; the screenshot is EXCERPTED (presented without saying so — the full DeepSeek pattern is far longer). Claim hygiene: "part of every frontier LLM" overstates as written — regex pretokenizers are near-universal in the dominant BPE lineage (OpenAI, DeepSeek, Llama-3-style, Qwen, Mistral tiktoken-style), but SentencePiece/Unigram tokenizers and tokenizer-free/byte-level approaches don't use a hand-written regex pretokenizer; read as "every frontier BPE LLM." Post 1's meme regex is an implementation variant (possessive quantifiers, apostrophe-less contraction branch) of the GPT-4-family pattern rather than literally the cl100k pattern shown two posts later — cosmetic, not an error in any captioned claim. A notable unanswered reply asks what regression test catches a silent pretokenizer change that shifts model quality.
- Thread
Dust: Pretraining Transformers Without Backpropagation (QLabs)
First zeroth-order method to pretrain transformers to approach and sometimes exceed backprop with large compute. Key idea: instead of weight-space ES (one forward pass per population member), Dust perturbs activations independently at every token (node perturbation), so each token acts as a virtual population member and one forward pass evaluates thousands of perturbations — a 'virtual population' scaling to large populations by perturbing activations in parallel. 1,000-10,000x more compute-efficient than EGGROLL (SOTA ES method) for training transformers. Results: beats backprop at 100k and 1M tokens, close at 10M and 20M (trend puts Dust's asymptote below backprop at 20M); integrates with Adam. Scientific finding: search in high dimensions gets better with overparameterization — at fixed population size, larger models (up to 120x) reach lower loss; backprop-like gradients emerge from a large population of activation perturbations, with Dust<->backprop gradient alignment holding up to 1B tokens, and Dust's gradients sometimes better. Still far more expensive than backprop; positioned as the 'bitter lesson' for optimization research — zeroth-order methods enabling non-differentiable architectures and better directions than first-order gradients.