Source-linked AI summary
Large Language Model-Driven Code Compliance Checking in Building Information Modeling
Soumya Madireddy, Lu Gao, Zia Din, Kinam Kim, Ahmed Senouci, Zhe Han, Yunpeng Zhang
TL;DR
Existing automated compliance checking faces challenges in interpreting complex regulations and relying on complete BIM information. This paper uses LLMs to generate Python scripts for checking in Revit; its evaluation found ChatGPT 4.0 and Claude Sonnet 3.5 most effective, while Meta Llama 3.1-405B and Microsoft Copilot failed to generate successful scripts.
Problem
Automated compliance checking faces difficulties interpreting complex, ambiguous regulations and requires accurate, complete BIM data, often necessitating labor-intensive model preparation.
Source: §2.3 · p. 5Method
The framework uses LLMs to interpret regulations, generate Python rule-checking scripts, and execute them within Revit, with execution errors returned for refinement.
Source: §3 · p. 7Results
ChatGPT 4.0 and Claude Sonnet 3.5 were the most effective models tested, while Meta Llama 3.1-405B and Microsoft Copilot did not generate successful Python scripts despite multiple attempts.
Source: §5 · p. 20Takeaways & Limitations
In a residential project assessed against IRC regulations, the framework identified non-compliance issues by flagging problems in the BIM model.
Source: §5 · p. 20The approach remains challenged by complex regulatory texts and depends on detailed, accurate, and complete BIM information.
Source: §2.3 · p. 5, §2.4 · p. 6
Abstract
from arXiv · showhide
This research addresses the time-consuming and error-prone nature of manual code compliance checking in Building Information Modeling (BIM) by introducing a Large Language Model (LLM)-driven approach to semi-automate this critical process. The developed system integrates LLMs such as GPT, Claude, Gemini, and Llama, with Revit software to interpret building codes, generate Python scripts, and perform semi-automated compliance checks within the BIM environment. Case studies on a single-family residential project and an office building project demonstrated the system's ability to reduce the time and effort required for compliance checks while improving accuracy. It streamlined the identification of violations, such as non-compliant room dimensions, material usage, and object placements, by automatically assessing relationships and generating actionable reports. Compared to manual methods, the system eliminated repetitive tasks, simplified complex regulations, and ensured reliable adherence to standards. By offering a comprehensive, adaptable, and cost-effective solution, this proposed approach offers a promising advancement in BIM-based compliance checking, with potential applications across diverse regulatory documents in construction projects.
1 Introduction
Manual code review in the AEC industry is time-consuming, inefficient, and prone to errors. The introduction positions LLM-based executable rules integrated with BIM as a response to unresolved challenges in automated compliance checking.
1.1 Code Compliance
- Code compliance is critical in AEC, but traditional reviews of drawings and specifications are time-consuming, inefficient, and error-prone.ACC translates regulations into machine-interpretable rules, prepares BIM data, executes the rules, and reports violations.Source: §1.1 · pp. 1–2
1.2 Challenges in current ACC systems
- Current ACC systems struggle with ambiguous, changing regulations and require accurate, complete BIM data, while preprocessing can be labor-intensive and systems may lack transparency or scalability.ACC systems nevertheless have potential to improve checking speed, accuracy, and consistency.Source: §1.2 · p. 2
1.3 Emergence of LLMs and its transformative potential
- LLMs may interpret complex regulations and convert them into computable rules, but output accuracy and reliance on prompt engineering remain challenges.They can also adapt to new regulations and extract structured information from regulatory texts.Source: §1.3 · pp. 2–3
1.4 Objectives of this research
- The study proposes converting regulations into executable Python scripts for real-time compliance checking in Revit, addressing gaps in BIM integration and adaptability to changing regulations.Source: §1.4 · p. 3
2 Literature Review
Code compliance supports construction safety, efficiency, and legal adherence, but automated checking remains difficult because regulations and BIM data are complex and existing tools have practical limits. Prior approaches range from hard-coded BIM rules and language-processing methods to LLM applications; the identified gap is direct, adaptable integration within BIM.
2.1 Importance of code compliance in construction
- Automated compliance checking can support safety and efficiency, while building-code adherence also protects legal compliance.Automated checks can identify safety issues early, reduce human error and costly rework, and streamline permitting and reporting.Source: §2.1 · p. 3
2.2 Methods for ensuring compliance
- Compliance methods evolved from manual review and rigid BIM rules toward semi-automated logic, NLP, visual languages, knowledge graphs, and LLM-based rule translation.Early BIM systems embedded hard-coded rules; later methods used logical operators, information extraction, ontologies, and accessible visual or domain-specific languages.Source: §2.2 · p. 4
2.3 Current automated tools and their limitations
- Current ACC systems face challenges translating ambiguous, frequently changing regulations and maintaining complete, accurate BIM data across varied jurisdictions.Model normalization can require labor-intensive manual correction, while commercial tools vary in regulatory scope and capabilities.Source: §2.3 · p. 5
- Existing tools can rely on hard-coded rules, manual configuration, or narrow code coverage, limiting adaptation to changing regulations and complex BIM models.Lack of transparency and flexibility can also constrain customization and user acceptance.Source: §2.3 · p. 5
2.4 Applications of Large Language Models in AEC
- LLMs have been applied to regulatory-text structuring and Python-code generation, but complex regulatory structures remain challenging and some studies use simpler texts.Other AEC applications include BIM design assistance and structural-design optimization.Source: §2.4 · p. 6
- LLMs can reduce reliance on annotated datasets and manual feature engineering, while nested clauses and ambiguous regulatory language remain difficult.The literature describes pre-classification and deep-learning methods as ways to handle these challenges.Source: §2.4 · p. 6
2.5 Research Gap
- The research gap is direct BIM-environment integration that can accommodate diverse regulations and changing requirements.The proposed approach converts regulations into executable Python scripts within BIM.Source: §2.5 · p. 6
3 Methodology
The methodology combines BIM models and regulatory documents in a four-component compliance-checking framework. LLMs interpret regulations and generate Python scripts for Revit; execution errors feed back for refinement, and the framework reports compliance or recommendations.
3 Methodology
- The framework connects input data, AI-based interpretation, rule-checking, and output into four components.Figure 1 presents the LLM-based BIM rule-checking framework.Source: §3 · p. 6, Figure 1 · p. 8
- BIM models supply building geometry, spatial relationships, elements, and metadata, while regulatory documents supply standards to validate against the model.Example requirements include fire safety, accessibility, and structural integrity.Source: §3 · p. 7
- LLMs interpret regulatory text into machine-readable logic and generate Python scripts tailored for rule-checking in Revit.When execution errors occur, the framework returns error details to the LLM for script refinement.Source: §3 · p. 7
- Successful script execution produces compliance or non-compliance reports, with targeted recommendations for non-compliant models.The feedback loop connects rule execution to AI interpretation for script refinement.Source: §3 · p. 7
4 Case Study
Two building projects were used to demonstrate Revit-based checks of code rules, with LLM-generated scripts and reports covering diverse building elements. Evaluation also compared eight LLMs on script-generation performance.
4.1 Sample Rules
- The 12 sample rules drawn from sources including the IRC and IMC cover dimensions, object relationships, materials, fixtures, structural elements, and mechanical components.The rules were converted into Python scripts for the case studies.Source: §4.1 · p. 8
4.2 Prompt Engineering
- The optimized prompt combines a basic task prompt, rule description, general Revit/PythonShell compatibility instructions, and rule-specific instructions for accessing model elements and attributes.After trial and error, Prompt B produced a correct Rule 1 result where Prompt A’s generated script produced an execution error.Source: §4.2 · pp. 10–11, Figure 2 · p. 10
4.3 Case Study 1
- The single-family case study checked doors, stairs, rooms, guardrails, ceilings, flooring, and fixtures, identifying compliant and non-compliant elements against the selected rules.Checks used Revit dimensions, room tags and boundaries, elevation parameters, material properties, and fixture relationships; inaccurate room data can affect which spaces are verified.Source: §4.3 · pp. 13–15
- Rule 8’s check identifies toilet fixtures and their properties, while the Rule 9 kitchen check reports a missing sink as non-compliant.The output can include room number or name when those parameters are available in Revit.Source: §4.3 · pp. 16–17, Figure 11 · p. 17, Figure 10 · p. 17
4.4 Case Study 2
- For the office model, Rule 12 assigns diffuser airflow to rooms and checks whether each room meets the area-based outdoor-air requirement of 0.06 CFM per square foot.The selected office rules also included the required minimum distance between footings.Source: §4.4 · pp. 17–18
4.5 Generating Compliance Reports Using LLMs’ API
- The LLM API generates reports from Revit outputs with issue summaries, descriptions of non-compliant elements, corrective recommendations, and potential safety and functionality impacts.The sample report applies this process to Rule 1.Source: §4.5 · p. 18, Figure 13 · p. 18
4.6 Comparison between Different Large Language Models
- 76.7% success rate: Grok achieved the best overall performance among eight evaluated LLMs, while Meta LLaMA 3.1-405B and Microsoft Copilot generated no working scripts.Claude Sonnet 3.5 averaged a 23.7% success rate, requiring 3.4 iterations versus ChatGPT 4.0’s 6.8.Source: §4.6 · p. 19, Table 4 · p. 20
5 Conclusions
The framework uses LLM-generated Python scripts for BIM compliance checking, and case studies show it can identify violations. Its performance depends on prompt design and well-structured BIM data, and testing remains limited in scope.
- The framework uses LLMs to generate Python scripts for regulatory compliance checks in a BIM environment and identified non-compliance in a residential project assessed against IRC regulations.Source: §5 · p. 20
- ChatGPT 4.0 and Claude Sonnet 3.5 were most effective, while Llama 3.1-405B and Copilot failed to generate successful scripts despite multiple attempts.Source: §5 · p. 20
- The optimized prompt combines a basic prompt, rule descriptions, general instructions, and rule-specific instructions; a functional script for one rule helped generate scripts for others.Source: §5 · p. 20
- The framework works best with well-structured BIM models and accurate room metadata, and Revit 2024 must be paired with PythonShell 2024 for proper functionality.Source: §5 · pp. 20–21
- The tool is intended for pre-construction issue resolution, scalable project use, adaptation to additional structural regulations, and changes in building regulations; it also reduces checking time.Source: §5 · p. 21
- Evaluation covered only two case studies and 12 rules, limited Revit versions, and a workflow requiring manual script execution and error correction.Source: §5 · p. 21