Test It Before You Trust It: Applying Software Testing for Trustworthy In-context Learning

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Racharak, Teeradaj, Ragkhitwetsagul, Chaiyong, Sontesadisai, Chommakorn, Sunetnanta, Thanwadee
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912575224020992
author Racharak, Teeradaj
Ragkhitwetsagul, Chaiyong
Sontesadisai, Chommakorn
Sunetnanta, Thanwadee
author_facet Racharak, Teeradaj
Ragkhitwetsagul, Chaiyong
Sontesadisai, Chommakorn
Sunetnanta, Thanwadee
contents In-context learning (ICL) has emerged as a powerful capability of large language models (LLMs), enabling them to perform new tasks based on a few provided examples without explicit fine-tuning. Despite their impressive adaptability, these models remain vulnerable to subtle adversarial perturbations and exhibit unpredictable behavior when faced with linguistic variations. Inspired by software testing principles, we introduce a software testing-inspired framework, called MMT4NL, for evaluating the trustworthiness of in-context learning by utilizing adversarial perturbations and software testing techniques. It includes diverse evaluation aspects of linguistic capabilities for testing the ICL capabilities of LLMs. MMT4NL is built around the idea of crafting metamorphic adversarial examples from a test set in order to quantify and pinpoint bugs in the designed prompts of ICL. Our philosophy is to treat any LLM as software and validate its functionalities just like testing the software. Finally, we demonstrate applications of MMT4NL on the sentiment analysis and question-answering tasks. Our experiments could reveal various linguistic bugs in state-of-the-art LLMs.
format Preprint
id arxiv_https___arxiv_org_abs_2504_18827
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Test It Before You Trust It: Applying Software Testing for Trustworthy In-context Learning
Racharak, Teeradaj
Ragkhitwetsagul, Chaiyong
Sontesadisai, Chommakorn
Sunetnanta, Thanwadee
Software Engineering
Artificial Intelligence
In-context learning (ICL) has emerged as a powerful capability of large language models (LLMs), enabling them to perform new tasks based on a few provided examples without explicit fine-tuning. Despite their impressive adaptability, these models remain vulnerable to subtle adversarial perturbations and exhibit unpredictable behavior when faced with linguistic variations. Inspired by software testing principles, we introduce a software testing-inspired framework, called MMT4NL, for evaluating the trustworthiness of in-context learning by utilizing adversarial perturbations and software testing techniques. It includes diverse evaluation aspects of linguistic capabilities for testing the ICL capabilities of LLMs. MMT4NL is built around the idea of crafting metamorphic adversarial examples from a test set in order to quantify and pinpoint bugs in the designed prompts of ICL. Our philosophy is to treat any LLM as software and validate its functionalities just like testing the software. Finally, we demonstrate applications of MMT4NL on the sentiment analysis and question-answering tasks. Our experiments could reveal various linguistic bugs in state-of-the-art LLMs.
title Test It Before You Trust It: Applying Software Testing for Trustworthy In-context Learning
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2504.18827