[Paper Review] Tokenization Matters! Degrading Large Language Models through Challenging Their Tokenization
The paper introduces the Adversarial Dataset for Tokenizer (ADT) to challenge LLM tokenization, showing tokenization errors can produce incorrect outputs across open- and closed-source models, and presents an automatic ADT-Auto framework for Chinese tokenization challenges.
Large Language Models (LLMs) have shown remarkable capabilities in language understanding and generation. Nonetheless, it was also witnessed that LLMs tend to produce inaccurate responses to specific queries. This deficiency can be traced to the tokenization step LLMs must undergo, which is an inevitable limitation inherent to all LLMs. In fact, incorrect tokenization is the critical point that hinders LLMs in understanding the input precisely, thus leading to unsatisfactory output. This defect is more obvious in Chinese scenarios. To demonstrate this flaw of LLMs, we construct an adversarial dataset, named as $ extbf{ADT (Adversarial Dataset for Tokenizer)}$, which draws upon the vocabularies of various open-source LLMs to challenge LLMs' tokenization. ADT consists of two subsets: the manually constructed ADT-Human and the automatically generated ADT-Auto. Our empirical results reveal that our ADT is highly effective on challenging the tokenization of leading LLMs, including GPT-4o, Llama-3, Deepseek-R1 and so on, thus degrading these LLMs' capabilities. Moreover, our method of automatic data generation has been proven efficient and robust, which can be applied to any open-source LLMs. In this paper, we substantially investigate LLMs' vulnerability in terms of challenging their token segmentation, which will shed light on the subsequent research of improving LLMs' capabilities through optimizing their tokenization process and algorithms.
Motivation & Objective
- Investigate whether tokenization flaws cause unsatisfactory LLM outputs for specific inputs.
- Construct ADT (manual and automatic) to challenge tokenizers across multiple LLMs.
- Evaluate how tokenization errors correlate with incorrect model responses.
- Demonstrate a scalable automatic data-generation framework for tokenization-adversarial examples.
- Highlight implications for improving tokenization in future LLM systems.
Proposed method
- Export vocabularies from multiple LLMs (Chinese and English) to build ADT vocabularies.
- Manually construct ADT-Human by inserting challenging spans around selected tokens to mislead tokenizers.
- Develop ADT-Auto by automatic word-pair matching to generate trap words and use GPT-4 to create challenging instances.
- Apply filtering (Trap Word presence in tokenization lists) and manual review to refine instances.
- Test ADT against a range of open-source and closed-source LLMs in both local and API deployments.
Experimental results
Research questions
- RQ1Can tokenization errors directly lead to incorrect or nonsensical model outputs for specific inputs?
- RQ2How effective is the manually constructed ADT-Human in revealing tokenization vulnerabilities across LLMs?
- RQ3Can an automatically generated ADT-Auto framework reliably produce challenging instances for tokenization across languages?
- RQ4What is the relative difficulty of tokenization challenges between Chinese and English inputs across different models?
- RQ5How do larger models compare to smaller ones in robustness to tokenization-based adversarial inputs?
Key findings
- ADT-Human produces very high error rates across tested models, indicating strong tokenization vulnerability.
- GPT-4o and other state-of-the-art models still show nontrivial error rates on ADT-Human, suggesting tokenization flaws persist despite scale.
- ADT-Auto generates 231 Chinese instances with substantial mis-tokenization effects, confirming automatic generation effectiveness.
- Open-source LLMs exhibit clearer tokenization weaknesses than some closed-source counterparts on ADT-Auto, implying model developers’ access to better tokenizers.
- Larger models tend to be more robust than smaller ones under tokenization challenges, though they are not immune to errors.
- The study provides a framework and dataset to guide future improvements in tokenization algorithms and vocabulary design.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.