TL;DR
This paper introduces novel methods for adapting large language models (LLMs) when only API access is available, meaning gradients cannot be computed. They achieve this by developing gradient-free prompt tuning techniques that also incorporate uncertainty quantification, leading to more reliable predictions and better out-of-distribution detection.
What Problem Does This Paper Address?
Large pre-trained language models (PLMs) are incredibly powerful but often inaccessible for direct modification due to privacy concerns, commercial restrictions, or simply being offered as black-box APIs. Traditional fine-tuning requires access to model gradients, which is impossible with API access. While "prompt tuning" offers a more efficient way to adapt PLMs by only tuning a small set of prompt parameters, it still relies on gradients. Recent work has explored "gradient-free" prompt tuning, but these methods often assume access to intermediate model layers. This paper tackles an even more challenging scenario: adapting PLMs with only API access (no gradients, no internal layer access) and also aims to quantify the uncertainty in these adapted models, which is crucial for real-world deployment where unexpected data might be encountered.
Methods
The authors propose two main sets of techniques:
- Gradient-free Prompt Tuning with Uncertainty Quantification:
- Gradient-free Variational Inference (ELBO): They adapt variational inference to estimate a distribution over prompt parameters. Since direct gradient computation is impossible, they use a gradient-free optimizer (CMA-ES) to optimize the variational distribution's parameters.
- Prompt Ensembles: This method leverages the idea of ensembling by running multiple independent gradient-free prompt tuning optimizations (using CMA-ES) with different initializations. The collection of optimized prompts forms a distribution, allowing for uncertainty estimation.
- Gradient-free and Likelihood-free Prompt Tuning:
- Simulation-based Inference (SBI) with ABC-SMC: For the strictest black-box setting where even model logits are unavailable (only discrete labels are returned), they frame the problem as a Simulation-based Inference task. They use a Sequential Monte Carlo Approximate Bayesian Computation (SMC-ABC) algorithm to infer the posterior distribution of prompts. The PLM acts as a simulator, generating label predictions based on sampled prompts.
Datasets
The paper evaluates its methods on standard text classification benchmark datasets:
- SST-2 (Sentiment Analysis)
- Yelp Polarity (Sentiment Analysis)
- AG's News (Topic Classification)
- DBPedia (Topic Classification)
- MRPC (Paraphrase Detection)
- SNLI (Natural Language Inference)
- RTE (Natural Language Inference)
For Out-of-Distribution (OOD) detection, they create ID/OOD pairs by combining datasets from different tasks (e.g., SST-2/RTE for "Far OOD") and use datasets like IMDB and MNLI for "Near OOD" detection.
Key Insights and Ideas
- Uncertainty is Key for Reliability: The paper strongly advocates for quantifying uncertainty in prompt tuning. They show that by learning a distribution over prompts (rather than a single point estimate), they can achieve better calibrated predictions and improve performance on tasks like selective classification and OOD detection.
- Tackling the "True" Black-Box: The most significant contribution is addressing the likelihood-free setting. By framing prompt tuning as an SBI problem, they demonstrate that it's possible to adapt PLMs even when only discrete labels are returned, a scenario not previously addressed by gradient-free prompt tuning methods.
- Gradient-free Methods Can Compete: Their proposed gradient-free methods (ELBO and Ensembles) achieve comparable or even better prediction performance than existing gradient-free baselines (like BBT) while also providing superior uncertainty quantification.
- ABC-SMC for Likelihood-Free Inference: The adaptation of SMC-ABC proves effective for inferring prompt posteriors in the challenging likelihood-free setting, outperforming other SBI approaches like SNPE in their experiments.
Key Results
- Prediction Performance: The proposed gradient-free methods (ELBO and Ensembles) achieve competitive prediction accuracy, often matching or slightly exceeding the SOTA gradient-free method BBT. In the likelihood-free setting, their ABC-SMC method also shows competitive performance.
- Calibration: Tables 2 and 11 show that the proposed gradient-free methods (ELBO and Ensembles) significantly improve calibration (lower ECE scores) compared to BBT.
- Selective Classification: Tables 3 and 12 indicate that the proposed methods, particularly Ensembles and ELBO, achieve better selective classification performance (lower AURRRC scores), meaning they are better at abstaining from predictions on uncertain samples.
- OOD Detection: Tables 4, 5, 13, and 14 demonstrate that the proposed methods, especially ABC-SMC in the likelihood-free setting, achieve strong performance on both Far and Near OOD detection tasks, outperforming baselines.
Limitations and Future Work
- Approximate Inference Challenges: The authors acknowledge that evaluating the quality of approximate posterior inference is inherently challenging. They rely on downstream metrics, which can conflate posterior quality with predictive performance.
- Computational Cost of ABC-SMC: The ABC-SMC approach, while effective, is computationally more expensive than methods that can leverage gradient information. Improving its efficiency is a key area for future work.
- Future Directions: The paper suggests exploring more modern neural SBI methods and developing more robust techniques for learning prompt posteriors. They also mention the potential for learning natural language-like interpretable prompts as an interesting avenue.
Summary updated