Table of Contents
Fetching ...

Testing Calibration in Nearly-Linear Time

Lunjia Hu, Arun Jambulapati, Kevin Tian, Chutong Yang

TL;DR

This work begins the algorithmic study of calibration through the lens of property testing, and develops algorithms for tolerant variants of the testing problem improving upon black-box linear program solvers, and gives sample complexity lower bounds for alternative calibration measures.

Abstract

In the recent literature on machine learning and decision making, calibration has emerged as a desirable and widely-studied statistical property of the outputs of binary prediction models. However, the algorithmic aspects of measuring model calibration have remained relatively less well-explored. Motivated by [BGHN23], which proposed a rigorous framework for measuring distances to calibration, we initiate the algorithmic study of calibration through the lens of property testing. We define the problem of calibration testing from samples where given $n$ draws from a distribution $\mathcal{D}$ on $(predictions, binary outcomes)$, our goal is to distinguish between the case where $\mathcal{D}$ is perfectly calibrated, and the case where $\mathcal{D}$ is $\varepsilon$-far from calibration. We make the simple observation that the empirical smooth calibration linear program can be reformulated as an instance of minimum-cost flow on a highly-structured graph, and design an exact dynamic programming-based solver for it which runs in time $O(n\log^2(n))$, and solves the calibration testing problem information-theoretically optimally in the same time. This improves upon state-of-the-art black-box linear program solvers requiring $Ω(n^ω)$ time, where $ω> 2$ is the exponent of matrix multiplication. We also develop algorithms for tolerant variants of our testing problem improving upon black-box linear program solvers, and give sample complexity lower bounds for alternative calibration measures to the one considered in this work. Finally, we present experiments showing the testing problem we define faithfully captures standard notions of calibration, and that our algorithms scale efficiently to accommodate large sample sizes.

Testing Calibration in Nearly-Linear Time

TL;DR

This work begins the algorithmic study of calibration through the lens of property testing, and develops algorithms for tolerant variants of the testing problem improving upon black-box linear program solvers, and gives sample complexity lower bounds for alternative calibration measures.

Abstract

In the recent literature on machine learning and decision making, calibration has emerged as a desirable and widely-studied statistical property of the outputs of binary prediction models. However, the algorithmic aspects of measuring model calibration have remained relatively less well-explored. Motivated by [BGHN23], which proposed a rigorous framework for measuring distances to calibration, we initiate the algorithmic study of calibration through the lens of property testing. We define the problem of calibration testing from samples where given draws from a distribution on , our goal is to distinguish between the case where is perfectly calibrated, and the case where is -far from calibration. We make the simple observation that the empirical smooth calibration linear program can be reformulated as an instance of minimum-cost flow on a highly-structured graph, and design an exact dynamic programming-based solver for it which runs in time , and solves the calibration testing problem information-theoretically optimally in the same time. This improves upon state-of-the-art black-box linear program solvers requiring time, where is the exponent of matrix multiplication. We also develop algorithms for tolerant variants of our testing problem improving upon black-box linear program solvers, and give sample complexity lower bounds for alternative calibration measures to the one considered in this work. Finally, we present experiments showing the testing problem we define faithfully captures standard notions of calibration, and that our algorithms scale efficiently to accommodate large sample sizes.
Paper Structure (26 sections, 41 theorems, 96 equations, 3 figures, 3 tables, 1 algorithm)

This paper contains 26 sections, 41 theorems, 96 equations, 3 figures, 3 tables, 1 algorithm.

Key Result

Theorem 1

Let $n \in \mathbb{N}$, and let $\varepsilon = \Omega(\varepsilon_n)$, where $\varepsilon_n = \Theta(n^{-1/2})$ is minimal such that it is information-theoretically possible to solve the $\varepsilon_n$-calibration testing problem (Definition def:testing_1) with $n$ samples. There is an algorithm wh

Figures (3)

  • Figure 1: Example graph $G$ for $n=5$ with $n+1 = 6$ vertices and $2n-1=9$ edges.
  • Figure 2: Example of segment tree with depth $r = 3$.
  • Figure 3: The $25\%$ quantile, median, and $75\%$ quantile (over $100$ runs) for ${\mathsf{smCE}}$, ${\underline{\mathsf{dCE}}}$ and ${\mathsf{cECE}}$ respectively. The $x$-axis is for dataset with size $2^x+1$.

Theorems & Definitions (80)

  • Definition 1: Lower distance to calibration
  • Definition 2: Calibration testing
  • Theorem 1: Informal, see Theorem \ref{['thm:tct_smooth']}, Corollary \ref{['cor:ct']}
  • Definition 3: Smooth calibration error
  • Theorem 2: Informal, see Theorem \ref{['thm:tct_ldtc']}, Corollary \ref{['cor:ct_ldtc']}
  • Definition 4: Tolerant calibration testing
  • Lemma 1
  • proof
  • Definition 5: $\mathsf{d}$ testing
  • Lemma 2
  • ...and 70 more