Pinterest engineering blog

Loading
How Pinterest Improved Analytics Agent Compliance with Loop Engineering
Pinterest Engineering describes how it improved compliance of its Analytics Agent, which must decide which procedural rules apply to each question. The team built paired required and skip test suites, moved from persistent sessions and memoryless Ralph Wiggum loops to fresh contexts with structured handoffs, and used a repair/break gate, acceptance critic, and regression guard to accept only safe edits. The post also notes that case-level flip rates of about 10% can hide real variation behind...
Safe and Efficient Multi-Epoch Embedding Training
Pinterest Engineering describes how it enabled multi-epoch fine-tuning of large ID embedding tables in its Homefeed ranking model, which had previously regressed about 6% in offline save metrics. The post traces the overfitting to the embedding table through gradient-isolation experiments and shows that freezing the table early and adapting it later works. It also covers a semi-synchronous lookup pipeline and kernel-level optimizations that reduced GPU idle time during longer training.
Scaling Model Evaluation at Pinterest with Ray (Part 4)
Pinterest Engineering describes a fused model evaluation platform built on Ray that computes metrics per batch during inference instead of in a separate Spark job, avoiding S3 serialization and cluster startup overhead. The post explains a decomposable metric contract, why global ROC-AUC cannot be averaged across batches, and how group-wise Precision@K uses bucketing of complete segments. Benchmarks show 25-32% wall-clock reduction at 100 experiments with runtime growing linearly in experiment...
Introducing ModuleLens: Zooming into PyTorch Modules for Human and Agentic Engineering
Pinterest Engineering introduces ModuleLens, a framework that captures PyTorch module inputs, outputs, weights, and init arguments via forward hooks and import patching, storing them in a W&B-backed registry so individual modules can be reconstructed and profiled locally without full multi-GPU initialization. The post covers the ModuleTracer, ModuleRepo, and consumption layer design, including shape-only tracing for large tensors, and describes internal use cases such as training bottleneck...
From Activity to Intent: Generating User Journeys with LLMs
Pinterest describes replacing a multi-stage clustering pipeline with a fine-tuned 4B Qwen LLM that infers ranked user journeys from chronological activity. The post covers prompt design, teacher-student distillation, safety filtering, GPU serving optimization, evaluation, and feedback-based preference tuning at notification scale.
Metrics Board: Building an Agent-ready Metrics Layer
Pinterest engineers describe Metrics Board, a governed metrics layer that turns version-controlled YAML definitions into scheduled Airflow pipelines, quality checks, catalog entries, dashboards, and experiment integrations. The platform also exposes structured metadata through an MCP server so analytics agents can discover and reason over trusted metrics.
Beyond Two Towers: Launching the 3-Tower Engagement Co-Train Model (Part 2)
Pinterest engineers describe a three-tower co-training architecture that combines cached two-tower scoring with cross-attention refinement for large-scale ad ranking. The post details multi-task modeling, BF16 and serving optimizations, two-stage candidate selection, and online gains achieved within tight latency and cost constraints.
Evolving Pinterest’s Embedding Retrieval Platform
Pinterest explains how it evolved the Manas embedding retrieval platform for tens of billions of vectors. The post details quantization trade-offs, SSD-based SPANN serving, SIMD optimizations, and multi-embedding late-interaction retrieval, including measured impacts on recall, latency, memory, CPU usage, and cost.
Building Pinterest’s VLM Serving Stack on NVIDIA Dynamo
Pinterest details how it built a production vision-language model serving platform on NVIDIA Dynamo, vLLM, Blackwell GPUs, and Kubernetes. The post covers disaggregated serving, multimodal KV-aware routing, cache offloading, projection embeddings, realistic agentic benchmarking, and substantial latency improvements.
Becoming an AI Team
Pinterest’s John Grass explains how AI changes engineering-team operating models, expanding capacity while making prioritization, strategic thinking, and problem definition more important. He outlines evolving manager responsibilities, practical uses of AI agents in infrastructure, and leadership practices for experimentation, learning, and psychological safety.
Scaling Conditional Learned Retrieval for Pinterest Home Feed
Pinterest engineers explain how Conditional Learned Retrieval scales personalized home-feed candidate generation beyond two-tower retrieval. The post covers condition-aware sequence modeling, semantic IDs, unified routing, training optimizations, GPU serving, and an 85% reduction in p90 latency.
Securing Infrastructure at Scale: Introducing Pinterest’s Resource Provisioner Pipeline (RPP)
Managing infrastructure as code at Pinterest’s scale requires strong security guardrails, and this post introduces Resource Provisioner Pipeline (RPP) as a centralized Terraform execution engine. It explains how RPP uses dual controls, workspace-to-role mapping, OIDC-based role chaining, and GitHub Actions to safely plan and apply AWS infrastructure changes across many repositories.
Achieving Near-Linear Training Scalability for Pinterest’s Foundation Models
Pinterest describes how it scaled embedding-heavy foundation model training from poor multi-node performance to near-linear throughput across 2, 4, and 8 nodes. The post walks through a sequence of optimizations including quantized communications, balanced sharding, bandwidth-aware embedding changes, and 2D parallel topology redesign, plus supporting infrastructure upgrades.
Making User-Sequence Data More Cost-Efficient, Faster, and Easier to Use
Pinterest redesigned its user-sequence platform to make enriched event sequences cheaper to run, faster to extend, and easier to debug. The post covers a one-definition, many-runtimes architecture, configuration-as-code, a shared execution engine, lambda-style batch and streaming paths, and columnar time-partitioned storage.
Enhancing Ad Relevance: Integrating Real-Time Context into Sequential Recommender Models
Pinterest Engineering describes a contextual sequential two-tower recommender designed to improve ad relevance by combining historical user behavior with real-time page context. The post explains the model architecture, synthetic context-based training, and hybrid offline/online inference flow, and reports meaningful gains in candidate survival, relevance, recall, and ROAS.
Optimizing ML Workload Network Efficiency (Part I): Feature Trimmer
Guangtong Bai, Shantam Shorewala, Chi Zhang, Neha Upadhyay, and Haoyang Li describe how Pinterest reduced root-to-leaf ML serving network bottlenecks by first enabling compression and then introducing Feature Trimmer to send only the features actually used by each model. The post covers model-signature-based allowlisting, deployment synchronization, versioned fallback, and the resulting latency, bandwidth, and infrastructure cost savings.