<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="static/style.xsl"?><OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"><responseDate>2026-11-28T12:11:58Z</responseDate><request verb="GetRecord" identifier="oai:dr.ntu.edu.sg:10356/218864" metadataPrefix="dim">https://dr.ntu.edu.sg/server/oai/request</request><GetRecord><record><header><identifier>oai:dr.ntu.edu.sg:10356/218864</identifier><datestamp>2026-07-21T11:50:07Z</datestamp><setSpec>com_10356_984</setSpec><setSpec>com_10356_19</setSpec><setSpec>com_10356_11</setSpec><setSpec>col_10356_2206</setSpec></header><metadata><dim:dim xmlns:dim="http://www.dspace.org/xmlns/dspace/dim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:doc="http://www.lyncode.com/xoai" xsi:schemaLocation="http://www.dspace.org/xmlns/dspace/dim http://www.dspace.org/schema/dim.xsd">
   <dim:field mdschema="dc" element="contributor" qualifier="author">Chen, Qi</dim:field>
   <dim:field mdschema="dc" element="contributor" qualifier="supervisor">-</dim:field>
   <dim:field mdschema="dc" element="contributor" qualifier="school" authority="85c7c066-467c-42e1-86e3-b953777526f2" confidence="500">School of Electrical and Electronic Engineering</dim:field>
   <dim:field mdschema="dc" element="contributor" qualifier="supervisor2">Simon Liu</dim:field>
   <dim:field mdschema="dc" element="contributor" qualifier="supervisoremail">simon.liu@ntu.edu.sg</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="accessioned">2026-07-08T02:50:33Z</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="available">2026-07-08T02:50:33Z</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="issued">2026</dim:field>
   <dim:field mdschema="dc" element="identifier" qualifier="uri">https://hdl.handle.net/10356/218864</dim:field>
   <dim:field mdschema="dc" element="description" qualifier="abstract">Modern code language models have become remarkably good at producing functionally correct solutions on standard benchmarks, but they still tend to write bare, uncommented code that would raise eyebrows in a professional codebase. This dissertation presents a two-stage fine-tuning approach — first Supervised Fine-Tuning (SFT), then Direct Preference Optimisation (DPO) — to steer a compact code model toward writing code that is properly documented and easier to maintain, without giving up correctness in the process. Starting from Qwen2.5-Coder-1.5B-Instruct, the first stage uses SFT on a curated set of documented, verified completions to nudge the model away from its default terse style. The second stage applies DPO with preference pairs built by deliberately introducing bugs into correct solutions and confirming failures through unit tests — this keeps the training signal anchored to whether code actually works, rather than how it looks on the surface. Evaluation on HumanEval shows a 1.22 percentage point gain in Pass@1 over the unmodified baseline, alongside a jump in comment rate from 6.1% to 77.4% and a Maintainability Index improvement from 79.81 to 84.83. An independent LLM judge favoured the fine-tuned model's outputs in 63–67% of head-to-head comparisons. Comment diversity rates above 95% further suggest the model is writing comments tailored to each problem rather than recycling a fixed pattern.</dim:field>
   <dim:field mdschema="dc" element="description" qualifier="degree">Master's degree</dim:field>
   <dim:field mdschema="dc" element="language" qualifier="iso">en</dim:field>
   <dim:field mdschema="dc" element="publisher">Nanyang Technological University</dim:field>
   <dim:field mdschema="dc" element="subject">Engineering</dim:field>
   <dim:field mdschema="dc" element="title">Aligning code language models for documentation quality via supervised fine-tuning and direct preference optimisation</dim:field>
   <dim:field mdschema="dc" element="type">Thesis-Master by Coursework</dim:field>
   <dim:field mdschema="dc" element="format" qualifier="mimetype">application/pdf</dim:field>
   <dim:field mdschema="dspace" element="entity" qualifier="type">Publication</dim:field>
   <dim:field mdschema="dspace" element="workflow" qualifier="startDateTime">2026-07-07T05:07:07.584Z</dim:field>
   <dim:field mdschema="datacite" element="rights">restricted</dim:field>restrictedrestricted<dim:field mdschema="cerif" element="openaire" authority="" confidence="-1">&lt;Publication xmlns="https://www.openaire.eu/cerif-profile/1.1/" id="59c47e12-9b40-47cd-b35a-03f401283f4a">
	&lt;Type xmlns="https://www.openaire.eu/cerif-profile/vocab/COAR_Publication_Types">http://purl.org/coar/resource_type/c_1843&lt;/Type>
	&lt;Language>en&lt;/Language>
   	&lt;Title>Aligning code language models for documentation quality via supervised fine-tuning and direct preference optimisation&lt;/Title>
   	&lt;PublishedIn>
    	&lt;Publication>
      	&lt;/Publication>
   	&lt;/PublishedIn>
   	&lt;PublicationDate>2026&lt;/PublicationDate>
   	&lt;Authors>
      	&lt;Author>
        	&lt;DisplayName>Chen, Qi&lt;/DisplayName>
         	&lt;Affiliation>
         		&lt;OrgUnit>
         		&lt;/OrgUnit>
         	&lt;/Affiliation>
      	&lt;/Author>
	&lt;/Authors>
   	&lt;Editors>
	&lt;/Editors>
    &lt;Publishers>
        &lt;Publisher>
            &lt;DisplayName>Nanyang Technological University&lt;/DisplayName>
            &lt;OrgUnit />
        &lt;/Publisher>
    &lt;/Publishers>
    &lt;Keyword>Engineering&lt;/Keyword>
   	&lt;Abstract>Modern code language models have become remarkably good at producing functionally correct solutions on standard benchmarks, but they still tend to write bare, uncommented code that would raise eyebrows in a professional codebase. This dissertation presents a two-stage fine-tuning approach — first Supervised Fine-Tuning (SFT), then Direct Preference Optimisation (DPO) — to steer a compact code model toward writing code that is properly documented and easier to maintain, without giving up correctness in the process. Starting from Qwen2.5-Coder-1.5B-Instruct, the first stage uses SFT on a curated set of documented, verified completions to nudge the model away from its default terse style. The second stage applies DPO with preference pairs built by deliberately introducing bugs into correct solutions and confirming failures through unit tests — this keeps the training signal anchored to whether code actually works, rather than how it looks on the surface. Evaluation on HumanEval shows a 1.22 percentage point gain in Pass@1 over the unmodified baseline, alongside a jump in comment rate from 6.1% to 77.4% and a Maintainability Index improvement from 79.81 to 84.83. An independent LLM judge favoured the fine-tuned model&amp;apos;s outputs in 63–67% of head-to-head comparisons. Comment diversity rates above 95% further suggest the model is writing comments tailored to each problem rather than recycling a fixed pattern.&lt;/Abstract>
	&lt;Access xmlns="http://purl.org/coar/access_right" 
    >
    &lt;/Access>
&lt;/Publication>
</dim:field>
</dim:dim></metadata></record></GetRecord></OAI-PMH>