Add PPR relation token features to graph transformer - #700
Draft
mkolodner-sc wants to merge 3 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
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 typed-PPR edge attributes.
Typed PPR can emit multi-column
edge_attrtensors where column 0 is the scalar PPR weight and the remaining columns describe relation/channel metadata. This PR lets Graph Transformer consume those extra columns as token-input features while preserving the existing scalar PPR path.What This Enables
A PPR edge can now carry:
ppr_weight: the firstedge_attrcolumn, used as the scalar PPR score.ppr_relation_features: any remainingedge_attrcolumns, projected into the token embedding as continuous token features.This allows typed-PPR metadata, such as channel scores or channel presence bits, to flow into Graph Transformer tokens without changing how scalar PPR batches behave.
Changes
ppr_relation_features.edge_attr.ppr_weightmapped toedge_attr[..., 0].ppr_relation_featurestoedge_attr[..., 1:].ppr_relation_featuresis used only as token input, not attention bias.Toy Example
Suppose typed PPR emits PPR edges from a
useranchor toitemtokens.Each PPR edge represents one selected
(anchor, token)pair in the sampled PPR sequence. Theedge_attrrow for that edge describes how typed PPR reached/scored that token:0is the scalar PPR weight used for ranking/weight-style features.1..num_channelsare per-channel calibrated PPR scores.1 + num_channels..are per-channel presence bits indicating which typed channels reached the token.For example, with two typed PPR channels:
Graph Transformer interprets this as:
A model can consume both as token-input features:
For the example above, each token receives:
These continuous features are concatenated, passed through the learned token-input projection, and added to the corresponding token embeddings before the Transformer layers run.
Validation