Back office ops · Production

Lyft builds graph-based embeddings to capture rideshare interaction patterns for ML

The problem

Representing complex rideshare interactions between riders, drivers, locations, and time using traditional features required sparse, high-dimensional histograms—a vector of over 9,000 entries per driver for location history alone—making the representation impractical for ML models.

Workflow diagram · grounded in source
1
Graph construction from ride data
trigger
“we can construct graphs representing these interactions (e.g. a graph can be formed by connecting a rider with all the locations they have visited)”
2
Embedding training via PyTorch BigGraph
ai_action
“Our training algorithm extends from the Pytorch BigGraph package. At the beginning of training, we specify the d dimensions of embedding vectors we want to obtain, and the algorithm assigns random values to these d-dimensional embedding …”
3
Positive and negative sampling
ai_action
“During each training cycle, for each entity, every edge connected to the entity in the original input graph is considered a positive (+) instance, while the algorithm randomly samples from the unconnected entities for negative (-) instan…”
4
Similarity score computation
output
“we calculated the similarity between every pair of driver and Gh6. In this example, similarity would signal how frequent a driver has picked up rides from a Gh6 location”
5
Embeddings served as ML features
output
“We plan to maintain fresh embeddings for the most interesting entities in the Lyft marketplace and make them available as easily accessible features for many common use cases”
Reported outcome

Graph-based embeddings compactly represent driver and rider patterns in low-dimensional vectors, revealing insights such as weekend versus weekday driver clusters; Lyft is building an Embeddings Platform to make these features available to ML modelers across the company.

Reported metrics
Embedding dimension vs. original feature spacerich picture of the drivers' ride patterns with just a 32-dimensional vector
Reported stack
Pytorch BigGraphAdagrad
Source
https://eng.lyft.com/lyft2vec-embeddings-at-lyft-d4231a76d219
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

Graph-based embeddings compactly represent driver and rider patterns in low-dimensional vectors, revealing insights such as weekend versus weekday driver clusters; Lyft is building an Embeddings Platform to make these…

What tools did this team use?

Pytorch BigGraph, Adagrad.

What results were reported?

Embedding dimension vs. original feature space: rich picture of the drivers' ride patterns with just a 32-dimensional vector (source-reported, not independently verified).

How is this back office ops AI workflow structured?

Graph construction from ride data → Embedding training via PyTorch BigGraph → Positive and negative sampling → Similarity score computation → Embeddings served as ML features.