Building Confidence: A Case Study in How to Create Confidence Scores for GenAI Applications
Dec 1, 2024Molly Zhu (Senior Engineering Manager), Xin Xu (Senior ML Engineer), and Kathy Gao (Senior Data Scientist)
Summary
This post details the evaluation and implementation of confidence scoring mechanisms for GenAI applications in a financial automation use case (invoice parsing). It compares three approaches: calibrator models, logprobs, and majority voting. Majority voting, particularly with weighted models and Platt scaling calibration, demonstrated a strong positive correlation with accuracy and was chosen for production. Challenges with long text fields were addressed by breaking them down, and granularity was improved using a permutation approach with multiple prompts per model. The post provides concrete examples of accuracy vs. confidence plots for different methods and fields, and discusses the trade-offs of ensemble size and weighting strategies.
More from the AI-Assisted Developer Productivity Platform trail
- Why Spotify Is Not Using Bayesian A/B Testing | Spotify Engineering
- Portal by Spotify cut my Claude Code token usage by 90% | Spotify Engineering
- AI Changed How Spotify Builds. What We Learned (and Fixed) About Quality at Higher Velocity
- When Can LLMs Replace Humans in A/B Tests? | Spotify Engineering
- Coding Is No Longer the Constraint: Scaling Developer Experience to Teams and Agents at Spotify | Spotify Engineering