Track: Track1; Team name: TripleA; Model: Graph Inductive Bias Transformer (GRIT)#370
Open
amiiiza wants to merge 8 commits into
Open
Track: Track1; Team name: TripleA; Model: Graph Inductive Bias Transformer (GRIT)#370amiiiza wants to merge 8 commits into
amiiiza wants to merge 8 commits into
Conversation
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
Checklist
Description
This PR adds GRIT (Graph Inductive Bias Transformer) to TopoBench, follwing the paperÖ
The model
GRIT is a graph transformer that injects graph inductive biases without any message-passing modules. It differs from both classical MPNNs and hybrid graph transformers in three ways:
Attention is global (all intra-graph node pairs) by default, but convertable to the sparse RRWP support with$K=8$ ).
pad_to_full_graph: false. The default configuration has ~190K parameters (hidden 64, 4 layers, 8 heads,Files added
Model
topobench/nn/backbones/graph/grit.pyGRITAttention,GRITTransformerLayer(attention + degree scaler + BatchNorm + FFN),GRITBackbone(RRWP node/pair encoders + layer stack), and thefull_edge_indexutility.topobench/transforms/data_manipulations/rrwp_positional_encodings.pyAddRRWPdata-manipulation transform +compute_rrwp: precomputes node-level (rrwp) and sparse relative (rrwp_index/rrwp_val) encodings pluslog_degper graph.topobench/nn/wrappers/graph/grit_wrapper.pyGRITWrapper: thin wrapper forwarding connectivity, RRWP attributes and log-degrees from the batch to the backbone. Returns rank-0 cell embeddings.Configs
configs/model/graph/grit.yamlTBModelcomposition (AllCellFeatureEncoder→GRITBackbone→GRITWrapper→NoReadOut).configs/transforms/data_manipulations/rrwp_positional_encodings.yamlAddRRWPtransform.configs/transforms/model_defaults/grit.yamlmodel=graph/gritis selected, interpolateswalk_lengthfrom the backbone config so transform and model can never drift apart.Tests
test/nn/backbones/graph/test_grit.pytest/transforms/data_manipulations/test_AddRRWP.pytest/nn/wrappers/graph/test_grit_wrapper.pyModified
test/pipeline/test_pipeline.pyDATASET = "graph/MUTAG",MODELS = ["graph/grit"], full end-to-end training pipeline test.Testing
graph/gritongraph/MUTAG) passes end-to-end through the real Hydra → PreProcessor → Lightning stack.Evaluation results (official notebook,
results.jsonincluded)2026_tdl_challenge/run_evaluation.ipynbwas run unmodified withMODEL_CONFIG = "graph/grit": 12 GraphUniverse settings × 3 seeds = 36 runs per task.Limitations
pad_to_full_graph: true(as in the paper). Set it tofalsefor sparse RRWP-support attention on larger graphs.dataset_defaultstransform config use the on-the-fly RRWP fallback, which is slower than the cached precomputation.