DONGZE LI, Songqiang Chen, Jialun Cao, Shing-Chi Cheung · Proceedings of the ACM on software engineering. 2026 · 2026
DOI: 10.1145/3832275
Counts differ because each database indexes a different set of publications. We treat OpenAlex as the canonical count; Google Scholar is not shown (no API, and crawling it violates its ToS).
In-Context Learning (ICL) has emerged as a promising solution to enhance the code generation capabilities of Large Language Models (LLMs) by incorporating code examples inside the prompt to let LLMs learn from demonstrations. However, despite their effectiveness gains, it remains unclear which specific properties of ICL-provided code examples (e.g., solution insight, essential contextual information, identifier naming styles, code formatting) drive these gains. This paper systematically investigates the impact of different sources and internal features of code examples on ICL for code generation through controlled experiments on contest-style programming questions and repository-level tasks. Our results show that while LLMs struggle to extract generalizable problem-solving insights from provided solutions to similar questions or repository snippets, their retrieval-augmented ICL performance can significantly benefit from explicit contextual information, such as input/output demonstrations, required helper functions, and namespace information. Through targeted mutation operators, we further find that identifier naming is substantially more critical than code formatting or low-level implementation details, with the elimination of descriptive variable names causing performance drops of up to 30 percentage points. Finally, we demonstrate that LLMs significantly prefer semantically meaningful identifier names and that adherence to surface-level naming conventions is far less important than semantic clarity. These findings provide practical guidelines for constructing effective ICL code examples and highlight challenges in reflection-based learning for code generation.
DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) 2018 · 2018 · 46039 citations90% match
2014 · 34004 citations90% match
2019 · 33225 citations90% match
DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) 2019 · 2019 · 17465 citations90% match
DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) 2023 · 2023 · 14309 citations90% match
2014 · 13959 citations90% match
arXiv (Cornell University) 2013 · 2013 · 11714 citations90% match
No comments yet — start the discussion below.
2019 · 11662 citations90% match
Transactions of the Association for Computational Linguistics 2017 · 2017 · 9887 citations90% match
2014 · 8653 citations90% match