Skip to content

Predicting black-box large language model performance via follow-up queriesPredicting the Performance of Black-box LLMs through Follow-up Queries

arXiv· arXiv:2501.01558· NeurIPS· Dylan Sam, Marc Finzi, J. Zico KolterCarnegie Mellon UniversityIndexed by this site · 2026-10-15· Originally publishedDefenses

Quick read

Analysis and theory

Based on the paper PDF (AI-generated); refer to the original

QueRE uses follow-up yes probabilities for black-box prediction; on CodeContests, GPT-4o-mini adversarial detection accuracy is 1.0000.

Questions
Closed-source APIs only provide inputs and outputs, making it difficult to judge whether answers are correct or manipulated by adversarial system prompts. The authors believe this hinders deployment in high-risk and agent scenarios.
Methods
After a greedy answer, ask about 50 follow-up questions in parallel, take the yes probability, and append the answer distribution and confidence before and after the QA, then train a linear classifier. When the API lacks top-k, use sampling averages as an approximation and give the convergence rate of the estimator.
Experiments and results
On reasoning tasks, QueRE's AUROC is higher than the baselines in Table 1. On LLaMA3 open QA, it is often higher than white-box; GPT's NQ has a counterexample. For detecting adversarial system prompts, GPT-4o-mini's accuracy on CodeContests is 1.0000.
Limitations and future work
The authors state they do not do attribution, multiple queries add latency, and the method depends on follow-up answers varying, which may not hold for low-quality models. Experiments include three LLaMA3 scales and GPT-3.5, GPT-4o-mini; reasoning correctness is judged by GPT-4o, and the paper does not report agreement with humans.
Experimental setupLLaMA3-3B、LLaMA3-8B et al. · Natural Questions (NQ)、SQuAD et al. · AUROC、Accuracy et al.
Evaluated models
LLaMA3-3BLLaMA3-8BLLaMA3-70BGPT-3.5GPT-4o-mini
Benchmarks
Natural Questions (NQ)SQuADBoolQWinoGrandeHaluEvalDHateCS QAGSM8KCode Contests
Metrics
AUROCAccuracyECEPrecisionF1
AI summaryAn arXiv paper proposes training a linear predictor by asking follow-up questions to a black-box large language model and treating the probabilities of answers as representations, to predict model behavior. The authors claim this method can reliably predict model correctness on question-answering and reasoning benchmarks, even outperforming white-box linear predictors based on the model's internal activations or internal states. The method can also distinguish normal models from models adversarially influenced via system prompts, deliberately answering incorrectly, or introducing bugs in generated code, and can differentiate between different black-box models, identifying models that have been impersonated and replaced via API. The authors believe this helps monitor black-box language model behavior, supporting their deployment in larger-scale autonomous systems.

