{"id":{"repo_id":"manitoba","oai_identifier":"oai:mspace.lib.umanitoba.ca:1993/38437"},"canonical_url":"https://search.ndltd.org/etd/manitoba/oai:mspace.lib.umanitoba.ca:1993/38437","repository":{"repo_id":"manitoba","name":"University of Manitoba","base_url":"https://mspace.lib.umanitoba.ca/oai/request"},"display":{"title":"Zero-shot synthesis of compilable code for incomplete code snippets using LLMs","abstract":"Technical Q&A sites and Large Language Models (LLMs) are valuable resources for software developers seeking knowledge. However, the provided code snippets are often uncompilable and incomplete due to unresolved types, missing libraries, and incorrect import statements. This poses a challenge for users who wish to reuse or analyze these snippets. Existing methods either do not focus on creating compilable code or have low success rates. To address this, we propose ZS4C, a lightweight approach for Zero-shot Synthesis of compilable code For incomplete Code snippets using LLMs. ZS4C operates in two stages: first, it uses an LLM, like GPT-3.5, to identify missing import statements in a snippet; second, it collaborates with a validator (e.g., compiler) to fix compilation errors caused by incorrect imports and syntax issues. We evaluated ZS4C on the StatType-SO benchmark and a new dataset, Python-SO, which includes 539 Python snippets from Stack Overflow across the 20 most popular Python libraries. ZS4C significantly outperforms existing methods, improving the compilation rate from 63% to 95.1% compared to the state-of-the-art SnR, marking a 50.1% improvement. On average, ZS4C can infer more accurate import statements (with an F1 score of 0.98) than SnR, with an improvement of 8.5% in the F1.","abstract_html":"Technical Q&amp;A sites and Large Language Models (LLMs) are valuable resources for software developers seeking knowledge. However, the provided code snippets are often uncompilable and incomplete due to unresolved types, missing libraries, and incorrect import statements. This poses a challenge for users who wish to reuse or analyze these snippets. Existing methods either do not focus on creating compilable code or have low success rates. To address this, we propose ZS4C, a lightweight approach for Zero-shot Synthesis of compilable code For incomplete Code snippets using LLMs. ZS4C operates in two stages: first, it uses an LLM, like GPT-3.5, to identify missing import statements in a snippet; second, it collaborates with a validator (e.g., compiler) to fix compilation errors caused by incorrect imports and syntax issues. We evaluated ZS4C on the StatType-SO benchmark and a new dataset, Python-SO, which includes 539 Python snippets from Stack Overflow across the 20 most popular Python libraries. ZS4C significantly outperforms existing methods, improving the compilation rate from 63% to 95.1% compared to the state-of-the-art SnR, marking a 50.1% improvement. On average, ZS4C can infer more accurate import statements (with an F1 score of 0.98) than SnR, with an improvement of 8.5% in the F1.","abstract_has_math":false,"creators":["Kabir, Azmain"],"institution":null,"degree_name":null,"degree_level":"Master of Science (M.Sc.)","degree_discipline":"Computer Science","degree_department":null,"school":null,"contributors":[],"advisors":["Wang, Shaowei"],"committee_chairs":[],"committee_members":["Chowdhury, Shaiful (Computer Science)","Tabiban, Azadeh (Computer Science)"],"year":2024,"date_issued":"2024-08-25","date_published":"2024-08-25","updated_at":"2026-11-19T09:12:44Z","subjects":["Incomplete code snippets","Large language models","API inference","Program synthesis","Prompt engineering"],"languages":["eng"],"rights":[],"rights_urls":[],"identifier_entries":[],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/1993/38437","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/1993/38437","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%3Amanitoba%3Aoai%3Amspace.lib.umanitoba.ca%3A1993%2F38437","prefix":"oai_dc"},"source_record":{"url":"https://mspace.lib.umanitoba.ca/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Amspace.lib.umanitoba.ca%3A1993%2F38437","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.committeemember","label":"Committee Member","values":["Chowdhury, Shaiful (Computer Science)","Tabiban, Azadeh (Computer Science)"]},{"key":"dc:contributor.supervisor","label":"Supervisor","values":["Wang, Shaowei"]},{"key":"dc:creator","label":"Author","values":["Kabir, Azmain"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2024-08-27T20:52:37Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2024-08-27T20:52:37Z"]},{"key":"dc:date.issued","label":"Date","values":["2024-08-25"]},{"key":"dc:date.submitted","label":"Dc Date Submitted","values":["2024-08-26T03:16:13Z"]},{"key":"dc:type","label":"Dc Type","values":["master thesis"]},{"key":"thesis:degree_discipline","label":"Discipline","values":["Computer Science"]},{"key":"thesis:degree_level","label":"Degree Level","values":["Master of Science (M.Sc.)"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["Incomplete code snippets","Large language models","API inference","Program synthesis","Prompt engineering"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["eng"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.uri","label":"Identifier URI","values":["http://hdl.handle.net/1993/38437"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["Technical Q&A sites and Large Language Models (LLMs) are valuable resources for software developers seeking knowledge. However, the provided code snippets are often uncompilable and incomplete due to unresolved types, missing libraries, and incorrect import statements. This poses a challenge for users who wish to reuse or analyze these snippets. Existing methods either do not focus on creating compilable code or have low success rates. To address this, we propose ZS4C, a lightweight approach for Zero-shot Synthesis of compilable code For incomplete Code snippets using LLMs. ZS4C operates in two stages: first, it uses an LLM, like GPT-3.5, to identify missing import statements in a snippet; second, it collaborates with a validator (e.g., compiler) to fix compilation errors caused by incorrect imports and syntax issues. We evaluated ZS4C on the StatType-SO benchmark and a new dataset, Python-SO, which includes 539 Python snippets from Stack Overflow across the 20 most popular Python libraries. ZS4C significantly outperforms existing methods, improving the compilation rate from 63% to 95.1% compared to the state-of-the-art SnR, marking a 50.1% improvement. On average, ZS4C can infer more accurate import statements (with an F1 score of 0.98) than SnR, with an improvement of 8.5% in the F1."]},{"key":"dc:description.note","label":"Dc Description Note","values":["October 2024"]},{"key":"dc:title","label":"Title","values":["Zero-shot synthesis of compilable code for incomplete code snippets using LLMs"]},{"key":"local:admin","label":"Local Admin","values":["no"]},{"key":"others:access_status","label":"Others Access Status","values":["open.access"]}]}],"canonical_facts":{"dc:contributor.committeemember":["Chowdhury, Shaiful (Computer Science)","Tabiban, Azadeh (Computer Science)"],"dc:contributor.supervisor":["Wang, Shaowei"],"dc:creator":["Kabir, Azmain"],"dc:date.accessioned":["2024-08-27T20:52:37Z"],"dc:date.available":["2024-08-27T20:52:37Z"],"dc:date.issued":["2024-08-25"],"dc:date.submitted":["2024-08-26T03:16:13Z"],"dc:description.abstract":["Technical Q&A sites and Large Language Models (LLMs) are valuable resources for software developers seeking knowledge. However, the provided code snippets are often uncompilable and incomplete due to unresolved types, missing libraries, and incorrect import statements. This poses a challenge for users who wish to reuse or analyze these snippets. Existing methods either do not focus on creating compilable code or have low success rates. To address this, we propose ZS4C, a lightweight approach for Zero-shot Synthesis of compilable code For incomplete Code snippets using LLMs. ZS4C operates in two stages: first, it uses an LLM, like GPT-3.5, to identify missing import statements in a snippet; second, it collaborates with a validator (e.g., compiler) to fix compilation errors caused by incorrect imports and syntax issues. We evaluated ZS4C on the StatType-SO benchmark and a new dataset, Python-SO, which includes 539 Python snippets from Stack Overflow across the 20 most popular Python libraries. ZS4C significantly outperforms existing methods, improving the compilation rate from 63% to 95.1% compared to the state-of-the-art SnR, marking a 50.1% improvement. On average, ZS4C can infer more accurate import statements (with an F1 score of 0.98) than SnR, with an improvement of 8.5% in the F1."],"dc:description.note":["October 2024"],"dc:identifier.uri":["http://hdl.handle.net/1993/38437"],"dc:language.iso":["eng"],"dc:subject":["Incomplete code snippets","Large language models","API inference","Program synthesis","Prompt engineering"],"dc:title":["Zero-shot synthesis of compilable code for incomplete code snippets using LLMs"],"dc:type":["master thesis"],"local:admin":["no"],"others:access_status":["open.access"],"thesis:degree_discipline":["Computer Science"],"thesis:degree_level":["Master of Science (M.Sc.)"]},"updated_at":"2026-11-19T09:12:44Z"}