Abstract
Pretrained Language Models (PLMs) such as BERT and RoBERTa are notoriously fragile when faced with typographical noise. While previous research has identified "segmentation drift" as a factor, the specific mechanics of how subword changes destroy semantic meaning have remained unclear. This paper introduces the Contrastive Lexical-Semantic (CoLeS) framework to systematically investigate this phenomenon. We demonstrate that the primary culprit is "segmentation corruption"—where noise forces a tokenizer to decompose words into subwords that no longer carry their original meaning. Our analysis reveals that the placement of noise (infixes vs. affixes) and the loss of "storage route" tokens are critical determinants of model failure.
Introduction
Humans possess a remarkable ability to process "tpyos" by recognizing character arrangements even when scrambled. In contrast, modern NLP models do not process text at the character level; they rely on subword tokenization (e.g., "playing" becomes "play" + "ing"). When a word is misspelled, the tokenizer often produces a different, often nonsensical, set of subwords. This study seeks to understand which specific types of subword alterations—losing pieces, adding pieces, or total replacement—most severely impact a model's ability to maintain semantic consistency.
The CoLeS Framework
To analyze these failures, we developed the Contrastive Lexical-Semantic (CoLeS) probe. This framework categorizes segmentation corruption into a four-part taxonomy based on how the noisy subword set overlaps with the original canonical word:
- Complete Corruption: No original subwords are retained in the noisy version.
- Partial Corruption: Some original subwords remain, but others are altered or replaced.
- Additive Corruption: All original subwords are present, but "noise" subwords are added. This is further divided into affixes (noise at the end) and infixes (noise in the middle).
- Missing Corruption: One or more original subwords are deleted.
Experimental Setup
We tested this taxonomy using three noise models: Keyboard typos (adjacent key hits), Swap typos (transposed letters), and Letter-reduplication (e.g., "loooove"). We evaluated three prominent models—BERT, RoBERTa, and ALBERT—measuring semantic preservation via cosine similarity of embeddings and performance on downstream tasks like sentiment analysis.
Key Insights into Model Vulnerability
The Storage Route vs. Computation Route
A critical finding of this study is the distinction between how models retrieve meaning. Models use the storage route for words that exist as single tokens in their vocabulary and the computation route for words they must derive from multiple subword parts. Models are most vulnerable when an "intact" word (a single token) is corrupted into a different single token. In these cases, the model has no constituent parts to fall back on and fails to derive the original meaning entirely.
The Impact of Noise Placement: Infixes vs. Affixes
The study reveals that the location of noise within a word significantly dictates the level of semantic degradation. Adding noise inside a word (an infix) is far more damaging than adding it to the end (an affix). For example, a model might still recognize "hilariousss" because the core semantic subword remains intact at the beginning. However, an infix like "insuubstantial" breaks the continuity of the core subwords, making it much harder for the model to reconstruct the original concept.
Chunk Size and the "More is Worse" Rule
In cases of partial corruption, the size of the preserved subword "chunk" matters. If a model retains a large "stem" (e.g., "phenomena" from "phenomenal"), it can often maintain semantic proximity. However, if only tiny 1-2 character fragments remain, the model's performance collapses. Furthermore, we observed a strong negative correlation between the number of additive "junk" subwords and semantic similarity; as the count of noise tokens increases, the internal representation drifts further from the ground truth.
Results and Discussion
- Semantic Deviation: Under "Complete" corruption, BERT’s similarity scores plummeted to 0.41, compared to a baseline of 0.69 for random words, suggesting the model's representations become effectively random.
- Downstream Performance: On the SST-2 sentiment task, clean text accuracy of ~93% dropped to as low as 63% for BERT under letter-reduplication noise.
- Model Resilience: While all models followed similar failure patterns, RoBERTa showed slightly higher resilience, likely due to its Byte-Pair Encoding (BPE) tokenizer being more robust than BERT’s WordPiece approach.
Conclusion
This research proves that the fragility of PLMs to typos is not merely a surface-level issue but a fundamental consequence of how tokenizers decompose language. By identifying the specific types of segmentation corruption that lead to semantic loss—particularly the devastating effect of infixes and the loss of storage-route tokens—we provide a roadmap for developing more robust tokenization strategies. Future work must focus on creating "noise-aware" tokenizers or generative architectures that can bridge the gap between subword processing and character-level resilience.
Summary updated