arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.22402cs.SEcs.AIcs.CLcs.LG
收藏

强化学习改进基于大语言模型的自动化代码合规系统

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

National University of Singapore(新加坡国立大学);Harbin Institute of Technology(哈尔滨工业大学);NovaCITYNETS

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

AI总结:

提出P4IR两阶段框架,先通过监督微调注入领域知识,再用GRPO优化高层代码骨架的准确性,在零样本设置下优于多个领先大语言模型。

摘要:

基于大语言模型(LLM)的建筑法规自动化代码合规(ACC)方法容易生成不正确和幻觉的计算机可处理规则。本文提出P4IR,一个两阶段框架,首先使用监督微调(SFT)向LLM注入领域知识,然后使用组相对策略优化(GRPO)提高生成的高层代码骨架形式中间表示的准确性。相对于SFT基线,该框架在树编辑距离和令牌级Levenshtein距离上分别减少了高达23.8%和38.6%。对比分析表明,该零样本设置方法在代码结构和语义上均优于领先的LLM,特别是Claude Opus和Sonnet 4.5、GPT-5.2、Qwen-3-Max和GLM-4.7(通过少样本提示评估)。此外,GRPO阶段产生了虽小但统计上显著的假阳性减少。通过将SFT与GRPO结合以直接优化领域特定目标,该方法为构建更准确可靠的基于LLM的ACC系统提供了一条途径。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