Dynamic Rescaling for Training GNNs

Nimrah Mustafa, Rebekka Burkholz

TL;DR

By exploiting the mathematical symmetries of Graph Attention Networks (GATs), this paper introduces dynamic rescaling—a method to "teleport" a model to different points in the parameter space that represent the same function but exhibit different training dynamics. The authors demonstrate that maintaining a "balanced" state between layers allows for higher learning rates and significantly better generalization, particularly on challenging heterophilic datasets.

The Problem: Broken Symmetries and Imbalanced Learning

Deep neural networks with ReLU-like activations possess a property called rescale invariance: you can shrink the incoming weights to a neuron and grow the outgoing weights by the same factor without changing the network's output. While the function remains the same, the gradients do not.

In an ideal world with infinitesimal learning rates, these symmetries are preserved. However, in practice, finite learning rates, weight decay, and stochasticity break these symmetries. This causes layers to "topple out of balance," where some layers learn much faster or slower than others, leading to poor convergence or sub-optimal generalization. This is especially problematic in Graph Neural Networks (GNNs), where the interaction between node features and graph structure creates complex training dynamics that are still not fully understood compared to standard CNNs.

Methods: Dynamic Rescaling (DR)

The authors propose Dynamic Rescaling (DR), a procedure to re-parameterize a GNN during training to influence its learning speed without altering its current predictions.

  1. Relative Gradient Criterion: Unlike previous work that focused on balancing weight norms, the authors propose balancing relative gradients ($\Delta\theta = \nabla_\theta\mathcal{L}/\theta$). The goal is to ensure that every layer has a relatively equal "opportunity" to learn from the incoming error signal.
  2. The Balancing Act: They derive an iterative scaling factor ($\lambda$) that can be applied to weights and attention parameters. By applying this every few epochs, they pull the network back into a balanced state.
  3. Layer-wise Control: Beyond simple balancing, DR allows researchers to intentionally "unbalance" a network to see if certain layers should learn before others.

Datasets Evaluated

The study evaluates DR across a wide range of benchmarks:

  • Heterophilic Graphs: roman-empire, amazon-ratings, tolokers, questions, and minesweeper. In these graphs, connected nodes often have different labels, making feature learning critical.
  • Homophilic Graphs: Cora, Pubmed, Citeseer, CS, Computers, Physics, and Photo. Here, neighbors are usually similar.
  • Synthetic Data: A custom node classification task designed to isolate and study the effects of layer-wise learning order.

Key Insights and Ideas

  • Heterophily vs. Homophily: The paper reveals a fundamental split in training requirements. Heterophilic tasks benefit most from balanced training, where all layers learn simultaneously. Conversely, homophilic tasks often perform better when the first layer is allowed to learn faster or earlier, as they rely more on neighborhood aggregation than complex feature transformations.
  • Stabilizing Large Learning Rates: Large learning rates are known to help models find "flatter" minima, which generalize better. However, large rates usually destroy model balance. DR acts as a stabilizer, allowing models to reap the benefits of high learning rates without the usual training instability.
  • Inducing Grokking: By intentionally delaying the learning of specific layers (inducing an imbalanced state), the authors could trigger "grokking"—a phenomenon where a model suddenly achieves perfect generalization long after the training loss has plateaued.

Key Results

  • Performance Boosts: On the roman-empire dataset, standard GAT training achieved ~50% accuracy. Applying DR based on relative gradients ($DR_C$) boosted this to 67.31%.
  • Efficiency: DR often allows models to reach peak validation performance in significantly fewer epochs. For example, on tolokers, DR-trained models converged nearly twice as fast as standard ones.
  • Robustness: The authors found that even when the mathematical prerequisite of "positive homogeneity" was violated (e.g., using Tanh instead of ReLU), the principle of rebalancing still provided practical gains in generalization.

Limitations and Future Work

  • Architectural Constraints: The method currently requires the model to exhibit rescale invariance. While common in GCNs and GATs, it may not apply to all GNN variants.
  • Numerical Stability: Directly manipulating parameters can lead to exploding or vanishing gradients, necessitating the use of gradient clipping as a safeguard.
  • Computational Overhead: While rebalancing only takes a few iterations (<10), doing it too frequently could increase training time.
  • Future Directions: The authors suggest that the "teleportation" enabled by DR could be used to develop more sophisticated, task-dependent learning schedules (e.g., cycling through layers) rather than relying on a one-size-fits-all approach.

Summary updated

BibTeX
@inproceedings{mustafa2024dynamic,
  author = {Nimrah Mustafa and Rebekka Burkholz},
  title = {{Dynamic Rescaling for Training GNNs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=IfZwSRpqHl},
}
Figure