Message passing features in embeddings

5 views
Skip to first unread message

Andre Ostrovsky

unread,
Aug 18, 2026, 11:27:10 PM (6 days ago) Aug 18
to GraphFrames
Hello,

Apologies for the novice questions. I'm trying to understand how features created with message passing interact with Word2Vec/Hash2Vec embeddings.

1. Say I create features at each vertex by aggregating some attributes from its neighbors within 3 hops. Will these features be used in creating the embeddings? Or will the features be used if I enable neighbor aggregation (sampling convolution)?
2. In a nutshell, what's the difference between aggregateMessages, aggregate_neighbors, and Pregel? Are these different style APIs for the same functionality or are they intended to solve different problems?

Thanks.

Sem

unread,
Aug 19, 2026, 3:17:56 AM (6 days ago) Aug 19
to Andre Ostrovsky, GraphFrames
Hello!

1. No, they won't. An approach is based on random walks: it simulates multiple parallel "random walkers" that traverse along the edges. At the end, we have multiple walks represented as sequence. After that we use an approach from natural language processing (either w2v or h2v) and transform these sequences to embeddings.
2. Aggregate Messages is a single (1-hop) aggregation neighbors of vertices. Aggregate Neighbors is a multi-hop traversal with aggregation. Pregel is a "think-like-a-vertex" programming paradigm. You can think about AM as something similar to one step of Pregel. AN is different from both.

Best regards,
--
You received this message because you are subscribed to the Google Groups "GraphFrames" group.
To unsubscribe from this group and stop receiving emails from it, send an email to graphframes...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/graphframes/3fd93870-176b-4f96-8d4d-d1ab11f6f24fn%40googlegroups.com.

Andre Ostrovsky

unread,
Aug 19, 2026, 4:26:16 PM (5 days ago) Aug 19
to GraphFrames
Thanks so much for the explanation. Small follow up:
Can one use aggregate_neighbors to generate features for the starting vertex rather than the target?
Meaning that the feature for vertex k is the aggregation of all n-hop neighbors of k. An example of this is mercury.graph.ml.GraphFeatures. I ask because the docs say that the id column in the returned dataframe represents the target vertex.

Sem

unread,
Aug 19, 2026, 4:54:17 PM (5 days ago) Aug 19
to Andre Ostrovsky, GraphFrames
Docs is slightly misleading. The story is the AN accepts `starting_vertices`: if you want to generate aggregations of the limited subset of nodes. And the "target" here means the "vertex from the requested set". Long story short, it is a starting vertex id.

P.S. There is also this one: https://graphframes.io/api/scaladoc/org/graphframes/convolutions/SamplingConvolution.html that is not exposed to the Python right now but it is easy to expose it. Feel free to open an issue if you think this may help.

Russell Jurney

unread,
Aug 19, 2026, 5:04:32 PM (5 days ago) Aug 19
to Sem, Andre Ostrovsky, GraphFrames
This tutorial on Pregel that is about to ship might be helpful to learn more about AggregateMessages and Pregel interfaces and how to “think like a vertex.”

Russell

--
You received this message because you are subscribed to the Google Groups "GraphFrames" group.
To unsubscribe from this group and stop receiving emails from it, send an email to graphframes...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages