Bridging the Divide: End-to-End Sequence-Graph Learning

Yuen Chen, Yulun Wu, Samuel Sharpe, Igor Melnyk, Nam H. Nguyen, Furong Huang, C. Bayan Bruss, Rizal Fathony

TL;DR

BRIDGE is a new end-to-end framework that unifies sequence modeling and graph neural networks (GNNs) to jointly learn from both individual event histories and relational network structures. By introducing a token-level cross-attention mechanism called TOKENXATTN, the model allows specific events in one entity's history to directly attend to events in a neighbor's history, significantly outperforming decoupled two-stage pipelines and temporal graph baselines.

What Problem Does This Paper Address?

Many real-world machine learning tasks involve data that is simultaneously sequential and relational. Consider an e-commerce platform: each user generates a sequence of independent actions over time (logins, page views, searches), but users are also embedded in a relational network (friendships, shared payment methods, or co-review patterns).

Figure 1. Illustration of data combining sequential and relational structure. Each entity is associated with a sequence of events, while edges capture interactions between entities. For example, in e-commerce, a user generates a sequence of purchases or reviews while also forming relations with other users. Example relations: friendship, family relation, sharing the same payment method, etc.

Traditionally, models excel at one modality while neglecting the other:

  1. Sequence models (e.g., Transformers) capture temporal patterns within an entity's history but treat each entity in isolation.
  2. Graph Neural Networks (GNNs) capture relational structures but typically compress an entity's entire history into a single static feature vector, discarding temporal granularity.
  3. Temporal Graph Networks (TGNs) handle timestamped edges but struggle with "intransitive" node-level actions (like logging in or updating a profile) that don't involve another entity. Forcing these actions into a graph structure creates artificial nodes and misleading topologies.

While some recent approaches attempt to combine both via a two-stage pipeline—pre-training a sequence model, freezing the embeddings, and feeding them into a GNN—this decoupled approach prevents gradients from flowing back to the sequence encoder, leading to representations that aren't fully optimized for the downstream task.

Methods

The authors introduce BRIDGE (Bimodal Representation Integration for Deep Graph–sequence End-to-end Learning), an architecture that couples a sequence model with a graph module under a single objective.

Figure 2. Illustration of our proposed model. (Left) BRIDGE, the end-to-end sequence–graph architecture, where the sequential module encodes node sequences and the resulting representation serve as node features for the graph module. (Right) TOKENXATTN, a zoomed-in view of the token-wise cross-attention layer that enables event-level message passing between neighboring sequences.

Key components include:

  • End-to-End Joint Optimization: Instead of using frozen embeddings, BRIDGE trains the sequence encoder (e.g., a Transformer) and the GNN backbone simultaneously. To make this work in mini-batches, the framework uses neighborhood sampling to ensure that the sequences entering the sequence module are interconnected via the underlying graph.
  • TOKENXATTN (Token-Level Cross-Attention): Standard GNNs pass messages using a single vector per node. TOKENXATTN replaces this by maintaining the full sequence of token representations during message passing. It computes a cross-attention matrix between the event tokens of a target node and the event tokens of its neighbors. This allows the model to learn, for instance, that a neighbor's recent purchase is highly relevant to the target user's current behavior, while an older login event is not.

Datasets

The framework was evaluated across two distinct tasks using five real-world datasets:

  • Relationship Prediction: Evaluated on Brightkite and Gowalla (location-based social networks where sequences consist of geohash check-ins and edges represent friendships) and three categories of Amazon Reviews (Movies, Electronics, Clothing, where sequences are product IDs/ratings and edges connect users who co-reviewed at least three products).
  • Fraud Detection: Evaluated on the same three Amazon Reviews categories. Here, sequences include both ratings and textual review embeddings (generated via Sentence-BERT), and users are labeled as fraudulent based on a high percentage of "unhelpful" review votes.

Key Insights and Ideas

  • The Power of Fine-Grained Interaction: Compressing a sequence into a single vector before graph propagation creates an information bottleneck. TOKENXATTN proves that preserving token-level granularity during message passing yields substantial performance gains because the model can pinpoint exactly which historical events influence a relationship.
  • End-to-End Alignment Matters: The massive performance gap between BRIDGE and two-stage baselines highlights how crucial task-specific gradient flow is. When the sequence encoder is forced to update its weights based on the final graph-level prediction objective, it learns radically better temporal features.
  • Graph Structure Refines Text Representations: In the fraud detection task, incorporating the sequence-graph architecture allowed the model to refine textual review representations using relational context, proving that fraud is better detected when looking at how connected users write reviews over time.

Key Results

BRIDGE consistently outperformed graph-only, sequence-only, and temporal graph baselines across all datasets.

Relationship Prediction

On the Brightkite dataset, the Mean Reciprocal Rank (MRR) jumped from 72.7 (the best two-stage baseline) to 92.9 using BRIDGE-TOKENXATTN. Similar dramatic improvements were observed across Gowalla and the Amazon datasets, where BRIDGE variants frequently outperformed temporal graph models (like TGN and NAT) by a wide margin.

Fraud Detection

For fraud detection, where performance is heavily driven by review text, BRIDGE variants still provided a noticeable edge over standalone text embedding models. On Amazon-Movies, BRIDGE-TOKENXATTN achieved a Max F1 score of 80.5 and a PR-AUC of 87.7, outperforming the standalone Sentence-BERT baseline (Max F1 of 75.7, PR-AUC of 83.1).

Limitations and Future Work

Despite its strong performance, the authors note a few key limitations:

  1. Lack of Absolute Time Encodings: BRIDGE preserves the order of events but does not explicitly encode absolute timestamps or the duration of time gaps between events (e.g., identifying bursts of activity).
  2. Computational Complexity: Because TOKENXATTN computes cross-attention between all tokens of neighboring nodes, its computational complexity scales quadratically ($O(B k L^2 d)$) with sequence length $L$ and neighborhood fanout $k$. This makes it expensive for very long event histories or highly dense graphs.

Future Directions: The authors suggest exploring sparse or linear attention mechanisms to scale TOKENXATTN, incorporating absolute timestamps, and designing graph-aware pre-training objectives for sequence models.

Summary updated

BibTeX
@inproceedings{chen2025bridging,
  author = {Yuen Chen and Yulun Wu and Samuel Sharpe and Igor Melnyk and Nam H. Nguyen and Furong Huang and C. Bayan Bruss and Rizal Fathony},
  title = {{Bridging the Divide: End-to-End Sequence-Graph Learning}},
  booktitle = {NPGML @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=xa7WxSc08h},
}
Figure