Actionable Interpretability via Causal Hypergraphs: Unravelling Batch Size Effects in Deep Learning

Zhongtian Sun, Anoushka Harit, Pietro LioarXiv 2025 · DOI

Introduction

In deep learning, the "rule of thumb" that smaller batch sizes improve generalization is widely accepted but has historically lacked a formal causal explanation. While extensively documented in computer vision, the underlying mechanisms in complex domains like Graph Neural Networks (GNNs) and Natural Language Processing (NLP) remain underexplored. Most research relies on correlation, failing to capture the higher-order, multi-variable dependencies inherent in optimization dynamics.

This paper introduces HGCNet, a framework utilizing causal hypergraphs and Deep Structural Causal Models (DSCMs) to explain why batch size affects generalization. By applying Judea Pearl’s do-calculus, the authors demonstrate that smaller batch sizes causally improve performance by increasing gradient noise and promoting flatter minima in the loss landscape.

Methodology: The HGCNet Framework

The authors propose HGCNet to move beyond pairwise interactions captured by traditional Directed Acyclic Graphs (DAGs). By using Causal Hypergraphs, the model can represent joint influences, such as how gradient noise and minima sharpness collectively impact model complexity.

The HGCNet framework overview and the underlying causal chain from batch size to generalization.

Key Components

  1. Deep Structural Causal Models (DSCMs): These trace the influence of Batch Size ($B$) through a chain of mediators: Gradient Noise ($N$), Minima Sharpness ($S$), and Model Complexity ($C$), ultimately affecting Generalization ($G$).
  2. Do-Calculus: The framework uses do-calculus to simulate interventions, mathematically "forcing" batch size to specific values ($do(B=b)$) to quantify direct and mediated effects.
  3. Mathematical Formalization:
    • Gradient Noise ($N$): Calculated as the variance of the estimated gradient.
  4. Minima Sharpness ($S$): Measured via the largest eigenvalue ($\lambda_{max}$) of the Hessian matrix (the second-order derivative of the loss function).
  5. Model Complexity ($C$): Defined as a function of both sharpness and noise.

Experimental Setup

The framework was evaluated across graph and text domains to ensure universality:

  • Graph Domains: Cora (2,708 nodes) and CiteSeer (3,327 nodes) citation networks.
  • Text Domains: PubMed (19,717 nodes) and Amazon (63,486 nodes) for sentiment analysis and citation classification.

HGCNet was benchmarked against standard GNNs including GCN, GAT, and GIN, as well as transformer-based models for text classification.

Key Results and Insights

The empirical evaluation confirms a specific causal pathway: Smaller Batch Size $\rightarrow$ Higher Gradient Noise $\rightarrow$ Flatter Minima $\rightarrow$ Lower Model Complexity $\rightarrow$ Better Generalization.

Performance comparison of HGCNet against baselines across varying batch sizes (B).

Core Findings

  • Consistent Performance Gains: HGCNet demonstrated generalization improvements of 2–4% across all tested domains. As shown in the results table, HGCNet consistently outperforms baselines, particularly at smaller batch sizes where the causal benefits are most pronounced.
  • Average Treatment Effect (ATE): Using do-calculus, the authors estimated that reducing batch size from 512 to 16 results in a +2.4% mean improvement in generalization across datasets.
  • Noise as a Regularizer: Increased stochasticity from small batches prevents the model from settling in "sharp" minima (narrow valleys in the loss landscape), pushing it toward "flat" minima that are more robust to data perturbations.
  • Sharpness Confirmation: Empirical results showed that larger batch sizes yield significantly higher $\lambda_{max}$ values. For example, on the Cora dataset, sharpness increased from 12.8 at $B=16$ to 25.1 at $B=512$.

Discussion and Conclusion

HGCNet provides "actionable interpretability" by allowing researchers to make informed choices about training parameters to drive better generalization. However, a trade-off exists: smaller batches are computationally more expensive, with training at $B=16$ taking roughly twice as long per epoch as at $B=512$ (e.g., 4.52s vs 2.21s on Cora).

Future work includes exploring adaptive batch size strategies within the causal framework and relaxing linearity assumptions in the DSCMs to capture more complex training dynamics. By formalizing the optimization process through causal hypergraphs, HGCNet opens new avenues for understanding and controlling the behavior of deep learning models.

Summary updated

BibTeX
@misc{sun2025actionable,
  author = {Zhongtian Sun and Anoushka Harit and Pietro Lio},
  title = {{Actionable Interpretability via Causal Hypergraphs: Unravelling Batch Size Effects in Deep Learning}},
  year = {2025},
  eprint = {2506.17826},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.17826},
}
Figure