Beyond Functional Correctness: Training-Time and Inference-Time Approaches to Improving Non-Functional Quality of LLM-Generated Code
| dc.contributor.advisor | Gias Uddin | |
| dc.contributor.author | Sivapiran, Sanjeepan | |
| dc.date.accessioned | 2026-07-24T15:37:51Z | |
| dc.date.available | 2026-07-24T15:37:51Z | |
| dc.date.copyright | 2026-04-02 | |
| dc.date.issued | 2026-07-24 | |
| dc.date.updated | 2026-07-24T15:37:51Z | |
| dc.degree.discipline | Electrical and Computer Engineering | |
| dc.degree.level | Master's | |
| dc.degree.name | MASc - Master of Applied Science | |
| dc.description.abstract | Large 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.uri | https://hdl.handle.net/10315/43884 | |
| dc.language | en | |
| dc.rights | Author owns copyright, except where explicitly noted. Please contact the author directly with licensing requests. | |
| dc.subject | Computer science | |
| dc.subject | Computer engineering | |
| dc.subject.keywords | LLM Code Generation | |
| dc.subject.keywords | Non-functional Requirements | |
| dc.subject.keywords | LLM Alignment | |
| dc.subject.keywords | AI4SE | |
| dc.subject.keywords | Security | |
| dc.subject.keywords | Prompt Optimization | |
| dc.title | Beyond Functional Correctness: Training-Time and Inference-Time Approaches to Improving Non-Functional Quality of LLM-Generated Code | |
| dc.type | Electronic Thesis or Dissertation |
Files
Original bundle
1 - 1 of 1
Loading...
- Name:
- Sivapiran_Sanjeepan_2026_MASc.pdf
- Size:
- 1.83 MB
- Format:
- Adobe Portable Document Format