An arXiv paper proposes training a linear predictor by asking follow-up questions to a black-box large language model and treating the probabilities of answers as representations, to predict model behavior. The authors claim this method can reliably predict model correctness on question-answering and reasoning benchmarks, even outperforming white-box linear predictors based on the model's internal activations or internal states. The method can also distinguish normal models from models adversarially influenced via system prompts, deliberately answering incorrectly, or introducing bugs in generated code, and can differentiate between different black-box models, identifying models that have been impersonated and replaced via API. The authors believe this helps monitor black-box language model behavior, supporting their deployment in larger-scale autonomous systems.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Under black-box APIs, the yes probability of follow-up questions is used to predict correctness and detect adversarial influence.

    With only black-box inputs and outputs, can we predict whether a single answer is correct and whether the model is influenced by an adversarial system prompt.

    • Scenario: Frontier models are often available only through closed APIs. The authors believe that without judging whether outputs are correct or manipulated, deployment in high-risk scenarios and autonomous agents is difficult.
    • Existing gaps: Methods that look at internal states, activations, or mechanisms require white-box access and cannot be used with closed APIs. The authors state existing work mostly predicts task-level performance or performance after scaling compute, not whether a particular answer is correct.
    • Assumption: The distribution of follow-up answers varies with correctness, model family, and scale. Only outputs are used, so it is model-agnostic.
    • Method: Propose QueRE, which uses the probabilities of yes tokens in follow-up questions as features and trains a linear predictor.
    • Detection setting:
      • The monitoring goal is to distinguish a normal model from a model influenced by system prompts to deliberately answer incorrectly or insert bugs in code.
      • Access is black-box; use probabilities if top-k is available, otherwise use sampling approximation.
      • The objects written in the experiments are GPT-3.5-turbo and GPT-4o-mini, on BoolQ and CodeContests.
      • The authors also use the same type of features to distinguish different black-box models, to detect whether an API is impersonating with a smaller model.
  2. What related research exists?

    Related work covers performance prediction, uncertainty quantification, and representation extraction; this paper does instance-level black-box prediction.

    Predicting Model Performance

    • Unterthiner et al. (2020) estimate performance in weight space; Jiang et al. (2021) evaluate generalization using disagreement among multiple trained models.
    • For language models, Xia et al. (2020), Ye et al. (2023) predict task-level performance on new tasks using scores on related tasks; Kaplan et al. (2020), Muennighoff et al. (2024) predict performance after scaling data or model size.
    • The authors state this paper instead does instance-level prediction, using only inputs and outputs, not parameters or activations.

    Uncertainty in LLMs

    • Xiong et al. (2023) evaluate whether models can express their own uncertainty; Kadavath et al. (2022), Kapoor et al. (2024) study verbalized confidence and self-evaluation.
    • Yadkori et al. (2024) use iterative queries to distinguish epistemic from aleatoric uncertainty.
    • The authors state this paper also asks confidence-type questions, but treats token probabilities as features to train a linear classifier, and the task is not limited to calibration metrics.

    Extracting Features from Networks

    • Koh et al. (2020) train image models to extract discrete concepts, then do linear probing. The authors state LLMs understand language, so no additional training is needed to extract features.
    • Wang et al. (2023), Zou et al. (2023a) extract representations for downstream tasks, but are white-box. Zou et al.'s RepE is used as a white-box baseline in the experiments.
    • Pacchiardi et al. (2024) use questions to detect model dishonesty. The authors state this is the closest work; this paper covers broader behavior and performance prediction.

    Baselines and Benchmarks

    • White-box baselines are RepE and Full Logits; black-box baselines are Self-Consistency, Answer Probs, Semantic Entropy, and pre-conf, post-conf.
    • Benchmarks are NQ, SQuAD, BoolQ, WinoGrande, HaluEval, DHate, CS QA, GSM8K, Code Contests. Appendix A.3 also compares Xiong et al.'s (2023) Vanilla, TopK, CoT, MultiStep.

    The authors position this paper as black-box, instance-level behavior prediction, rather than task-level prediction, looking only at verbalized confidence, or only lie detection.

  3. How does the paper address this problem?

    QueRE treats the yes probability of follow-up questions as a feature and trains a linear classifier to predict behavior.

    QueRE (Follow-up Question Representation Elicitation) asks a set of follow-up questions in parallel after the model gives a greedy answer, forms a vector from the yes probabilities, and trains a linear classifier.

    How the Representation Is Constructed

    • Data has binary labels, e.g., whether the model answered this input correctly. Answers use greedy decoding.
    • Each follow-up question corresponds to one dimension: the conditional probability normalized over yes and no, zj=P(yes∣ x⊕ a⊕ qj).
    • Closed QA additionally concatenates the distribution over candidate answers. Both open and closed tasks concatenate pre-conf and post-conf, i.e., the probability of answering yes to a confident-class prompt before and after seeing the greedy answer at temperature 0.
    • The authors state about 50 questions are enough. Each dimension can be extracted in parallel; the authors state the computational cost of increasing the number of questions is small.

    Where the Questions Come From

    • Appendix D.4 lists 9 handwritten confidence or belief questions, plus 40 generated by GPT4. Appendix D.3 gives the generation prompt, D.4 gives the full questions.
    • The authors note that a single question's yes probability may be only a weak predictor. To stay task-agnostic, they treat these probabilities only as abstract features and do not restrict question types.
    • The authors mention discrete prompt optimization could further improve the representation, but believe it may overfit and make the generalization bound harder to analyze, so they do not do it currently.

    Without top-k

    • Some APIs do not provide top-k. The authors approximate with high-temperature sampling: each dimension is the average over k draws from the corresponding Bernoulli distribution.
    • Proposition 1 assumes a unique optimal weight exists and k is much larger than the feature dimension. Then the logistic regression maximum likelihood estimate on sampled data converges as sample size and k go to infinity, at rate O(1/√n+√(n/k)). The proof is in Appendix B.
    • The authors state that when k grows with sample size but can grow slower than sample size, the estimate is consistent. Finite-k comparisons are in Section 4.5.

    Training and Evaluation

    • The downstream is L2, class-balanced logistic regression with scikit-learn default settings. LLM inference is loaded in half precision.
    • Correctness follows each benchmark's own metric. SQuAD uses exact match and uses SQuAD-v1, which has no unanswerable questions. NQ checks whether the output contains a valid answer, with two held-out training examples prepended to the prompt.
    • GSM8K and Code Contests are judged by GPT-4o. Adversarial detection and model distinction use linear probing on the extracted features, classifying whether the system prompt is helpful or harmful, or which model the representation comes from.
  4. What experiments did the paper conduct?

    QueRE is highest on reasoning tasks in Table 1; on open-ended QA it is below baseline on some GPT rows.

    Experimental Setup

    • Models: LLaMA3-3B, LLaMA3-8B, LLaMA3-70B, GPT-3.5, GPT-4o-mini. Table 2 writes GPT-3.5-turbo. Follow-up questions are generated by GPT4/GPT-4o. Correctness for GSM8K and Code Contests is judged by GPT-4o.
    • Data: Open QA is NQ, SQuAD; closed QA is BoolQ, WinoGrande, HaluEval, DHate, CS QA; reasoning is GSM8K, Code Contests. Training takes the first 5000 examples of the original split; LLaMA3-70B and GPT use 1000; HaluEval uses 3500. Testing takes the first 1000. The code adversarial experiment uses 500 training examples from Code Contests and the full test set.
    • Baselines: White-box are RepE (last token hidden state) and Full Logits. In Tables 5, 6, GPT Logits are API top-5 sparse vectors, marked with *. Black-box are Self-Consistency (10 samples), Answer Probs for closed tasks, Semantic Entropy (10 generations, Deberta bidirectional entailment clustering), pre-conf and post-conf.
    • Metrics: Correctness uses AUROC; adversarial detection and model distinction use Accuracy. Also ECE, precision/F1 on incorrect examples, and a PAC-Bayes accuracy lower bound with δ=0.01.
    • Repeats: The main tables do not report the number of repeats. Sampling approximation and question subset ablations use 5 random seeds, with standard error shown as shading in figures. The paper does not report agreement between GPT-4o evaluation and humans.
    • Other protocols: Generation uses greedy decoding. WinoGrande uses the debiased version, HaluEval uses the general split. The largest experiment is a single node with 4 RTX A6000s; inference for each model and dataset takes about 24 hours.

    Main Results

    AUROC for predicting correctness on reasoning tasks, per Table 1. This table does not include LLaMA3.

    Swipe horizontally to read the table

    Task and ModelLogitsSem. EntropyQueRE
    GSM8K / GPT-3.50.56360.74950.7748
    GSM8K / GPT-4o-mini0.54630.55460.7319
    Code Contests / GPT-3.50.60010.53460.6800
    Code Contests / GPT-4o-mini0.52740.56040.7924
    • The authors state QueRE is highest on reasoning tasks, where other methods fail. In the table, QueRE is higher than the other columns in the same table for all four rows; in the GSM8K, GPT-3.5 row, Sem. Entropy is close to QueRE, while the gap is larger in the other three rows.
    • Open QA numbers are in Table 5; Figure 2 is a bar chart and the text does not label numbers per bar. On LLaMA3, QueRE is higher than RepE: NQ, LLaMA3-3B is 0.9596, RepE is 0.6639. There are counterexamples for GPT: NQ, GPT-3.5 QueRE is 0.6755, lower than Sem. Entropy's 0.7063; GPT-4o-mini is 0.6780, lower than Self-Consistency's 0.6956. SQuAD, GPT-4o-mini QueRE is 0.7113, lower than Logits' 0.7413 and Self-Consistency's 0.7203.
    • Closed QA is in Table 6. The authors state QueRE is mostly the highest black-box method. Counterexamples include CS QA, LLaMA3-8B: Sem. Entropy 0.8467, QueRE 0.8332; HaluEval, LLaMA3-3B: Answer P. 0.7508, QueRE 0.7502. On DHate, LLaMA3-70B, Logits and RepE are 1.0000, QueRE is 0.7896. The authors state QueRE's ECE is generally lower in Figure 6; the text cannot reliably align the numbers in the figure to bars, so specific ECE values are not cited.

    Adversarial System Prompts

    • What was tested: On BoolQ, 3 harmful and 3 helpful system prompts are used, and a linear probe is trained to distinguish them. On CodeContests, a system prompt requiring secretly inserting bugs in code while answering other questions normally is used. Appendices D.1, D.2 give the full prompts.
    • Results: In Table 2, all four QueRE rows are higher than the listed baselines. On BoolQ, GPT-3.5-turbo is 0.8668, GPT-4o-mini is 0.9258; on CodeContests, they are 0.9909 and 1.0000 respectively. The next highest, Logits, is 0.9455 on CodeContests, GPT-3.5-turbo.
    • Authors' interpretation: The authors state QueRE can detect such influence and does not depend on one particular prompt formulation. Appendix D.1 states that the first harmful prompt drops GPT-3.5's BoolQ from 87% to 32%, and DHate from 77% to 28%.

    Distinguishing Models and Transfer

    • Distinguishing different scales on BoolQ (Figure 4): the authors state QueRE can often separate different scales of the same family, while looking only at confidence cannot; the text does not give accuracy for this figure. Table 13's multi-negative task identifies GPT-4o-mini among LLaMA3-8B, LLaMA3-70B, GPT-3.5; QueRE AUROC is 0.998 for both SQuAD and BoolQ; the maximum for the other methods in the table is BoolQ, Sem. Entropy's 0.592.
    • Transfer is in Table 3. Dataset transfer on LLaMA3-70B: SQuAD to NQ is 0.8964, NQ to SQuAD is 0.7934. Model transfer on SQuAD: 3B to 8B is 0.8409, 8B to 70B is 0.8295. All four are the highest in the same table. RepE is not compared for model transfer because activation dimensions differ.
    • Generalization bound is in Table 4, δ=0.01. On NQ, LLaMA3-8B QueRE lower bound is 0.7409; on SQuAD it is 0.8088, higher than Full Logits, RepE, Self-Consistency, and Sem. Entropy in the same table. The authors state this bound requires the extracted representation to be independent of downstream data. Appendix Table 9 gives QueRE lower bound 0.7930 for NQ, LLaMA3-70B, while Table 4's same cell is 0.6495; the paper does not explain the difference.

    Other Ablations and Analyses

    • Sampling approximation: GPT-3.5, HaluEval, 5 seeds; the authors state AUROC drops less than 2 points relative to true probabilities (Figure 5 left).
    • Number of questions: on LLaMA3-70B, BoolQ, the authors state AUROC rises with the number of questions and the increase slows (Figure 5 right). The authors state that increasing interpretability diversity is not necessarily better (Figure 7); irrelevant text is usually weaker than follow-up questions (Figure 8). The endpoints of these figures are not labeled in the text.
    • Quantization: distinguishing 4-bit or 16-bit from 32-bit on SQuAD, LLaMA3-3B QueRE is 0.99, 0.99, LLaMA3-8B is 0.98, 0.97 (Table 7).
    • Latency: LLaMA3-8B, SQuAD, 50 follow-up questions AUROC 0.949, mean time 0.89 seconds; 5 questions is 0.868, 0.17 seconds; Self-Consistency is 0.534, 0.19 seconds (Table 11).
    • Small system prompt changes: GPT-4o-mini, BoolQ, linear probe accuracy between no extra prompt and cautious assistant prompt is 0.5445; a GPT-3.5 discriminator trained on no prompt, distinguishing GPT-4o-mini, transfers to 0.983 accuracy when both have the cautious prompt (Appendix A.9).
    • Uncertainty baselines (Table 8): HaluEval, LLaMA3-3B, QueRE is 0.7502, Vanilla is 0.5660, CoT is 0.5000, MultiStep is 0.4730; on 8B, QueRE is 0.6783, Vanilla is 0.5040.
  5. What are some points that can be further explored?

    The authors note non-explainability, query latency, and that follow-up answers may not change on low-quality models.

    Limitations and Future Directions Noted by the Authors

    • Features come from natural language, but the authors state the focus is not interpretability or attribution; features are only inputs to a predictive model (Section 5 Limitations).
    • Each example requires multiple follow-up queries, which adds latency; the authors state batching can mitigate this (Section 5).
    • The method assumes follow-up answers will vary meaningfully; the authors state very low-quality language models may not satisfy this assumption (Section 5).
    • The authors believe the "diversity" requested by the prompt may not match the diversity of features the model actually extracts, and leave clarifying this difference as future work (Appendix A.5).
    • How to choose follow-up questions, remove redundancy or noise, is called a future question by the authors (Appendix A.12).

    Experimental Coverage

    • Correctness prediction uses LLaMA3-3B, LLaMA3-8B, LLaMA3-70B, GPT-3.5, GPT-4o-mini. Table 1's reasoning results include only GPT-3.5 and GPT-4o-mini.
    • Tasks are NQ, SQuAD, BoolQ, WinoGrande, HaluEval, DHate, CS QA, GSM8K, Code Contests. Adversarial detection is system prompts: QA uses 3 harmful vs 3 helpful, code uses bug insertion; Table 2's models are written as GPT-3.5-turbo and GPT-4o-mini.
    • White-box comparisons are RepE and Full Logits. GPT's Logits are top-5 sparse vectors; RepE is not used for black-box models, and RepE is not compared in model transfer.
    • Training takes the first 5000 examples, 70B and GPT use 1000, HaluEval uses 3500, testing takes the first 1000. The code adversarial experiment uses 500 training examples and the full test set. The main tables do not report the number of repeats.
    • GSM8K and Code Contests are judged by GPT-4o; the paper does not report agreement between this evaluation and humans. Section 4.4 states the generalization bound requires the representation to be independent of downstream task data.
  6. Summarize the main content of the paper

    QueRE uses black-box follow-up question features to predict correctness, detect system prompt influence, and distinguish models.

    QueRE uses the yes probability from black-box follow-up questions to predict individual behavior and monitor whether a model is influenced by system prompts or swapped in the API.

    • Problem: Closed APIs hide internal states. The authors want to judge whether a given answer is correct and distinguish normal models, models influenced by system prompts, and different black-box models.
    • Method: After a greedy answer, ask about 50 follow-up questions in parallel, take the yes probability over yes and no, add the answer distribution and confidence before and after the QA, and train L2 logistic regression. Without top-k, use the average over k samples as an approximation and give the convergence rate.
    • Reasoning: In Table 1, on GSM8K, GPT-3.5 QueRE AUROC is 0.7748, GPT-4o-mini is 0.7319; on Code Contests, they are 0.6800 and 0.7924, all higher than the other columns in the same table.
    • QA: On LLaMA3 open QA, QueRE is higher than RepE, e.g., NQ, LLaMA3-3B is 0.9596 (Table 5). On GPT, not every row is higher: NQ, GPT-3.5 QueRE is 0.6755, lower than Sem. Entropy's 0.7063. On DHate, LLaMA3-70B, white-box is 1.0000, QueRE is 0.7896 (Table 6).
    • Monitoring: For detecting system prompt influence, CodeContests, GPT-4o-mini accuracy is 1.0000, BoolQ, GPT-4o-mini is 0.9258 (Table 2). Identifying GPT-4o-mini among the other three models, SQuAD and BoolQ AUROC are both 0.998 (Table 13).
    • Authors' conclusion: The authors state these features can be used for various behavior predictions, sometimes matching predictors that use internal states, and thus can serve black-box monitoring in larger autonomous systems. The authors also state this is not an attribution method and depends on follow-up answers varying with behavior.
Read originalNeurIPS