Abstract
Training Large Language Models (LLMs) is computationally expensive, largely due to the massive volume of tokens in training datasets. We present MultiTok, a novel tokenization method inspired by Lempel-Ziv-Welch (LZW) compression. MultiTok identifies and encodes repetitive multi-word phrases as single, variable-length tokens. Our evaluation shows that MultiTok can reduce data volume by up to 33% and accelerate training by up to 2.5x while maintaining accuracy competitive with standard tokenizers like BERT and GPT-2.
Introduction
The primary bottleneck in training LLMs is the sheer quantity of data the model must process. Current tokenization schemes, such as Byte Pair Encoding (BPE), break text into sub-word units but often fail to fully exploit higher-level repetitive patterns. By representing common multi-word sequences as single tokens, we can significantly shorten input sequences, thereby reducing the total computational work required per training epoch.
Methods: The MultiTok Framework
MultiTok leverages the principles of LZW compression to build a dynamic dictionary of variable-length tokens.
- Dictionary Construction: The algorithm scans the training corpus using a look-ahead window to identify the longest known sequences. New sequences are iteratively added to the dictionary.
- Frequency-Based Pruning: To ensure the model learns robust embeddings, MultiTok employs a pruning step. Tokens that appear too infrequently are decomposed into their constituent parts. This prevents the "rare token" problem, where the model fails to learn meaningful representations for unique phrases.
- Cascaded Integration: MultiTok can function as a standalone tokenizer or as a secondary compression layer applied on top of existing outputs from BERT or GPT-2 tokenizers.
Experimental Evaluation
We evaluated MultiTok across three text classification benchmarks: IMDB, sst2, and AG-News. To isolate the impact of tokenization, models were trained using random vector embeddings.
Key Results
- Training Speedup: MultiTok-based models converged significantly faster. As shown in our analysis, configurations like
MultiTok-100%, 2-2, <2reduced the average training time from 20 epochs to just 8 epochs—a 2.5x speedup. - Data Compression: MultiTok achieved a compression ratio as low as 0.57, representing a 43% reduction in the total number of tokens compared to uncompressed text.
- Accuracy Benchmarks: On the IMDB dataset, MultiTok achieved an accuracy of 0.743, outperforming the BERT baseline (0.738) despite the reduced sequence length.
Discussion and Future Work
MultiTok demonstrates that sequence length is a critical driver of training efficiency. By bridging data compression and deep learning, we show that more efficient data representation leads to more efficient learning.
Current limitations include a focus on discriminative tasks (classification) rather than generative ones. Future research will explore MultiTok's performance in generative LLM contexts and its interaction with pre-trained embeddings. Additionally, the LZW-inspired approach holds potential for other data modalities, such as video, where temporal redundancy is high.
Summary updated