Skip to content

Reconstructing the Model from Model Explanations

Model Reconstruction from Model Explanations

arXiv· arXiv:1807.05185· FAT· Smitha Milli, Ludwig Schmidt, Anca D. Dragan, Moritz HardtUniversity of California, BerkeleyIndexed by this site · 12 days ago· Originally publishedSelected AttacksSelectedAttention38

Quick read

Attacks

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

The authors state that models can be reconstructed from gradient explanations: theoretically O(h log h) queries learn a two-layer ReLU network, and experimentally several orders of magnitude fewer queries are needed than for prediction API attacks.

Threat modelThe attacker's goal is to reconstruct the confidential proprietary model f from the explanation API. The attacker can query inputs x of their choice to obtain the model's function value f(x) and input gradient ∇f(x) at x (membership and gradient queries), including gradients processed by SmoothGrad; the victim system is a commercial model that provides a saliency map explanation interface.

Questions
Commercial models want both confidentiality and to provide decision explanations, and there is tension between the two. The authors note that popular gradient-based explanations (saliency maps) may, as a side effect, leak the model itself.
Methods
Theoretically, an algorithm for reconstructing a two-layer ReLU network using input gradient queries is given: binary search along a random line for gradient change points to recover the hyperplanes, then solve linear equations to recover the signs. Experimentally, a surrogate model is trained with a joint loss of gradient loss plus membership loss to match the target model's outputs and gradients.
Experiments and results
Theoretically, O(h log h) queries can exactly reconstruct a two-layer ReLU network, independent of dimension. Experimentally, gradient queries require 10–1000× fewer queries than membership queries; gradients processed by SmoothGrad hardly reduce reconstruction effectiveness; gradients still help when the model class is unknown or the data distribution is unknown (Gaussian queries).
Limitations and future work
The theoretical results are limited to two-layer ReLU networks; the authors raise open questions such as whether they can be extended to depth-3 or k-layer networks and whether reconstruction-resistant explanation methods can be designed; the experiments are conducted only on image models on MNIST and CIFAR10, and defenses such as query rate limiting on explanation APIs are not tested.
Experimental setup1-layer network (multinomial logistic regression)、2-layer neural network with ReLU activations et al. · MNIST、CIFAR10 · test accuracy of reconstructed classifier、number of queries
Evaluated models
1-layer network (multinomial logistic regression)2-layer neural network with ReLU activationsConv (two convolutional layers each followed by a max-pool layer, followed by two dense layers)VGG11ResNet-18
Benchmarks
MNISTCIFAR10
Metrics
test accuracy of reconstructed classifiernumber of queries
AI summaryand selection rationaleThe researchers demonstrate theoretically and experimentally that gradient-based model explanations rapidly leak the model itself, and that there is tension between the confidentiality needs of proprietary models and providing explanations. Theoretically, the paper proposes an algorithm for learning a two-layer ReLU network from input-gradient queries, which recovers a functionally equivalent model with high probability in O(h log h) queries, where the number of queries is independent of the input dimension and the dependence on model size is near-optimal. Experimentally, the heuristic method the authors give requires orders of magnitude fewer queries to reconstruct models on MNIST and CIFAR10 than reconstruction attacks that rely on the prediction interface; for example, an MNIST convolutional model reaches 95% accuracy with 10 gradient queries, whereas membership queries require 1000; gradients processed with SmoothGrad also did not noticeably slow reconstruction. The authors point out that explanation quality standards must be weighed against the risk of model leakage.

The researchers demonstrate theoretically and experimentally that gradient-based model explanations rapidly leak the model itself, and that there is tension between the confidentiality needs of proprietary models and providing explanations. Theoretically, the paper proposes an algorithm for learning a two-layer ReLU network from input-gradient queries, which recovers a functionally equivalent model with high probability in O(h log h) queries, where the number of queries is independent of the input dimension and the dependence on model size is near-optimal. Experimentally, the heuristic method the authors give requires orders of magnitude fewer queries to reconstruct models on MNIST and CIFAR10 than reconstruction attacks that rely on the prediction interface; for example, an MNIST convolutional model reaches 95% accuracy with 10 gradient queries, whereas membership queries require 1000; gradients processed with SmoothGrad also did not noticeably slow reconstruction. The authors point out that explanation quality standards must be weighed against the risk of model leakage.

