SEK: Self-Explained Keywords Empower Large Language Models for Code Generation

Large language models (LLMs) have achieved impressive performance in code generation.Despite the remarkable success, we observed that LLMs often misunderstand or overlook some problem-specific undertrained keywords during code generation, compromising the accuracy of the generated code.After explicitly explaining these undertrained keywords using well-trained terms in the prompt, LLMs are more likely to generate correct code implementation.Inspired by this observation, we propose a novel technique named SEK (Self-Explained Keywords), which empowers an LLM for better code generation by extracting and explaining the key terms in the problem description with the LLM itself.Comprehensive experiments across four benchmarks, i.e., HumanEval(+), MBPP(+), APPS and Big-CodeBench, with five representative LLMs, show that SEK can significantly improve LLMs in code generation, yielding substantial and consistent gains.For instance, SEK improves the Pass@1 of DeepSeek-Coder-V2-Instruct from 85.4% to 93.3% on the Humaneval benchmark.Further analysis confirms that SEK enables the LLMs to shift their attention from low-frequency keywords to their corresponding explanations.Our code is available at https://github.com/ZJU-CTAG/SEK.

Authors

Institutions

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.324
Citations
4
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
9.92

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

SEK: Self-Explained Keywords Empower Large Language Models for Code Generation

Mouxiang Chen, Zhongxin Liu, Lishui Fan
4 citations
Natural Language Processing Techniques
9.92
article

SEK: Self-Explained Keywords Empower Large Language Models for Code Generation

Mouxiang Chen, Zhongxin Liu, Lishui Fan
article en
4 citations

Abstract

Large language models (LLMs) have achieved impressive performance in code generation.Despite the remarkable success, we observed that LLMs often misunderstand or overlook some problem-specific undertrained keywords during code generation, compromising the accuracy of the generated code.After explicitly explaining these undertrained keywords using well-trained terms in the prompt, LLMs are more likely to generate correct code implementation.Inspired by this observation, we propose a novel technique named SEK (Self-Explained Keywords), which empowers an LLM for better code generation by extracting and explaining the key terms in the problem description with the LLM itself.Comprehensive experiments across four benchmarks, i.e., HumanEval(+), MBPP(+), APPS and Big-CodeBench, with five representative LLMs, show that SEK can significantly improve LLMs in code generation, yielding substantial and consistent gains.For instance, SEK improves the Pass@1 of DeepSeek-Coder-V2-Instruct from 85.4% to 93.3% on the Humaneval benchmark.Further analysis confirms that SEK enables the LLMs to shift their attention from low-frequency keywords to their corresponding explanations.Our code is available at https://github.com/ZJU-CTAG/SEK.

Zhejiang University (CN)
National Natural Science Foundation of China, Natural Science Foundation of Zhejiang Province
Openalex Percentile: Top 2%
Natural Language Processing Techniques
9.92
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.