PAC Prediction Sets for Large Language Models of Code
Not on the map. Why?
Abstract (arXiv)
Prediction sets have recently been shown to be a promising strategy for quantifying the uncertainty of deep neural networks in a way that provides theoretical guarantees. However, existing techniques have largely targeted settings where the space of labels is simple, so prediction sets can be arbitrary subsets of labels. For structured prediction problems where the space of labels is exponential in size, even prediction sets containing a small fraction of all labels can be exponentially large. In the context of code generation, we propose a solution that considers a restricted set of prediction sets that can compactly be represented as partial programs, which are programs with portions replaced with holes. Given a trained code generation model, our algorithm leverages a programming language's abstract syntax tree to generate a set of programs such that the correct program is in the set with high-confidence. Valuable applications of our algorithm include a Codex-style code generator with holes in uncertain parts of the generated code, which provides a partial program with theoretical guarantees. We evaluate our approach on PICARD (a T5 model for SQL semantic parsing) and Codex (a GPT model for over a dozen programming languages, including Python), demonstrating that our approach generates compact PAC prediction sets. This is the first research contribution that generates PAC prediction sets for generative code models.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 15 of its 21 references that are in the map. First posted on arXiv 17 Feb 2023.
Builds on
15 of 21 references.
References · 15
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2014Sequence to Sequence Learning with Neural Networkscited by 2,986
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
- 2021Measuring Coding Challenge Competence With APPScited by 902
- 2020A Review of Uncertainty Quantification in Deep Learning: Techniques, Applications and Challengescited by 819
- 2019Conformal Prediction Under Covariate Shiftcited by 519
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
- 2020Uncertainty Sets for Image Classifiers using Conformal Predictioncited by 366
- 2021Distribution-Free, Risk-Controlling Prediction Setscited by 288
3 more
- 2019PAC Confidence Sets for Deep Neural Networks via Calibrated Predictioncited by 60
- 2022Autoregressive Structured Prediction with Language Modelscited by 43
- 2021Learning to Complete Code with Sketchescited by 23
Built on by
Citing papers per year: 2023: 1; 2024: 2; 2025: 1; 2026: 1.
5 papers.
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2024Conformal Prediction: A Data Perspectivecited by 25
- 2024Conformal Structured Predictioncited by 10
- 2025Statistical Methods in Generative AIcited by 4
- 2026Uncertainty Quantification for LLM-based Code Generationcited by 0
- 2026Uncertainty Quantification for LLM-based Code Generation12 May 2026
- 2025Statistical Methods in Generative AI8 Sep 2025
- 2024Conformal Prediction: A Data Perspective9 Oct 2024
- 2024Conformal Structured Prediction8 Oct 2024
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023