{"id":{"repo_id":"york","oai_identifier":"oai:yorkspace.library.yorku.ca:10315/43884"},"canonical_url":"https://search.ndltd.org/etd/york/oai:yorkspace.library.yorku.ca:10315/43884","repository":{"repo_id":"york","name":"York University","base_url":"https://yorkspace.library.yorku.ca/oai/request"},"display":{"title":"Beyond Functional Correctness: Training-Time and Inference-Time Approaches to Improving Non-Functional Quality of LLM-Generated Code","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.","abstract_html":"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.","abstract_has_math":false,"creators":["Sivapiran, Sanjeepan"],"institution":null,"degree_name":"MASc - Master of Applied Science","degree_level":"Master's","degree_discipline":"Electrical and Computer Engineering","degree_department":null,"school":null,"contributors":[],"advisors":["Uddin, Gias"],"committee_chairs":[],"committee_members":[],"year":2026,"date_issued":"2026-07-24","date_published":"2026-07-24","updated_at":"2026-11-19T09:50:22Z","subjects":["Computer science","Computer engineering"],"languages":["en"],"rights":["Author owns copyright, except where explicitly noted. Please contact the author directly with licensing requests."],"rights_urls":[],"identifier_entries":[],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/10315/43884","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/10315/43884","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","access_status":null,"embargo_until":null,"access_note":null},"oai_pmh_record":{"url":"https://union.ndltd.org/oai-pmh/?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai%3Aunion.ndltd.org%3Arepo%3Ayork%3Aoai%3Ayorkspace.library.yorku.ca%3A10315%2F43884","prefix":"oai_dc"},"source_record":{"url":"https://yorkspace.library.yorku.ca/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Ayorkspace.library.yorku.ca%3A10315%2F43884","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.advisor","label":"Advisor","values":["Uddin, Gias"]},{"key":"dc:creator","label":"Author","values":["Sivapiran, Sanjeepan"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2026-07-24T15:37:51Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2026-07-24T15:37:51Z"]},{"key":"dc:date.copyright","label":"Dc Date Copyright","values":["2026-04-02"]},{"key":"dc:date.issued","label":"Date","values":["2026-07-24"]},{"key":"dc:date.updated","label":"Dc Date Updated","values":["2026-07-24T15:37:51Z"]},{"key":"dc:type","label":"Dc Type","values":["Electronic Thesis or Dissertation"]},{"key":"thesis:degree_discipline","label":"Discipline","values":["Electrical and Computer Engineering"]},{"key":"thesis:degree_level","label":"Degree Level","values":["Master's"]},{"key":"thesis:degree_name","label":"Degree Name","values":["MASc - Master of Applied Science"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["Computer science","Computer engineering"]},{"key":"dc:subject.keyword","label":"Dc Subject Keyword","values":["LLM code generation","Non-functional requirements","LLM alignment","AI4SE","Security","Prompt optimization"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language","label":"Dc Language","values":["en"]},{"key":"dc:rights","label":"Dc Rights","values":["Author owns copyright, except where explicitly noted. Please contact the author directly with licensing requests."]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://hdl.handle.net/10315/43884"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["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."]},{"key":"dc:title","label":"Title","values":["Beyond Functional Correctness: Training-Time and Inference-Time Approaches to Improving Non-Functional Quality of LLM-Generated Code"]},{"key":"others:access_status","label":"Others Access Status","values":["open.access"]}]}],"canonical_facts":{"dc:contributor.advisor":["Uddin, Gias"],"dc:creator":["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: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","Computer engineering"],"dc:subject.keyword":["LLM code generation","Non-functional requirements","LLM alignment","AI4SE","Security","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"],"others:access_status":["open.access"],"thesis:degree_discipline":["Electrical and Computer Engineering"],"thesis:degree_level":["Master's"],"thesis:degree_name":["MASc - Master of Applied Science"]},"updated_at":"2026-11-19T09:50:22Z"}