# Metamorphic Testing for Evaluating Robustness of Sentiment Analysis Models

DevFeed: [Metamorphic Testing for Evaluating Robustness of Sentiment Analysis Models](<https://devfeed.tech/articles/metamorphic-testing-for-evaluating-robustness-of-sentiment-analysis-models-114670.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.02248>)

Author: Sowjanya Karanam, Jayanth Bhargav

Published: 2026-11-03T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>), [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [ai evaluation](<https://devfeed.tech/topics/ai-evaluation.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>)

Tags: [confidence](<https://devfeed.tech/tags/confidence.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-cl](<https://devfeed.tech/tags/cs-cl.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [evaluation](<https://devfeed.tech/tags/evaluation.md>), [genai](<https://devfeed.tech/tags/genai.md>), [language](<https://devfeed.tech/tags/language.md>), [lightweight](<https://devfeed.tech/tags/lightweight.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [metamorphic-testing](<https://devfeed.tech/tags/metamorphic-testing.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [model](<https://devfeed.tech/tags/model.md>), [nlp](<https://devfeed.tech/tags/nlp.md>), [noise](<https://devfeed.tech/tags/noise.md>), [order](<https://devfeed.tech/tags/order.md>), [replacement](<https://devfeed.tech/tags/replacement.md>), [robustness](<https://devfeed.tech/tags/robustness.md>), [score](<https://devfeed.tech/tags/score.md>), [semantic](<https://devfeed.tech/tags/semantic.md>), [testing](<https://devfeed.tech/tags/testing.md>), [vulnerabilities](<https://devfeed.tech/tags/vulnerabilities.md>)

## AI overview

The paper presents a lightweight, batch-based metamorphic testing approach to reveal sentiment model inconsistencies that accuracy and F1-score may miss. It evaluates a pretrained classifier under synonym replacement, typo injection, word-order variation, and negation, measuring consistency score, flip accuracy, and confidence change. The abstract reports strengths with semantic variations and vulnerabilities to textual noise and logical transformations; it does not provide specific scores or further implementation details.

## Source excerpt

arXiv:2611.02248v1 Announce Type: new Abstract: Machine learning systems are challenging to test using traditional software testing methods because their behavior is learned from data rather than explicitly programmed. This challenge is particularly significant in natural language processing (NLP), where small input variations can lead to unexpected model behavior. Conventional evaluation metrics, such as accuracy and F1-score, often fail to capture such inconsistencies. Metamorphic testing addresses this limitation by evaluating expected relationships between original and transformed inputs. With the increasing prevalence of generative artificial intelligence (GenAI) and language-based AI systems, the need for systematic robustness testing has become even more pronounced. Motivated by this growing need, this paper presents a lightweight, batch-based metamorphic testing approach for evaluating the robustness of such systems. In particular, we consider sentiment analysis as a representative NLP task and evaluate a pretrained classifier under four transformations: synonym replacement, typo injection, word-order variation, and negation. Using consistency score, flip accuracy, and confidence change, we identify strengths in handling semantic variations and vulnerabilities to textual noise and logical transformations. These findings highlight the value of metamorphic testing in identifying behavioral inconsistencies beyond conventional performance metrics and demonstrate its potential as a systematic framework for evaluating the robustness of language-based AI systems and guiding performance improvements before deployment.