zip2zip: Inference-Time Adaptive Tokenization via Online Compression
Not on the map. Why?
Abstract (arXiv)
Tokenization efficiency plays a critical role in the performance and cost of large language models (LLMs), yet most models rely on static tokenizers optimized on general-purpose corpora. These tokenizers' fixed vocabularies often fail to adapt to domain- or language-specific inputs, leading to longer token sequences and higher computational costs. We introduce zip2zip, a novel method for achieving context-adaptive tokenization in LLMs at inference time. Leveraging an online data compression algorithm (Lempel-Ziv-Welch), zip2zip dynamically expands its active vocabulary at inference time by continuously replacing fragmented token sequences with more compact hypertokens, which it can immediately output during generation. In doing so, the model refines its internal tokenization scheme to match the token distribution of the current context, reducing redundancy and improving representational efficiency. zip2zip consists of three key components: (1) a tokenizer based on Lempel-Ziv-Welch compression that incrementally merges co-occurring tokens into reusable hypertokens on the fly; (2) a dynamic embedding (and unembedding) layer that computes embeddings for newly formed hypertokens at runtime; and (3) a variant of autoregressive language modeling that pretrains the model to handle hypertokenized, compressed text sequences as inputs and outputs. We show that an existing LLM can be uptrained for zip2zip in 10 GPU-hours via parameter-efficient finetuning. The resulting LLM performs test-time adaptation, learning to use hypertokens in unseen contexts and reducing input and output tokens by 15-40%.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 49 of its 60 references that are in the map. First posted on arXiv 1 Jun 2025.
Builds on
49 of 60 references.
References · 49
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2014Sequence to Sequence Learning with Neural Networkscited by 2,986
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,883
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,592
37 more
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,164
- 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 992
- 2023Enhancing Chat Language Models by Scaling High-quality Instructional Conversationscited by 839
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2023Capabilities of GPT-4 on Medical Challenge Problemscited by 638
- 2023Learning to Compress Prompts with Gist Tokenscited by 390
- 2023Adapting Language Models to Compress Contextscited by 356
- 2023Language Model Tokenizers Introduce Unfairness Between Languagescited by 214
- 2019WinoGrande: An Adversarial Winograd Schema Challenge at Scalecited by 204
- 2023In-context Autoencoder for Context Compression in a Large Language Modelcited by 199
- 2023Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Modelscited by 192
- 2023Compressing Context to Enhance Inference Efficiency of Large Language Modelscited by 189
- 2023MEGABYTE: Predicting Million-byte Sequences with Multiscale Transformerscited by 170
- 2024Byte Latent Transformer: Patches Scale Better Than Tokenscited by 146
- 2024Tokenization counts: the impact of tokenization on arithmetic in frontier LLMscited by 115
- 2021Hierarchical Transformers Are More Efficient Language Modelscited by 102
- 2022Prompt Compression and Contrastive Conditioning for Controllability and Toxicity Reduction in Language Modelscited by 97
- 2023XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Modelscited by 88
- 2022Efficient Transformers with Dynamic Token Poolingcited by 76
- 2024Getting the most out of your tokenizer for pre-training and domain adaptationcited by 66
- 2025SuperBPE: Space Travel for Language Modelscited by 63
- 2023Paloma: A Benchmark for Evaluating Language Model Fitcited by 54
- 2024SpaceByte: Towards Deleting Tokenization from Large Language Modelingcited by 34
- 2024Zero-Shot Tokenizer Transfercited by 31
- 2019Improving Pre-Trained Multilingual Models with Vocabulary Expansioncited by 28
- 2023Task-Adaptive Tokenization: Enhancing Long-Form Text Generation Efficacy in Mental Health and Beyondcited by 23
- 2025CAT: Content-Adaptive Image Tokenizationcited by 21
- 2024Multi-word Tokenization for Sequence Compressioncited by 17
- 2024Training LLMs over Neurally Compressed Textcited by 17
- 2024Retrofitting Large Language Models with Dynamic Tokenizationcited by 16
- 2024Efficient and Effective Vocabulary Expansion Towards Multilingual Large Language Modelscited by 15
- 2024Gold Panning in Vocabulary: An Adaptive Method for Vocabulary Expansion of Domain-Specific LLMscited by 12
- 2023Learn Your Tokens: Word-Pooled Tokenization for Language Modelingcited by 8
- 2023Toucan: Token-Aware Character Level Language Modelingcited by 8
- 2024Generation with Dynamic Vocabularycited by 6
- 2025Overcoming Vocabulary Constraints with Pixel-level Fallbackcited by 6
Built on by
Citing papers per year: 2025: 2; 2026: 3.
5 papers.
- 2025Memory-Augmented Transformers: A Systematic Review from Neuroscience Principles to Enhanced Model Architecturescited by 9
- 2025Bolmo: Byteifying the Next Generation of Language Modelscited by 9
- 2026Proxy Compression for Language Modelingcited by 3
- 2026Distilling Sequential Computation in Transformer Language Modelscited by 0
- 2026zip2zip++: Towards Inference-Time Token Compression with Minimal Quality Losscited by 0
- 2026zip2zip++: Towards Inference-Time Token Compression with Minimal Quality Loss9 Oct 2026
- 2026Distilling Sequential Computation in Transformer Language Models23 Sep 2026
- 2026Proxy Compression for Language Modeling4 Feb 2026
- 2025Bolmo: Byteifying the Next Generation of Language Models17 Dec 2025
- 2025Memory-Augmented Transformers: A Systematic Review from Neuroscience Principles to Enhanced Model Architectures14 Aug 2025