Loading…

Visual discovery platform that helps people find, save, organize, and share ideas and inspiration.
- 13 posts summarised
- latest
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
From their blog
Latest articles
Evolving Pinterest’s Embedding Retrieval Platform
Pinterest describes how its Manas distributed search platform is evolving embedding retrieval for a corpus growing toward tens of billions of embeddings. Traditional HNSW indexes require all data in RAM, while single-vector two-tower retrieval limits context-dependent relevance, motivating changes across quantization, SSD-based serving, and multi-embedding retrieval. Manas uses Scalar Quantization and Product Quantization across HNSW and IVF, with SQ preserving over 90% recall while reducing index size, and Linear Scaling plus SIMD cuts per-query computing resources by 10–15%. For disk-based serving, SPANN with PQ is reported as 4.5x faster than plain SPANN and over 3x DiskANN QPS, while a five-billion-embedding production evaluation saved over 40% CPU time with under 5% recall drop. The platform is also adding ColBERT-style late interaction using Sum of MaxSim, with a pilot in progress.
Building Pinterest’s VLM Serving Stack on NVIDIA Dynamo
Pinterest describes building a VLM serving stack on NVIDIA Blackwell B200 GPUs and NVIDIA Dynamo for multimodal products including Pinterest Assistant, hybrid search, multimodal reranking, content understanding, signal generation, and content safety. Unlike text-only workloads, requests may contain thousands of images, costly and variable prefill, long multi-turn histories, and large KV caches, making preprocessing, routing, memory, and latency central serving concerns. The implementation combines Dynamo's distributed orchestration, multimodal frontend and vLLM support, KV-aware routing, disaggregated encoder/prefill/decode serving, and LMCache-based KV offloading with vLLM, an OpenAI Chat Completions interface, model-aware routing, EKS, and custom deployment components. Production-oriented AIPerf DAG benchmarks model QPS patterns, multi-turn conversations, many-image requests, and agentic DAGs; the team concludes that payload design, cache-aware routing, offload tiers, and a shared platform are essential to meeting product targets and accelerating new launches.
Becoming an AI Team
Becoming an AI team requires more than adding assistants to existing workflows: it changes ownership, planning, roles, and execution. At Pinterest, infrastructure teams face the scale of serving billions of Pins, boards, ads, and real-time signals, making AI adoption an operational necessity for reliability, cost efficiency, and developer productivity. AI code-generation and transformation models can turn a widespread legacy-codebase refactor, such as replacing “foo” with “bar,” from a months-long effort into work completed and verified in a week or less. As routine execution is increasingly augmented or automated, engineers, product managers, and designers are expected to spend more time on strategy, problem definition, and user validation, while managers emphasize vision, trade-offs, mentorship, and collective impact. The conclusion is that teams must continuously optimize an AI-driven operating system rather than treat AI as a side project.
Scaling Conditional Learned Retrieval for Pinterest Home Feed
Pinterest home feed candidate generation relies on large-scale retrieval, but standard two-tower models produce single embeddings that struggle to capture diverse concurrent user intentions. To solve this, Pinterest expanded Conditional Learned Retrieval (CLR) to generate condition-aware embeddings conditioned on explicit interest, Pin, and Board contexts. The team evolved model representations by appending condition tokens to user sequences in transformers, integrating the PinFM foundation model, and introducing hierarchical semantic IDs to improve cold-start coverage. On the serving side, engineers consolidated duplicate feature requests and shifted inference to GPU instances using NVEmbed under a one-query-to-many-documents paradigm. These infrastructure and modeling changes unlocked new condition types, achieved seven-figure cost savings, and reduced p90 model retrieval latency from 80ms down to 12ms.
Pinner Progression: Better Use-Case Representation Driving Weekly Active User Growth at Pinterest
Pinterest designed the Pinner Progression initiative to shift its home feed recommendation pipeline from short-term engagement optimization toward long-term user retention. Standard ranking systems model user actions as immediate sequential features, failing to capture the evolving lifecycles of distinct user habits. To address this gap, the platform introduced User Interest Clusters (UICs), which cluster a user's engaged Pins in OmniSage embedding space using dynamic cluster counts and stateful lifecycle metadata. Pinterest integrated a UIC-aware penalty directly into Sliding Spectrum Diversity (SSD) scoring by matching Pin embeddings to cluster medoids via cosine similarity. Online experiments demonstrated that balancing use-case representation increased interaction diversity, extended session lengths, and delivered meaningful engagement gains across the platform.
Securing Infrastructure at Scale: Introducing Pinterest’s Resource Provisioner Pipeline (RPP)
Managing Infrastructure as Code across distributed repositories presents significant security and operational challenges. Pinterest developed the Resource Provisioner Pipeline (RPP), a proprietary Terraform execution engine, to securely deploy and manage AWS infrastructure across hundreds of workspaces. The pipeline utilizes centralized GitHub composite actions triggered by pull request events and enforces dual human approvals. To maintain least privilege, RPP uses GitHub OpenID Connect authentication to assume a central identity before validating repository paths and down-scoping to specific team execution roles. Automated checks include backend state validation, linting, plan generation, Semgrep static analysis, and optional LocalStack testing before deliberate comment-driven deployments execute.
Achieving Near-Linear Training Scalability for Pinterest’s Foundation Models
Pinterest’s foundation ranking models store approximately 99% of their parameters in embedding tables, causing cross-node NCCL all-to-all communication to severely bottleneck multi-node distributed training. Initial multi-node scaling stalled at 1.21x on four nodes even after adopting AWS Elastic Fabric Adapter for OS-bypass networking. To resolve this, engineers profiled GPU activity with PyTorch Profiler and systematically addressed communication bottlenecks across multiple layers. The team implemented FP8 quantized communications using FBGEMM, balanced table sharding across GPUs, halved embedding dimensions while doubling row counts, and adopted a 2D parallel communication topology alongside PyTorch Distributed Checkpoint. These combined interventions achieved near-linear scaling factors of 3.9x on four nodes and 7.5x on eight nodes across 64 GPUs.
Automated Schema Evolution in Pinterest’s Next-Generation DB Ingestion Framework
Pinterest's CDC ingestion platform relies on a multi-stage pipeline built with Kafka, Flink, Spark, and Iceberg, where upstream schema updates risk disrupting data transformations and offline storage. To prevent pipeline failures and schema drift, Pinterest introduced an automated schema evolution framework based on a staged convergence model. Upstream changes are detected via push-based DDL messages and daily pull-based validation checks. The workflow automatically restricts automated updates to additive changes and numeric precision widening, updating Iceberg table definitions and regenerating Flink and Spark code through auditable pull requests. By decoupling schema divergence, code deployment, and data convergence, the system maintains continuous ingestion availability while working toward eventual schema consistency across all storage layers.
Making User-Sequence Data More Cost-Efficient, Faster, and Easier to Use
User sequences serve as core primitives powering machine learning models across ranking, retrieval, and recommendation surfaces at Pinterest. Managing these sequences previously caused high infrastructure costs, operational fragility, and data drift between offline training pipelines and online serving systems. In response, engineering teams redesigned the platform around a single definition executed across multiple runtimes, including real-time streaming, batch backfills, and online inference. The updated architecture pairs a unified enrichment engine with columnar time-partitioned storage and standardized validation tiers. Consequently, the redesign achieved lower storage and network costs, faster signal onboarding via configuration, and improved engagement metrics across major recommendation surfaces.
An Engineer’s Guide to Better AI Skills: Implementing a Testing Process to Optimize Agent…
Software engineers deploying AI agents often encounter unreliable skill invocation for repository-specific architectures, such as Pinterest's iOS framework. To quantify and resolve this issue, a Bash test harness piped positive and negative prompts into Pin-agent and Claude Code while parsing streamed JSON logs for execution signatures. Initial vanilla benchmarks yielded baseline accuracies of 73% for GPT 5.2-codex and 62% for Opus 4.5 Claude. Optimizations such as expanding YAML frontmatter descriptions with architectural context, utilizing capitalized imperative directives, and adding reference tables in AGENTS.md raised invocation rates. Both agents reliably loaded skills when prompts contained explicit invocations, demonstrating that empirical testing paired with descriptive prompting stabilizes agent skill adoption.
Enhancing Ad Relevance: Integrating Real-Time Context into Sequential Recommender Models
Pinterest's sequential ads candidate generator inferred user embeddings offline from historical offsite conversions, which lacked real-time browsing context. Consequently, less than 1% of impressions on the Related Pins surface were attributed to this generator because its retrieved candidates struggled in downstream ranking. To resolve this limitation, engineers developed the Contextual Sequential Two Tower Model, integrating a context layer directly into the query tower alongside user demographic features. Offline training utilized synthetic context derived from positive conversion labels paired with high dropout rates to preserve sequence reliance, while serving split into offline Transformer inference and online context computation. Offline evaluations showed a 3x to 10x increase in Recall@K, and production deployment lifted median candidate relevance by 275% to 300% and overall ROAS by approximately 0.7%.
Optimizing ML Workload Network Efficiency (Part I): Feature Trimmer
Pinterest deployed a root-leaf architecture for online machine learning serving to decouple CPU-based feature preprocessing from GPU-based inference. Because the root cluster retrieved a union of features across models and fanned out the full set to every leaf, network bandwidth became a severe bottleneck. After initial tests with fbthrift LZ4 compression yielded a 20% bandwidth reduction at the cost of CPU and latency overhead, the team implemented Feature Trimmer. This mechanism uses exported model signatures as the source of truth to prune unused features on the root before transmission. By dispatching only required features per model, the system reduced network bandwidth, decreased latency, and enabled cluster rightsizing that saved over $4M annually.
From Clicks to Conversions: Architecting Shopping Conversion Candidate Generation at Pinterest
Pinterest built a dedicated shopping candidate generation model to optimize for lower-funnel purchase conversions rather than relying strictly on engagement retrieval models. Because offsite conversion events are sparse and delayed, engineers trained a single multi-surface two-tower model using conversion data supplemented by duration-weighted click engagement and unengaged ad impressions as hard negatives. The two-tower retrieval architecture incorporates a parallel DCN v2 and MLP layer structure that allows simultaneous learning from the same inputs without information bottlenecks. Later revisions transitioned the system from a multi-head loss structure to a unified single-head multi-task architecture paired with an advertiser-level objective. Deployed across more than 600 million monthly active users, the system increased shopping conversion volume by 2.3% and boosted return on ad spend by 3.1% for United States shopping campaigns.
Topics they write about
All topics →Weekly digest
The best engineering reads, once a week.