Knowledge-Aware Code Generation with Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) perform well on basic programming problems. However, they encounter challenges when dealing with complex tasks involving the use of diverse algorithmic and data structure skills, particularly programming competition-level problems. Notably, ChatGPT exhibits proficient performance on problems it has encountered during its pre-training phase, but this performance deteriorates when faced with novel problems. Consequently, enhancing the ability of LLMs to address unfamiliar problems has emerged as a pivotal research focus. The problem-solving process of LLMs mirrors human programmers' approach to a certain extent. When confronted with new programming tasks, human programmers engage in task planning and code writing with the previously acquired knowledge about algorithms and data structures. Despite having learned such knowledge, LLMs struggle to effectively apply it when faced with specific new problems. To address this issue, we constructed a novel dataset, CodeF, which contains a portion of programming problems that ChatGPT has not previously encountered. Furthermore, we developed a Knowledge Library tailored for Python programming contest problems and introduced the concept of Knowledge-Aware Code Generation (KareCoder). KareCoder bolsters the models' understanding and problem-solving capabilities by integrating prompt and knowledge from the library into the LLMs' code generation reasoning process, especially on Pass@1 metrics. Upon testing on the CodeF and APPS datasets, KareCoder demonstrated outstanding performance in handling novel problems previously unencountered by LLMs. In contrast with the code directly generated by ChatGPT, KareCoder achieved a relative improvement of 23.3% on the Pass@1 metric on the CodeF post2021-9 dataset. Additionally, it performs well compared to other methods when dealing with problems that LLMs have previously encountered.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). First posted on arXiv 29 Jan 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 2; 2025: 3; 2026: 1.
6 papers.
- 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMscited by 17
- 2025Unified attacks to large language model watermarks: spoofing and scrubbing in unauthorized knowledge distillationcited by 9
- 2024Self-Explained Keywords Empower Large Language Models for Code Generationcited by 2
- 2025Refactoring with LLMs: Bridging Human Expertise and Machine Understandingcited by 2
- 2026MIRROR: A Multi-Agent Framework with Iterative Adaptive Revision and Hierarchical Retrieval for Optimization Modeling in Operations Researchcited by 2
- 2025Investigating Execution-Aware Language Models for Code Optimizationcited by 1
- 2026MIRROR: A Multi-Agent Framework with Iterative Adaptive Revision and Hierarchical Retrieval for Optimization Modeling in Operations Research3 Feb 2026
- 2025Refactoring with LLMs: Bridging Human Expertise and Machine Understanding4 Oct 2025
- 2025Unified attacks to large language model watermarks: spoofing and scrubbing in unauthorized knowledge distillation24 Apr 2025
- 2025Investigating Execution-Aware Language Models for Code Optimization11 Mar 2025
- 2024Self-Explained Keywords Empower Large Language Models for Code Generation21 Oct 2024
- 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMs20 Mar 2024
Similar, not cited
Close in wording, no citation either way
- 2023Think Outside the Code: Brainstorming Boosts Large Language Models in Code Generation
- 2026CodeEval: A pedagogical approach for targeted evaluation of code-trained Large Language Models
- 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs
- 2025Evaluating and Improving Large Language Models for Competitive Program Generation
- 2025Seed-Coder: Let the Code Model Curate Data for Itself
- 2024What Makes Large Language Models Reason in (Multi-Turn) Code Generation?
- 2025The Valley of Code Reasoning: Scaling Knowledge Distillation of Large Language Models
- 2025Increasing LLM Coding Capabilities through Diverse Synthetic Coding Tasks