Rules as code, graded against firms’ filings
Laws are increasingly turned into programs that decide specific cases, such as whether a firm was a small or medium enterprise (SME) on a given date, and LLMs now write such programs. A program is usually graded against answers written by someone who read the same law, so it can score well by repeating that reading rather than by applying the law correctly. LexTemporis grades rules against an independent key - what the firms themselves stated in their annual reports. The main set is 10,901 firm-years of 1,677 Korean listed companies for fiscal years 2015-2023 with both a disclosed SME status and the facts for a decision, plus every version of the act, decree, annexes and addenda: 39 versions of the act and 45 of the decree. Under Korean law the answer requires at least five provisions in four layers, among them a 2014 transitional provision that keeps firms that were SMEs under the old rules in that status until 31 March 2018. For comparison, an appendix adds 2,000 synthetic US tax returns for 2013-2022 graded by the NBER TAXSIM35 calculator, and 7,845 insurers’ decisions on minimum procedure volumes in German hospitals with 24 versions of the rule.
The author hand-wrote a reference rule - one reading of the law - and reports every score twice: against the reference rule and against the disclosures. Agreement with the reference shows whether a rule reproduces the author’s reading; agreement with the disclosures shows whether it reproduces practice. The LLMs received an interface specification and a selection of provisions and returned a Python function. The selections: no law, current law, a fixed list of articles in the version in force on the decision date, the same list padded with unrelated provisions to the size of the author’s bundle, the author’s retrieval accounting for delegation and addenda, and a bundle of exactly the required provisions as an upper bound. Each condition-year cell was sampled three times. The main model was Gemini 3.8 Flash; Claude Opus 5.5, Claude Haiku 5.5 and GPT-OSS 120B answered the same 343 prompts. The primary comparison (the author’s retrieval versus the fixed list) and the success criteria were fixed in an analysis plan before the remaining results were collected.
The reference rule agrees with the disclosures in 89.1% of cases (95% interval 87.9-90.3%). Modelling the 2014 transitional provision together with the once-only grace rule raises agreement for 2015-2017 from 83-86% to 89-90%, while applying the 2025 annex with its new ceilings to all years changes 3.5% of size decisions but moves the size test’s agreement with the disclosures only from 85.3% to 85.8%: the date matters through transitional rules more than through the amounts. The disclosures also tested the author’s reading. The 2014 provision admits two readings, and in the 189 firm-years where they diverge the disclosures side with the author’s reading in 130 and with the other in 59; a hand check and a blind second annotator confirm the labels. In a sample of 60 of the remaining disagreements (1,183 in total), about 32% point to the independence requirements that the rule omits. For the LLMs, the pre-registered comparison found no selection better across all four models, and for Gemini 3.8 Flash no year passed the criteria. In an exploratory analysis, the author’s retrieval leads the fixed list by 0.021 against the reference rule and by 0.006 against the disclosures. Where a model does not reach the transitional provision’s outcome on its own, the added provision decides the outcome and the lead survives against the disclosures (Claude Opus 5.5, firms covered by the 2014 provision, 2015: 0.935 versus 0.348).
The author states the limitations. The disclosures are the firms’ self-assessment outside the audit of the financial statements, not legal ground truth, and part of the 11% disagreement may be error in them. The reference rule is the reading of one author without legal training (reviewed by one practising lawyer), it omits the independence requirements, and correcting label errors in the key itself changed the conclusion on the contested provision: before the corrections the disclosures split between the readings almost evenly. The start of the grace period was chosen on the key and then checked on held-out firms. The LLM results are exploratory: four models, three functions per cell. For legal analytics, the author’s conclusion is that grading a rule-as-program against the grader’s own reading can overstate how well it works, while an independent key also tests the reading of the law itself.
Paper: Grading Executable Legal Rules Against Independent Records: Transitional Provisions and Korean SME Status. Jinhyung Bae