Learning with Explanation Constraints

Rattana Pukdee, Dylan Sam, J. Zico Kolter, Maria-Florina Balcan, Pradeep Ravikumar

TL;DR

Instead of merely extracting post-hoc explanations from black-box models, this paper introduces a learning-theoretic framework for training models that satisfy a priori explanation constraints (such as target input gradients). The authors formalize EPAC (Explanation constraints Probably Approximately Correct) learnability, prove how such constraints shrink Rademacher complexity and sample requirements, and propose a scalable variational teacher-student algorithm that enforces these constraints far better than standard Lagrangian penalties.

What Problem Does This Paper Address?

In supervised learning, models typically learn purely from labeled input-output pairs $(x, y)$. However, human domain experts often know why a decision should be made—for example, which features should be ignored or how sensitive a prediction should be to particular input dimensions.

While recent work has explored penalizing models when their explanations disagree with human intuition, two fundamental gaps remained:

  1. Theoretical Understanding: Under what conditions and by how much do explanation constraints mathematically improve generalization or reduce sample complexity?
  2. Optimization Scalability: Enforcing complex, stochastic explanation constraints (e.g., Jacobian/gradient constraints) directly in deep neural networks is non-convex and notoriously difficult to optimize using standard Lagrangian regularizers.

Methods

  • EPAC Framework: The authors formalize explanations as vector functionals $g(h, x) \in C(x)$ and relax them using surrogate explanation losses $\phi(h, x) \ge 0$. A model is $\tau$-EPAC if its expected explanation loss over the data distribution satisfies $\mathbb{E}_{x}[\phi(h, x)] \le \tau$.
  • Rademacher Complexity Bounds: By analyzing the restricted hypothesis class $\mathcal{H}_{\phi, \tau}$ of models satisfying the constraints, the authors derive agnostic generalization bounds, proving that valid explanation constraints reduce Rademacher complexity from $\mathcal{O}(B/\sqrt{n})$ to scaled factors depending on constraint slack $\tau$. They instantiate concrete bounds for:
  • Linear models under gradient angle constraints.
  • Two-layer ReLU neural networks under bounded gradient difference constraints.
  • Variational Teacher-Student Objective: Rather than directly penalizing the model via augmented Lagrangian methods (which often fail to generalize constraints to unseen data), the authors propose a variational posterior-regularization objective:
  • Teacher Step: Train a teacher model $f_{t+1}$ on unlabeled data to simultaneously mimic the current student and satisfy the explanation constraints via a penalized loss.
  • Student Step: Update the student model $h_{t+1}$ to minimize supervised empirical risk on labeled data while matching the teacher's predictions on unlabeled data.

Datasets

  • Synthetic Datasets: Synthetic regression tasks over $\mathbb{R}^d$ ($X \sim \mathcal{N}(0, \sigma^2 I)$ or uniform distributions on the unit sphere) used to test linear regressors and two-layer ReLU networks under exact and noisy gradient supervision.
  • Real-World Benchmark: Weak supervision classification tasks from the WRENCH benchmark:
  • YouTube (comment spam classification)
  • Yelp (review sentiment analysis) Here, pseudo-gradients from weak labeling functions served as noisy explanation constraints along specific feature dimensions.

Key Insights and Ideas

  • Explanations Shrink the Search Space: For a two-layer neural net with $m$ hidden nodes, gradient constraints enforce matching decision boundaries or force unmatched weights to be at most $\tau$. This reduces the Rademacher complexity bound from $\frac{2BC}{\sqrt{n}}$ down to $\frac{3\tau m C}{\sqrt{n}}$, demonstrating concrete sample complexity savings when $\tau < \frac{2B}{3m}$.
  • Greatest Value Under Data Scarcity: Explanation constraints provide massive error reductions when labeled data $n$ is small (e.g., $n \le 40$). As labeled data grows plentiful, standard supervised models catch up, matching standard PAC learning intuition.
  • Lagrangian Penalties Fail to Generalize Explanations: Direct Lagrangian penalty methods often memorize explanations on training samples but fail to satisfy constraints on held-out test data. The alternating teacher-student projection smoothly propagates constraints across the input space.
  • Simpler Teachers Suffice: Ablations show that the teacher model in the variational objective can actually be smaller (fewer hidden units) than the base student model without degrading performance, significantly reducing computational overhead.

Key Results

  • Exact Synthetic Gradients: On two-layer ReLU networks with few labeled examples ($n=20$), the variational method achieves an MSE around $10^{-2.5}$, compared to $>1.0$ for standard supervised learning and $\approx 10^{-0.5}$ for augmented Lagrangian regularization.
  • Constraint Satisfaction at Test Time: On held-out test points, the variational approach achieved substantially lower $\ell_2$ input gradient error compared to ground truth (gradient distance $<2.0$) than both supervised ($>3.5$) and Lagrangian regularized baselines ($\approx 2.5$).
  • Robustness to Noisy Explanations: In synthetic noise experiments ($\epsilon = 0.5$ and $\epsilon = 2.0$), the variational method maintained low MSE while the Lagrangian method suffered severe performance instability and divergence.
  • Real-World Benchmarks: On the WRENCH YouTube and Yelp tasks, the proposed method consistently outperformed supervised learning, standard self-training, and Lagrangian regularizers across all labeled sample sizes ($n=100$ to $200$).

Limitations and Future Work

  • Rate Loose in Realizable Case: The theoretical bounds are based on standard Rademacher uniform convergence, yielding $\mathcal{O}(1/\sqrt{n})$ rates, which are loose in doubly realizable settings (where zero error and zero constraint violation are achievable).
  • Curse of Dimensionality on Gradients: Because input gradients scale with data dimension $d$, the empirical advantage of gradient constraints diminishes as input dimensionality grows very large unless the constraints are sparse.
  • Architectural Scope: Explicit Rademacher bounds were derived for linear models and shallow (two-layer) networks; extending explicit complexity bounds to deep convolutional or transformer architectures remains open.

Summary updated

Abstract

As larger deep learning models are hard to interpret, there has been a recent focus on generating explanations of these black-box models. In contrast, we may have apriori explanations of how models should behave. In this paper, we formalize this notion as learning from explanation constraints and provide a learning theoretic framework to analyze how such explanations can improve the learning of our models. One may naturally ask, "When would these explanations be helpful?"Our first key contribution addresses this question via a class of models that satisfies these explanation constraints in expectation over new data. We provide a characterization of the benefits of these models (in terms of the reduction of their Rademacher complexities) for a canonical class of explanations given by gradient information in the settings of both linear models and two layer neural networks. In addition, we provide an algorithmic solution for our framework, via a variational approximation that achieves better performance and satisfies these constraints more frequently, when compared to simpler augmented Lagrangian methods to incorporate these explanations. We demonstrate the benefits of our approach over a large array of synthetic and real-world experiments.
BibTeX
@inproceedings{pukdee2023learning,
  author = {Rattana Pukdee and Dylan Sam and J. Zico Kolter and Maria-Florina Balcan and Pradeep Ravikumar},
  title = {{Learning with Explanation Constraints}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=n6ztJ3Lrdj},
}
Figure