CoolFace
Modelpublic

Fsoft-AIC/COBOL-Coder-7B-Instruct

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
1likes10downloads
Model Card

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

</div>

Introduction

COBOL-Coder is a family of domain-adapted LLMs specialized for COBOL code generation and bidirectional COBOL-Java code translation. Built on top of Qwen2.5-Coder, COBOL-Coder addresses the critical gap in LLM capabilities for legacy programming languages.

<!--

Model Versions

We release XMAiNframe with 7B and 10.5B parameters, including base and instruct models, to the public. XMAiNframe 10.5B is expanded from DeepSeek-Coder 7B by the depth up-scaling method without introducing additional modules or dynamic expert selection methods.

<div align="center">

**Model****Download**
XMAiNframe-base-7b๐Ÿค— HuggingFace
XMAiNframe-instruct-7b๐Ÿค— HuggingFace
XMAiNframe-base-10.5b๐Ÿค— HuggingFace
XMAiNframe-instruct-10.5b๐Ÿค— HuggingFace

</div> -->

Quickstart

Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents.

python
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Fsoft-AIC/COBOL-Coder-7B-Instruct")
model = AutoModelForCausalLM.from_pretrained("Fsoft-AIC/COBOL-Coder-7B-Instruct")

prompt = """Complete the given COBOL code:
"""
messages = [
    {"role": "system", "content": "You are a helpful assistant for COBOL generation."},
    {"role": "user", "content": prompt}
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
 
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, top_k=50, top_p=0.95, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))

Additional Information

Other Resources:

  • โ€”Github: https://github.com/COBOL-Coder/COBOL-Coder
  • โ€”Paper: https://arxiv.org/abs/2604.03986

Citation Information

More details can be found in our paper.

If you're using COBOL-Coder, please cite using this BibTeX:

@article{dau2026cobol,
  title={COBOL-Coder: Domain-Adapted Large Language Models for COBOL Code Generation and Translation},
  author={Dau, Anh TV and Tan, Shin Hwei and Yang, Jinqiu and Bui, Nghi DQ and Nguyen, Anh Tuan},
  journal={arXiv preprint arXiv:2604.03986},
  year={2026}
}