mlsanityData to 7 Oct 2026

Comments as Natural Logic Pivots: Improve Code Generation via Comment Perspective

arXiv 2404.07549 ↗First posted 11 Apr 2024cs.CLcited by 3

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

Code generation aims to understand the problem description and generate corresponding code snippets, where existing works generally decompose such complex tasks into intermediate steps by prompting strategies, such as Chain-of-Thought and its variants. While these studies have achieved some success, their effectiveness is highly dependent on the capabilities of advanced Large Language Models (LLMs) such as GPT-4, particularly in terms of API calls, which significantly limits their practical applicability. Consequently, how to enhance the code generation capabilities of small and medium-scale code LLMs without significantly increasing training costs is an appealing challenge. In this paper, we suggest that code comments are the natural logic pivot between natural language and code language and propose using comments to boost the code generation ability of code LLMs. Concretely, we propose MANGO (comMents As Natural loGic pivOts), including a comment contrastive training strategy and a corresponding logical comment decoding strategy. Experiments are performed on HumanEval and MBPP, utilizing StarCoder and WizardCoder as backbone models, and encompassing model parameter sizes between 3B and 7B. The results indicate that MANGO significantly improves the code pass rate based on the strong baselines. Meanwhile, the robustness of the logical comment decoding strategy is notably higher than the Chain-of-thoughts prompting. The code is publicly available at urlhttps://github.com/pppa2019/Mango.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 15 of its 21 references that are in the map. First posted on arXiv 11 Apr 2024.

Builds on

15 of 21 references.

Closest ancestors · 2

Same direction, newest first

  1. 2023Think Outside the Code: Brainstorming Boosts Large Language Models in Code Generation18 May
  2. 2023Structured Chain-of-Thought Prompting for Code Generation11 May

Other references · 13

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  4. 2021Program Synthesis with Large Language Modelscited by 3,509
  5. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  6. 2023WizardLM: Empowering large pre-trained language models to follow complex instructionscited by 1,116
  7. 2023StarCoder: may the source be with you!cited by 790
  8. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
  9. 2022CodeT: Code Generation with Generated Testscited by 369
  10. 2023At Which Training Stage Does Code Data Help LLMs Reasoning?cited by 82
  11. 2023Improving Code Generation by Training with Natural Language Feedbackcited by 75
  12. 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositionscited by 62
1 more
  1. 2023Can Programming Languages Boost Each Other via Instruction Tuning?cited by 7

Built on by

Cited by year (2026 to 7 Oct)

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

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Assessing Code Generation with Intermediate Languages
  2. 2025Optimizing Knowledge Utilization for Multi-Intent Comment Generation with Large Language Models ↗
  3. 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
  4. 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs
  5. 2024HumanEval Pro and MBPP Pro: Evaluating Large Language Models on Self-invoking Code Generation
  6. 2023On the Effectiveness of Large Language Models in Domain-Specific Code Generation
  7. 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensus
  8. 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositories