Manuscript Offprint

arXiv:2609.05125

Single-Query Black-Box Calibration Auditing via Logit Bias

Roman Plaud, Antoine Saillenfest, Matthieu Labeau, Thomas Bonald, Willem Waegeman

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Evaluating the calibration of Large Language Models (LLMs) is critical for their safe deployment as zero-shot classifiers. Yet, commercial API providers increasingly hide the continuous output probabilities required by standard calibration metrics. To bypass this opacity, we demonstrate that any LLM API exposing a logit_bias parameter can be mathematically manipulated to evaluate exact probability thresholds using strictly one query per sample. Leveraging this mechanism, we introduce a novel and provably consistent estimator of the True Calibration Error for binary tasks. Our approach therefore provides an efficient framework for auditing black-box foundation models.

1 Introduction

Standard calibration metrics for assessing the reliability of classifiers, such as the Expected Calibration Error (ECE) [12, 6], inherently require access to the model's continuous output probabilities. When Large Language Models (LLMs) are deployed as zero-shot or few-shot classifiers on benchmarks like MMLU [7] or binary Question-Answering tasks [2], classification is typically performed by extracting the raw probabilities of specific target tokens (e.g., "True" versus "False" or "A" versus "B") [9]. However, for commercial, black-box models accessed via APIs, these continuous token probabilities are frequently restricted. API providers often hide output logits (logprobs) to protect proprietary architectures and prevent model distillation or imitation attacks [1]. This opacity severely limits independent auditing and practically prohibits calibration evaluation.

To bypass this limitation, we exploit the logit_bias parameter, a feature exposed by some major APIs (such as OpenAI [13]), originally intended to give users semantic control over generation, such as suppressing specific vocabulary or enforcing formatting. We demonstrate that this parameter can be mathematically manipulated to evaluate exact probability thresholds. Querying these probability thresholds allows us to compute the calibration error of an opaque model over a full dataset without ever extracting a continuous logit.

Contributions. In this paper, we introduce a novel empirical calibration estimator for black-box APIs equipped with a logit_bias parameter. Our method strictly requires only one API query per sample. We rigorously decompose the estimator's bias and variance, proving its asymptotic consistency to the True Calibration Error (TCE). Our approach therefore provides an efficient, mathematically grounded framework for calibration auditing of black-box LLMs.

Preprint.

References (17)