Table of Contents
Fetching ...

When Every Token Counts: Optimal Segmentation for Low-Resource Language Models

Bharath Raj, Garvit Suri, Vikrant Dewangan, Raghav Sonavane

TL;DR

The paper tackles tokenization inefficiency in low-resource languages by proposing an optimal BPE segmentation algorithm that reduces token counts and improves downstream performance, especially for smaller models. It formalizes optimal segmentation via dynamic programming and a reversed-token Trie, and introduces the Token Saving Ratio to quantify gains. Experimental results show consistent token-count reductions (TSR) across languages, with notable improvements in non-English tasks and minimal or positive impact on English perplexity. The work highlights a practical path toward more inclusive NLP, suggesting tokenization-aware strategies as a lever for performance gains in multilingual, low-resource settings.

Abstract

Traditional greedy tokenization methods have been a critical step in Natural Language Processing (NLP), influencing how text is converted into tokens and directly impacting model performance. While subword tokenizers like Byte-Pair Encoding (BPE) are widely used, questions remain about their optimality across model scales and languages. In this work, we demonstrate through extensive experiments that an optimal BPE configuration significantly reduces token count compared to greedy segmentation, yielding improvements in token-saving percentages and performance benefits, particularly for smaller models. We evaluate tokenization performance across various intrinsic and extrinsic tasks, including generation and classification. Our findings suggest that compression-optimized tokenization strategies could provide substantial advantages for multilingual and low-resource language applications, highlighting a promising direction for further research and inclusive NLP.

When Every Token Counts: Optimal Segmentation for Low-Resource Language Models

TL;DR

The paper tackles tokenization inefficiency in low-resource languages by proposing an optimal BPE segmentation algorithm that reduces token counts and improves downstream performance, especially for smaller models. It formalizes optimal segmentation via dynamic programming and a reversed-token Trie, and introduces the Token Saving Ratio to quantify gains. Experimental results show consistent token-count reductions (TSR) across languages, with notable improvements in non-English tasks and minimal or positive impact on English perplexity. The work highlights a practical path toward more inclusive NLP, suggesting tokenization-aware strategies as a lever for performance gains in multilingual, low-resource settings.

Abstract

Traditional greedy tokenization methods have been a critical step in Natural Language Processing (NLP), influencing how text is converted into tokens and directly impacting model performance. While subword tokenizers like Byte-Pair Encoding (BPE) are widely used, questions remain about their optimality across model scales and languages. In this work, we demonstrate through extensive experiments that an optimal BPE configuration significantly reduces token count compared to greedy segmentation, yielding improvements in token-saving percentages and performance benefits, particularly for smaller models. We evaluate tokenization performance across various intrinsic and extrinsic tasks, including generation and classification. Our findings suggest that compression-optimized tokenization strategies could provide substantial advantages for multilingual and low-resource language applications, highlighting a promising direction for further research and inclusive NLP.

Paper Structure

This paper contains 25 sections, 10 equations, 3 figures, 9 tables, 1 algorithm.

Figures (3)

  • Figure 1: TSR and Word length correlation across seven different languages, with Vocab. size $m=100K$.
  • Figure 2: Frequency vs Word Length: Comparison across seven languages with a vocab size of $m=100K$
  • Figure 3: In-Context Comparison: Percentage of examples that fit across languages with vocab size of $m=100K$, highlighting the impact on extrinsic performance with increasing in-context examples.