← Latest papers
💻 computer science

COBOL-Coder: Domain-Adapted Large Language Models for COBOL Code Generation and Translation

This paper introduces COBOL-Coder, a domain-adapted large language model developed through an automated data curation pipeline that significantly outperforms general-purpose LLMs in COBOL code generation and Java-COBOL translation tasks, as validated by both benchmark metrics and expert developer surveys.

Original authors: Anh T. V. Dau, Shin Hwei Tan, Jinqiu Yang, Nghi D. Q. Bui, Anh Tuan Nguyen

Published 2026-04-07
📖 5 min read🧠 Deep dive

Original authors: Anh T. V. Dau, Shin Hwei Tan, Jinqiu Yang, Nghi D. Q. Bui, Anh Tuan Nguyen

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine the world of software as a massive, bustling city. Most of the new buildings are modern skyscrapers made of glass and steel, built with the latest tools (languages like Python and Java). But deep in the city's foundation, there are still massive, ancient stone fortresses running the banks, insurance companies, and government systems. These fortresses are built with COBOL, a programming language invented in the 1960s.

The problem? The city's newest, smartest construction robots (Large Language Models or LLMs) are amazing at building glass skyscrapers. But when you ask them to fix or build a stone fortress, they get confused. They don't know the old rules, the specific stone-cutting techniques, or how the ancient blueprints work. They try to build a glass window into a stone wall, and it falls apart.

This paper introduces COBOL-Coder, a specialized robot designed specifically to understand and build these ancient stone fortresses. Here is how they did it, explained simply:

1. The Problem: The "Language Barrier"

Think of COBOL as a very old, strict dialect. It's not just about the words; it's about the grammar, the formatting, and the specific way the "stone" (data) must be laid.

  • The Old Robots: General AI models (like GPT-4) are like polyglots who speak 100 modern languages fluently but have never seen a stone fortress. They try to guess, but their guesses are usually wrong. They can't even get the basic structure right.
  • The Data Scarcity: There are very few public blueprints (code) for these fortresses because they are kept secret in bank vaults. The robots didn't have enough practice material to learn.

2. The Solution: Building a Specialized Training School

The researchers didn't just give the robot more books; they built a specialized training academy. They created COBOL-Coder through three clever steps:

  • Step A: The "Self-Healing" Library (Data Curation)
    They dug up old blueprints from public archives (GitHub). But many were broken or incomplete.

    • The Analogy: Imagine a robot librarian who finds a torn, muddy blueprint. Instead of throwing it away, the librarian uses a "magic compiler" (a tool that checks for errors) to see what's wrong. Then, they ask a super-smart AI (GPT-4) to act as a master mason and fix the blueprint. They repeat this until the blueprint is perfect.
    • Result: They turned thousands of broken, messy blueprints into a clean, perfect library of 31,000+ working COBOL programs.
  • Step B: The "Translator" Gym (Synthetic Data)
    Since there weren't enough COBOL blueprints, they used a trick. They took modern, easy-to-read blueprints (Java code) and asked the AI to translate them into the ancient COBOL dialect.

    • The Analogy: It's like taking a modern English novel and asking a translator to rewrite it in 1960s business English. They then checked the translation twice: once to see if it made sense, and again by translating it back to English to see if the story stayed the same. This created a massive new set of practice problems.
  • Step C: The "Mentor" (Instruction Tuning)
    They didn't just feed the robot raw blueprints. They created a "Question and Answer" textbook. They took the blueprints and wrote questions like, "How do you calculate interest?" and provided the correct COBOL answer. This taught the robot how to think like a COBOL developer, not just memorize code.

3. The Results: The Specialized Robot Wins

They put COBOL-Coder to the test against the general-purpose giants (like GPT-4o and other open-source models).

  • The Test: They asked the robots to build small COBOL programs and translate Java code into COBOL.
  • The Outcome:
    • General Robots: Most failed completely. They produced code that wouldn't even compile (like a car that wouldn't start). GPT-4o managed to get about 42% of the code working.
    • COBOL-Coder: It got 74% of the code working perfectly. When translating modern code back to the ancient language, it was the only one that could do it with any success, while the others scored near zero.

4. The Human Verdict: The "Senior Mason" Review

Numbers are great, but do the actual builders like it? The researchers asked three experienced COBOL developers (the "Senior Masons") to review the code.

  • The Feedback: The developers said COBOL-Coder felt "pragmatic" and "production-ready." It understood the old-school structure and didn't try to be fancy.
  • The General Robots: The developers felt the general robots were either "inconsistent" or "over-engineered" (trying to use modern tricks that didn't fit the old system).
  • The Takeaway: The developers saw COBOL-Coder as a helpful junior apprentice who could draft the work quickly, saving them time. They didn't see the general robots as useful at all for this specific job.

The Big Lesson

The paper teaches us that size isn't everything. A massive, general-purpose robot isn't necessarily better than a smaller, specialized one if the task requires deep, niche knowledge.

To fix the world's ancient systems, we don't just need bigger brains; we need specialized training. We need to teach our AI the specific dialect, the strict rules, and the history of the language, rather than just hoping it can guess its way through.

In short: COBOL-Coder is the result of taking a smart AI, giving it a massive, high-quality textbook of COBOL, and training it until it speaks the language of the mainframe fluently, while the other AIs are still trying to learn the alphabet.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →