arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.17246cs.LGcs.AI
收藏

规范-代码对齐的保真度探针

Fidelity Probes for Specification--Code Alignment

AWS Agentic AI(AWS智能AI)

Ferhat Erata, Hao Zhou, Jun Huan

AI总结:

本文提出保真度探针,通过从参考artifact生成的自然语言问题和代码派生的地面真实答案,从候选规范中回答问题。保真度是同意探针的比例,分解为矛盾率和覆盖缺口率,驱动针对性的规范编辑以达到收敛。在15个程序、约12000行COBOL基准(AWS CardDemo)上,通过八次迭代将冻结测试规范的保真度从0.63提升到0.94,其中平台位置由仅需四次速率数据的两状态马尔可夫固定点$F^\dagger$预测。探针来自LLM读取代码或静态分析管道对其控制流、数据流和系统依赖图的处理,具有可调混合比例。一个带有冻结留出集的探针重采样协议提供了Hoeffding有界的过拟合判别;我们测量的训练/测试差距保持在该包络线下一个数量级。三种基于图的混合提升了保真度16到30分;跨分布评估显示LLM和符号通道在经验上互补。在五个独立LLM家族(Anthropic、DeepSeek、Google、Alibaba、OpenAI)上进行的跨家族生成器扫描确认了收敛行为不依赖于任何单一模型家族:五个非Claude生成器中有三个产生了与马尔可夫固定点预测一致的轨迹,而冻结测试协议主动否定了两个探针分布随迭代变化的生成器。该方法适用于任何应描述相同行为的artifact对。

摘要:

我们引入了保真度探针:从参考artifact生成的自然语言问题,其代码派生的地面真实答案由候选规范回答。保真度是同意探针的比例,分解为矛盾率和覆盖缺口率,驱动针对性的规范编辑以达到收敛。在15个程序、约12000行COBOL基准(AWS CardDemo)上,我们通过八次迭代将冻结测试规范的保真度从0.63提升到0.94,其中平台位置由仅需四次速率数据的两状态马尔可夫固定点$F^\dagger$预测。探针来自LLM读取代码或静态分析管道对其控制流、数据流和系统依赖图的处理,具有可调混合比例。一个带有冻结留出集的探针重采样协议提供了Hoeffding有界的过拟合判别;我们测量的训练/测试差距保持在该包络线下一个数量级。三种基于图的混合提升了保真度16到30分;跨分布评估显示LLM和符号通道在经验上互补。在五个独立LLM家族(Anthropic、DeepSeek、Google、Alibaba、OpenAI)上进行的跨家族生成器扫描确认了收敛行为不依赖于任何单一模型家族:五个非Claude生成器中有三个产生了与马尔可夫固定点预测一致的轨迹,而冻结测试协议主动否定了两个探针分布随迭代变化的生成器。该方法适用于任何应描述相同行为的artifact对。

英文摘要:

Software modernization often relies on natural-language specifications recovered from an existing implementation. Incorrect or missing requirements can lead to defects in the modernized system. We introduce fidelity probes to check a specification against the code and guide its revision. Each probe pairs a question about program behaviour with a reference answer derived from the code. A language model answers the question using only the specification, and the fraction of agreeing answers defines fidelity. Disagreements flag conflicting claims or missing information and guide proposed corrections and additions to the requirements. An LLM generates probes directly from code or phrases facts selected through control-flow, data-flow, and call-graph analysis. We use an observability rule to focus probe questions on behaviour that the modernized system is intended to preserve, including user-visible outputs, changes to stored business data, and interactions with other systems. We revise the specification using fresh probes and evaluate each version on a fixed held-out set. A repair-regression model describes how new failures can offset the gains from repairs. On CardDemo, held-out fidelity improves from 0.59 to 0.89, exceeding free-form revision from source code. We also evaluate the method on industrial systems and public documentation, and assess probe quality and reported defects through human reviews and comparison with an independent requirements audit.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