arrow
Return

Large Language Model-Aware In-Context Learning for Code Generation

delete2025-08-14
delete0
delete
OA
AI
J
Jia Li
C
Chongyang Tao
J
Jia Li
G
Ge Li
Z
Zhi Jin
H
Huangzhao Zhang
Z
Zheng Fang
F
Fang Liu
DOI:10.1145/3715908delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Large Language Models (LLMs) have shown impressive In-Context Learning (ICL) ability in code generation. LLMs take a prompt context consisting of a few demonstration examples and a new requirement as input, and output new programs without any parameter update. Existing studies have found that the performance of ICL-based code generation heavily depends on the quality of demonstration examples and thus arises research on selecting demonstration examples: given a new requirement, a few demonstration examples are selected from a candidate pool, where LLMs are expected to learn the pattern hidden in these selected demonstration examples. Existing approaches are mostly based on heuristics or randomly selecting examples. However, the distribution of randomly selected examples usually varies greatly, making the performance of LLMs less robust. The heuristics retrieve examples by only considering textual similarities of requirements, leading to sub-optimal performance.
Keywords:
In-Context Learning
Code Generation
Large Language Models
Demonstration Example Selection
Prompt Engineering

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.2K
Citations:
3.4K

Organization

No organization information available