Back to search

Nanyang Technological University

Building, analyzing, and enhancing code language models for software engineering

Abstract

dc:description.abstract

Code language models have become an important foundation for a wide range of software engineering tasks, including code understanding, generation, and completion. By learning from large-scale code corpora, these models have demonstrated strong potential in assisting developers and automating parts of the software development workflow. However, advancing code language models for practical software engineering requires more than scaling model size or training on static source code alone. It also calls for stronger pre-training strategies, a better understanding of model reliability under realistic threats, and more effective ways to support downstream coding tasks. This thesis presents a systematic study of code language models from three complementary perspectives: strengthening code models through change-aware pre-training, analyzing their security boundaries, and enhancing their effectiveness in downstream software engineering tasks. Together, these studies aim to improve both the capability and the understanding of code language models in realistic software engineering settings. First, this thesis investigates how code language models can be strengthened through change-aware pre-training. Software development is not only reflected in static source code, but also in code changes and their accompanying natural language descriptions. To better exploit such signals, we construct a large-scale benchmark of GitHub commits and propose a pre-training framework that jointly models code changes and commit messages. The resulting model, CommitBART, improves the modeling of software evolution and demonstrates strong performance on commit-related understanding and generation tasks, showing that change-aware pre-training is an effective way to build stronger code models. Second, this thesis examines the security boundaries of code language models under realistic attack surfaces. As pre-trained code models are increasingly reused across downstream applications, it is critical to understand how they may be compromised. We study this problem from two complementary angles. The first explores training-time poisoning attacks, showing that backdoors can be implanted into code pre-trained models and later activated across multiple downstream tasks. The second investigates weight-level attacks through model editing, demonstrating that large language models can be efficiently backdoored by lightweight parameter modifications without full retraining. Together, these studies reveal important vulnerabilities in both the training pipeline and the post-training deployment stage of code language models. Third, this thesis investigates how code models can be further enhanced in downstream software engineering tasks. In practical code completion scenarios, model performance depends not only on the pretrained model itself but also on how contextual information is provided and utilized. We first study repository-level retrieval-augmented code completion and show that retrieved cross-file context is not always beneficial. Based on this insight, we propose REPOFILTER, a framework that identifies and retains only helpful retrieved context for completion. We then study function-level code completion and show that successful completion often depends on correctly interpreting implicit intent hidden in surrounding context. To address this, we develop an intention-augmented completion framework that explicitly infers coding intent before generation. These approaches demonstrate that downstream effectiveness can be substantially improved by selecting and interpreting context more carefully. Overall, this thesis shows that advancing code language models for software engineering requires a holistic perspective that spans model construction, security analysis, and downstream enhancement. The results presented in this thesis contribute to a better understanding of how stronger, better analyzed, and more effectively applied code language models can be developed to support realistic software engineering tasks.

Degree

thesis:*
College dc:contributor.school
College of Computing and Data Science
Grantor dc:publisher
Nanyang Technological University
Year dc:date.issued
2026

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Li, Yanzhou
Advisor dc:contributor.supervisor
  • Liu Yang

Subjects

dc:subject × 1

Rights

dc:rights
Statement dc:rights
  • This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).
Language dc:language.iso
en

Identifiers

dc:identifier.*

Chain of custody

source
Harvested from
Nanyang Technological University
Base URL
dr.ntu.edu.sg/oai/request
Last updated
2026-11-29
Source record
OAI-PMH GetRecord
citation

Li, Yanzhou. Building, analyzing, and enhancing code language models for software engineering. Nanyang Technological University, 2026. https://doi.org/10.32657/10356/224277