Views
No views yet
| Model | Compile rate | Pass@1 |
|---|---|---|
| Qwen3.6-27B (vanilla, no fine-tuning) | 28.1% | 20.5% |
| GPT-4o | 41.8% | 16.4% |
| This adapter (Qwen3.6-27B) | 88.4% | 36.3% |
| COBOL-Coder-14B (published SOTA) | 73.95% | 49.33% |
peft — no patching needed:1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3import torch
4
5base = AutoModelForCausalLM.from_pretrained(
6 "Qwen/Qwen3.6-27B", torch_dtype=torch.bfloat16, device_map="auto")
7model = PeftModel.from_pretrained(base, "AlexThunder0/qwen-cobol-27b")
8tok = AutoTokenizer.from_pretrained("AlexThunder0/qwen-cobol-27b")
9
10prompt = '''Complete the following COBOL program by implementing the PROCEDURE DIVISION.
11The code MUST compile with the open-source GnuCOBOL compiler. Declare every variable
12in WORKING-STORAGE, do not use IBM-only intrinsics, end with exactly one END PROGRAM.
13Provide the complete, compilable COBOL program inside a single ```cobol code block.
14
15```cobol
16<the COBOLEval-style skeleton with a LINKAGE SECTION and a RESULT field>
17```'''
18
19msg = tok.apply_chat_template([{"role": "user", "content": prompt}],
20 tokenize=False, add_generation_prompt=True, enable_thinking=False)
21out = model.generate(**tok(msg, return_tensors="pt").to(model.device),
22 max_new_tokens=2048, do_sample=False)
23print(tok.decode(out[0], skip_special_tokens=True))LINKAGE SECTION and a RESULT field, which it completes with the WORKING-STORAGE SECTION and PROCEDURE DIVISION, ending in GOBACK / END PROGRAM. Greedy decoding is what the reported numbers use.