Why it was selectedThe paper shows theoretically and experimentally that gradient-based explanation interfaces leak the model, requiring orders of magnitude fewer queries than model-stealing attacks that rely on the prediction interface.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors state that providing gradient-based model explanations is in tension with model confidentiality: an explanation API would quickly leak the model itself.

    Core question: whether gradient-based model explanations (saliency maps) allow proprietary models to be reconstructed, thereby conflicting with model confidentiality.

    • Scenario and motivation: Commercial ML models are being used for high-stakes decisions such as medical diagnosis, employment, and criminal justice, and the demand for model explanations is growing, with model confidentiality being part of the motivation for this demand. At the same time, companies have legitimate reasons to keep models confidential: competitive value, preventing gaming that degrades predictive power, and preventing leakage of sensitive training data information.
    • Gap in existing work: Prior research has focused on stealing models from prediction APIs (Tramèr et al. [19]), but the authors note that the explanation API, a complementary leakage channel, has not been studied; explanation method research (such as various saliency map variants) has not considered model leakage risk.
    • Core observation: Gradients contain more information than labels. The gradient of a linear model f(x)=⟨w,x⟩ is the parameter w itself, learnable with a single gradient query; from this the authors hypothesize that gradient queries can greatly reduce the number of queries needed for reconstruction.
    • Paper contributions: (1) Theoretically, a framework for "learning from input gradient queries" is proposed, with an algorithm that exactly reconstructs a two-layer ReLU network using O(h log h) queries; (2) experimentally, a reconstruction heuristic independent of the target model structure is given, which the authors report is several orders of magnitude more query-efficient than reconstruction attacks that rely on prediction interfaces.
    • Threat model:
      • Goal: Reconstruct a model f̂ functionally equivalent to the unknown model f.
      • Knowledge: The theoretical part assumes the model is known to be a two-layer ReLU network with hidden dimension h; later parts of the experiments relax this to both model class and data distribution being unknown.
      • Capability: Query inputs x of their choice to obtain f(x) and gradient ∇f(x) (membership and gradient queries), including gradients processed by SmoothGrad.
      • Victim system: The proprietary model behind an explanation API that provides standard saliency maps.
  2. What related research exists?

    Related work falls into three categories: prediction API model stealing, membership query learning theory, and saliency map explanation methods.

    Model extraction and prediction APIs

    • Tramèr et al. (2016) [19]—show how to reconstruct a model in practice via a prediction API; this paper studies a complementary threat: leaking the model via a (hypothetical) explanation API. The practical black-box attack of Papernot et al. (2017) [10] belongs to the same "train a new classifier to match the target's outputs" heuristic, and this paper's experimental method adds a gradient loss on top of it.
    • Dwork and Feldman (2018) [7]—differential privacy can defend against attacks from prediction APIs; the authors note that whether differential privacy can defend against reconstruction from explanations is not yet clear.

    Query learning theory

    • Angluin (1988) [1]—membership query learning framework: the learner actively queries an oracle for labels of inputs of its choosing; this paper proposes a complementary "input gradient query" learning framework, which the authors believe may be the theoretical framework behind reconstruction from explanation APIs.
    • Baum (1991) [3]—learning two-layer linear threshold networks with membership queries; the authors state that the geometric intuition of this paper's algorithm is similar.
    • Learning two-layer ReLU networks has received attention in recent years (Safran and Shamir 2018 [11], Tian 2017 [18], Zhong et al. 2017 [21]); the paper lists it as a challenge toward deeper nonlinear models and does not compare them one by one.

    Model explanation methods

    • Gradient saliency maps: Baehrens et al. (2010) [2] and Simonyan et al. (2013) [14] proposed the most basic form of taking gradients with respect to the input.
    • Various variants that transform the raw gradient: Zeiler and Fergus (2014) [20], Springenberg et al. (2014) [16], SmoothGrad (Smilkov et al. 2017 [15]), Integrated Gradients (Sundararajan et al. 2017 [17]); the paper mentions that there is disagreement among these methods about applicable scenarios, and this paper abstracts away implementation details and targets only the underlying primitive—the input gradient.

    Baselines and benchmarks: the experimental baseline trains a surrogate model using only membership queries (cross-entropy loss matching outputs), compared with gradient queries and SmoothGrad queries; the datasets are MNIST and CIFAR10.

    The authors position this paper as: a first step in the direction of "explanation API leakage", parallel to prediction API extraction, and theoretically a complementary framework to membership query learning.

  3. How does the paper address this problem?

    The theoretical algorithm performs binary search along random lines for gradient change points to recover hyperplanes and then solve for signs; the experimental heuristic trains a surrogate model with a joint loss.

    The overall approach has two parts: the theoretical algorithm targets two-layer ReLU networks and exploits the structure that gradients change abruptly at the boundaries of piecewise-linear units to exactly recover parameters; the experimental heuristic treats gradients as an additional supervision signal, training a surrogate model to match both outputs and gradients.

    Problem setup

    • The target function is a single-hidden-layer ReLU network f(x) = ∑i=1h wi max(Ai⊤ x, 0), with parameters A∈R^{h×d}, w∈R^h.
    • Three assumptions: the rows of A are unit vectors; no two rows are collinear (⟨A_i,A_j⟩≤1−c); the rows are linearly independent. The authors state that the first two can be made without loss of generality via reparameterization.
    • Oracle: given x, returns f(x) and ∇f(x).

    Theoretical algorithm (Algorithm 1)

    • Key structure: f is a piecewise-linear function, g(x)=I{Ax≥0} partitions the input space into cells, and the gradient is constant within a cell; different gradients at two points indicate a separating hyperplane between them, and when sufficiently close the gradient difference is exactly ±w_iA_i.
    • Step one (Algorithm 1a recovers Z): take random u,v∼N(0,I_d), binary-search for gradient change points along the segment from u−lv to u+lv at resolution ε, repeat h times, and use the gradient differences as the rows of Z, recovering ±w_iA_i.
    • Step two (Algorithm 1b recovers signs s): select h query points with the same gradient and Rank(ZX)=h (Appendix B gives a method for selecting points using the Chebyshev center via linear programming), construct a 2h×2h matrix M and solve the linear equation Ms=[f(x_1),…,f(−x_h)], obtaining s∈{−1,0,1}^{2h} such that f(x)=[max(Zx,0)ᵀ max(−Zx,0)ᵀ]s.
    • Guarantee: Theorem 1—with probability 1−δ, f̂=f is found within O(h log(h/δ)) queries, and failure is reported when it occurs; the number of queries is independent of the input dimension d, and is optimal up to a logarithmic factor (the model has dh+h parameters, and each query reveals only O(d) numbers). Appendix C gives a conversion using d membership queries to estimate gradients by finite differences, yielding an O(dh log(h/δ)) membership-query version.

    Experimental heuristic

    • Gradient loss: ℓ_G(x)=‖∇f(x)−∇f̂(x)‖₂², combined with the membership loss into a joint loss ℓ_J(x)=ℓ_G(x)+λℓ_M(x), where ℓ_M is the cross-entropy between f(x) and f̂(x).
    • Query types: membership only, membership+raw gradient, membership+SmoothGrad gradient (SmoothGrad averages gradients over noisy inputs, ∇f̃(x)=(1/N)Σ∇f(x+z_i), z_i∼N(0,σ²I)).
    • Process: first train the target model f, then randomly sample inputs from f̂'s training set (10,000 images, no true labels) to query f, train a same-class f̂, and finally measure f̂'s accuracy on 10,000 test images.
    • Subsequent experimental settings: (1) reconstruct f with an f̂ of a different model class (model class unknown); (2) query with Gaussian random inputs x∼N(0,I_d) (data distribution unknown).

    Success determination

    • Theory: f̂ is functionally equivalent to f (pointwise equal).
    • Experiments: f̂'s classification accuracy on 10,000 test images, and the number of queries required to reach a given accuracy.
  4. What experiments did the paper conduct?

    Reconstructing 6 models on MNIST/CIFAR10, gradient queries require 10–1000× fewer queries than membership queries.

    Experimental setup

    • Target models: 3 on MNIST—1-layer (multinomial logistic regression), 2-layer ReLU network, Conv (two convolutional layers each followed by max-pool, then two fully connected layers); 3 on CIFAR10—the same Conv structure, VGG11, ResNet-18.
    • Datasets: MNIST (f training set 50,000 images) and CIFAR10 (f training set 40,000 images); f̂ training set 10,000 images (no true labels, requires querying f); test set 10,000 images.
    • Query types: membership only, membership+gradient, membership+SmoothGrad (experiments use N=10; σ=1000σ_D on MNIST, σ=σ_D on CIFAR10, where σ_D is the dataset standard deviation, Appendix D).
    • Baseline: training a surrogate model using only membership queries (cross-entropy loss), corresponding to the heuristics of Tramèr et al. [19] and Papernot et al. [10].
    • Metric: accuracy of the reconstructed model f̂ on the test set, compared against the number of queries needed to reach the same accuracy (horizontal axis is number of queries, log scale).
    • Number of repetitions: not reported in the paper.

    Main results

    Figure 2 gives the "number of queries–test accuracy" curves for the 6 target models under three query types (the main text §5.1 gives representative readings):

    Swipe horizontally to read the table

    Target modelTaskGradient queriesMembership queriesQuery reduction
    1-layerMNISTreaches original model performance with 17841000x
    2-layerMNIST——100x
    ConvMNIST95% with 1095% with 1000100x
    ConvCIFAR10reconstruction with 10010,000≥100x
    VGG11CIFAR10reaches 75% accuracyreaches 75% accuracy10x
    ResNet-18CIFAR10reaches 75% accuracyreaches 75% accuracy10x

    (According to the main text of §5.1; "—" means the main text gives no specific reading, only the reduction factor.)

    • The authors state that in all experiments gradient queries reduce the number of queries required by several orders of magnitude, and the reduction is larger for lower-complexity models.
    • The authors report that SmoothGrad queries are almost indistinguishable from raw gradient queries, even though the chosen SmoothGrad hyperparameters are the values that produce the best saliency maps (Appendix D).
    • The authors believe the relative reduction in query count depends more on model class complexity than on task complexity (Conv is 100x on both tasks), but the absolute query count rises with task complexity.

    Unknown model class (Figure 3)

    • Setup: on MNIST, 1-layer↔2-layer and 2-layer↔Conv reconstruct each other; on CIFAR10, VGG11↔ResNet-18 reconstruct each other.
    • Results: reconstructing an MNIST 1-layer with a 2-layer gives a 100x query reduction; conversely, reconstructing a 2-layer with a 1-layer gives only an initial 10x reduction. Reconstructing a 2-layer with a Conv is clearly better than reconstructing a Conv with a 2-layer. Reconstructing ResNet-18 with VGG11 still gives a 10x reduction, but when reconstructing VGG11 with ResNet-18, gradients help very little.
    • Authors' interpretation: gradients help more when the model class of f̂ is more complex than that of f; the authors state it is unclear how to compare the complexity of VGG11 and ResNet-18.

    Unknown data distribution (Figure 4)

    • Setup: queries are instead made with Gaussian random inputs x∼N(0,I_d).
    • MNIST results: the 2-layer network shows at least a 1000x reduction (100x when querying with the data distribution); the Conv network reaches 84% with 10 gradient queries, whereas 10,000 membership queries reach only 71%, which the authors call at least a 1000x reduction.
    • CIFAR10 results: performance drops substantially for both query types, making interpretation difficult; the Conv network reaches 50% with 10 gradient queries, while 10,000 membership queries reach only 11%.

    Other ablations and analyses

    • SmoothGrad hyperparameters (Appendix D): the best σ on MNIST is 1000σ_D; on CIFAR10 VGG-11 and ResNet-18, no σ value yields a clear saliency map, so σ=σ_D is used (Figure 5–7).
    • SmoothGrad sample count N: Smilkov et al. state that returns diminish for N>50; this paper uses N=10 for computational reasons, which the authors believe only makes learning harder.
    • The authors expect that further increasing σ would eventually degrade reconstruction performance, but no performance degradation was observed at the tested values.
  5. What are some points that can be further explored?

    The authors raise open questions such as theoretical extensions and reconstruction-resistant explanations; the experiments cover only image models on MNIST/CIFAR10.

    Limitations noted by the authors and future directions

    • Whether the theoretical results extend to depth-3 networks (§1.1 Conclusion part).
    • What the optimal query complexity is when computational efficiency is ignored; in particular, whether a k-layer ReLU network with h units per layer can be learned with Õ(kh) queries (§1.1).
    • Whether practical explanation methods that resist model reconstruction attacks can be designed; the authors note that there is currently no accepted measure of explanation quality, making this trade-off difficult to study formally (§1.1).
    • Differential privacy can defend against prediction API attacks, but the authors note that it is unclear whether it can defend against reconstruction from explanations (§6 Related Work).
    • The authors state that their work is only a first step in this new direction (§1.1).

    Scope of experiments

    • There are 6 target models tested: 1-layer, 2-layer, Conv on MNIST, and Conv, VGG11, ResNet-18 on CIFAR10 (§4).
    • The datasets are two image classification tasks, MNIST and CIFAR10; the f̂ training set has 10,000 images and the test set has 10,000 images (§4).
    • Query types cover three: membership, raw gradient, and SmoothGrad; SmoothGrad is tested only with N=10 and the above σ values (§4, Appendix D).
    • The unknown model class experiments cover six pairs: 1-layer↔2-layer and 2-layer↔Conv on MNIST, and VGG11↔ResNet-18 on CIFAR10 (§5.2); the unknown data distribution experiments use Gaussian queries (§5.3).
    • The paper does not report the number of experimental repetitions or variance, nor does it evaluate any defenses against explanation APIs (such as query rate limiting).
  6. Summarize the main content of the paper

    Gradient explanations leak the model: theoretically O(h log h) queries exactly reconstruct a two-layer ReLU network, and experimentally the number of queries is reduced by 10–1000×.

    An attack paper in the model stealing direction, studying the threat of "explanation APIs leaking models," which is complementary to prediction API stealing.

    • Problem: Commercial models need to be kept confidential (competitive value, preventing gaming, preventing training data leakage), but gradient-based saliency map explanations expose the model itself.
    • Theory: An "input gradient query" learning framework is proposed. For two-layer ReLU networks, the algorithm binary-searches along a random line for gradient change points to recover ±w_iA_i, then solves 2h linear equations to recover the signs; with probability 1−δ it exactly reconstructs using O(h log(h/δ)) queries, independent of the input dimension d, about d times fewer than membership queries, and optimal up to a logarithmic factor.
    • Experiments: A surrogate model is trained with a joint loss (gradient loss + cross-entropy). On MNIST Conv, 10 gradient queries reach 95% accuracy, while membership queries require 1000; a 1-layer network can be reconstructed with 1 gradient query (1000x reduction); on CIFAR10 VGG11/ResNet-18 the reduction is 10x.
    • Robustness: Gradients processed by SmoothGrad hardly weaken reconstruction; when the model class is unknown, gradients still help (helping more when f̂ is more complex); under Gaussian random queries, the gap on MNIST instead widens to at least 1000x.
    • Authors' conclusion: Standards for explanation quality must be traded off against model leakage risk; open questions include extending to deeper networks, optimal query complexity, and designing reconstruction-resistant explanation methods.

Related papers

Show 3 more papers
Read originalFAT