Risks and Limits of Automatic Consolidation of Statutes (2025)

Abstract: As in many countries of the Civil Law tradition, consolidated versions of statutes - statutes with added amendments - are difficult to obtain reliably and promptly in Germany. This gap has prompted interest in using large language models (LLMs) to ‘synthesize’ current and historical versions from amendments. Our paper experiments with an LLM-based consolidation framework and a dataset of 908 amendment–law pairs drawn from 140 Federal Law Gazette documents across four major codes. While automated metrics show high textual similarity (93-99%) for single-step and multi-step amendment chains, only 50.3% of exact matches (single-step) and 20.51% (multi-step) could be achieved; our expert assessment reveals that non-trivial errors persist and that even small divergences can carry legal significance. We therefore argue that any public or private deployment must treat outputs as drafts subject to rigorous human verification.

## introduction legal systems of the civil law tradition are based on statutes. statutes change over time. changes are typically ordered by the legislator and implemented via other (amending) statutes; these amendments, published in the official gazette, describe how the current wording of a statute is to be changed, but do not spell out its updated 'version'. this makes the process of consolidation necessary, where amendments are used to update the text of a statute in order to get the current 'version'. access to consolidated versions of german statutes is limited. non-legally-authoritative platforms provide current texts and separate, authoritative amendment logs, but consolidated texts may appear with substantial delays. users must often reconcile amendment logs with outdated consolidations -a process that is time-consuming and error-prone for specialists and non-specialists alike. ## background german legal professionals lack an authoritative archive of historically consolidated federal statutes. "laws on the internet" ("gesetze im internet") foot_2 provides current federal laws without historical versions. amendments have been published since 1949 in federal law gazettes (german: bundesgesetzblatt) foot_3 , and since 2023 on recht.bund.de, foot_4 , but these publish only the amending texts, not integrated consolidations. private efforts such as buzer.de foot_5 partially fill the gap (post-2006 snapshots), yet coverage and timeliness remain limited. ## data figure 1 shows our pipeline for creating the dataset to track the 'evolution' of selected german federal statutes over time. step 1 downloads daily snapshots of all federal laws from the laws on the internet repository foot_6 covering 2019 to 2025. each snapshot contains approximately 300 mb of xml files representing all federal legislation. since most laws remain unchanged on a daily basis, this raw data contains significant redundancy. steps 2 and 3 identify and preserve only meaningful changes. we process each law's xml files in chronological order, comparing consecutive versions to detect any modifications. when identical content appears across multiple days, we keep only one version. this de-duplication retains all substantive amendments while reducing storage requirements. each preserved version corresponds to a specific amendment that altered the law's content. step 4 links these law versions to their official sources. the federal law gazette serves as germany's official publication for amendments, providing authoritative texts of amendments. we match each detected change to its corresponding gazette entry. we use gpt-4.1 with a structured prompt (see appendix a) to extract amendment text and effective dates. step 5 assembles all components into our complete dataset. we merge the consolidated law versions with their corresponding amendments and effective dates to create a temporal record. as figure 1 shows, this process reveals distinct patterns: 𝐿𝑎𝑤 1 underwent three amendments during our study period, 𝐿𝑎𝑤 2 remained unchanged, while 𝐿𝑎𝑤 3 and 𝐿𝑎𝑤 𝑛 experienced varying numbers of modifications at different times. this dataset enables precise tracking of how each law evolved throughout the examination period. ## experiments using the dataset, we tested whether we can reconstruct law versions by applying amendments to initial versions. we evaluate automated legal text consolidation in single-step (isolated amendments) and multi-step (sequential modifications over time) setups. in single-step experiments, we apply one amendment to an initial version to create a predicted version, then compare it against the actual version using similarity scores. in multi-step experiments, we apply 𝑛 amendments sequentially to an initial version and compare the final predicted version against the exact version after 𝑛 changes. this multi-step approach serves two purposes: it reduces computational costs by requiring fewer similarity calculations and ,more importantly, it validates whether laws can be reconstructed accurately when intermediate versions are unavailable-a common scenario in practice. while single-step is straightforward-applying one amendment to produce a predictable result-multi-step processing involves challenging dependency chains. if amendment 1 is not used correctly, amendment 2 cannot, e.g., locate the text "10,000 euros" because this phrase only exists in the amended version, not the original. this dependency means amendment 2 cannot add the public infrastructure criterion without amendment 1's threshold text already in place, propagating mistakes down the chain. for illustration, we show a single-step amendment using an example (adapted for brevity) from civil code § 31a and a multi-step amendment using an example adapted from criminal code § 194. ## results the results for the previously tried single-step (5.1) and the novel multi-step (5.2) setup for automated consolidation diverge; while the exact match rate massively deteriorates, the lexical and semantic similarity scores remain high. the expert scores show a mixed picture (5.3). ## prototype for experimentation we developed a prototype web application for consolidating german federal laws, planned for public experimentation. the interface (figure 3 ) provides a three-step workflow: users select a law (civil code, criminal code, commercial code, or income tax act), the system processes it through twelve automated steps (10-30 minutes depending on complexity), and users access all versions with timestamps and validity status. the prototype creates version histories using enforcement dates extracted during amendment processing (section 4). each version is marked as historical or currently valid. currently, the system reconstructs versions from 2019 onward, but the framework can extend to amendments published since 1949. users can download any version as an archive. ## conclusion and future work this research presents the first investigation into an llm-based approach to consolidating german statutes, examining the practical viability of addressing the task with technical means. our experimental framework successfully processed 140 of 148 federal law gazette documents (94.5%) and achieved 93-99% semantic similarity even with complex amendment chains averaging 2.79 amendments. however, the exact match rates remained very low (50.3% for single-step and 20.51% for multi-step). given the peculiarities of the legal language with its strict definitions of technical terms, we pointed out that these low rates make human evaluation paramount. while our own expert evaluation of 100 imperfect consolidations revealed that 53% of discrepancies were cosmetic or had limited technical effects (s0-s2), with 78% requiring only trivial corrections (c0-c2) and no validity-threatening errors, relying on lexical or semantic scores in the cases of non exact matches alone would severely overestimate the performance of such systems. we therefore recommend strict oversight when using llms for the task of automated consolidation. three documents exceeded the model's context window, revealing a critical limitation. future work should develop chunking strategies for lengthy legal documents that preserve semantic relationships within context constraints, enabling processing of currently inaccessible documents and improving existing consolidations. another direction involves an agentic framework that dynamically selects models based on amendment complexity. simple substitutions would use smaller, cost-effective models, while complex amendments with cross-references or dependency chains would trigger larger models. this adaptive approach optimizes the cost-accuracy trade-off, making large-scale deployment economically feasible while maintaining quality for critical consolidations. these improvements could enable comprehensive automation of german federal legal consolidation, transforming legal accessibility for practitioners, courts, and citizens.