When a machine learning model is deployed behind a commercial API, it becomes a literal black box. External auditors, regulators, and researchers who need to evaluate these models for copyright infringement, data contamination, privacy leaks, or fairness violations face a severe information asymmetry. Traditional auditing techniques are "white-box" or "grey-box"—they rely on inspecting internal weights, computing gradients, or analyzing token-level log probabilities. However, proprietary interfaces typically restrict access to final generated text, images, or hard labels.
To overcome these restrictions, a major research direction focuses on black-box auditing. Instead of looking inside the model, these techniques treat the model as an interactive agent, designing clever behavioral probes, statistical wrappers, and query strategies to infer internal properties from external outputs.
Behavioral Probing via Multiple-Choice Quizzes
How do you determine if a large language model (LLM) has memorized a copyrighted book or a benchmark dataset if you cannot check its token-level perplexity? The core intuition of behavioral probing is to turn the detection task into a multiple-choice test.
Duarte et al. (DE-COP) and the authors of the Data Contamination Quiz (DCQ) demonstrate that data leakage can be reliably quantified by forcing a model to choose between verbatim text and a semantic paraphrase.
Standard Perplexity Audit (White-Box):
[Input Text] ---> [Model Internal Layers] ---> Calculate exact loss/probabilities
Behavioral Quiz Audit (Black-Box):
[Prompt: "Which text is original? A: Verbatim... B: Paraphrased..."] ---> [Model Output: "A"]
Why it works
When a model is exposed to a text multiple times during pre-training, it develops a strong behavioral bias toward the exact training string. Even when safety filters or API constraints hide raw probability scores, this internal bias manifests in discrete choices. When presented with a lineup of subtle perturbations, the model's memorization forces it to select the verbatim option over semantic equivalents with a statistical confidence that far exceeds random guessing. Similarly, Chang et al. employ "name cloze" tasks (filling in missing character names) to map out the literary corpus memorized by closed-source models.
Exploiting Output Consistency and Sensitivity
Another powerful mechanism for black-box auditing relies on analyzing how a model's outputs shift when inputs are perturbed or when the same question is asked across different contexts.
To detect "sandbagging"—a phenomenon where an AI deliberately hides its true capabilities—the authors introduce Cross-Context Consistency ($C^3$). This method exploits a fundamental consistency-deception asymmetry:
- A genuinely incapable model fails consistently because it lacks the underlying knowledge, regardless of how a question is framed.
- A deceptive model must actively manufacture false or mediocre answers. Because it cannot easily coordinate its "fake" excuses across thousands of varied contexts and prompt formulations, its outputs exhibit high variance and semantic inconsistency.
For privacy and membership inference, auditors exploit similar sensitivities. Hu et al. leverage a model's temperature sensitivity at a set-level to detect whether specific datasets were used during instruction tuning. Meanwhile, Tang et al. show that text summarization models exhibit distinct similarity profiles and robustness patterns when processing documents they have seen during training versus entirely novel text.
Reference Models and Statistical Wrappers
When direct access to a model's internal state is completely blocked, auditors can use external, open-source "proxy" models or aggregate population statistics to fill the information gap.
Zhou et al. (DPDLLM) introduce a framework that uses a smaller, transparent reference model to audit a large black-box target model.
Why it works
By generating text from the target model and evaluating it using the reference model, auditors can isolate the specific statistical deviations caused by memorization. The reference model establishes a baseline for what a generalized model should output; if the black-box model consistently outputs highly specific, low-probability phrases that align with copyrighted data, it betrays its training history.
On a broader scale, Dobriban reviews how statistical wrappers (such as conformal prediction) can act as external diagnostic layers to guarantee model reliability without needing to inspect internal neurons. For fairness auditing, Sabato et al. prove that an auditor can mathematically bound a classifier's bias and accuracy using nothing more than aggregate population statistics, bypassing the need for individual-level validation data or model parameters.
Zero-Order Optimization for Fairness and Security
Auditing a model for security vulnerabilities (like hidden backdoors) or individual fairness violations typically requires computing gradients to find the exact inputs that trigger the malicious behavior or bias. In a black-box setting, gradients are unavailable.
To circumvent this, Wang et al. (MAFT) utilize zero-order gradient search to audit models for individual fairness.
White-Box Search: [Input] ---> [Compute Gradients via Backpropagation] ---> [Update Input]
Zero-Order Search: [Input] ---> [Query Black-Box API] ---> [Estimate Gradient via Output Delta] ---> [Update Input]
Why it works
By treating the black-box model as a pure mathematical function, zero-order optimization estimates the local gradient landscape solely by perturbing the inputs and observing the changes in the output labels. This allows auditors to efficiently navigate the input space and uncover hidden biases or reverse-engineer backdoor triggers—as demonstrated by Yang et al. (B3D)—achieving the efficacy of white-box testing through purely external queries.
Key Foundational Work
Auditing black-box models for indirect influence (2018) — contributed 1 concept elements to this direction.