Raw Text Preservation for Transformer Models

92 concepts61 papers1 proposal

For decades, the standard operating procedure in Natural Language Processing (NLP) began with a destructive ritual: text preprocessing. Before a sentence ever reached a model, engineers would strip punctuation, remove common "stopwords" (the, is, at), convert everything to lowercase, and stem words down to their roots (running became run). This was a necessity born of architectural limitations. Early statistical models and recurrent neural networks (RNNs) suffered from the curse of dimensionality; reducing the vocabulary size and filtering out "noise" was the only way to make computation tractable and prevent overfitting.

The advent of the Transformer architecture has fundamentally inverted this paradigm. A growing body of research demonstrates that aggressive text cleaning is not only unnecessary for modern language models, but frequently detrimental. Instead, a new consensus has emerged around raw text preservation—the practice of feeding raw, uncleaned, and non-destructive text directly into Transformer encoders and decoders.

To understand why raw text preservation works, we have to look at how self-attention processes context and why traditional "noise" is actually a vital signal.

The Geometry of Self-Attention Requires Scaffolding

Traditional preprocessing treats a sentence as a "bag of words," where removing high-frequency function words like of or which narrows the focus to core lexical keywords. However, Transformers do not read text as isolated keywords; they construct meaning dynamically by calculating the relationships between all tokens in a sequence.

When we remove stopwords or punctuation, we break the syntactic scaffolding of the sentence. High-frequency function words act as structural anchors that help the self-attention mechanism route information correctly. For instance, Sharma et al. found that retaining high-frequency stopwords preserves critical semantic context that traditional lexical cleaning discards. Similarly, Kumar et al. demonstrated that keeping stopwords preserves the sequence context necessary for Transformers to resolve nuanced meanings in informal text.

Traditional Cleaning:  [movie] [not] [good] [but] [acting] [excellent]
Raw Preservation:      The movie was not that good, but the acting was excellent!
                        ^--- Transformer maps long-range contrast via "but" and ","

When a Transformer processes the raw sentence above, the attention heads use the comma and the conjunction but to map the structural shift between the negative and positive clauses. If you strip the punctuation and function words, the model is left with a disjointed sequence of tokens, forcing it to reconstruct the structural dependencies from scratch. As Nguyen et al. observe, these architectures rely on the full linguistic context to capture deep semantic relationships, making the retention of original sentence structures critical.

Noise as a High-Fidelity Signal

In social media streams or digitized text, elements like emojis, hashtags, user mentions, and non-standard punctuation are routinely stripped out by traditional pipelines under the guise of "noise reduction." But in human communication, this "noise" carries dense pragmatic and emotional weight.

Consider the task of sarcasm or irony detection. Sarcasm is rarely explicit in the literal definition of words; it resides in the tension between the words and their context. Abaskohi et al. demonstrated that bypassing emoji and link removal entirely yielded peak performance in sarcasm detection, proving that Transformers extract highly nuanced cues from the raw noise of social media text. When Potamias et al. avoided manual feature engineering like stemming or emoji-tagging, they found that the underlying Transformer could learn complex linguistic nuances directly from the raw data.

Punctuation marks like exclamation points, question marks, or repeated characters (coooool) act as explicit markers of intent. As Saha et al. argue, stripping these elements removes structural cues that are vital for identifying complex behaviors like offensive language. By preserving these tokens, the non-destructive approach ensures that the encoder leverages the full contextual nuance of the input text.

Implicit Noise Filtering

If raw text contains actual corruptions—such as typos, formatting inconsistencies, or automated speech recognition (ASR) errors—should we not clean them?

The surprising answer is that high-capacity Transformers are highly capable of filtering this noise internally. Because models like RoBERTa or Mistral are pre-trained on massive, diverse datasets containing billions of raw, uncleaned strings, they develop an internal resilience to textual imperfections.

Bhatnagar et al. showed that highly parameterized Transformer models learn to internally filter social media noise like mentions and hashtags without manual intervention. When fine-tuned on representative data, the model's attention layers naturally learn to down-weight peripheral metadata and prioritize core semantic content.

This implicit filtering extends to severe text corruptions:

  • ASR Transcriptions: Li et al. showed that modern Transformers demonstrate significant resilience to the errors and noise inherent in automated speech-to-text transcriptions, maintaining high classification accuracy even when inputs contain high character error rates.
  • Digitization Errors: In literary text digitization, Durandard et al. found that fine-tuned Transformers maintain high accuracy despite missing or corrupted typographic markers by relying on broader lexical and semantic context.

By forcing a hard-coded cleaning rule onto the text, we risk introducing systematic biases or destroying the underlying distribution that the model learned during pre-training. As Siino notes, extensive text preprocessing can safely be omitted to maintain computational efficiency without sacrificing performance, demonstrating a profound architectural robustness to raw input formats.

The Pre-training Alignment Principle

The ultimate reason raw text preservation works comes down to alignment with pre-training. Modern large language models are trained on raw web scrapes. They have learned the statistical properties of human language complete with its typos, slang, punctuation, and structural idiosyncrasies.

When we fine-tune or run inference on a model, introducing an artificial preprocessing step creates a distribution shift. For example, Demidova et al. observed that while structured discriminative models might occasionally tolerate emoji standardization, generative models trained on diverse, raw text can actually be hindered by such preprocessing. Even in multimodal domains, Huang et al. demonstrated that retaining raw, unfiltered text tokens during vision-language pre-training yields superior representations compared to manual filtering techniques like stopword removal. Subtle signals in the raw text provide valuable supervisory information that is lost when text is aggressively simplified.

While there are still niche scenarios where targeted text normalization is beneficial—such as handling highly sensitive language tasks where spelling corrections normalize sparse tokens (Al-Omari et al.)—the overarching trajectory of the field is clear. Trusting the model's internal attention mechanism to parse, filter, and organize raw text preserves the rich, multi-layered context of human language.

Key Foundational Work

On the Role of Text Preprocessing in Neural Network Architectures: An Evaluation Study on Text Categorization and Sentiment Analysis (2018) — contributed 3 concept elements to this direction.
HateMonitors: Language Agnostic Abuse Detection in Social Media (2019) — contributed 2 concept elements to this direction.
An Empirical Study on Pre-trained Embeddings and Language Models for Bot Detection (2019) — contributed 2 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_context_preserving_preprocessing_f7724384,
  title = {context-preserving preprocessing},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/context-preserving-preprocessing/rdr_f7724384d0fe4479ae85257575a2c657},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-23},
}

This exact version (version 1, frozen text):

@misc{lacuna_context_preserving_preprocessing_f7724384_v1,
  title = {context-preserving preprocessing},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/context-preserving-preprocessing/rdr_f7724384d0fe4479ae85257575a2c657/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-23},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake