# Reinforcement learning to improve large language model-based automated code compliance systems

DevFeed: [Reinforcement learning to improve large language model-based automated code compliance systems](<https://devfeed.tech/articles/reinforcement-learning-to-improve-large-language-model-based-automated-code-compliance-systems-107342.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2606.22402>)

Author: Jack Wei Lun Shi, Minghao Dang, Wawan Solihin, Justin K. W. Yeoh

Published: 2026-10-30T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [grpo](<https://devfeed.tech/topics/grpo.md>), [Reinforcement learning](<https://devfeed.tech/topics/reinforcement-learning.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [LLM evaluation / benchmarking](<https://devfeed.tech/topics/llm-evaluation-benchmarking.md>), [Fine-tuning](<https://devfeed.tech/topics/fine-tuning.md>)

Tags: [code-compliance](<https://devfeed.tech/tags/code-compliance.md>), [compliance](<https://devfeed.tech/tags/compliance.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-cl](<https://devfeed.tech/tags/cs-cl.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [edit-distance](<https://devfeed.tech/tags/edit-distance.md>), [false-positives](<https://devfeed.tech/tags/false-positives.md>), [few-shot](<https://devfeed.tech/tags/few-shot.md>), [fine-tuning](<https://devfeed.tech/tags/fine-tuning.md>), [grpo](<https://devfeed.tech/tags/grpo.md>), [intermediate](<https://devfeed.tech/tags/intermediate.md>), [large-language-model](<https://devfeed.tech/tags/large-language-model.md>), [levenshtein-distance](<https://devfeed.tech/tags/levenshtein-distance.md>), [regulations](<https://devfeed.tech/tags/regulations.md>), [reinforcement-learning](<https://devfeed.tech/tags/reinforcement-learning.md>), [semantics](<https://devfeed.tech/tags/semantics.md>), [zero-shot](<https://devfeed.tech/tags/zero-shot.md>)

## AI overview

P4IR combines supervised fine-tuning (SFT) to instill building-regulation knowledge in an LLM with Group Relative Policy Optimization (GRPO) to improve intermediate code skeletons for automated code compliance. Relative to SFT baselines, it reduced tree edit distance by up to 21.3% and token-level Levenshtein distance by up to 41.0%. The abstract also reports that its zero-shot approach outperformed leading LLMs evaluated with few-shot prompting on code structure and semantics, and that GRPO significantly reduced false positives. These results are reported for the study; the supplied excerpt does not provide further evaluation details.

## Source excerpt

arXiv:2606.22402v2 Announce Type: replace Abstract: Large language model (LLM)-based approaches for automated code compliance (ACC) of building regulations are prone to generating incorrect and hallucinated computer-processable rules. This paper introduces P4IR, a two-stage framework that uses supervised fine-tuning (SFT) to instill domain knowledge in an LLM, followed by Group Relative Policy Optimization (GRPO) to improve the accuracy of the generated intermediate representations in the form of high-level code skeletons. The framework achieved final reductions of up to 21.3% and 41.0% in tree edit distance and token-level Levenshtein distance respectively, relative to the SFT baselines. Comparative analysis demonstrates that this approach in a zero-shot setting outperforms leading LLMs in both code structure and semantics, evaluated via few-shot prompting. Additionally, the GRPO stage produced a statistically significant reduction in false positives. By combining SFT with GRPO to optimize directly for domain-specific objectives, this approach offers a path toward more accurate and reliable LLM-based ACC systems.