An LLM Agentic Approach for Legal-Critical Software: A Case Study for Tax Prep Software

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.

Authors

Institutions

Publication Details

Journal
ArXiv.org
Published
2025-09-16
DOI
https://doi.org/10.1145/3744916.3764575
Primary Topic
Artificial Intelligence in Law
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

An LLM Agentic Approach for Legal-Critical Software: A Case Study for Tax Prep Software

Diptikalyan Saha, Ashutosh Trivedi, Saeid Tizpaz-Niari, Sina Gogani-Khiabani
ArXiv.org
Artificial Intelligence in Law
article

An LLM Agentic Approach for Legal-Critical Software: A Case Study for Tax Prep Software

Diptikalyan Saha, Ashutosh Trivedi, Saeid Tizpaz-Niari, Sina Gogani-Khiabani
article en

Abstract

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.

ArXiv.org
University of Illinois Chicago (US), University of Chicago (US), IBM (India) (IN)
National Science Foundation
Openalex Percentile: Top 61%
Artificial Intelligence in Law
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

An LLM Agentic Approach for Legal-Critical Software: A Case Study for Tax Prep Software — Diptikalyan Saha, Ashutosh Trivedi, et al. · ArXiv.org (2025) | TGRS Research Map | TGRS