You open your phone, type a couple words, and soon enough you have a Lyft ride to your destination. The process is supposed to feel effortless — as if a friend is picking you up. As principal software engineer Jason Laska, on Lyft’s mapping team, explains: “When it's working, it's invisible. Getting it right means nobody notices that you're doing it.”
This seemingly simple process is powered by sophisticated machine learning algorithms. Here’s a peek under the hood showing how Lyft leverages machine learning to generate faster, more accurate routes and more convenient pickup spots — and to even predict where you want to go.
Getting Accurate ETAs
Accurately predicting estimated times of arrival (ETAs) is more than just a matter of convenience: It’s crucial to managing Lyft’s complicated network. After all, if the system doesn’t know how long it will take a driver to reach a pickup point, it can’t determine which driver to pair with each rider. Minimizing this amount of time across all rides — quickly and continuously — helps make the system as efficient as possible.
This is where machine learning comes in. It learns from aggregated data of past rides to determine precisely how long a driver’s journey will take, from request to drop-off. For example, a ride that goes through a traffic-heavy section of an urban downtown will have a different ETA when called on a Thursday afternoon than a Sunday morning. The algorithms consider real-time data, too. Let’s say a Lyft ride is moving 10 mph slower than usual. The model will understand there’s likely heavy traffic, and use that to calculate the ETA of the current ride, informing the ETA of upcoming rides along the same route. As Laska explains, “Seasonality, changes to the road, changing customer behaviors, all of those things impact predictions.”
But not all inputs are considered equal. For instance, ETA models had to discount a lot of historical data when adapting to new traffic patterns during the pandemic, and will remain in flux as companies require employees to return to the office. Choosing what data the machine learning algorithms should consider — and what to disregard — is one of the tasks of Lyft’s technical team.
In 2019 Lyft engineers also helped build Lyft’s own in-app maps, which generated more rideshare-specific data points for the algorithm to learn from. For example, drivers tend to slow down when picking up and dropping off their passengers as they scan for a safe place to stop the car. Lyft knows when the cars are in pick-up and drop-off mode and can account for that when predicting average speed.
All this work has paid off. According to Lyft’s mapping data science manager Serdar Colak, when it comes to ETAs, “We're pretty darn accurate, and we've been getting continuously better at it over the years.” In San Francisco, Lyft’s average pickup ETA is accurate to within a minute, and the average dropoff ETA is accurate within two.
Optimizing routes
Lyft’s algorithms don’t just estimate how long it will take a driver to reach a destination — they can also help find the fastest route based on current conditions. Lyft ingests real-time data from many of its drivers, giving it an up-to-the-minute snapshot of some of the most heavily used roads in the country. All that data helps Lyft adapt its routes quickly. Suppose a tree falls down, blocking a popular road. Lyft will sense that riders are no longer traveling there, conclude the road is closed, and provide a route around it. When cars begin traveling the road again the model will recognize it must have reopened, returning to its original route recommendations.
Laska mentions that the same process often occurs when cars get stuck in complicated pickup areas, like apartment complexes, which often have rules about which way cars can go. “We see them turning around and doing weird U-turns. We detect all that stuff.” And when the model registers these patterns, Lyft prompts the driver to learn more. “We actually ask the driver while it's happening, with a ‘yes’ or ‘no.’ Like, did you encounter a gate here?” Such information helps improve the route when unfamiliar drivers encounter the building in the future.
Selecting the right destination
You may have noticed that when you begin typing a destination into the Lyft search box a list of suggestions pop up. Lyft pulls those recommendations from its vast database of destinations, which is built not by armies of people but, yes, machine learning algorithms making predictions based off of customers’ locations and past behaviors. On a Friday evening, the app might suggest a bar that you often visit on the weekends. But on a Tuesday, it might prompt your favorite weeknight taco spot. According to Lyft engineer Murat Aydos, this technology has become so sophisticated it can predict your destination about 60 to 70 percent of the time.
What happens if you’re headed to a brand-new restaurant? As you type in the unfamiliar name and no destination appears in the app, you’re likely to look the address up online and paste it into the search box. Lyft’s algorithms register this activity, and alert Lyft employees that there’s a new destination to add to the database — and once it’s there, you won’t have to hunt it down again.
Coordinating rider pickup
While most users get picked up from wherever they order a ride, some destinations, like malls or hospitals with multiple exits, require a bit more guidance.
Suppose you’re ordering a ride after getting out of a concert at a big venue, a particularly complex pickup destination with crowds, cab stands, and busy surrounding streets. Phoning or texting your driver to find the right meeting spot can be distracting, or even dangerous, for drivers. So Lyft has designed the pickup pin in the app to suggest the most common pickup point, since it’s probably one of the most intuitive and convenient spots for rider and driver to meet.
Historical behavior also helps Lyft route drivers and passengers toward pickup spots that avoid dangerous U-turns or inconvenient hills. When riders clearly avoid going to a certain spot to be picked up, the model can infer it is not ideal and avoid that location going forward.
In the future, Lyft won’t just help riders and drivers figure out where to meet each other, but when. Take airport pickups. Riders often don’t know how long it will take to navigate customs, security, and baggage claim, and so are often forced to delay ordering a ride until they are almost at the pickup spot, and then must wait for it to arrive. But a new preorder experience in airports like LAX and JFK allows passengers to book their rides as soon as they deplane. An algorithm estimates riders’ walking times to the pickup area from wherever they might be when opening the app. As Lyft’s machine-learning models adapt over time, this process will only get smoother.
But sometimes, using machine learning intelligently means knowing when it’s not necessary. Right now, for instance, Lyft doesn’t rely on machine learning alone to inform the drop-off location. That’s because the rider is right there in the car and can direct the driver to the right spot. Sometimes the best answer is not AI, but good old person-to-person dialogue.