TL;DR
This paper introduces a "dynamic vocabulary" framework that allows language models to incorporate arbitrary text spans (phrases) as atomic generation blocks on the fly. By bypassing the constraints of traditional static tokenizers, this plug-and-play approach simultaneously boosts text fluency, increases generation diversity, and reduces decoding latency by up to 20%.
What Problem Does This Paper Address?
Standard autoregressive language models rely on a fixed, pre-trained tokenizer (like BPE or WordPiece) that maps text to a static vocabulary. Once set, this vocabulary cannot easily adapt to new domains, handle multi-word technical terms efficiently, or generate exact verbatim references (like inline citations) as single units.
Previous attempts to expand vocabulary dynamically usually split phrases back into individual tokens at the input layer, causing a representation mismatch and slowing down generation. The authors tackle this by treating arbitrary text spans as atomic "bricks" in both the input and output layers without requiring a full retraining of the base language model.
Methods
The authors introduce a framework consisting of three core components:
- Dynamic Phrase Encoder: Instead of fine-tuning the entire language model for every new phrase set, the authors build a lightweight, parametric encoder using a causal Transformer decoder. It maps any arbitrary text span into the existing embedding space of the language model.
- Atomic Input/Output Integration: The expanded vocabulary ($V' = V \cup P$) is seamlessly integrated into both the input and output embedding matrices, allowing the model to read and write phrases in a single decoding step.
- Informative Negative Sampling: Training a model to switch between standard tokens and dynamic phrases introduces decoding ambiguity (e.g., distinguishing the phrase "Mark Ravenhill" from its prefix "Mark" or its continuation "Mark Ravenhill wrote"). The authors introduce a robust training regime using four negative sampling strategies: pre-batch, corpus-retrieval, self-retrieval, and generation-based continuation.
- Alignment Loss: A specialized loss function combines standard language modeling loss with a KL-divergence alignment loss to ensure the model maintains its base generation capabilities while learning to utilize the dynamic phrases.
Datasets
The framework was evaluated across three distinct tasks using the following datasets:
- WikiText-103: Used for evaluating open-ended language generation and basic language modeling performance.
- LawMT: An English-German translation dataset in the legal domain, utilized here to test training-free domain adaptation.
- ASQA: A long-form question-answering dataset used to evaluate the model's ability to generate text with precise, reliable inline citations.
Key Insights and Ideas
- Phrases as First-Class Citizens: Unlike prior work that only used dynamic phrases at the output layer, this method treats phrases as atomic units at both the input and output stages, maximizing sequence compression and generation speed.
- The Ambiguity Trap: Standard in-batch negative sampling fails because the model struggles to transition smoothly between tokens and phrases. Introducing informative negatives (like prefixes and successor tokens) is the secret sauce that makes the phrase encoder learn effectively.
- Interleaving is Key: To prevent the model from becoming heavily biased toward either purely static tokens or purely dynamic phrases, phrases must be carefully interleaved with at least a five-token gap during training.
Key Results
- Efficiency & Quality Boost: On WikiText-103, the dynamic vocabulary model improved the MAUVE score (a metric for human-likeness) by roughly 25% (from 20.47 to 25.69) and reduced generation latency by up to 20% compared to a standard Transformer.
- Zero-Shot Domain Adaptation: When tested on the legal domain (LawMT) using a model trained only on WikiText-103, the plug-and-play dynamic vocabulary outperformed a standard Transformer that was explicitly fine-tuned on the legal data.
- Accurate Citations: In the ASQA question-answering task, the model dramatically improved citation recall (from 0.62 to 9.76) and precision (from 1.54 to 29.30) by treating document-linked phrases as dynamic tokens.
Limitations and Future Work
- Generation-Only Compression: The model does not modify the underlying tokenizer for the initial input prompt or question; it only compresses and accelerates the subsequently generated text.
- Overhead: Running the dynamic phrase encoder introduces additional memory allocation and minor computational overhead during the initial setup phase.
- External Dependencies: The system relies heavily on external tools, such as document retrievers and chunking algorithms, to extract candidate phrases before generation can begin.
Summary updated