Elamur Research⌕
☰
home / papers / 2026 / Chunking German Legal Code

Chunking German Legal Code

Paper · 2026 · Max Prior, Natalia Milanova and Andreas Schultz

Summary

The paper asks how German statutory law should be split into chunks for retrieval-augmented generation. The test corpus is the German Civil Code (BGB), which has about 2,400 sections. The authors index the BGB in many ways:

  • Structural units: sections, subsections, sentences, LLM-derived propositions.
  • Fixed-size windows: overlapping windows of uniform length.
  • Modifying or aggregating methods: contextual chunking, semantic clustering, Lumber-style LLM boundary detection, and RAPTOR summary trees.

Each variant is scored on a German layperson legal QA dataset with section-level gold labels. Every retrieved unit is mapped back to its parent section, so all granularities are compared fairly. Besides Recall@10, the study records query latency, index build time and disk footprint.

The structure-preserving variants win: subsection and section retrieval give the best recall, followed by sentences and propositions. Methods that pool or cut across the legislator's boundaries do worse, and the LLM-heavy pipelines also cost far more to build. The practical lesson is that in highly structured domains, respecting the native document structure beats semantic enrichment in both accuracy and cost.

Key points

  • Ranking: Recall@10 is highest for subsection and section chunks, then sentence and proposition chunks. Fixed windows, semantic clustering and Lumber-style chunking score measurably lower, and RAPTOR sits in between.
  • Build time: RAPTOR indexes take roughly 3 h 4 m to 5 h 51 m to build. Lumber variants are the most expensive, at about 9 h 2 m to 11 h 41 m, because of extensive LLM preprocessing.
  • Flat index sizes: these grow with granularity, from 33.2 MB (section) to 62.1 MB (subsection), 95.7 MB (sentence) and 131.9 MB (proposition). Contextual variants have the same sizes, since they embed the same number of units.
  • Other index sizes: RAPTOR needs 68.5–144.1 MB because it stores leaves plus summary nodes, and Fixed 16/4 is the largest at 230.9 MB. Fixed 256/64 (14.7 MB) and semantic clustering (15.4–16.4 MB) are the smallest; clustering stays near one thousand vectors regardless of base unit.
  • Limitations: only one layperson dataset, retrieval-only evaluation, no cross-reference resolution, and dependence on the chosen embedding models.

Interesting ideas

  • I1. Indexing can happen at any granularity, while scoring always rolls hits up to a fixed parent unit; this makes very different segmentations directly comparable.
  • I2. The authors explain clustering's weakness as averaging: one vector for many pooled provisions drifts toward the shared topic and away from the specific rule asked about.
  • I3. Proposition splitting keeps all the conditions of a norm and isolates one consequence per proposition, so each unit is self-contained.
  • I4. Every method is reported with offline build time, online latency and storage next to accuracy, which exposes when expensive LLM preprocessing is not worth it.
  • I5. The proposed future work is reference-aware chunking: expand a unit with the definitions it relies on, including implicit ones signalled only by a defined term (e.g. "consumer").

For Mova

How these ideas could serve Mova, our small open language model — its files, stages and tests:

  • I1 (answer): Fable/tale QA could locate evidence at sentence or clause level but grade it at paragraph level, letting us compare evidence-finding strategies on one scale.
  • I2 (world): Store entity states and facts per clause rather than merging them into topic-level summaries, so an exception never gets blurred into its general rule.
  • I3 (frames): Coordinated verb phrases ("deliver X and procure Y") could become separate frames that each inherit the shared agent and conditions, making each who-did-what step individually explainable.
  • I4 (learn): When choosing among LLM teacher tiers or witness-parser ensembles, log compute and storage cost beside agreement gains to justify each tier.
  • I5 (world): When a text uses a term defined elsewhere in it or in the ontology, link the mention to that definition node so downstream reasoning sees the full meaning.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Institutions

 Fields, topics and concepts

Cite

Cite as Max Prior, Natalia Milanova and Andreas Schultz. 2026. Chunking German Legal Code. arXiv:2605.19806.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2605.19806 · arXiv 2605.19806

