TL;DR
Generalist large language models (LLMs) struggle with specialized medical and legal text because their tokenizers chop domain-specific jargon into meaningless subword fragments. This paper introduces VOCABADAPT, a parameter-efficient method that recycles "glitch tokens" (undertrained or unreachable vocabulary slots) and replaces them with domain-specific terms. This approach slashes training time by 35–55% and reduces parameter overhead by up to 37% while generating more coherent, faithful, and relevant summaries.
What Problem Does This Paper Address?
When you feed a highly specialized term like "Osteoporosis" into a standard LLM tokenizer, it often gets fragmented into pieces like ["O", "ste", "opor", "osis"]. This over-fragmentation forces the model to waste context window space and compute power just to piece basic semantic concepts back together.
While standard domain-adaptive pretraining (DAPT) helps models learn domain concepts, it leaves this underlying tokenization mismatch completely untouched. Simply expanding the vocabulary by appending thousands of new tokens introduces massive parameter overhead in the model's embedding and unembedding layers. The authors tackle a critical efficiency bottleneck: How can we adapt an LLM's vocabulary to highly specialized domains without blowing up the model's size and training costs?
Methods
The authors propose VOCABADAPT, a hybrid "replace-then-expand" strategy consisting of four main steps:
- Domain Vocabulary Extraction: Train a new Byte-Pair Encoding (BPE) tokenizer on a target domain corpus to identify the top 10,000 high-frequency, purely alphabetic domain tokens.
- Identifying Glitch Tokens: Locate useless tokens in the base model's vocabulary. These include undertrained tokens (identified by low $L_2$ embedding norms) and unreachable tokens (tokens that fail a round-trip consistency test, meaning
encode(decode(token_id)) != token_id). - Tokenizer Integrity Filtering: Filter out candidate replacement tokens if removing them would break existing BPE merge rules for other valid tokens.
- Replacement & Expansion: Replace the filtered glitch tokens with the new domain tokens first. If the domain vocabulary requirements exceed the available glitch slots, only then expand the vocabulary size.
New token embeddings are initialized using subword aggregation (taking the mean of their constituent subword embeddings from the base model) and fine-tuned using Low-Rank Adaptation (LoRA) during a brief continual pretraining phase.
Datasets
The framework was evaluated across two highly specialized domains:
- Medical Domain: MultiClinSumm (clinical case reports), Evidence-Based Summarization (EBM), and Patient Healthcare Query Summarization (CHQ).
- Legal Domain: IN-ABS (abstractive summarization of Indian Supreme Court case judgments).
To rigorously test the models, the authors restructured these datasets into challenge subsets: OOV_SD (high out-of-vocabulary concentration in source documents) and OOV_RS (high OOV concentration in reference summaries).
Key Insights and Ideas
- LLMs carry dead weight in their vocabularies: Modern LLMs contain roughly 3–4% "glitch tokens" that are either undertrained or completely unreachable during normal inference. Recycling these slots is essentially a "free lunch" for parameter efficiency.
- Source vs. Target OOV impacts models differently: High OOV in source documents (OOV_SD) hurts the model's ability to understand context due to fragmented attention. High OOV in reference summaries (OOV_RS) hurts lexical realization (the model struggles to output the exact right technical terms).
- Better tokens unlock higher abstraction: Models with adapted vocabularies generate more novel unigrams (meaningful words not present in the source text but highly relevant to the summary). This shows that proper tokenization allows the model to synthesize concepts rather than just copy-pasting text.
Key Results
- Faster Convergence: VOCABADAPT allowed models (Llama-3.1-8B and Qwen2.5-7B) to reach peak performance 35–55% earlier in training steps compared to standard continual pretraining without vocabulary adaptation.
- Parameter Savings: The replacement strategy reduced parameter growth by 12.04% for Llama and 37.19% for Qwen compared to expansion-only baselines.
- Performance Gains: The method consistently brought down fragment scores (average subwords per word) by up to 16% in medical domains, leading to higher ROUGE-LCS and BERTScore metrics.
- Beating Closed-Source Giants: An 8B model optimized with VOCABADAPT consistently outperformed a zero-shot GPT-5-mini on both medical and legal summarization tasks.
Limitations and Future Work
- Fixed Corpus and Vocabulary Sizes: The pretraining corpora size was fixed at 100M tokens, and the vocabulary expansion size was rigidly set to 10K tokens based purely on frequency. More sophisticated selection methods could optimize this subset further.
- Model Scope: The study was limited to Llama-3.1 and Qwen2.5, which already possess large vocabularies. The authors note that exploring the efficacy of these strategies on models with tighter vocabulary constraints (like Microsoft Phi) remains an open area for future work.
Summary updated