Identified-Set Geometry of Distributional Model Extraction under Top-K Censored API Access

Wenhua Nie, ZiCheng Zhu, Jianan Wu, Binhan Luo, Haoran Zheng, Jyh-Shing Roger JangNeurIPS 2026

TL;DR

When serving Large Language Models (LLMs), providers often hide most of the model's output probabilities and return only the top-$K$ token scores—a common defense meant to prevent attackers from cloning the model. This paper proves the exact mathematical blind spot created by top-$K$ censoring, showing it successfully obscures the model's exact probability distribution. However, there is a twist: mimicking a model's probabilities and stealing its actual skills are two very different things, meaning top-$K$ censoring slows down distribution cloning without stopping capability theft through text generation.

What Problem Does This Paper Address?

Imagine you’ve spent a small fortune fine-tuning a specialized LLM. When you put it behind an API or a self-hosted serving engine (like vLLM), you might expose token scores (logits or log-probabilities) for debugging or scoring prompts. If you expose the entire vocabulary's scores, an attacker can easily distill your model's brain into their own student model.

To prevent this "model extraction," interfaces routinely truncate the output, returning only the top-$K$ highest-scoring tokens (say, $K=20$) and censoring the remaining $V-K$ vocabulary words. Until now, the community lacked a hard theoretical floor for this defense: just how much ambiguity does a single top-$K$ observation leave behind, regardless of how clever the attacker is? Furthermore, if top-$K$ censoring successfully muddies the probability distribution, does that actually stop an attacker from stealing the model's downstream reasoning skills?

Figure 1: Overview. (a) One top-K observation leaves an identified set of TV diameter exactly UK (Theorem 2), and two bounds that depend only on UK bracket the minimax KL risk (Theorem 6). (b) With the same GSM8K prompts, top-K and full-logit distillation reach nearly equal KL closure yet recover very different shares of the teacher’s private capability (PVR; Table 3, 3 seeds, students initialized from the teacher’s base). The two parts are separate results: UK does not predict PVR.

Methods

Instead of proposing a new attack or distillation trick, the authors borrow a lens from econometrics called partial identification.

When an interface returns raw top-$K$ scores for a single prompt position, the normalization constant (the denominator of the softmax) is unknown, and every hidden token's score is known only to be less than or equal to the $K$-th score, $\tau$. Rather than pinpointing a single teacher distribution, this observation defines an identified set—a geometric cloud of all valid probability distributions compatible with those $K$ numbers.

The authors derive:

  1. Exact Total-Variation (TV) Diameter ($U_K$): The exact worst-case distance between two valid teacher distributions in this cloud: one where hidden tokens have zero probability mass, and one where they hold the maximum uniform probability mass allowed by $\tau$. Remarkably, $U_K$ can be computed from a single API call using just the $K$ returned scores and the public vocabulary size $V$.
  2. Minimax KL Risk Bounds: Two-sided mathematical brackets ($R_{\text{bin}} \le R^*_K \le R_{\text{cap}}$) on the worst-case Kullback-Leibler (KL) divergence any attacker faces when guessing the true distribution.
  3. Controlled Extraction Hierarchy: Empirical head-to-head distillation experiments (using Qwen3-0.6B and Llama-3.2-1B/3B) comparing standard cross-entropy, sparse top-$K$ knowledge distillation (KD), full-logit distillation, and supervised fine-tuning (SFT) on teacher-generated text.

Datasets

The authors rely on established benchmarks rather than introducing new datasets:

  • WikiText-103: Used to privately fine-tune teachers for distribution-geometry measurements, off-task distillation, and held-out KL divergence evaluations.
  • GSM8K: Grade-school math word problems used to create a math-reasoning teacher and measure downstream capability recovery.
  • MBPP: Python programming problems used as a secondary domain check, scored via code execution on held-out assertions.

Key Insights and Ideas

  • Raw top-$K$ scores leave massive mathematical ambiguity: Because modern LLM vocabularies are huge ($V > 128,000$), hundreds of thousands of hidden tokens sitting just below the threshold $\tau$ could collectively hold a massive amount of probability mass. Even at $K=100$, over 80% of the total-variation diameter remains unresolved for raw scores.
  • Distribution fidelity decouples from capability transfer: Closing the KL divergence gap between student and teacher does not mean the student learned the teacher's private skill. Conversely, a student with terrible overall KL fidelity can still pick up useful task skills if the distillation method biases it toward the teacher's #1 favorite token.
  • Reasoning lives in trajectories, not single-pass prompt scores: Math reasoning requires rolling out chains of thought. Prompt-only top-$K$ distillation struggles to steal math skills—not just because of censored tails, but because static prompts don't show the student how the teacher steps through a solution. If an attacker can simply sample generated text, top-$K$ censoring won't save you.
  • Temperature matters; rounding doesn't: Lowering the release temperature ($\theta$) dramatically shrinks the ambiguity $U_K$, whereas rounding log-probabilities or int8-quantizing logits barely moves the needle.

