一句话:提出基于角色分工的多智能体框架,用高阶蜕变关系自动生成测试并合成代码,从税法法条构建可靠报税软件。
将自然语言法条翻译为可执行逻辑是 LLM 的潜力方向,但在法律关键场景中,法条歧义与模型幻觉使可靠性难以保证,同时测试用例生成面临 oracle 问题:正确输出本身需要解释法律。本文以美国联邦报税软件为案例,提出一种智能体式开发方法。其核心是在蜕变测试基础上定义高阶蜕变关系,通过比较相似纳税人在结构化变动下的系统输出来判定正确性;由于人工编写此类关系繁琐易错,作者采用 LLM 驱动、基于角色的框架自动生成测试与合成代码,实现一个将税法翻译为可执行软件的多智能体系统,并嵌入蜕变测试智能体主动搜索反例。实验表明,使用较小模型 GPT-4o-mini 的框架在最坏情况下通过率达 45%,显著优于 GPT-4o 与 Claude 3.5 等前沿模型在复杂税法任务上的 9%–15%,说明智能体式 LLM 方法有望从自然语言规约构建稳健可信的法律关键软件。
Large language models (LLMs) show promise for translating natural-language statutes into executable logic, but reliability in legally critical settings remains challenging due to ambiguity and hallucinations. We present an agentic approach for developing legal-critical software, using U.S. federal tax preparation as a case study. The key challenge is test-case generation under the oracle problem, where correct outputs require interpreting law. Building on metamorphic testing, we introduce higher-order metamorphic relations that compare system outputs across structured shifts among similar individuals. Because authoring such relations is tedious and error-prone, we use an LLM-driven, role-based framework to automate test generation and code synthesis. We implement a multi-agent system that translates tax code into executable software and incorporates a metamorphic-testing agent that searches for counterexamples. In experiments, our framework using a smaller model (GPT-4o-mini) achieves a worst-case pass rate of 45%, outperforming frontier models (GPT-4o and Claude 3.5, 9-15%) on complex tax-code tasks. These results support agentic LLM methodologies as a path to robust, trustworthy legal-critical software from natural-language specifications.
@inproceedings{paperbot11913,
title = {An LLM Agentic Approach for Legal-Critical Software: A Case Study for Tax Prep Software},
author = {Sina Gogani Khiabani and Ashutosh Trivedi and Diptikalyan Saha and Saeid Tizpaz-Niari},
booktitle = {ICSE},
year = {2026},
doi = {10.1145/3744916.3764575}
}