COBOLAssist: Analyzing and Fixing Compilation Errors for LLM-Powered COBOL Code Generation
- URL: http://arxiv.org/abs/2604.03978v1
- Date: Sun, 05 Apr 2026 05:51:54 GMT
- Title: COBOLAssist: Analyzing and Fixing Compilation Errors for LLM-Powered COBOL Code Generation
- Abstract summary: This paper investigates the challenges of compilation errors and introduces a framework leveraging large language models (LLMs) to address these issues.<n>We first categorize the common compilation errors in LLM-generated code into three groups: incomplete code errors, syntax errors, and type-related errors.
- Score: 10.733306714499067
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Legacy programming languages such as COBOL (Common Business-Oriented Language) remain critical in business computing. However, maintaining legacy COBOL systems is increasingly challenging due to a declining pool of skilled developers and the persistence of COBOL errors that require deep domain expertise to resolve. This paper investigates the challenges of COBOL compilation errors and introduces a framework leveraging large language models (LLMs) to address these issues. We first categorize the common compilation errors in LLM-generated COBOL code into three groups: incomplete code errors, syntax errors, and type-related errors. We further propose COBOLAssist, a technique to enhance code correctness through iterative repairs guided by compilation feedback. Our evaluation using five LLMs including GPT variants and mAInframer, shows a high prevalence of incorrect program structures and function usage in COBOL programs and demonstrates the effectiveness of COBOLAssist, with the compilation success rates increasing from 29.5\% to 64.38\% for GPT-4o-mini and from 41.8\% to 95.89\% for GPT-4o. It also improves pass@1 significantly, for example from 9.1 to 22.6 for GPT-4. Notably, while mAInframer-34B achieves the highest compilation success rate, its functional correctness remains limited. This research not only highlights the limitations in current LLMs for COBOL but also demonstrates a practical path forward for automated debugging in legacy systems.
Related papers
- CoSTAR: Data Synthesis-Driven Constraint-Aware COBOL Section Summarization for Legacy System Modernization [12.071793069280623]
CoSTAR is an integrated framework that combines execution-validated data synthesis with constraint-aware training.<n>We evaluate CoSTAR on both public and confidential enterprise systems.
arXiv Detail & Related papers (2026-09-10T10:08:46Z) - SEDCoT: Enhancing LLM-Based COBOL Code Translation via Symbolic Execution and Delta Debugging [49.898541267264115]
Maintenance is increasingly challenging due to outdated technologies, sparse documentation, and developer retirement.<n>Traditional rule-based transcompilers yield outputs that are difficult to read and maintain.<n>We propose SEDCoT, a novel-to-C translation framework.
arXiv Detail & Related papers (2026-07-05T03:07:10Z) - COBOL-Coder: Domain-Adapted Large Language Models for COBOL Code Generation and Translation [10.733306714499067]
Existing large language models (LLMs) struggle to generate and translate code correctly.<n>We introduce an automated data curation pipeline that combines compiler-guided validation with multi-stage similarity-based filtering.<n>Code-Coder achieves up to 73.95 percent compilation success rate and 49.33 Pass-1 onEval, compared to 41.8 percent and 16.4 for GPT-4o.
arXiv Detail & Related papers (2026-04-05T06:12:49Z) - HELIOS: Hierarchical Graph Abstraction for Structure-Aware LLM Decompilation [11.110675371854988]
textscHELIOS is a framework that reframes binary decompilation as a structured reasoning task.<n>textscHELIOS is a practical building block for reverse engineering in security settings.
arXiv Detail & Related papers (2026-01-21T02:37:33Z) - Specification-Guided Repair of Arithmetic Errors in Dafny Programs using LLMs [79.74676890436174]
We present an APR tool for Dafny that uses formal specifications as oracles for fault localization and repair.<n>We localize faults through a series of steps, which include using Hoare logic to determine the state of each statement within the program.<n>Our tool achieves 89.6% fault localization coverage and GPT-4o mini yields the highest repair success rate of 74.18%.
arXiv Detail & Related papers (2025-07-04T15:36:12Z) - Enhancing COBOL Code Explanations: A Multi-Agents Approach Using Large Language Models [1.835291631794229]
We propose a multi-agent approach that generates explanations for functions, files, and the overall project.<n>We evaluate the effectiveness of our approach using 14 open-source, real-world projects.
arXiv Detail & Related papers (2025-07-02T22:28:35Z) - Type-Constrained Code Generation with Language Models [51.03439021895432]
We introduce a type-constrained decoding approach that leverages type systems to guide code generation.<n>For this purpose, we develop novel prefix automata and a search over inhabitable types, forming a sound approach to enforce well-typedness on LLM-generated code.<n>Our approach reduces compilation errors by more than half and significantly increases functional correctness in code synthesis, translation, and repair tasks.
arXiv Detail & Related papers (2025-04-12T15:03:00Z) - Investigating the Transferability of Code Repair for Low-Resource Programming Languages [57.62712191540067]
Large language models (LLMs) have shown remarkable performance on code generation tasks.
Recent works augment the code repair process by integrating modern techniques such as chain-of-thought reasoning or distillation.
We investigate the benefits of distilling code repair for both high and low resource languages.
arXiv Detail & Related papers (2024-06-21T05:05:39Z) - Leveraging Print Debugging to Improve Code Generation in Large Language
Models [63.63160583432348]
Large language models (LLMs) have made significant progress in code generation tasks.
But their performance in tackling programming problems with complex data structures and algorithms remains suboptimal.
We propose an in-context learning approach that guides LLMs to debug by using a "print debug" method.
arXiv Detail & Related papers (2024-01-10T18:37:59Z) - INTERVENOR: Prompting the Coding Ability of Large Language Models with the Interactive Chain of Repair [42.5403218101046]
INTERVENOR is a system designed to emulate the interactive code repair processes observed in humans.
LLMs play distinct roles during the code repair process, functioning as both a Code Learner and a Code Teacher.
arXiv Detail & Related papers (2023-11-16T12:55:20Z) - Dcc --help: Generating Context-Aware Compiler Error Explanations with
Large Language Models [53.04357141450459]
dcc --help was deployed to our CS1 and CS2 courses, with 2,565 students using the tool over 64,000 times in ten weeks.
We found that the LLM-generated explanations were conceptually accurate in 90% of compile-time and 75% of run-time cases, but often disregarded the instruction not to provide solutions in code.
arXiv Detail & Related papers (2023-08-23T02:36:19Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.