Beyond Functional Correctness: Training-Time and Inference-Time Approaches to Improving Non-Functional Quality of LLM-Generated Code

dc.contributor.advisorGias Uddin
dc.contributor.authorSivapiran, Sanjeepan
dc.date.accessioned2026-07-24T15:37:51Z
dc.date.available2026-07-24T15:37:51Z
dc.date.copyright2026-04-02
dc.date.issued2026-07-24
dc.date.updated2026-07-24T15:37:51Z
dc.degree.disciplineElectrical and Computer Engineering
dc.degree.levelMaster's
dc.degree.nameMASc - Master of Applied Science
dc.description.abstractLarge Language Models (LLMs) generate functionally correct code that often lacks software standard qualities such as security, readability, and maintainability. This thesis investigates complementary approaches to bridge this gap. The first study examines training-time alignment using DPO and BoNBoN across five LLMs and their instruction-tuned variants. Results show non-functional alignment achieves consistent improvements (10.6\% average) while functional alignment proves unreliable (4.9\% average), with effectiveness varying by model family and pathway. The second study introduces POSec, an inference-time framework combining automatic prompt optimization with Selective Prompt Anchoring for secure code generation. Evaluated across 8 LLMs, 5 languages, and 3 optimizers, POSec achieves +20–33\% security improvements at Pass@10 without model retraining. Together, these studies demonstrate that improving LLM-generated code quality requires multi-level interventions, with training-time alignment offering breadth and inference-time optimization offering targeted depth.
dc.identifier.urihttps://hdl.handle.net/10315/43884
dc.languageen
dc.rightsAuthor owns copyright, except where explicitly noted. Please contact the author directly with licensing requests.
dc.subjectComputer science
dc.subjectComputer engineering
dc.subject.keywordsLLM Code Generation
dc.subject.keywordsNon-functional Requirements
dc.subject.keywordsLLM Alignment
dc.subject.keywordsAI4SE
dc.subject.keywordsSecurity
dc.subject.keywordsPrompt Optimization
dc.titleBeyond Functional Correctness: Training-Time and Inference-Time Approaches to Improving Non-Functional Quality of LLM-Generated Code
dc.typeElectronic Thesis or Dissertation

Files

Original bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
Sivapiran_Sanjeepan_2026_MASc.pdf
Size:
1.83 MB
Format:
Adobe Portable Document Format