Key Results

  • High Ambiguity on Real Models: On a WikiText-tuned Qwen3-0.6B ($V=151,936$), the mean TV diameter $U_K$ is 0.908 at $K=20$ (bounding minimax KL risk between 0.538 and 1.150 nats) and 0.809 at $K=100$. On Llama-3.2-1B, $U_K$ is 0.942 at $K=20$. (Under normalized log-probabilities, where hidden tail mass is known, the bound drops to 0.176 at $K=20$).
  • The Capability Gap (GSM8K): Using Private Value Recovery (PVR—the percentage of the teacher's accuracy gain over the base model recovered by the student), training on GSM8K prompts yields nearly identical WikiText KL closure for both top-$K$ KD (98.4%) and full-logit KD (99.0%). Yet top-$K$ KD recovers only 11.8% PVR, while full-logit KD jumps to 56.5% PVR. Simple SFT on teacher-generated solutions bypasses logit limits entirely, recovering 96.1% PVR.
  • Task-Dependence (Code vs. Math): On MBPP code generation, the gap between top-$K$ and full-logit prompt distillation disappears (46.3% vs. 44.4% PVR), while generation SFT hits 100.0% PVR.

Limitations and Future Work

  • Open Finite-Regime Exactness: While the upper and lower KL bounds match asymptotically as $U_K \to 0$, they differ by a factor of 1.7x to 3.5x at realistic $U_K$ values, leaving the exact finite-$U_K$ minimax KL risk an open theoretical problem.
  • Single-Position Threat Model: The theoretical bounds apply per-position in a single forward pass (typical of self-hosted vLLM setups, rather than commercial chat APIs that only return log-probs on generated tokens). Adaptive multi-query attacks, low-rank logit structures, or sequential token-by-token querying can tighten or bypass these single-position barriers.
  • Same-Family Scope: All capability-transfer (PVR) experiments initialize the student from the teacher's exact base checkpoint, architecture, and tokenizer. Because logit distillation requires matching vocabularies, cross-family capability extraction remains an open question.

Summary updated

Abstract

Some LLM serving interfaces return, for each position of a supplied text, only the top-K token scores and censor the rest of the vocabulary. We study what one such observation identifies about the next-token distribution, an access mode we call prompt-only single-pass logit access; we do not assume that the attacker lacks generation access. This access mode arises mainly in self-hosted, vLLM-style serving; major commercial APIs that expose log-probabilities return them only at generated positions. The teacher distributions compatible with an observation form an identified set whose total-variation diameter is exactly U_K = (V-K)e^τ / (Z_A + (V-K)e^τ), where τ is the K-th returned score and Z_A is the sum of the exponentiated returned scores. For worst-case KL recovery we prove a two-sided bound that holds at every U_K: the lower bound uses the two extreme compatible distributions (no hidden mass and maximal uniform hidden mass), the upper bound uses an estimator that respects the per-token cap on hidden probabilities, and both equal U_K/e to first order as U_K → 0. At the diameters we measure on a WikiText-fine-tuned Qwen3-0.6B teacher, the bracket is finite but not tight (0.54–1.15 nats at the mean diameter for K = 20), so the exact finite-U_K minimax value remains open. Experiments on a GSM8K-fine-tuned Qwen3-0.6B teacher separate distribution fidelity from capability transfer: trained on the same GSM8K prompts, on-task top-K distillation recovers 11.8% of the teacher's private GSM8K capability and on-task full-logit distillation 56.5%, while both close 98–99% of the teacher–baseline KL gap on held-out WikiText; fine-tuning on teacher-generated solutions recovers 96.1%. Top-K censoring therefore limits per-position distribution recovery but does not by itself prevent capability extraction. Our capability-transfer results are within a single model family and scale.
BibTeX
@inproceedings{nie2026identified,
  author = {Wenhua Nie and ZiCheng Zhu and Jianan Wu and Binhan Luo and Haoran Zheng and Jyh-Shing Roger Jang},
  title = {{Identified-Set Geometry of Distributional Model Extraction under Top-K Censored API Access}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=lqDgPjh2zT},
}
Figure