Date of Award

2-5-2025

Publication Type

Thesis

Degree Name

M.Sc.

Department

Computer Science

Keywords

artificial intelligence; code generation; fine-tuning; instruction-tuning; large language models; natural language processing

Supervisor

Jianguo Lu

Rights

info:eu-repo/semantics/openAccess

Abstract

Instruction tuning enhances language models by fine-tuning them on instruction-output pairs, particularly improving performance in code generation tasks. Models like OctoCoder and Wavecoder have shown significant gains in pass@k metrics. However, instruction tuning is resource-intensive and often inaccessible for users with limited computational power. Additionally, many existing datasets are too simplistic, hindering performance on complex tasks. In this research, we introduce a new Leetcode dataset featuring complex problems and Python implementations to improve instruction tuning. We fine-tune the CodeLlama model using this dataset and explore two fine-tuning methods: Instruction Tuning, which focuses on generated code tokens, and Instruction Modelling, which considers both instruction and code tokens for better context awareness. We also use Llama 3 in the Evol-Instruct method to generate additional instructions, avoiding closed-source models like GPT. Additionally, we investigate the impact of different LoRA ranks in Instruction Tuning and present a detailed analysis of failure cases on the HumanEval dataset. To address the high resource demands, we employ parameter-efficient techniques like LoRA (Low-Rank Adaptation) and qLoRA, which reduce model weights to 4-bit precision. Our evaluation, using the HumanEval and MBPP datasets, with pass@k as the primary metric, demonstrates a scalable, resource-efficient approach to instruction tuning for code generation.

Share

COinS