@misc{prior2026chunking,
  title = {{Chunking German Legal Code}},
  author = {Max Prior, Natalia Milanova and Andreas Schultz},
  year = {2026},
  doi = {10.48550/arxiv.2605.19806},
  eprint = {2605.19806},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2605.19806}
}

References

14 references, 6 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Generative AI in Professional Services Report, Technical Report, Thomson Reuters Institute, 2025. URL: https://www.thomsonreuters.com/content/dam/ewp-m/documents/thomsonreuters/en/pdf/ reports/2025-generative-ai-in-professional-services-report-tr5433489-rgb.pdf. ↗
  2. Y. Gao, Y. Xiong, X. Gao, K. Jia, J. Pan, Y. Bi, Y. Dai, J. Sun, M. Wang, H. Wang, Retrieval-augmented generation for large language models: A survey, 2024. URL: https://arxiv.org/abs/2312.10997. arXiv:2312.10997 . ↗
  3. N. F. Liu, K. Lin, J. Hewitt, A. Paranjape, M. Bevilacqua, F. Petroni, P. Liang, Lost in the middle: How language models use long contexts, Transactions of the Association for Computational Linguistics 12 (2024) 157–173. doi: 10.1162/tacl_a_00638 . ↗
  4. M. Büttner, I. Habernal, Answering legal questions from laymen in German civil law system, in: Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers), 2024, pp. 2015–2027. doi: 10.18653/v1/2024.eacl-long. 122 . ↗
  5. L. James, AI data centers are swallowing the world’s memory and storage supply, setting the stage for a pricing apocalypse that could last a decade, https://www.tomshardware.com/pc-components/ storage/perfect-storm-of-demand-and-supply-driving-up-storage-costs, 2025. Accessed: 2026-04-23. ↗
  6. P. Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, H. Küttler, M. Lewis, W.-t. Yih, T. Rocktäschel, S. Riedel, D. Kiela, Retrieval-augmented generation for knowledge-intensive nlp tasks, in: Advances in Neural Information Processing Systems, volume 33, Curran Associates, Inc., 2020, pp. 9459–9474. URL: https://proceedings.neurips.cc/paper_files/paper/2020/file/ 6b493230205f780e1bc26945df7481e5-Paper.pdf. ↗
  7. A. V. Duarte, J. Marques, M. Graça, M. Freire, L. Li, A. L. Oliveira, Lumberchunker: Long-form narrative document segmentation, 2024. URL: https://arxiv.org/abs/2406.17526. ↗
  8. T. Chen, H. Wang, S. Chen, W. Yu, K. Ma, X. Zhao, H. Zhang, D. Yu, Dense X retrieval: What retrieval granularity should we use?, in: Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, Association for Computational Linguistics, Miami, Florida, USA, 2024, pp. 15159–15177. doi: 10.18653/v1/2024.emnlp-main.845 . ↗
  9. Y. Liu, K. Hashimoto, Y. Zhou, S. Yavuz, C. Xiong, P. Yu, Dense hierarchical retrieval for open-domain question answering, in: Findings of the Association for Computational Linguistics: EMNLP 2021, Association for Computational Linguistics, 2021, pp. 188–200. doi: 10.18653/v1/ 2021.findings-emnlp.19 . ↗
  10. P. Sarthi, S. Abdullah, A. Tuli, S. Khanna, A. Goldie, C. D. Manning, Raptor: Recursive abstractive processing for tree-organized retrieval, 2024. URL: https://arxiv.org/abs/2401.18059. ↗
  11. Anthropic, Contextual retrieval, https://www.anthropic.com/engineering/contextual-retrieval, 2024. Accessed: 2026-04-08. ↗
  12. J. A. Hartigan, M. A. Wong, A k-means clustering algorithm, Journal of the Royal Statistical Society: Series C (Applied Statistics) 28 (1979) 100–108. doi: 10.2307/2346830 . ↗
  13. M. Friedman, The use of ranks to avoid the assumption of normality implicit in the analysis of variance, Journal of the American Statistical Association 32 (1937) 675–701. doi: 10.1080/ 01621459.1937.10503522 . find
  14. S. Holm, A simple sequentially rejective multiple test procedure, Scandinavian Journal of Statistics 6 (1979) 65–70. URL: http://www.jstor.org/stable/4615733. ↗

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/prior-2026-chunking-german-legal-code/