File size: 2,969 Bytes
ff372ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
license: apache-2.0
base_model:
- Qwen/Qwen2.5-Coder-7B-Instruct
tags:
- COBOL generation
- COBOL-Java translation
---
  
# 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](https://https://huggingface.co/Fsoft-AIC/XMAiNframe-base-7b/) |
| XMAiNframe-instruct-7b    | [🤗 HuggingFace](https://huggingface.co/Fsoft-AIC/XMAiNframe-instruct-7b) |
|     XMAiNframe-base-10.5b     |       [🤗 HuggingFace](https://huggingface.co/Fsoft-AIC/XMAiNframe-base-10.5b) |
|   XMAiNframe-instruct-10.5b   |   [🤗 HuggingFace](https://huggingface.co/Fsoft-AIC/XMAiNframe-instruct-10.5b) |

</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](https://arxiv.org/abs/2604.03986). 

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}
}
```