Uncertainty Awareness of Large Language Models Under Code Distribution Shifts: A Benchmark Study
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 29 of its 43 references that are in the map. First posted on arXiv 12 Jan 2024.
Builds on
29 of 43 references.
References · 29
- 2017On Calibration of Modern Neural Networkscited by 4,860
- 2015Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learningcited by 4,416
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
- 2016Simple and Scalable Predictive Uncertainty Estimation using Deep Ensemblescited by 3,888
- 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2018A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attackscited by 1,472
- 2017Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networkscited by 1,325
- 2019Can You Trust Your Model's Uncertainty? Evaluating Predictive Uncertainty Under Dataset Shiftcited by 1,274
- 2017Deep Bayesian Active Learning with Image Datacited by 812
- 2019A Simple Baseline for Bayesian Uncertainty in Deep Learningcited by 555
- 2015Variational Dropout and the Local Reparameterization Trickcited by 489
17 more
- 2020Simple and Principled Uncertainty Estimation with Deterministic Deep Learning via Distance Awarenesscited by 389
- 2018code2vec: Learning Distributed Representations of Codecited by 249
- 2022Out-of-Distribution Detection and Selective Generation for Conditional Language Modelscited by 193
- 2018Understanding Measures of Uncertainty for Adversarial Example Detectioncited by 177
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2022Uncertainty Quantification in Scientific Machine Learning: Methods, Metrics, and Comparisonscited by 169
- 2022Plex: Towards Reliability using Pretrained Large Model Extensionscited by 102
- 2020Contrastive Code Representation Learningcited by 76
- 2020Code Prediction by Feeding Trees to Transformerscited by 70
- 2018Adversarial Sample Detection for Deep Neural Network through Model Mutation Testingcited by 48
- 2020On the Generalizability of Neural Program Models with respect to Semantic-Preserving Program Transformationscited by 41
- 2022Self-Ensemble Adversarial Training for Improved Robustnesscited by 38
- 2021Sequence Level Contrastive Learning for Text Summarizationcited by 31
- 2023On Uncertainty Calibration and Selective Generation in Probabilistic Neural Summarization: A Benchmark Studycited by 25
- 2021Impact of Evaluation Methodologies on Code Summarizationcited by 11
- 2023Uncertainty-Aware Bootstrap Learning for Joint Extraction on Distantly-Supervised Datacited by 7
- 2022CodeS: Towards Code Model Generalization Under Distribution Shiftcited by 6
Built on by
Citing papers per year: 2024: 1; 2025: 1; 2026: 1.
3 papers.
- 2024UBench: Benchmarking Uncertainty in Large Language Models with Multiple Choice Questionscited by 6
- 2025LeMix: Unified Scheduling for LLM Training and Inference on Multi-GPU Systemscited by 2
- 2026PromptShift-CRC: Drift-Aware Conformal Risk Control for Foundation Models Under Prompt and Domain Shiftcited by 2
- 2026PromptShift-CRC: Drift-Aware Conformal Risk Control for Foundation Models Under Prompt and Domain Shift14 Jun 2026
- 2025LeMix: Unified Scheduling for LLM Training and Inference on Multi-GPU Systems28 Jul 2025
- 2024UBench: Benchmarking Uncertainty in Large Language Models with Multiple Choice Questions18 Jun 2024