Skip to main content
QUICK REVIEW

[论文解读] A Survey on LLM-based Code Generation for Low-Resource and Domain-Specific Programming Languages

Sathvik Joel, Jie JW Wu|arXiv (Cornell University)|Oct 4, 2024
Embedded Systems Design Techniques被引用 4
一句话总结

本综述对2020–2024年间111篇文献进行了系统性文献回顾,分析了基于大语言模型(LLM)的低资源编程语言(LRPLs)和领域特定编程语言(DSLs)的代码生成。研究识别出数据稀缺和领域专有语义等关键挑战,评估了现有基准、度量指标和模型改进策略,并指出缺乏标准化的评估框架——为该研究领域尚待探索的未来工作奠定了基础。

ABSTRACT

Large Language Models (LLMs) have shown impressive capabilities in code generation for popular programming languages. However, their performance on Low-Resource Programming Languages (LRPLs) and Domain-Specific Languages (DSLs) remains a significant challenge, affecting millions of developers-3.5 million users in Rust alone-who cannot fully utilize LLM capabilities. LRPLs and DSLs encounter unique obstacles, including data scarcity and, for DSLs, specialized syntax that is poorly represented in general-purpose datasets. Addressing these challenges is crucial, as LRPLs and DSLs enhance development efficiency in specialized domains, such as finance and science. While several surveys discuss LLMs in software engineering, none focus specifically on the challenges and opportunities associated with LRPLs and DSLs. Our survey fills this gap by systematically reviewing the current state, methodologies, and challenges in leveraging LLMs for code generation in these languages. We filtered 111 papers from over 27,000 published studies between 2020 and 2024 to evaluate the capabilities and limitations of LLMs in LRPLs and DSLs. We report the LLMs used, benchmarks, and metrics for evaluation, strategies for enhancing performance, and methods for dataset collection and curation. We identified four main evaluation techniques and several metrics for assessing code generation in LRPLs and DSLs. Our analysis categorizes improvement methods into six groups and summarizes novel architectures proposed by researchers. Despite various techniques and metrics, a standard approach and benchmark dataset for evaluating code generation in LRPLs and DSLs are lacking. This survey serves as a resource for researchers and practitioners at the intersection of LLMs, software engineering, and specialized programming languages, laying the groundwork for future advancements in code generation for LRPLs and DSLs.

研究动机与目标

  • 解决现有文献中忽视低资源与领域特定编程语言(LRPLs 和 DSLs)在基于大语言模型的代码生成研究中的关键空白。
  • 系统分析当前大语言模型在LRPLs和DSLs中用于代码生成的现状,重点关注评估度量指标、基准和模型改进技术。
  • 识别并分类针对LRPLs和DSLs特有的数据收集与整理策略,这些语言因训练数据有限和语义专有性而面临独特挑战。
  • 突出显示LRPLs和DSLs缺乏标准化基准和评估度量指标的问题,与高资源编程语言(HRPLs)的挑战进行对比。
  • 提出可操作的研究机会,以推动特定领域中代码生成的发展,包括跨语言迁移、中间表示形式以及形式化验证技术。

提出的方法

  • 对超过27,000项研究进行了系统性文献回顾(SLR),筛选出111篇文献(2020–2024年),并通过2024–2025年的雪球法和扩展搜索确保覆盖全面。
  • 将评估技术分为四大类,并分析了14种以上用于评估LRPLs和DSLs中代码生成性能的度量指标,包括语法正确性和语义正确性。
  • 将模型改进策略划分为六大类:微调、提示工程、检索增强生成(RAG)、蒸馏、思维链提示和基于合成数据的微调。
  • 映射并分析了文献中使用的数据集,重点关注网络爬取、代码仓库挖掘和人工标注等整理方法,尤其针对低资源语言。
  • 探索了新型架构与技术,如中间语言表示形式和符号执行,以提升DSLs中代码生成与评估的性能。
  • 采用结构化框架比较LRPLs和DSLs中的方法,识别出由于领域特定语法、语义和专业知识需求而带来的独特挑战,尤其在DSLs中更为显著。

实验结果

研究问题

  • RQ1目前用于评估基于大语言模型的低资源与领域特定编程语言代码生成的基准、度量指标和评估技术有哪些?
  • RQ2文献中提出了哪些方法论和模型改进策略以提升大语言模型在LRPLs和DSLs中的性能?
  • RQ3LRPL和DSL语境下用于训练和评估大语言模型的数据集是如何收集、整理和预处理的?
  • RQ4与LRPLs相比,DSLs在代码生成方面面临的关键挑战与方法有何不同,特别是在数据稀缺性和领域专有性方面?
  • RQ5在评估缺乏标准化和基准不统一的情况下,有哪些研究机会可用于解决LRPLs和DSLs的问题?

主要发现

  • 尽管关注度持续上升,但大多数LRPLs和DSLs仍缺乏标准化的基准和评估度量指标,而像Python这样的高资源语言则已具备。
  • MultiPL-E基准显示显著性能差距,大语言模型在Rust和R等LRPLs上的得分远低于在Python上的表现。
  • 识别出六类主要的模型改进策略:微调、提示工程、RAG、蒸馏、思维链提示和合成数据生成。
  • LRPLs和DSLs的数据收集严重依赖网络爬取、GitHub代码仓库挖掘和人工整理,但这些方法常导致数据量有限、噪声多或代表性不足。
  • DSLs面临的挑战比LRPLs更为突出,主要由于高度专有的语法、语义以及对专家知识或领域专用工具的依赖。
  • 研究机会包括开发形式等价性检查器、从HRPLs进行跨语言迁移学习、中间语言表示形式,以及整合符号执行或定理证明以实现语义验证。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。