mlsanityData to 7 Oct 2026

Knowledge-Aware Code Generation with Large Language Models

arXiv 2401.15940 ↗First posted 29 Jan 2024cs.SEcited by 6

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

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 2; 2025: 3; 2026: 1.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2023Think Outside the Code: Brainstorming Boosts Large Language Models in Code Generation
  2. 2026CodeEval: A pedagogical approach for targeted evaluation of code-trained Large Language Models
  3. 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs
  4. 2025Evaluating and Improving Large Language Models for Competitive Program Generation
  5. 2025Seed-Coder: Let the Code Model Curate Data for Itself
  6. 2024What Makes Large Language Models Reason in (Multi-Turn) Code Generation?
  7. 2025The Valley of Code Reasoning: Scaling Knowledge Distillation of Large Language Models
  8. 2025Increasing LLM Coding Capabilities through Diverse Synthetic Coding Tasks