Understanding prompt engineering may not require rethinking generalization
On the map: LLM reasoning → Multimodal reasoning
Abstract (arXiv)
Zero-shot learning in prompted vision-language models, the practice of crafting prompts to build classifiers without an explicit training process, has achieved impressive performance in many settings. This success presents a seemingly surprising observation: these methods suffer relatively little from overfitting, i.e., when a prompt is manually engineered to achieve low error on a given training set (thus rendering the method no longer actually zero-shot), the approach still performs well on held-out test data. In this paper, we show that we can explain such performance well via recourse to classical PAC-Bayes bounds. Specifically, we show that the discrete nature of prompts, combined with a PAC-Bayes prior given by a language model, results in generalization bounds that are remarkably tight by the standards of the literature: for instance, the generalization bound of an ImageNet classifier is often within a few percentage points of the true test error. We demonstrate empirically that this holds for existing handcrafted prompts and prompts generated through simple greedy search. Furthermore, the resulting bound is well-suited for model selection: the models with the best bound typically also have the best test performance. This work thus provides a possible justification for the widespread practice of prompt engineering, even if it seems that such methods could potentially overfit the training data.
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Placed in Multimodal reasoning, one of 17 directions in LLM reasoning. Builds on 32 of its 42 references that are in the map. First posted on arXiv 6 Oct 2023.
Builds on
32 of 42 references.
References · 32
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2021Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervisioncited by 3,864
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
- 2021Learning to Prompt for Vision-Language Modelscited by 2,281
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
- 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,256
- 2017Deep Hashing Network for Unsupervised Domain Adaptationcited by 1,188
20 more
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,045
- 2021Robust fine-tuning of zero-shot modelscited by 797
- 2017Spectrally-normalized margin bounds for neural networkscited by 686
- 2017Exploring Generalization in Deep Learningcited by 600
- 2017Computing Nonvacuous Generalization Bounds for Deep (Stochastic) Neural Networks with Many More Parameters than Training Datacited by 533
- 2019Fantastic Generalization Measures and Where to Find Themcited by 513
- 2014In Search of the Real Inductive Bias: On the Role of Implicit Regularization in Deep Learningcited by 342
- 2017Functional Map of the Worldcited by 338
- 2023Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discoverycited by 336
- 2017A PAC-Bayesian Approach to Spectrally-Normalized Margin Bounds for Neural Networkscited by 314
- 2015Norm-Based Capacity Control in Neural Networkscited by 299
- 2022PromptSource: An Integrated Development Environment and Repository for Natural Language Promptscited by 289
- 2019Uniform convergence may be unable to explain generalization in deep learningcited by 224
- 2021How Many Data Points is a Prompt Worth?cited by 198
- 2021ZeroCap: Zero-Shot Image-to-Text Generation for Visual-Semantic Arithmeticcited by 150
- 2018Non-Vacuous Generalization Bounds at the ImageNet Scale: A PAC-Bayesian Compression Approachcited by 126
- 2020In Search of Robust Measures of Generalizationcited by 79
- 2022PAC-Bayes Compression Bounds So Tight That They Can Explain Generalizationcited by 76
- 2020On the role of data in PAC-Bayes boundscited by 64
- 2019Generalization in Deep Networks: The Role of Distance from Initializationcited by 51
Built on by
Citing papers per year: 2024: 3; 2025: 6; 2026: 1.
10 papers.
- 2024Unlocking Tokens as Data Points for Generalization Bounds on Larger Language Modelscited by 25
- 2024Automated Black-box Prompt Engineering for Personalized Text-to-Image Generationcited by 12
- 2025Predicting the Performance of Black-box LLMs through Follow-up Queriescited by 9
- 2024Finetuning CLIP to Reason about Pairwise Differencescited by 6
- 2025Bridging Kolmogorov Complexity and Deep Learning: Asymptotically Optimal Description Length Objectives for Transformerscited by 6
- 2025Compute-Optimal LLMs Provably Generalize Better With Scalecited by 5
- 2025Prompts Generalize with Low Data: Non-vacuous Generalization Bounds for Optimizing Prompts with More Informative Priorscited by 3
- 2026What Fits (Into Few Tokens) Doesn't Overfit: Compression and Generalization in ML Research Agentscited by 3
- 2025Non-vacuous Generalization Bounds for Deep Neural Networks without any modification to the trained modelscited by 2
- 2025Aligning Probabilistic Beliefs under Informative Missingness: LLM Steerability in Clinical Reasoningcited by 0
- 2026What Fits (Into Few Tokens) Doesn't Overfit: Compression and Generalization in ML Research Agents9 Jun 2026
- 2025Aligning Probabilistic Beliefs under Informative Missingness: LLM Steerability in Clinical Reasoning29 Nov 2025
- 2025Prompts Generalize with Low Data: Non-vacuous Generalization Bounds for Optimizing Prompts with More Informative Priors9 Oct 2025
- 2025Bridging Kolmogorov Complexity and Deep Learning: Asymptotically Optimal Description Length Objectives for Transformers26 Sep 2025
- 2025Compute-Optimal LLMs Provably Generalize Better With Scale21 Apr 2025
- 2025Non-vacuous Generalization Bounds for Deep Neural Networks without any modification to the trained models10 Mar 2025
- 2025Predicting the Performance of Black-box LLMs through Follow-up Queries2 Jan 2025
- 2024Finetuning CLIP to Reason about Pairwise Differences15 Sep 2024
- 2024Unlocking Tokens as Data Points for Generalization Bounds on Larger Language Models25 Jul 2024
- 2024Automated Black-box Prompt Engineering for Personalized Text-to-Image Generation28 Mar 2024
Similar, not cited
Close in wording, no citation either way
- 2022Test-Time Prompt Tuning for Zero-Shot Generalization in Vision-Language Models
- 2023Align Your Prompts: Test-Time Prompting with Distribution Alignment for Zero-Shot Generalization
- 2024Revisiting Prompt Pretraining of Vision-Language Models
- 2025Decoupling Augmentation Bias in Prompt Learning for Vision-Language Models
- 2026Beyond Heuristic Prompting: A Concept-Guided Bayesian Framework for Zero-Shot Image Recognition
- 2024Generalizable Prompt Tuning for Vision-Language Models
- 2022Prompting through Prototype: A Prototype-based Prompt Learning on Pretrained Vision-Language Models
- 2024Improving Zero-shot Generalization of Learned Prompts via Unsupervised Knowledge Distillation