一种评估大语言模型生成代码中故障独立性的系统方法
A Systematic Methodology for Evaluating Failure Independence in LLM-Generated Code
AI总结:
提出评估大语言模型生成代码中故障独立性的系统方法,应用于多模型、语言和提示策略的224个问题,通过多种分析得出大语言模型生成的解决方案不满足故障独立性假设,但异构模型有帮助,验证了该方法。
摘要:
N版本编程(NVP)通过执行多个独立实现并组合输出提高软件可靠性,但其采用受高成本和故障独立性假设限制。大语言模型(LLMs)的进展降低了生成多个实现的成本,本文提出首个评估LLM生成代码中故障独立性的系统方法并应用于多个问题,分析得出LLM生成的解决方案不满足NVP的故障独立性假设,异构模型有帮助,验证了该方法。
英文摘要:
N-Version Programming (NVP) improves software reliability by executing multiple independent implementations and combining outputs, but its adoption is limited by high cost and the assumption of failure independence, which empirical studies have challenged. Recent advances in Large Language Models (LLMs) reduce the cost of generating multiple implementations, shifting focus to whether their failures are independent. We propose the first systematic methodology to assess failure independence in LLM-generated code and apply it to 224 problems across twelve models, five languages, and three prompting strategies. We analyze both structural and behavioral diversity (i.e., whether implementations fail on the same test cases), complemented by N-version reliability analysis under majority voting and manual inspection of the generated code. Structural diversity analysis shows that implementations from the same model are highly similar, while different models produce more distinct solutions. The same trend appears in behavioral diversity, with implementations from different models showing higher diversity yet still failing on the same tests far more often than expected under independence. N-version reliability analysis reinforces this: three- and five-version ensembles realize only 0.43 and 0.44 of the reliability gain achievable under independence, dropping below 0.3 when ensembles are built from the same model. Manual fault analysis shows that even different failure patterns often share root causes. Overall, these results suggest LLM-generated solutions do not satisfy NVP's failure independence assumption, though heterogeneous models help partially. They also validate our methodology as a tool for systematically evaluating failure independence as models evolve.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。