Abstract
Meaning is context-dependent, but many properties of language (should) remain the same even if we transform the context. For example, sentiment or speaker properties should be the same in a translation and original of a text. We introduce language invariant properties: i.e., properties that should not change when we transform text, and how they can be used to quantitatively evaluate the robustness of transformation algorithms. Language invariant properties can be used to define novel benchmarks to evaluate text transformation methods. In our work we use translation and paraphrasing as examples, but our findings apply more broadly to any transformation. Our results indicate that many NLP transformations change properties. We additionally release a tool as a proof of concept to evaluate the invariance of transformation applications.
Introduction: The Essence of Invariance
In Natural Language Processing (NLP), evaluation typically focuses on task-specific metrics—such as BLEU scores for translation or ROUGE for summarization. While these metrics assess surface-level accuracy, they often fail to capture whether the essence of the speaker or the nuanced context of the message survives the transformation.
We define Language Invariant Properties (LIPs) as characteristics—such as sentiment, topic, or author demographics—that should remain constant across transformations like translation or paraphrasing. When a model changes these underlying properties, it indicates a reliance on "spurious signals"—patterns in the data unrelated to the actual semantic meaning. For instance, if a teenager describes a performance as "sick" (meaning excellent), a robust translation should not interpret this as "disgusting" or shift the perceived age of the speaker to that of an older adult.
Methodology: A Framework for Testing Invariance
To formally evaluate invariance, we propose a framework where if $a$ is an original sentence and $t(a)$ is its transformed version, a property $p$ is considered invariant if $p(a) = p(t(a))$. Our benchmarking pipeline follows three distinct stages:
- Annotation: Utilizing datasets where the source text is labeled with a specific property (e.g., author age or gender).
- Transformation: Applying an NLP model, such as a neural machine translation system or a paraphraser, to the source text.
- Classification and Comparison: Running a property classifier on both the original and transformed texts to detect shifts in the predicted property.
We employ statistical measures, including KL Divergence and Chi-squared ($X^2$) tests, to quantify how much the distribution of these properties shifts post-transformation. A significant shift indicates that the LIP has been "broken," revealing potential biases or lack of robustness in the transformation model.
Experimental Setup and Datasets
Our study evaluates several properties across diverse datasets:
- TrustPilot: Multi-lingual reviews (English, Italian, German) labeled with author age and gender.
- HatEval: English tweets labeled for hatefulness.
- Affects in Tweets (AiT): Tweets in English and Spanish labeled with emotional categories.
Key Insights and Results
Our findings reveal that current NLP transformations frequently fail to preserve LIPs:
- Gender Bias in Translation: Translating from gendered languages (e.g., Italian) into English often shifts the predicted author gender toward "male." In TrustPilot data, Italian-to-English translation increased "male" predictions from 56% to 64%, suggesting that models may reinforce societal biases.
- The Erasure of Toxicity: Paraphrasing models often "clean" hate speech, reducing hatefulness scores. While seemingly positive, this represents a failure of invariance; the model fails to preserve the original intent and tone, which is critical for tasks like hate speech moderation.
- Robustness of Sentiment: Sentiment (positive/negative) emerged as one of the most stable properties, likely due to its central role in core semantics.
Discussion and Future Directions
While this framework provides a new lens for evaluation, it faces challenges such as classifier bias—where the evaluation tool itself may be inaccurate—and the inherent difficulty of preserving cultural nuances. Some properties may not translate directly due to cultural differences in expression.
Future research will expand the scope of LIPs to include political leaning, dialect, and rhetorical style. As we strive for more accurate models, ensuring they are also "invariant" to the subtle, human dimensions of language is paramount for building reliable AI systems.
Summary updated