Bangla is a low-resource language for code generation, lacking large-scale annotated datasets and tools to transform natural language specifications into executable programs. This makes Bangla-to-code generation a challenging task requiring innovative solutions. To address this, we introduce BanglaForge, a novel framework for generating code from Bangla function descriptions. BanglaForge leverages a retrieval-augmented dual-model collaboration paradigm with self-refinement, combining in-context learning, llm-based translation, systematic prompt engineering, and iterative self-refinement based on execution feedback, where a coder generates initial solutions and a reviewer enhances them for robustness. On the BLP-2025 Bangla Code Generation benchmark, BanglaForge achieves a competitive Pass@1 accuracy of 84.00%, demonstrating the effectiveness of retrieval, model collaboration, and self-refinement for low-resource Bangla code generation.
翻译:孟加拉语在代码生成领域属于低资源语言,缺乏大规模标注数据集以及将自然语言描述转换为可执行程序的工具,这使得孟加拉语到代码的生成成为一项需要创新解决方案的挑战性任务。为此,我们提出了BanglaForge——一个从孟加拉语函数描述生成代码的新型框架。BanglaForge采用检索增强的双模型协作范式并结合自精炼机制,融合了上下文学习、基于LLM的翻译、系统性提示工程以及基于执行反馈的迭代自精炼过程,其中编码器生成初始解决方案,评审器则对其进行鲁棒性增强。在BLP-2025孟加拉语代码生成基准测试中,BanglaForge取得了84.00%的竞争性Pass@1准确率,验证了检索机制、模型协作与自精炼策略在低资源孟加拉语代码生成任务中的有效性。