Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Lyft Engineering 8 min read Deep dive mediumAdept

Predicting Rider Conversion in Sparse Data Environments with Bayesian Trees

Lyft predicts whether a rider will request a ride after seeing price and ETA using "Bayesian trees": a hierarchy of contexts such as city region, time of day and supply-demand balance, where every node holds the same simple parametric model. Training runs top-down, and each child's parameters carry an L2 penalty toward its parent's (a Gaussian prior). Sparse leaves therefore fall back to the broader parent's behavior, and nodes with more data can specialize. The regularization strength is tuned to the relative data sizes of parent and child. Keeping per-node models simple, such as logistic regression with sign-constrained weights, enforces monotonic, explainable relationships while keeping inference low-latency compared with gradient boosted trees that overfit sparse slices or heavier neural models.

Assumes: logistic regressionL2 regularizationBayesian priors

Related posts

  • Smooth Cruiser at Lyft: Built for Safety and Transparency

    Lyft Engineering easyNovice

    Smooth Cruiser scores Lyft Drivers on braking, steering, speed and mounted-phone use relative to what is typical for the same road segment, time of day, day of week and season, rather than against fixed universal thresholds. Drivers are ranked within k-means clusters of markets with similar event-rate characteristics, using a rolling window of their last 100 rides over 12 months (minimum 20 rides) to balance stability against responsiveness. ML models detect harsh events from up to ~135 GB/hour of phone telemetry, a daily Airflow-managed ETL enriches rides with location-based expected-risk maps and calibrates scores, and results are served from DynamoDB. Per-signal detail pages let Drivers trace score changes back to specific rides.

  • Refreshing the Travel-Time Map Behind Lyft’s Marketplace: Rebuilding Neighborhood Reachability…

    Lyft Engineering mediumAdept

    Lyft rebuilt its Neighborhood Reachability Signals, precomputed geohash-6 travel-time matrices that define the graph its pricing engine optimizes over. Much of the data dated from 2018–2019, underestimated ETAs and dropped matchable pairs. The redesign filters cells against drivable geohashes derived from road-segment interpolation, which removes cells over water. It also uses gentler session-based pruning, with new regions starting from the full drivable set, and adds consumer-facing fields such as rider-session density, so teams no longer need their own allowlists and denylists. ETAs blend historical trips with routing simulation for sparse pairs. A two-week time-split pricing test showed fewer phantom nearby drivers and more genuine medium-range matches. Next steps are a six-month refresh cadence and nine time-of-week ETA files per region, prefetched to keep read latency flat at the cost of extra memory.

  • Teaching LLMs to reason like Bayesians

    Google Research easyNovice

    Off-the-shelf LLMs fall well short of an optimal Bayesian assistant in a multi-round flight recommendation task, often plateauing after one interaction instead of updating beliefs about user preferences. Fine-tuning models such as Gemma and Qwen to mimic the Bayesian assistant's predictions (Bayesian teaching) beats fine-tuning on oracle-correct answers. It reaches about 80% agreement with the Bayesian model and transfers to unseen domains like hotel recommendations and web shopping. The results suggest supervised distillation of a symbolic probabilistic model can teach LLMs generalizable belief-updating skills.

  • Scaling Model Evaluation at Pinterest with Ray (Part 4)

    Pinterest Engineering mediumAdept

    Pinterest fused model-evaluation metric computation into its Ray batch inference jobs, removing the separate Spark/Ray metrics job and the write-predictions-to-S3-then-reread handoff. The fusion relies on a metric contract (preprocess, compute partials per batch, reduce partials) that covers decomposable metrics like MAE, holistic metrics like ROC-AUC (approximated via per-threshold confusion matrices), and group-wise metrics like Precision@K. Group-wise metrics use Spark to pack complete segments into buckets so no segment spans a bucket. Overlapping CPU metric work with GPU inference via Ray's shared object store cut end-to-end evaluation time by 25–32% at 100 feature-importance experiments, with runtime scaling linearly in experiment count.

  • How we knew COVID was over (and what our models had to unlearn)

    Airbnb Engineering mediumAdept

    Airbnb's forecasting team splits "retrain" into three distinct decisions: refit (same model, new data), respecify (change structure, features or priors), and hold (leave the model alone). Each one has a matching failure: refitting on one-off spikes, carrying stale COVID-era assumptions through routine refits, and rebuilding in panic after temporary shocks such as FX swings. The triage rule is to hold if the miss sits inside the model's normal range, respecify if errors are one-sided and persistent or refits go unstable, and otherwise refit. In the COVID recovery, refitting a hierarchical pooled model left error about 3x the pre-shock baseline. Respecifying it to borrow strength by geographic adjacency and shared recovery dynamics cut error by over half.

The quest for software engineering knowledge.

Look:
Layout: