On the Proper Treatment of Tokenization in Psycholinguistics

Mario Giulianelli, Luca Malagutti, Juan Luis Gastaldi, Brian DuSell, Tim Vieira, Ryan Cotterell · DOI

Abstract

Modern language models (LMs) process text as discrete tokens, yet human reading behavior is measured against character-based regions of interest (ROIs). This discrepancy introduces a "nuisance" variable into psycholinguistic research: tokenization. This paper argues that to accurately model human language processing, researchers must marginalize out tokenization, converting token-level probabilities into character-level surprisal. By applying this framework to eye-tracking corpora, we demonstrate that character-level focal areas—specifically the first few characters of a word—provide superior predictive power for reading behaviors like word skipping and fixation duration.

Introduction

In computational psycholinguistics, surprisal theory serves as a cornerstone for predicting human reading behavior. The theory posits that the processing effort (and thus the time spent) on a word is proportional to its conditional unpredictability, or surprisal, given the preceding context. However, a significant technical gap exists between the models used to calculate surprisal and the humans being studied.

Modern large language models (LMs), such as GPT-2 or Llama, do not process text character-by-character. Instead, they utilize sub-word tokenization schemes like Byte-Pair Encoding (BPE). These tokens often fail to align with the linguistic units researchers care about, such as morphemes or words. This misalignment forces researchers into awkward heuristic workarounds, such as debating whether a leading space belongs to the current or previous word, which can lead to inconsistent results. This paper proposes a mathematically grounded alternative: treating tokenization as a nuisance variable to be marginalized out.

Methodology

Character-Level Marginalization

The authors propose transforming any token-level LM into a character-level LM through a process of marginalization. Because a single string of characters can often be represented by multiple different token sequences (a phenomenon known as "spurious ambiguity"), the probability of a character string is the sum of the probabilities of all valid tokenizations that produce that string.

To handle the potentially exponential number of tokenization paths, the researchers employ a beam summing algorithm. This approach approximates the total probability by focusing on the most probable tokenization paths, making character-level surprisal computationally feasible for large-scale models.

Focal Areas

With a character-level model, researchers are no longer bound by token boundaries. They can calculate the surprisal of any arbitrary substring, termed a focal area. The study explores three types of focal areas:

  1. Fixed: A set number of characters (e.g., the first 3 letters of a region).
  2. Dynamic: A window based on the human "word identification span," simulating the amount of text a reader perceives in a single glance.
  3. Look-ahead: A window that includes characters from the subsequent word to test if readers begin processing upcoming text before their eyes move to it.

Experimental Setup

The framework was evaluated across four prominent eye-tracking corpora:

  • UCL: Stimuli from English novels.
  • Provo: Sentences spanning news, science, and fiction.
  • MECO: A multilingual corpus (English portion utilized).
  • CELER: A large-scale dataset featuring Wall Street Journal articles.

These datasets provide high-resolution data on exactly how long readers fixate on specific words and whether they skip them entirely.

Key Insights and Results

The Predictive Power of the "First Three Letters"

One of the study's most significant findings concerns skip rates. On the CELER dataset, the surprisal of a fixed-size focal area consisting of only the first three characters of a word was a significantly stronger predictor of skipping behavior than the surprisal of the entire word. In terms of predictive power ($\Delta R^2$), the first-three-characters model outperformed the full-region model by a factor of two. This supports the "parafoveal" processing theory, suggesting that the brain decides whether to skip a word based on the information gathered from its beginning while the eye is still on the previous word.

Peeking Ahead and Integration Costs

For measures of reading time, such as First Fixation Duration and Gaze Duration, "Look-ahead" focal areas—which include the current word plus the start of the next—consistently matched or exceeded the performance of standard word-level ROIs. This suggests that the cognitive cost of integrating a word into its context begins even before the reader has finished fixating on that word.

Resolving the Whitespace Debate

By moving to a character-level marginalization framework, the researchers demonstrated that the long-standing debate over leading versus trailing whitespace becomes largely irrelevant. Because the model can handle arbitrary character boundaries gracefully, the sensitivity to specific ROI definitions is minimized, leading to more robust and replicable psycholinguistic findings.

Discussion and Limitations

The authors conclude that tokenization is an algorithmic artifact that should not influence linguistic theory. By marginalizing it out, researchers can focus on the actual stimuli—character strings—rather than the quirks of a specific model's vocabulary.

However, the study notes several areas for future exploration. The current research is English-centric; focal areas may behave differently in morphologically rich languages or non-alphabetic scripts like Chinese. Additionally, while linear regression was used here, future work could employ Generalized Additive Models (GAMs) to capture non-linear relationships between surprisal and reading time. Finally, accounting for individual reader differences through mixed-effects models remains a vital next step for the field.

Summary updated

BibTeX
@inproceedings{giulianelli2024proper,
  author = {Mario Giulianelli and Luca Malagutti and Juan Luis Gastaldi and Brian DuSell and Tim Vieira and Ryan Cotterell},
  title = {{On the Proper Treatment of Tokenization in Psycholinguistics}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.1032},
}
Figure