AIResearch AIResearch
Back to articles
Science

AI Learns to Read Both Stories and Connections

AI can now read between the lines to predict friendships and stop fraud. See how this new approach combines personal behavior and social networks for unprecedented accuracy.

AI Research
November 14, 2025
2 min read
AI Learns to Read Both Stories and Connections

A new artificial intelligence method can now analyze complex data that contains both sequences of events and relationships between entities, addressing a fundamental limitation in how machines process real-world information. This breakthrough matters because most human activities—from social media interactions to online shopping—involve both time-ordered actions and social or transactional connections, yet current AI systems typically handle only one aspect at a time.

The researchers developed RIDGE, an AI architecture that jointly learns from sequences and graphs without compromising either data type. Unlike previous approaches that either compressed sequence information into single vectors or forced all events into graph structures, RIDGE maintains the full detail of event sequences while simultaneously modeling how different entities connect through relationships.

The method works through two key components: a sequence encoder that processes ordered events, and a novel token-level cross-attention mechanism called XATTN that allows events from one sequence to directly interact with events from connected sequences. This enables the AI to consider how a user's recent actions might be influenced by their friends' activities, for example, while preserving the exact timing and order of those actions.

Experimental results demonstrate substantial improvements across multiple domains. In friendship prediction using Brightkite location data, RIDGE achieved 92.9% accuracy in identifying likely connections, compared to 72.7% for the best previous method. For fraud detection on Amazon review data, the system reached 80.0% precision-recall area under curve, significantly outperforming graph-only approaches (44.9%) and sequence-only methods (75.6%). These gains persisted across Amazon's Musical, Clothing, and Electronics categories, showing the method's broad applicability.

This advancement matters because it more closely mirrors how humans naturally process information—we consider both what happens and who's involved. For everyday internet users, this could mean more accurate product recommendations that understand both your purchase history and your social connections, or better fraud detection that spots suspicious patterns across both individual behavior and network relationships. Online platforms could use this technology to create more personalized experiences while maintaining privacy, since the system learns patterns rather than storing sensitive raw data.

The approach does have limitations. It doesn't currently use exact timestamps, focusing only on event ordering rather than the actual time gaps between actions. This means it might miss patterns that depend on specific timing intervals. Additionally, the cross-attention mechanism becomes computationally expensive with very long sequences, potentially limiting applications to extremely high-volume data streams without further optimization.

About the Author

Guilherme A.

Guilherme A.

Former dentist (MD) from Brazil, 41 years old, husband, and AI enthusiast. In 2020, he transitioned from a decade-long career in dentistry to pursue his passion for technology, entrepreneurship, and helping others grow.

Connect on LinkedIn