Uncertainty Awareness of Large Language Models Under Code Distribution Shifts: A Benchmark Study

Yufei Li, Simin Chen, Yanghong Guo, Wei Yang, Yue Dong +1 more
1/12/2024
cs.SEcs.CLcs.LG

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

Large Language Models (LLMs) have been widely employed in programming language analysis to enhance human productivity. Yet, their reliability can be compromised by various code distribution shifts, leading to inconsistent outputs. While probabilistic methods are known to mitigate such impact through uncertainty calibration and estimation, their efficacy in the language domain remains underexplored compared to their application in image-based tasks. In this work, we first introduce a large-scale benchmark dataset, incorporating three realistic patterns of code distribution shifts at varying intensities. Then we thoroughly investigate state-of-the-art probabilistic methods applied to CodeLlama using these shifted code snippets. We observe that these methods generally improve the uncertainty awareness of CodeLlama, with increased calibration quality and higher uncertainty estimation~(UE) precision. However, our study further reveals varied performance dynamics across different criteria (e.g., calibration error vs misclassification detection) and trade-off between efficacy and efficiency, highlighting necessary methodological selection tailored to specific contexts.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{li2024uncertainty,
  title  = {Uncertainty Awareness of Large Language Models Under Code Distribution Shifts: A Benchmark Study},
  author = {Yufei Li and Simin Chen and Yanghong Guo and Wei Yang and Yue Dong and Cong Liu},
  year   = {2024},
  eprint = {2402.05939},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.05939v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.05939.svg)](https://codeofpaper.com/paper/2402.05939)

Discussion