基于大语言模型的受约束代码生成研究进展
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:

国家重点研发计划(2023YFB4503803)


Research Progress on Constrained Code Generation in Large Language Models
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    大语言模型在自动代码生成领域已展现出巨大的潜力, 但在实际应用中, 生成的代码常存在语法、语义、安全性、运行效率和可维护性等多方面的问题. 为解决这些挑战, 受约束代码生成技术应运而生. 此技术借鉴了受约束文本生成的方法, 通过在代码生成的各个阶段引入严格的约束, 确保生成代码能够满足预期的要求. 首先回顾大语言模型在代码生成过程中所暴露的主要问题, 详细分析代码正确性与代码质量方面的缺陷. 接着, 总结当前受约束代码生成技术的研究进展, 深入探讨不同方法的优势与局限. 之后, 讨论评估方法, 包括基准数据集的构建和评价指标的设计, 为后续研究的实验方案提供有价值的参考. 最后, 展望受约束代码生成技术面临的研究挑战和未来发展趋势.

    Abstract:

    Large language models (LLMs) demonstrate significant potential in automatic code generation. However, in practical applications, the generated code often suffers from multiple issues, including syntax errors, semantics inconsistencies, security inconsistencies, inefficient runtime performance, and poor maintainability. To address these challenges, constrained code generation techniques are introduced. Drawing inspiration from constrained text generation, these techniques impose explicit constraints at various stages of the code generation process to ensure that the generated code satisfies predefined requirements. This study first reviews the major issues exposed by LLMs in code generation, with a detailed analysis of deficiencies related to code correctness and quality. Subsequently, recent research progress in constrained code generation is summarized, and the strengths and limitations of existing approaches are systematically examined. Furthermore, evaluation methods are discussed, including the construction of benchmark datasets and the design of evaluation metrics, providing valuable references for experimental settings in future research. Finally, the research challenges faced by constrained code generation and its future development trends are outlined.

    参考文献
    相似文献
    引证文献
引用本文

李宇轩,邹艳珍,王玥,谢冰.基于大语言模型的受约束代码生成研究进展.软件学报,,():1-31

复制
相关视频

分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2025-05-30
  • 最后修改日期:2025-08-13
  • 录用日期:
  • 在线发布日期: 2026-04-01
  • 出版日期:
文章二维码
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号