NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Entropy-Driven Pre-Tokenization for Byte-Pair Encoding

Yifan Hu, Ningyue Liang, Dachuan Zhao, Jonathan Geuter, Varshini Reddy, Craig W Schmidt, Chris Tanner

TL;DR

This paper introduces two novel methods for pre-tokenizing Chinese text before applying Byte-Pair Encoding (BPE). By leveraging information-theoretic cues, these methods guide BPE to create more linguistically meaningful subword units, significantly improving segmentation quality for unsegmented languages.

What Problem Does This Paper Address?

Modern large language models (LLMs) heavily rely on Byte-Pair Encoding (BPE) for tokenization. BPE works by iteratively merging frequent character pairs to build a vocabulary. While effective for languages with clear word boundaries (like English, often separated by spaces), BPE struggles with unsegmented languages such as Chinese. In Chinese, characters can form words of varying lengths without explicit delimiters, leading BPE to produce tokenizations that don't align with natural linguistic units, potentially harming downstream performance. This paper aims to bridge this gap by introducing pre-tokenization strategies that inject linguistic awareness into the BPE process for such languages.

Methods

The authors propose two entropy-driven pre-tokenization strategies to guide BPE:

  • Statistical-based Pre-tokenization: This method uses unsupervised, information-theoretic cues. It calculates a "utility score" for every possible n-gram (up to 6 characters) in the corpus. This score combines:
  • Pointwise Mutual Information (PMI): Measures how strongly adjacent characters co-occur, indicating cohesion within a potential token.
  • Left/Right Entropy: Measures the diversity of characters that appear immediately before and after a span, indicating how likely it is to be a distinct unit. A greedy maximal matching algorithm then selects the highest-scoring spans to form initial segments, which are then space-delimited for BPE.

  • Auto-regressive LLM-based Pre-tokenization: This approach leverages the predictive uncertainty of a pre-trained Chinese GPT-2 model. By calculating the conditional entropy of the next character given the preceding ones, the model identifies "peaks" in uncertainty. These peaks signal potential shifts in meaning or structure, indicating likely token boundaries. These boundaries are then used to pre-segment the text before BPE training.

Datasets

The experiments were conducted on a subset of the PKU dataset. This dataset is a standard benchmark for Chinese word segmentation, consisting of news articles manually annotated with gold-standard word boundaries. The authors used 70% of the data for training and 30% for testing.

Key Insights and Ideas

  • Entropy as a Linguistic Signal: The core idea is that information-theoretic measures (like PMI and entropy) can capture underlying linguistic structure even in the absence of explicit word delimiters.
  • Pre-tokenization as a "Soft Constraint": Instead of hard-coding rules, the proposed methods provide "hints" to BPE, guiding its merge operations towards more linguistically coherent units without sacrificing BPE's efficiency.
  • Balancing Cohesion and Separability: The statistical method explicitly balances the tendency for characters to stick together (PMI) with the tendency for a unit to be distinct from its neighbors (entropy).
  • LLM Uncertainty as a Boundary Detector: Pre-trained LLMs, by their nature, learn complex linguistic patterns. Their uncertainty about the next token can serve as a surprisingly effective signal for word boundaries.
  • Entropy-Only Segmentation is Meaningful: Even without subsequent BPE, the entropy-only segmentation (from the LLM approach) shows promising alignment with gold standards, suggesting the inherent value of this signal.

Key Results

  • Significant Improvement over Baseline: Both entropy-driven pre-tokenization methods substantially outperform standard BPE on the PKU dataset.
  • Statistical Method with Tuning: The statistical method, particularly with a tuned regularization parameter ($\lambda=4$), achieved the highest F1 score of 58.73%, a significant improvement of 9.43 percentage points over the baseline BPE's 49.30%. This setting also yielded the best precision.
  • LLM Method's Strong Recall: The GPT-2 based method achieved the highest recall (64.69%) and a competitive F1 score of 57.70%, demonstrating the power of LLM uncertainty.
  • Qualitative Alignment: Visualizations show that the entropy-guided methods produce segmentations that align much more closely with human-annotated gold-standard boundaries compared to standard BPE.

Limitations and Future Work

  • Computational Cost: The auto-regressive LLM-based method is computationally expensive, requiring significant GPU resources and time for pre-tokenization.
  • Hyperparameter Tuning: The statistical method requires tuning a regularization parameter ($\lambda$), which needs to be determined empirically.
  • Future Work: The authors suggest integrating these pre-tokenization methods into LLM training pipelines for downstream tasks like machine translation and named entity recognition. They also propose exploring these methods for byte-level tokenization, which could enhance robustness and language independence in multilingual settings.

Summary updated

BibTeX
@inproceedings{hu2025entropy,
  author = {Yifan Hu and Ningyue Liang and Dachuan Zhao and Jonathan Geuter and Varshini Reddy and Craig W Schmidt and Chris Tanner},
  title = {{Entropy-Driven Pre-Tokenization for Byte-Pair Encoding}},
  booktitle = {TokShop @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=1hcu9Vq4Or},
}
Figure