用大模型自身能力弥补低资源编程语言的代码生成短板
Bridge-Coder: Unlocking LLMs' Potential to Overcome Language Gaps in Low-Resource Code
- 利用大模型跨语言理解能力生成高质量低资源语言数据
- 在多个低资源语言上性能提升显著,最高达37.6%准确率
- 适合关注编程语言公平性与低资源语言开发的研究者
大型语言模型(LLMs)在高资源编程语言(如Python)上表现优异,但在低资源编程语言(如Racket、D)上表现显著下降,加剧了技术鸿沟。尽管增加训练数据有潜力,但人工标注成本高,且大模型生成的低资源语言代码质量不佳。根本原因在于自然语言与编程语言之间的语义鸿沟,尤其在低资源语言中更为突出。本文提出Bridge-Coder,分两阶段提升性能:首先通过大模型的通用知识与上下文学习能力生成高质量低资源语言数据;其次通过桥接对齐逐步增强自然语言指令与低资源语言间的映射。实验表明,在多个低资源语言上,该方法显著提升模型性能,准确率最高提升37.6%。我们还对关键组件进行分析,为未来研究提供洞见。
原文摘要 · Abstract (English)
Large Language Models (LLMs) demonstrate strong proficiency in generating code for high-resource programming languages (HRPLs) like Python but struggle significantly with low-resource programming languages (LRPLs) such as Racket or D. This performance gap deepens the digital divide, preventing developers using LRPLs from benefiting equally from LLM advancements and reinforcing disparities in innovation within underrepresented programming communities. While generating additional training data for LRPLs is promising, it faces two key challenges: manual annotation is labor-intensive and costly, and LLM-generated LRPL code is often of subpar quality. The underlying cause of this issue is the gap between natural language to programming language gap (NL-PL Gap), which is especially pronounced in LRPLs due to limited aligned data. In this work, we introduce a novel approach called Bridge-Coder, which leverages LLMs' intrinsic capabilities to enhance the performance on LRPLs. Our method consists of two key stages. Bridge Generation, where we create high-quality dataset by utilizing LLMs' general knowledge understanding, proficiency in HRPLs, and in-context learning abilities. Then, we apply the Bridged Alignment, which progressively improves the alignment between NL instructions and LRPLs. Experimental results across multiple LRPLs show that Bridge-Coder significantly enhances model performance, demonstrating the effectiveness and generalization of our approach. Furthermore, we offer a detailed analysis of the key components of our method, providing valuable insights for future work aimed at addressing the challenges associated with LRPLs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。