Track: Track1; Team name: SweetLesson; Model: HOD-GNN - #402
Open
AaravG42 wants to merge 4 commits into
Open
Conversation
First public implementation of 1-HOD-GNN from "On the Expressive Power of GNN Derivatives" (Eitan et al., ICLR 2026, arXiv:2510.02565), following the paper's empirical architecture (Appendix F): a deep-and- narrow base GIN whose exact first-order input-Jacobian is propagated analytically alongside the features (Algorithm 1; sparse, batch-aware, fully differentiable), with 1/t!-scaled per-layer diagonal derivatives encoded by a pointwise MLP and consumed by a downstream GIN. Tests: analytic derivatives vs torch.autograd (exact, all activation x aggregation combinations), Theorem-4.2 equivalence with random-walk return probabilities under the paper's initialisation, batch isolation, permutation equivariance, gradient flow through the derivative computation, C6-vs-2xC3 expressivity beyond 1-WL. 100% line coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The paper's Appendix-F initialisation with GIN sum aggregation produces walk-count-scale derivative features that destabilise training on the dense GraphUniverse regimes under the challenge's fixed single learning rate (initial loss ~2e7, oscillatory convergence under patience-10 early stopping). The row-normalised mean aggregation - the operator used in the constructive proof of the paper's Theorem 4.2 - keeps the derivative diagonals in [0,1] (they start exactly at RWSE under structural_init), trains stably, and generalises better OOD on both tasks: CD acc in-dist/OOD: mean 0.439/0.358 vs sum 0.432/0.355 Tri MSE/tri in-dist/OOD: mean 0.080/2.40 vs sum 0.174/10.6 (Polynormer geometric-intelligence#345 baseline: 0.455/0.350 and 0.872/35.1) Committed results.json = default config, full 72-run grid + OOD eval (study 2026-07-27_22-10-00-rw), generated via the utils.py backend. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CPU-only, ~15 s: verifies the Theorem-4.2 RWSE-at-init equivalence against dense matrix powers, demonstrates the C6 vs 2xC3 beyond-1-WL separation, checks batch isolation, and trains briefly on MUTAG through the TopoBench pipeline. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
- Seed the global RNG in the test-model factory: an unlucky random init could kill every ReLU in a layer and flake the nonzero-gradient asserts (observed once under --cov). - Mean aggregation: guard only true zero degrees (masked_fill) instead of clamp(min=1), so fractional weighted degrees yield an exact mean. - Document the batch-vector contiguity assumption behind the local source indexing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HOD-GNN — first public implementation of "On the Expressive Power of GNN Derivatives" (ICLR 2026)
Paper: Eitan, Eliasof, Gelberg, Frasca, Bar-Shalom, Maron — arXiv:2510.02565 / OpenReview Tvat33IDmK.
To our knowledge no public implementation exists (checked the authors' pages, GitHub code search, and the paper's citations as of 2026-07-28); this backbone was written from the paper alone.
Why this model for this challenge
Message passing is bounded by 1-WL and provably cannot count triangles (Chen et al., NeurIPS 2020). HOD-GNN's motivating example is exactly the triangle-counting task: for a base GNN computing
A³X, the derivative of node v's output w.r.t. its own input is(A³)_vv— six times the triangles at v. HOD-GNN turns the derivatives of a base MPNN into learnable, structure-aware node features that restore what 1-WL is blind to, with expressivity between encoding-augmented MPNNs and Subgraph GNNs (paper §4). It is also a direct conceptual extension of our TopoPolynormer submission (#353): Theorem 4.2 of the paper proves the derivative diagonal of a suitably initialised base MPNN equals the random-walk structural encoding — so the hand-crafted RWSE we injected there is here learned end-to-end, strictly more expressively.What is implemented
The paper's own empirical architecture (its Appendix F — used for every reported experiment):
Documented deviations and an insight for reusers
(A^t)_vv) that explode on the denser GraphUniverse regimes (initial loss ~2×10⁷, oscillatory training that patience-10 early stopping freezes at a bad checkpoint). The mean operator keeps the derivative diagonals in [0,1] — at initialisation they are exactly the k-step RW return probabilities — and trains stably. Both variants are implemented and both were run on the full grid (table below).Tests (100% line coverage of the backbone)
torch.autograd.functional.jacobianexactly (atol 1e-10, float64), for every activation × aggregation combination, inside a batch.Results — full 72-run GraphUniverse grid + OOD evaluation
Generated with
run_challenge_grid()+save_challenge_artifacts()from2026_tdl_challenge/utils.py(unmodified). Note: the evaluation notebook's integrity-hash cell currently rejects the unmodified upstream notebook (stored hash mismatch), same as noted in #345/#353, so the backend was called directly — identical pipeline. Committedresults.jsonis the default config (study2026-07-27_22-10-00-rw).Files
topobench/nn/backbones/graph/hod_gnn.py— backbone (module docstring contains the full method description, faithfulness notes, and references)configs/model/graph/hod_gnn.yaml— model config (both tasks)test/nn/backbones/graph/test_hod_gnn.py— test suitetest/pipeline/test_pipeline.py— pipeline registration2026_tdl_challenge/outputs/2026-07-27_22-10-00-rw/results.json— grid results (default config)Team SweetLesson · Track 1 (GNNs) · companion submissions: #345 (Polynormer, faithful baseline), #353 (TopoPolynormer, hand-crafted RWSE) — together the three PRs progress from a faithful transformer baseline (#345), to a hand-crafted structural encoding (#353), to this PR, where that encoding is generalised and learned end-to-end.