Long Context Window-Based Legal Interpretation of Building Codes and Regulations

59 Pages Posted: 2 Jan 2025

See all articles by Jaekun Lee

Jaekun Lee

Yonsei University

Ghang Lee

Yonsei University

Abstract

Authorities handle over 2,000 inquiries daily about building code violations. Interpreting these complex, frequently updated codes is challenging, even for legal experts. Prior studies used large language models (LLMs) with retrieval-augmented generation (RAG) but struggled to maintain context due to data segmentation. This study evaluates three automated building code interpreter (ABCI) models—Original, Inferred, and Filtered—leveraging long-context window (LCW) LLMs. ABCI-Filtered achieved 63.2% accuracy on 171 legal interpretative question-answering (LIQA) datasets, followed by ABCI-Inferred (60.8%) and ABCI-Original (56.7%), all surpassing the RAG baseline (56.1%). While RAG struggled to maintain contextual relationships among segmented data, ABCI identified an average of 2.13 additional relevant provisions per inquiry. Unlike prior methods requiring fine-tuning for task-specific patterns, ABCI demonstrated zero-shot reasoning, referencing attached forms and definitions 40 times. However, ABCI-Original struggled to integrate relevant information. Adding a recursive search module improved accuracy by 7.3%p by separating provision searching from answer generation.

Keywords: legal interpretation, building code, Large Language Model, context window, task-specific patterns

Suggested Citation

Lee, Jaekun and Lee, Ghang, Long Context Window-Based Legal Interpretation of Building Codes and Regulations. Available at SSRN: https://ssrn.com/abstract=5080078 or http://dx.doi.org/10.2139/ssrn.5080078

Jaekun Lee

Yonsei University ( email )

Seoul
Korea, Republic of (South Korea)

Ghang Lee (Contact Author)

Yonsei University ( email )

Seoul
Korea, Republic of (South Korea)

Do you have a job opening that you would like to promote on SSRN?

Paper statistics

Downloads
15
Abstract Views
191
PlumX Metrics