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

Perplexity-Driven Case Encoding Needs Augmentation for CAPITALIZATION Robustness

Rohit Jain, Huda Khayrallah, Roman Grundkiewicz, Marcin Junczys-Dowmunt

Neural Machine Translation (NMT) models exhibit a surprising fragility when faced with non-standard capitalization. While humans intuitively understand that "HELLO," "Hello," and "hello" share the same semantic core, standard NMT models often treat them as distinct entities. This discrepancy leads to catastrophic failures in both translation quality and inference speed.

The Fragility of Perplexity-Driven Tokenization

Most modern NMT systems utilize subword segmentation algorithms like SentencePiece or Byte Pair Encoding (BPE). These algorithms are "perplexity-driven," optimizing for the most efficient compression of text into a fixed vocabulary. Because ALL CAPS or Title Case text is relatively rare in standard training corpora, tokenizers often "shatter" these words into numerous nonsensical fragments. For instance, the word "PHRASE" might be segmented into _PH, RA, and SE.

This fragmentation causes two primary issues:

  1. Quality Degradation: Models struggle to synthesize meaning from fragmented sequences, leading to massive drops in translation metrics (e.g., BLEU or ChrF).
  2. Latency Spikes: Increased token counts lead to longer sequences. Given the quadratic complexity of Transformer decoders relative to sequence length, translation can become 3x to 4x slower for ALL CAPS inputs.

Proposed Method: Case Encoding and Augmentation

The researchers introduce a two-pronged solution to decouple casing from semantic content without sacrificing efficiency.

1. Multi-Level Case Encoding

Instead of treating case as an intrinsic property of characters, the authors separate it into markers added before subword segmentation. This allows the tokenizer to learn whether to keep a marker attached to a word or split it off based on efficiency.

The proposed case encoding pipeline: from character-level tagging to span-level markers and final SentencePiece segmentation.

The pipeline involves:

  • Character-level tagging: Mapping cased characters to a lowercase version plus a tag.
  • Word-level tagging: Aggregating tags into word labels (e.g., T for Title Case, U for Upper Case).
  • Span tagging: Identifying long sequences (3+ words) of ALL CAPS and marking the entire span with an A tag to minimize token overhead.

2. Targeted Data Augmentation

The authors argue that natural data demonstrates how we capitalize but not why it is invariant. By augmenting just 3% of the training data with synthetic lowercase, ALL CAPS, and Title Case variations, the model learns to be invariant to casing without requiring massive amounts of additional data.

Experimental Results

The method was evaluated on WMT 2022 datasets for English↔German, English↔Japanese, and English↔Russian. The results demonstrate that the combination of case encoding and data augmentation effectively bridges the robustness gap.

Comparison of translation quality (ChrF) and latency across different casing conditions and encoding methods.

Key findings include:

  • Robustness: On ALL CAPS English-to-German translation, the baseline model's performance is dismal (35.2 ChrF). The proposed method restores this to 66.0 ChrF, nearly matching standard text performance.
  • Efficiency: While prior "inline casing" methods (like Berard et al.) significantly increase latency (up to +104% on ALL CAPS), the proposed prefix-based encoding is less than 10% slower than the baseline.
  • Zero Degradation: Performance on standard, correctly-cased text remains within ±0.1 ChrF of the baseline, proving that robustness does not require sacrificing general quality.

Conclusion

By nudging the tokenizer to treat casing as a separate linguistic feature rather than a reason for fragmentation, this method achieves capitalization robustness with minimal computational overhead. The approach is particularly effective for high-resource languages and suggests a path forward for making NMT systems more resilient to the varied text formats found in real-world applications.

Summary updated

BibTeX
@inproceedings{jain2023perplexity,
  author = {Rohit Jain and Huda Khayrallah and Roman Grundkiewicz and Marcin Junczys-Dowmunt},
  title = {{Perplexity-Driven Case Encoding Needs Augmentation for CAPITALIZATION Robustness}},
  booktitle = {IJCNLP},
  year = {2023},
  doi = {10.18653/v1/2023.ijcnlp-short.17},
}
Figure