USCD: Improving Code Generation of LLMs by Uncertainty-Aware Selective Contrastive Decoding

L Ding, L Shen, W Yu, D Tao - 2024 - papers.ssrn.com
Large language models (LLMs) have shown remarkable capabilities in code generation.
However, the effects of hallucinations (eg, output noise) make it particularly challenging for
LLMs to generate high-quality code in one pass. In this work, we propose a simple and
effective uncertainty-aware selective contrastive decoding (USCD) mechanism to improve
the quality of one-pass code generation in LLMs and reduce the impact of output noise. To
be specific, we first elaborately designed a negative prompt (namely lame prompt) to output …

: Improving Code Generation of LLMs by Uncertainty-Aware Selective Contrastive Decoding

S Wang, L Ding, L Shen, Y Luo, Z He, W Yu… - arXiv preprint arXiv …, 2024 - arxiv.org
Large language models (LLMs) have shown remarkable capabilities in code generation.
However, the effects of hallucinations (eg, output noise) make it particularly challenging for
LLMs to generate high-quality code in one pass. In this work, we propose a simple and
effective\textbf {u} ncertainty-aware\textbf {s} elective\textbf {c} ontrastive\textbf {d} ecoding
($\mathbb {USCD} $) mechanism to improve the quality of one-pass code generation in
LLMs and reduce the impact of output noise. To be specific, we first elaborately designed a …
Showing the best results for this search. See all results