To token or not to token: A Comparative Study of Text Representations for Cross-Lingual Transfer

Md Mushfiqur Rahman, Fardin Ahsan Sakib, Fahim Faisal, Antonios AnastasopoulosarXiv 2023

This study explores a fundamental question in modern NLP: how should we represent text to maximize knowledge transfer between languages? As we move beyond English-centric models, the choice between traditional subword tokens, raw characters, or even visual pixels becomes a critical architectural decision.

TL;DR

The researchers perform a massive comparative study across 133 languages to determine how different text representations (subwords, characters, and images) affect cross-lingual transfer. They introduce the Learning Quotient (LQ), a metric for measuring adaptation speed, and provide a decision tree to help practitioners choose the right model based on language script and task type.

What Problem Does This Paper Address?

Multilingual Large Language Models (LLMs) are notoriously uneven; they perform brilliantly on high-resource languages like English but struggle with low-resource ones. A major bottleneck is tokenization. Traditional models like BERT rely on subword segmentation, which can fail to capture the nuances of languages with complex word formations or entirely different scripts.

While "tokenization-free" models (using characters or images) have emerged as alternatives, we haven't had a clear understanding of when to use which. This paper aims to fill that gap by evaluating how these different "modalities" of text representation handle cross-lingual transfer in zero-shot and few-shot scenarios.

Methods

The authors compared four distinct models:

  • Subword-based: BERT (monolingual) and mBERT (multilingual).
  • Character-based: CANINE, which operates on raw Unicode characters.
  • Image-based: PIXEL, which renders text as images and processes them with a Vision Transformer (ViT).

To measure success, they proposed the Learning Quotient (LQ). Standard metrics like Accuracy or F1 only show a snapshot of performance. The LQ metric (Equation 1 in the paper) weights both the initial zero-shot performance and the "leap" the model makes after just 10 steps of few-shot fine-tuning. This effectively measures learning efficiency—how quickly a model can "pick up" a new language based on what it already knows.

Datasets

The study utilized a massive linguistic footprint:

  • Universal Dependencies (UD): Used for Part-of-Speech (POS) tagging and Dependency Parsing across 123 target languages.
  • MasakhaNER: A specialized dataset for Named Entity Recognition (NER) in African languages.
  • Diversity: The languages spanned 28 sub-families and 19 different scripts, as shown in the distribution below:
Language distribution by sub-family

Key Insights and Ideas

  • Visual Similarity is a Powerful Signal: For image-based models like PIXEL, the actual linguistic relationship matters less than the script. PIXEL excelled at transferring knowledge between languages that share the Latin script, even if they were linguistically unrelated.
  • Semantics vs. Syntax: Subword models (mBERT) are superior for tasks that rely on word meaning (POS, NER) because their tokens map more directly to semantic concepts. Conversely, character-level models (CANINE) shine in dependency parsing, where understanding fine-grained morphological relationships (like prefixes and suffixes) is more important than the "meaning" of the root word.
  • The Script Barrier: When the script changes (e.g., transferring from English to Russian), PIXEL’s performance plummets, whereas character-based models like CANINE remain more stable.
Figure 4: LQ score obtained by PIXEL and CANINE on Latin and non-Latin scripts on POS tagging. PIXEL outperforms CANINE on the POS tagging task when both source and target use the same script (on the left portion of the graph). Conversely, PIXEL does not outperform CANINE when the scripts are dissimilar (on the right portion of the graph)

Key Results

  • PIXEL's Niche: In the "English $\rightarrow$ European" case, PIXEL significantly outperformed CANINE on Latin-script languages but fell behind on Cyrillic (Russian) or Finnic languages.
  • Hindi Case Study: When transferring from Hindi (Devanagari script), PIXEL performed poorly on Urdu (Arabic script) despite the languages being linguistically similar. However, it performed exceptionally well on Marathi, which shares the Devanagari script but is linguistically distinct.
  • Syntactic Champion: CANINE consistently outperformed mBERT and BERT in dependency parsing, proving that character-level focus is better for capturing syntactic structures in low-resource settings.

Limitations and Future Work

The authors acknowledge that their study focused primarily on syntactic tasks, leaving broader semantic reasoning tasks for future exploration. They also noted that their analysis did not include modern decoder-based models (like GPT-style architectures) or highly complex language types like agglutinative (Turkish) or logographic (Chinese) languages.

One promising future direction is the use of transliteration. For "unseen" scripts, the authors suggest that converting the target language into a script the model already knows (e.g., Romanizing Arabic) could drastically improve transfer performance for multilingual models.

Based on their findings, they offer this Model Recommendation Tree for researchers:

Model Recommendation Tree

Summary updated

Abstract

Choosing an appropriate tokenization scheme is often a bottleneck in low-resource cross-lingual transfer. To understand the downstream implications of text representation choices, we perform a comparative analysis on language models having diverse text representation modalities including 2 segmentation-based models (\texttt{BERT}, \texttt{mBERT}), 1 image-based model (\texttt{PIXEL}), and 1 character-level model (\texttt{CANINE}). First, we propose a scoring Language Quotient (LQ) metric capable of providing a weighted representation of both zero-shot and few-shot evaluation combined. Utilizing this metric, we perform experiments comprising 19 source languages and 133 target languages on three tasks (POS tagging, Dependency parsing, and NER). Our analysis reveals that image-based models excel in cross-lingual transfer when languages are closely related and share visually similar scripts. However, for tasks biased toward word meaning (POS, NER), segmentation-based models prove to be superior. Furthermore, in dependency parsing tasks where word relationships play a crucial role, models with their character-level focus, outperform others. Finally, we propose a recommendation scheme based on our findings to guide model selection according to task and language requirements.
BibTeX
@misc{rahman2023token,
  author = {Md Mushfiqur Rahman and Fardin Ahsan Sakib and Fahim Faisal and Antonios Anastasopoulos},
  title = {{To token or not to token: A Comparative Study of Text Representations for Cross-Lingual Transfer}},
  year = {2023},
  eprint = {2310.08078},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.08078},
}

Loading related content...

Figure