Imagine you’re driving a car guided by an AI that confidently tells you to turn left into a lake. The problem isn't just that the AI was wrong; it’s that it was certainly wrong. In the world of machine learning, we call the fix for this "Uncertainty Quantification" (UQ)—the art of teaching models to say, "I'm not sure."
TL;DR
probly is a new Python library that brings order to the chaotic world of uncertainty-aware machine learning. It provides a unified, framework-agnostic toolkit to transform standard models (from PyTorch to scikit-learn) into "honest" ones that can represent, quantify, and evaluate their own doubt across tasks like out-of-distribution detection and active learning.
What Problem Does This Paper Address?
We’ve gotten really good at building powerful predictive models, but we’re still struggling with reliability. When a model sees something it hasn't been trained on—like a "dog" classifier seeing a "tractor"—it often just guesses "dog" with 99% confidence.
The researchers identify three core obstacles:
- Fragmented Tools: UQ implementations are scattered across niche repositories with inconsistent interfaces. If you switch from PyTorch to Flax, you often have to start your UQ pipeline from scratch.
- No Standardized Evaluation: There’s no "gold standard" for testing if one uncertainty method is actually better than another.
- Narrow Focus: Most tools only work for standard classification, leaving practitioners in the dark when dealing with Large Language Models (LLMs), graphs, or streaming data.
Methods
The authors introduce probly, built on a modular, four-stage workflow that works regardless of your underlying ML framework.
- Transform: You take a "dumb" model and make it uncertainty-aware using lightweight wrappers (e.g., adding Dropout or creating an Ensemble).
- Represent: The model produces a representation of its doubt. This could be a simple probability distribution (1st-order), a distribution over distributions (2nd-order), or even a "credal set" (a convex set of possible distributions).
- Quantify & Decide:
problycalculates scalar scores like "Total Uncertainty" (TU) and breaks them down into Aleatoric (inherent randomness, like a noisy sensor) and Epistemic (lack of knowledge, like seeing a new object). - Evaluate: Finally, it puts these scores to the test in real-world scenarios.
Datasets
The paper benchmarks 23 different methods across:
- Standard Vision: ImageNet and CIFAR-10.
- Tabular Data: OpenML datasets.
- First-Order Data: This is a highlight. Unlike standard datasets where a label is just "Dog," these datasets (like CIFAR-10H and ImageNet-ReaL) provide the full distribution of human expert opinions. This allows for a much more direct evaluation of whether a model's "doubt" matches human "doubt."
- Specialized Domains: Relational graphs (Amazon Photos) and synthetic loan-approval data streams.
Key Insights and Ideas
- The "Ensemble" is still King: In tasks like selective prediction (where the model can choose to abstain from guessing), Deep Ensembles remain incredibly hard to beat. Interestingly, the way you build the ensemble matters more than the mathematical formalism you use to represent the uncertainty.
- Aleatoric Uncertainty is an Active Learning Hero: Usually, we query new data based on what the model doesn't know (epistemic). However, the authors found that for tabular data, querying based on total uncertainty (including aleatoric) actually performed better. It turns out the "noise" near decision boundaries is a very useful signal for learning.
- The "Orders" of Doubt: The paper beautifully categorizes how we represent uncertainty. A 0th-order model just gives a guess. A 1st-order model gives a probability. A 2nd-order model gives you a "cloud" of probabilities, showing you exactly how much it's guessing about its own guesses.
Key Results
- Selective Prediction: On ImageNet, the best methods (Deep Ensembles and Credal Ensembles) achieved an area under the accuracy-rejection curve of ~0.935, significantly outperforming "evidential" models like PostNet (~0.879).
- OoD Detection: For detecting "far" out-of-distribution samples (e.g., ImageNet vs. iNaturalist), the
CreRL(Credal Relative Likelihood) method was a top performer with an AUROC of 0.806. - LLM Efficiency: Implementing UQ for LLMs is usually slow because you have to sample many responses.
probly's batched implementation achieved a 14.6x speedup for NLI-based clustering compared to standard reference implementations.
Limitations and Future Work
The authors admit their case studies (LLMs, GNNs) are "illustrative rather than exhaustive." They envision moving toward more explicit "decision rules"—essentially, more sophisticated ways for a model to decide exactly what to do once it knows it's uncertain. They also hope the community will contribute more "first-order" datasets, as these provide the most rigorous way to ground uncertainty in reality.
If you've ever felt the frustration of trying to glue a PyTorch uncertainty wrapper onto a scikit-learn pipeline, probly might just be the library you've been waiting for. You can find it at github.com/pwhofman/probly.
Summary updated