Add PPR relation token features to graph transformer - #700
Draft
mkolodner-sc wants to merge 6 commits into
Draft
Conversation
mkolodner-sc
requested review from
kmontemayor2-sc,
nshah-sc,
svij-sc,
xgao4-sc,
yliu2-sc and
zfan3-sc
as code owners
July 10, 2026 19:54
mkolodner-sc
marked this pull request as draft
July 10, 2026 19:56
mkolodner-sc
force-pushed
the
mkolodner/gt-ppr-relation-features
branch
from
July 28, 2026 10:43
7fb45ce to
8ccc1a0
Compare
yliu2-sc
reviewed
Jul 31, 2026
mkolodner-sc
force-pushed
the
mkolodner/gt-ppr-relation-features
branch
from
August 14, 2026 19:14
33b0fde to
d3f3332
Compare
yliu2-sc
approved these changes
Aug 14, 2026
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.
Summary
Adds Graph Transformer support for generic PPR edge-attribute metadata.
PPR can emit multi-column
edge_attrtensors where column0is the scalar PPR weight and the remaining columns contain sampler metadata. This PR lets Graph Transformer consume those extra columns as token-input features while preserving the existing scalar PPR path.This also works with the current GiGL
mainPPR output shape, where heterogeneous PPR batches may include preserved original message-passing edges alongside virtual PPR edges. Graph Transformer uses only virtual(anchor_type, "ppr", neighbor_type)edges for PPR token sequence construction, while still allowing preserved original edges to participate in relation-aware attention and value/message edge-type features.What This Enables
A PPR edge can now carry:
ppr_weight: the firstedge_attrcolumn, used as the scalar PPR score.ppr_features: all remainingedge_attrcolumns, projected into the token embedding as continuous token features.For current GiGL PPR outputs:
edge_attras[ppr_score, hop_proximity].edge_attras[best_score, hop_proximity, (channel_score, channel_hop_proximity, channel_presence), ...].hop_proximityis1 / (1 + hop), so anchor/self is1.0, one-hop is0.5, two-hop is about0.333, and so on. For channel-level hop proximity, missing channels use0.0and should be interpreted using the corresponding channel presence bit.This allows PPR metadata such as global hop proximity, channel scores, channel hop proximity, and channel presence bits to flow into Graph Transformer tokens without changing how scalar PPR batches behave.
Changes
ppr_features.edge_attr.ppr_weightmapped toedge_attr[..., 0].ppr_featurestoedge_attr[..., 1:].ppr_features.ppr_weightclamped as a scalar score in[0, 1].edge_attr[..., 0]and carries feature columns through the same permutation.ppr_featuresis used only as token input, not attention bias.Toy Example
Suppose typed-channel PPR emits virtual PPR edges from an anchor to selected tokens.
Each PPR edge represents one selected
(anchor, token)pair. Theedge_attrrow describes how PPR reached/scored that token:0is the scalar best PPR score.1is the global hop proximity.For example, with two typed PPR channels:
Graph Transformer interprets this as:
A model can consume both as token-input features:
These continuous features are concatenated, passed through the learned token-input projection, and added to the corresponding token embeddings before the Transformer layers run.
Preserved Original Edges
Current heterogeneous PPR can preserve original graph edges alongside virtual PPR edges when the sampler is configured to include sampled edges.
In that mixed batch shape:
This enables PPR token metadata and original-edge relation/value modeling to be used together.
Example:
Validation
ppr_relation_featuresreferences were removed.ppr_featurespreserves metadata columns rather than clamping hop-like columns.