COBOL-Coder:面向COBOL代码生成与翻译的领域适应性大语言模型
COBOL-Coder: Domain-Adapted Large Language Models for COBOL Code Generation and Translation
AI总结:
本文提出COBOL-Coder,一种专为COBOL设计的大型语言模型,通过自动化数据管道和领域适应技术,在代码生成与翻译任务中表现出色,优于现有模型。
摘要:
COBOL仍然是主框系统的关键语言,但现有大语言模型(LLMs)在生成和翻译COBOL代码方面表现不佳。本文报告了我们在开发和评估面向COBOL和主框软件工程的领域适应性LLMs的经验。我们介绍了(1)一个自动化数据整理管道,结合编译器引导验证和多阶段相似性过滤,以构建高质量的COBOL训练数据;(2)COBOL-Coder,一种在整理后的COBOL领域数据上微调的COBOL专用LLM。我们评估了COBOL-Coder在两个任务上的表现:代码生成(在COBOLEval和COBOLCodeBench)和代码翻译(在COBOL-JavaTrans,我们提出的双向COBOL-Java翻译基准)。在实验中,COBOL-Coder在COBOLEval上达到了高达73.95%的编译成功率和49.33 Pass-1,相比GPT-4o的41.8%和16.4,而大多数开源基线(如CodeGemma、CodeLlama、StarCoder2)无法生成可编译的程序。对于Java到COBOL的翻译,COBOL-Coder达到了34.93 Pass-1,而通用LLMs得分接近零。为了评估LLM生成代码在现实中的实用性,我们进行了与有经验的COBOL开发人员的调查。参与者一致报告说,COBOL-Coder在COBOL意识、程序结构可靠性和企业实践方面优于通用LLMs。
英文摘要:
COBOL remains a critical language for mainframe systems, yet existing large language models (LLMs) struggle to generate and translate COBOL code correctly. This paper reports our experience in developing and evaluating domain-adapted LLMs for COBOL and mainframe software engineering. We introduce (1) an automated data curation pipeline that combines compiler-guided validation with multi-stage similarity-based filtering to construct high-quality COBOL training data, and (2) COBOL-Coder, a COBOL-specialized LLM fine-tuned on the curated COBOL domain data. We evaluate COBOL-Coder on two tasks: code generation (on COBOLEval and COBOLCodeBench) and code translation (on COBOL-JavaTrans, our proposed benchmark for bidirectional COBOL-Java translation). In our experiments, COBOL-Coder achieves up to a 73.95 percent compilation success rate and 49.33 Pass-1 on COBOLEval, compared to 41.8 percent and 16.4 for GPT-4o, while most open-source baselines (e.g., CodeGemma, CodeLlama, StarCoder2) fail to produce compilable programs. For Java-to-COBOL translation, COBOL-Coder reaches 34.93 Pass-1, whereas general-purpose LLMs achieve near-zero scores. To assess the usability of LLM-generated code in real-world settings, we conduct a survey with experienced COBOL developers. Participants consistently report that COBOL-Coder exhibits stronger COBOL awareness, has more reliable program structure, and is better aligned with enterprise practices than general-purpose LLMs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。