Evaluating "Rules as Code"—the process of turning legal text into executable programs—is notoriously difficult. Usually, researchers grade their code against their own interpretation of the law. But what if the researcher is wrong? This paper introduces LexTemporis, a framework that grades legal programs against independent, real-world records to reveal how well these systems actually handle the complexities of time and delegation in law.
TL;DR
LexTemporis moves beyond "grading against the author's homework" by evaluating LLM-generated legal rules against 10,901 real-world records of Korean SME status. It demonstrates that traditional evaluation methods overstate model performance and that "transitional provisions"—rules about how laws change over time—are often more important than the core statutory text.
What Problem Does This Paper Address?
As we move toward "Rules as Code" (RaC), Large Language Models (LLMs) are increasingly used to translate statutes into executable Python or Prolog. However, current benchmarks suffer from a circularity problem: a model is typically graded against a "gold standard" written by the same person who provided the law to the model. If the human grader misreads a subtle provision, the model is rewarded for making the same mistake.
Furthermore, most legal AI research treats law as a static "point-in-time" problem. In reality, law is intertemporal. When a law changes, "transitional provisions" (often buried in addenda) determine whether an old rule still applies to a specific firm on a specific date. This paper tackles the challenge of evaluating how well LLMs handle these "layers" of law—statutes, decrees, annexes, and addenda—across many years of real-world outcomes.
Methods
The author developed a pipeline to test four LLMs (Gemini 3.8 Flash, Claude Opus 5.5, Claude Haiku 5.5, and GPT-OSS 120B) on their ability to write a judge(facts) function that determines a firm's status.
Key methodological innovations include:
- Two-Reference Grading: Every model output is graded twice—once against a "Reference Rule" (the author's manual interpretation) and once against an "Answer Key" (independent real-world records).
- Delegation-Aware Retrieval: A custom retriever that doesn't just look at the main statute but "walks" through citations to find subordinate decrees, industry-specific annexes, and transitional addenda.
- Verify-and-Repair Loop: A system that checks the generated code against logical properties derived from the law (e.g., "a firm far below the revenue ceiling must be an SME") and asks the LLM to fix violations.
Datasets
The paper introduces a massive, newly curated test bed:
- Korean SME Status: 10,901 firm-years (2015–2023) of Small and Medium Enterprise (SME) status disclosed by listed companies in South Korea. This is paired with a "Version Store" containing 39 versions of the Act and 45 versions of the Decree.
- US Income Tax: 2,000 synthetic returns (2013–2022) graded against the NBER TAXSIM35 calculator to test yearly changes in tax parameters.
- German Hospital Volumes: 7,845 decisions regarding hospital entitlements, where thresholds are often hidden in transitional clauses.
Key Insights and Ideas
- The "Addenda" Gap: In the Korean case, the date of a decision matters more because of transitional provisions (addenda) than because of the actual numbers (ceilings) in the law. Ignoring these addenda leads to significant errors.
- Performance "Shrinkage": This is the paper's most critical finding. A model's apparent "lead" in performance often shrinks when measured against real records compared to the author's reading. For three models, the advantage of providing the "right" provisions was 28–60% smaller against real records.
- The Grader's Bias: Grading against your own reading can overstate a model's utility. If a model reproduces a human's incorrect reading of a contested provision, it looks "perfect" in a standard benchmark but fails in the real world.
- Reporting Inertia: Real-world data revealed that firms often repeat their previous year's status word-for-word, even when the law suggests they should have transitioned. This "inertia" is a property of practice that a pure legal reading cannot predict.
Key Results
- Accuracy Boost: Modelling just one transitional provision raised the agreement between the executable rule and real-world disclosures from 83–86% to 89–90%.
- Testing Interpretations: The real-world disclosures were used to "vote" on a contested legal reading. In 130 out of 189 firm-years where two legal readings diverged, the disclosures favored the author's specific interpretation.
- Retrieval Sensitivity: Providing the exact required provisions (an "oracle" bundle) resulted in 98.9% agreement with the author's reading but only 89% agreement with real-world records, highlighting the "ceiling" created by real-world noise and missing facts.
Limitations and Future Work
- Ground Truth vs. Practice: The "Answer Key" (company disclosures) is not a legal "ground truth"—firms can and do make mistakes in their own filings.
- Omitted Complexity: The current reference rules omit some highly complex ownership-based independence tests, which accounted for about 32% of the remaining disagreements with the data.
- Future Directions: The author suggests that future retrieval systems should include "dated official interpretations" from government agencies as an additional layer to help models resolve open legal questions.
Summary updated