paper-with-me

Papers

$\mathbb{USCD}$: Improving Code Generation of LLMs by Uncertainty-Aware Selective Contrastive Decoding

2024-09-09 · Shuai Wang, Liang Ding, Li Shen, Yong Luo, Zheng He, Wei Yu, DaCheng Tao

Large language models (LLMs) have shown remarkable capabilities in code generation. However, the effects of hallucinations (e.g., 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 negative prompt (namely lame prompt) to output noise by removing input-output examples from the standard few-shot prompt. Our preliminary study shows that the Jensen-Shannon divergence (JS divergence) between token distribution uncertainty and the output noise is relatively low (approximately $0.25$), indicating their high relevance. Then, we selectively eliminate output noise induced by lame prompts based on the uncertainty of the prediction distribution from the standard prompt. Notably, our proposed plug-and-play mechanism is an inference-only method, enjoying appealing flexibility. Extensive experiments on widely used benchmarks, e.g., HumanEval, MBPP, and MultiPL-E, upon several LLMs (i.e., Inocder-6b, CodeLlama-7b, WizardCoder-15b, StarCoder, and Llama2-7b), demonstrate that our proposed USCD significantly improves one-pass code generation, with an average \textit{pass@$1$} scores increase of 16.59\%. We will release code and data on GitHub.

📄 PDF Abstract BibTeX arXiv:2409.05923

Code (0)

등록된 구현이 없습니다.

Tasks

Code GenerationHumanEvalmbpp

Similar Papers 제목 키워드 기반

EMPLACE: Self-Supervised Urban Scene Change Detection

2025-03-22 · Tim Alpherts, Sennay Ghebreab, Nanne van Noord

Urban change is a constant process that influences the perception of neighbourhoods and the lives of the people within them. The field of Urban Scene Change Detection (USCD) aims to capture changes in street scenes using…

Change DetectionScene Change DetectionTriplet

Domain-Specific Knowledge Graphs in RAG-Enhanced Healthcare LLMs

2026-01-21 · Sydney Anuyah, Mehedi Mahmud Kaushik, Hao Dai, Rakesh Shiradkar 외 arxiv

Large Language Models (LLMs) generate fluent answers but can struggle with trustworthy, domain-specific reasoning. We evaluate whether domain knowledge graphs (KGs) improve Retrieval-Augmented Generation (RAG) for health…

Knowledge Graphs

Conformal prediction under ambiguous ground truth

2023-07-18 · David Stutz, Abhijit Guha Roy, Tatiana Matejovicova, Patricia Strachan 외

Conformal Prediction (CP) allows to perform rigorous uncertainty quantification by constructing a prediction set $C(X)$ satisfying $\mathbb{P}(Y \in C(X))\geq 1-\alpha$ for a user-chosen $\alpha \in [0,1]$ by relying on …

Conformal PredictionPredictionUncertainty Quantification

IUQ: Interrogative Uncertainty Quantification for Long-Form Large Language Model Generation

2026-04-16 · Haozhi Fan, Jinhao Duan, Kaidi Xu arxiv

Despite the rapid advancement of Large Language Models (LLMs), uncertainty quantification in LLM generation is a persistent challenge. Although recent approaches have achieved strong performance by restricting LLMs to pr…

Text Generation

Look Before You Leap: An Exploratory Study of Uncertainty Measurement for Large Language Models

2023-07-16 · Yuheng Huang, Jiayang Song, Zhijie Wang, Shengming Zhao 외

The recent performance leap of Large Language Models (LLMs) opens up new opportunities across numerous industrial applications and domains. However, erroneous generations, such as false predictions, misinformation, and h…

Code GenerationHallucinationMisinformation