paper-with-me

홈 › Papers

Validating LLM-Generated Programs with Metamorphic Prompt Testing

2024-06-11 · Xiaoyin Wang, Dakai Zhu

The latest paradigm shift in software development brings in the innovation and automation afforded by Large Language Models (LLMs), showcased by Generative Pre-trained Transformer (GPT), which has shown remarkable capacity to generate code autonomously, significantly reducing the manual effort required for various programming tasks. Although, the potential benefits of LLM-generated code are vast, most notably in efficiency and rapid prototyping, as LLMs become increasingly integrated into the software development lifecycle and hence the supply chain, complex and multifaceted challenges arise as the code generated from these language models carry profound questions on quality and correctness. Research is required to comprehensively explore these critical concerns surrounding LLM-generated code. In this paper, we propose a novel solution called metamorphic prompt testing to address these challenges. Our intuitive observation is that intrinsic consistency always exists among correct code pieces but may not exist among flawed code pieces, so we can detect flaws in the code by detecting inconsistencies. Therefore, we can vary a given prompt to multiple prompts with paraphrasing, and to ask the LLM to acquire multiple versions of generated code, so that we can validate whether the semantic relations still hold in the acquired code through cross-validation. Our evaluation on HumanEval shows that metamorphic prompt testing is able to detect 75 percent of the erroneous programs generated by GPT-4, with a false positive rate of 8.6 percent.

📄 PDF Abstract BibTeX arXiv:2406.06864

Code (0)

등록된 구현이 없습니다.

Tasks

HumanEval

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Adam 설명 없음
Residual Connection 설명 없음

Similar Papers 제목 키워드 기반

MTGP: Combining Metamorphic Testing and Genetic Programming

2023-01-20 · Dominik Sobania, Martin Briesch, Philipp Röchner, Franz Rothlauf

Genetic programming is an evolutionary approach known for its performance in program synthesis. However, it is not yet mature enough for a practical use in real-world software development, since usually many training cas…

Program Synthesis

A semantic mutation metric for metamorphic relation adequacy in scientific computing programs

2026-05-17 · Meng Li, Xiaohua Yang, Jie Liu, Shiyu Yan arxiv

Context. Metamorphic Testing addresses the test-oracle problem in scientific computing, but classical Mutation Score operates on syntactic AST mutations and misses domain semantics. Objective. We propose the Semantic Mut…

Metamorphic Relation Prioritization for Effective Regression Testing

2021-09-20 · Madhusudan Srinivasan, Upulee Kanewala

Metamorphic testing (MT) is widely used for testing programs that face the oracle problem. It uses a set of metamorphic relations (MRs), which are relations among multiple inputs and their corresponding outputs to determ…

Fault DetectionregressionRelation

Bias Testing and Mitigation in Black Box LLMs using Metamorphic Relations

2025-11-29 · Sina Salimian, Gias Uddin, Sumon Biswas, Henry Leung arxiv

The widespread deployment of Large Language Models (LLMs) has intensified concerns about subtle social biases embedded in their outputs. Existing guardrails often fail when faced with indirect or contextually complex bia…

Object-based Metamorphic Testing through Image Structuring

2020-02-12 · Adrian Wildandyawan, Yasuharu Nishi

Testing software is often costly due to the need of mass-producing test cases and providing a test oracle for it. This is often referred to as the oracle problem. One method that has been proposed in order to alleviate t…

Object