Skip to content

When Knowledge Changes: Metamorphic Testing of RAG Systems with Mutations

Jul 2026 · arXiv.org · Vol abs/2607.26843 · 1 citation · 23 references
Computer Science

TL;DR

This work introduces a metamorphic testing framework that evaluates the consistency of RAG systems under corpus evolution, formalising a fault taxonomy and 11 mutation operators that systematically perturb the system at both the pre-chunk (retrieval index) and post-chunk (retrieved context) levels.

Abstract

Retrieval-Augmented Generation (RAG)-based LLM systems rely on external document corpora that can evolve and change over time. However, current evaluation methodologies (e.g., RAGAS) assess correctness against static snapshots, failing to detect faults when routine updates, factual changes, or noise alter the underlying data. We introduce a metamorphic testing framework that evaluates the consistency of RAG systems under corpus evolution. We formalise a fault taxonomy and 11 mutation operators that systematically perturb the system at both the pre-chunk (retrieval index) and post-chunk (retrieved context) levels. An empirical evaluation across five datasets and over 28k mutants reveals metamorphic violation rates of 4.9-10.2%. In a meta-evaluation against ground truth, our metamorphic oracle achieves F1 scores of 0.927-1.000, while the best RAGAS metric reaches only 0.570. Finally, we provide actionable insights into mitigating these faults through retrieval re-configuration, generator upgrades, and LLM-based reranking.

View source

Similar papers

Conference Jul 2026

Temporal Metamorphic Testing for RAG-Based LLMs under Evolving Knowledge

Evaluating the temporal consistency of RetrievalAugmented Generation (RAG) systems is challenging because conventional evaluation methods rely on ground-truth answers, which are difficult to define under continuously evolving knowledge. This paper presents a temporal metamorphic testing framework for RAG-based large la...

Hongyu Wang, Dave Towey, Ge Zhang et al. · 0 citations
Jul 2026

Testing Retrieval-Augmented Generation Systems with Chunk Coverage

Chunk Coverage (CC), an oracle-independent test adequacy criterion for testing the retrieval component of RAG systems, is introduced and results show that CC captures retrieval diversity relevant to effective testing without requiring test oracles.

Jinhan Kim, Samuele Pasini, Paolo Tonella · 1 citation
Preprint Jul 2026

RAG-TESTER: Automated End-to-End Testing of Retrieval-Augmented Large Language Models

RagTester is presented, an automated end-to-end testing approach for RAG systems that can effectively expose failures caused by the interaction between retrieval and generation components and support the assessment of RAG configurations before deployment.

Ange Maiztegi, J. Ayerdi, Miren Illarramendi et al. · 0 citations
Conference Jul 2026

Toward Standardized Evaluation of Metamorphic Relations: A Structured Rubric and Human-LLM Comparison

Software testing often depends on a test oracle to determine whether or not an output is correct. However, many real-world systems lack reliable or affordable oracles. Metamorphic testing (MT) alleviates this problem by using metamorphic relations (MRs), which examine the correctness of relations between outputs produc...

Yifan Zhang, Dave Towey, Matthew Pike et al. · 0 citations
Preprint Jul 2026

From Failing to Passing: Evolving Natural Language Prompt Optimization Rules for LLM Code Generation

This work introduces a search-based approach that identifies and evolves a set of natural language transformation rules with strong downstream effects on coding performance, and proposes DUALFIX, a staged repair pipeline that combines the evolved transformation rules with execution-feedback repair, addressing both spec...

Amal Akli, Melissa Akli, Cedric Richter et al. · 0 citations
Preprint Aug 2026

From Diagnosis to Correction: Benchmarking and Improving Real-World Table Parsing

Decompose--Enhance--Correct (Decompose--Enhance--Correct), a visual-consistency-guided agentic framework that improves frozen table parsers without retraining is proposed, which derives a 1,977-table Consensus-Hard Set from 4,556 candidates through offline metrics and cross-model consensus.

Jutao Xiao, Yuan Qu, Dongsheng Ma et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.