paper-with-me

홈 › Papers

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

2024-04-11 · Yijie Chen, Yijin Liu, Fandong Meng, Yufeng Chen, Jinan Xu, Jie zhou

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 \url{https://github.com/pppa2019/Mango}.

📄 PDF Abstract BibTeX arXiv:2404.07549

Code (1)

pppa2019/mango 공식 구현 pytorch

Tasks

Code GenerationHumanEvalmbpp

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Residual Connection 설명 없음
Multi-Head Attention 설명 없음

Similar Papers 제목 키워드 기반

Learning Generalizable Multimodal Representations for Software Vulnerability Detection

2026-04-28 · Zeming Dong, Yuejun Guo, Qiang Hu, Yao Zhang 외 arxiv

Source code and its accompanying comments are complementary yet naturally aligned modalities-code encodes structural logic while comments capture developer intent. However, existing vulnerability detection methods mostly…

Vulnerability Detection

Revisiting the Role of Natural Language Code Comments in Code Translation

2026-01-23 · Monika Gupta, Ajay Meena, Anamitra Roy Choudhury, Vijay Arya 외 arxiv

The advent of large language models (LLMs) has ushered in a new era in automated code translation across programming languages. Since most code-specific LLMs are pretrained on well-commented code from large repositories …

Code Translation

Large Language Models are Qualified Benchmark Builders: Rebuilding Pre-Training Datasets for Advancing Code Intelligence Tasks

2025-04-28 · Kang Yang, XinJun Mao, Shangwen Wang, Yanlin Wang 외

Pre-trained code models rely heavily on high-quality pre-training data, particularly human-written reference comments that bridge code and natural language. However, these comments often become outdated as software evolv…

Code SearchCode Summarization

Hierarchical Attention Transfer Network for Cross-Domain Sentiment Classification

2018-04-26 · Thirty-Second AAAI Conference on Artificial Intelligence 2018 4 · Zheng Li, Ying WEI, Yu Zhang, Qiang Yang

Cross-domain sentiment classification aims to leverage useful information in a source domain to help do sentiment classifi- cation in a target domain that has no or little supervised infor- mation. Existing cross-domain …

ClassificationCross-Domain Text ClassificationDomain AdaptationGeneral Classification+2

Code Needs Comments: Enhancing Code LLMs with Comment Augmentation

2024-02-20 · Demin Song, Honglin Guo, Yunhua Zhou, Shuhao Xing 외

The programming skill is one crucial ability for Large Language Models (LLMs), necessitating a deep understanding of programming languages (PLs) and their correlation with natural languages (NLs). We examine the impact o…

Data Augmentation