MeTMaP: Metamorphic Testing for Detecting False Vector Matching Problems in LLM Augmented Generation

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Wang, Guanyu, Li, Yuekang, Liu, Yi, Deng, Gelei, Li, Tianlin, Xu, Guosheng, Liu, Yang, Wang, Haoyu, Wang, Kailong
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866913240062099456
author Wang, Guanyu
Li, Yuekang
Liu, Yi
Deng, Gelei
Li, Tianlin
Xu, Guosheng
Liu, Yang
Wang, Haoyu
Wang, Kailong
author_facet Wang, Guanyu
Li, Yuekang
Liu, Yi
Deng, Gelei
Li, Tianlin
Xu, Guosheng
Liu, Yang
Wang, Haoyu
Wang, Kailong
contents Augmented generation techniques such as Retrieval-Augmented Generation (RAG) and Cache-Augmented Generation (CAG) have revolutionized the field by enhancing large language model (LLM) outputs with external knowledge and cached information. However, the integration of vector databases, which serve as a backbone for these augmentations, introduces critical challenges, particularly in ensuring accurate vector matching. False vector matching in these databases can significantly compromise the integrity and reliability of LLM outputs, leading to misinformation or erroneous responses. Despite the crucial impact of these issues, there is a notable research gap in methods to effectively detect and address false vector matches in LLM-augmented generation. This paper presents MeTMaP, a metamorphic testing framework developed to identify false vector matching in LLM-augmented generation systems. We derive eight metamorphic relations (MRs) from six NLP datasets, which form our method's core, based on the idea that semantically similar texts should match and dissimilar ones should not. MeTMaP uses these MRs to create sentence triplets for testing, simulating real-world LLM scenarios. Our evaluation of MeTMaP over 203 vector matching configurations, involving 29 embedding models and 7 distance metrics, uncovers significant inaccuracies. The results, showing a maximum accuracy of only 41.51\% on our tests compared to the original datasets, emphasize the widespread issue of false matches in vector matching methods and the critical need for effective detection and mitigation in LLM-augmented applications.
format Preprint
id arxiv_https___arxiv_org_abs_2402_14480
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle MeTMaP: Metamorphic Testing for Detecting False Vector Matching Problems in LLM Augmented Generation
Wang, Guanyu
Li, Yuekang
Liu, Yi
Deng, Gelei
Li, Tianlin
Xu, Guosheng
Liu, Yang
Wang, Haoyu
Wang, Kailong
Software Engineering
Augmented generation techniques such as Retrieval-Augmented Generation (RAG) and Cache-Augmented Generation (CAG) have revolutionized the field by enhancing large language model (LLM) outputs with external knowledge and cached information. However, the integration of vector databases, which serve as a backbone for these augmentations, introduces critical challenges, particularly in ensuring accurate vector matching. False vector matching in these databases can significantly compromise the integrity and reliability of LLM outputs, leading to misinformation or erroneous responses. Despite the crucial impact of these issues, there is a notable research gap in methods to effectively detect and address false vector matches in LLM-augmented generation. This paper presents MeTMaP, a metamorphic testing framework developed to identify false vector matching in LLM-augmented generation systems. We derive eight metamorphic relations (MRs) from six NLP datasets, which form our method's core, based on the idea that semantically similar texts should match and dissimilar ones should not. MeTMaP uses these MRs to create sentence triplets for testing, simulating real-world LLM scenarios. Our evaluation of MeTMaP over 203 vector matching configurations, involving 29 embedding models and 7 distance metrics, uncovers significant inaccuracies. The results, showing a maximum accuracy of only 41.51\% on our tests compared to the original datasets, emphasize the widespread issue of false matches in vector matching methods and the critical need for effective detection and mitigation in LLM-augmented applications.
title MeTMaP: Metamorphic Testing for Detecting False Vector Matching Problems in LLM Augmented Generation
topic Software Engineering
url https://arxiv.org/abs/2402.14480