Self-Explained Keywords Empower Large Language Models for Code Generation
Lishui Fan, Mouxiang Chen, Zhongxin Liu

TL;DR
This paper introduces SEK, a technique that enhances large language models' code generation by extracting and explaining key problem-specific keywords, leading to significant performance improvements across multiple benchmarks.
Contribution
SEK is a novel method that helps LLMs better understand low-frequency keywords in code problems by self-explaining and ranking them, improving code generation accuracy.
Findings
SEK improves Pass@1 from 85.4% to 93.3% on HumanEval.
SEK consistently enhances performance across five LLMs and three benchmarks.
SEK shifts LLMs' focus from low-frequency to high-frequency keywords.
Abstract
Large language models (LLMs) have achieved impressive performance in code generation. However, due to the long-tail distribution of LLMs' training data, low-frequency terms are typically underrepresented in the training process. Consequently, LLMs often misunderstand or overlook problem-specific, low-frequency keywords during code generation, compromising the accuracy of the generated code. To address this, we propose a novel technique named SEK(\textbf{S}elf-\textbf{E}xplained \textbf{K}eywords), which empowers an LLM for better code generation by extracting and explaining the key terms in the problem description with the LLM itself and ranking them based on frequency. Comprehensive experiments across three benchmarks, i.e., HumanEval(+), MBPP(+), and APPS, with five representative LLMs, show that SEK can significantly improve LLMs in code generation, yielding substantial and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Text Analysis Techniques · Topic Modeling · Natural Language Processing Techniques
MethodsSoftmax · Attention Is All You Need
