Views
No views yet
| Parameter | Value |
|---|---|
| Base model | meta-llama/Meta-Llama-3-8B-Instruct |
| Method | LoRA (PEFT) |
| LoRA rank | 8 |
| LoRA alpha | 32 |
| LoRA dropout | 0.1 |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Training data | yangweiqing/DebugEval train split (24,892 samples) |
| Epochs | 1 |
| Batch size | 4 × 8 (grad accum) = 32 |
| Learning rate | 2e-5 (cosine decay) |
| Max seq length | 2048 |
| Final train loss | 0.1765 |
| Hardware | NVIDIA H100 80GB |
| Training time | ~42 minutes |
1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3import torch
4
5base = "meta-llama/Meta-Llama-3-8B-Instruct"
6adapter = "ntduc0901/llama3-8b-debugeval-lora"
7
8tokenizer = AutoTokenizer.from_pretrained(base)
9model = AutoModelForCausalLM.from_pretrained(base, torch_dtype=torch.bfloat16, device_map="auto")
10model = PeftModel.from_pretrained(model, adapter)
11model.eval()
12
13prompt = """
14You are an AI programming assistant, developed by NEUIR, and you only answer questions related to computer science.
15### Instruction:
16Given the following buggy code, identify the type of error.
17Choose one: (A) Syntax Error (B) Reference Error (C) Logical Error (D) Multiple Errors
18
19def factorial(n):
20 if n == 0:
21 return 1
22 return n * factorial(n - 2)
23
24Final answer format: <Answer>(Option)</Answer>.
25### Response:
26"""
27
28inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
29with torch.no_grad():
30 out = model.generate(**inputs, max_new_tokens=256, temperature=0.2, do_sample=True)
31print(tokenizer.decode(out[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True))1@misc{yang2025coastenhancingcodedebugging,
2 title={COAST: Enhancing the Code Debugging Ability of LLMs through Communicative Agent Based Data Synthesis},
3 author={Weiqing Yang and Hanbin Wang and Zhenghao Liu and Xinze Li and Yukun Yan and Shuo Wang and Yu Gu and Minghe Yu and Zhiyuan Liu and Ge Yu},
4 year={2025},
5 eprint={2408.05006},
6 archivePrefix={arXiv},
7 primaryClass={cs.SE},
8 url={https://arxiv.org/abs/2408.05006},
9}