Weight Coding: Evolving Web-Scale Recommenders through Direct Weight Edits with LLM Agents was submitted to arXiv on 2026-11-22 by Junpeng Hou, Jiaxing Qu, Derek Cheng, Jaewon Yang, Abhinav Naikawadi, Karthik Subbian. Read it on arXiv or as a PDF.
Key findings
- On Pinterest’s 147M-parameter Image Search two-tower retriever, direct weight edits and parameter searches executed by an Opus 5.5 LLM agent increased held-out recall@10 by up to 15.0 percentage points (+24% relative) in roughly one-quarter of the GPU hours needed for a full post-training fine-tune.
- Resetting specific layer normalization parameters alone raised held-out recall@10 by 10.1 percentage points on the Pinterest Image Search retriever, and even after randomly reinitializing the entire 13.6M-parameter DHEN interaction module, searching 2,448 mixing and normalization parameters achieved 9.8 recall@10 points above the production model.
- Single-coefficient steering edits to the retrieval head bias shifted the share of fresh Pins (at most 28 days old) in the top-10 results from 2% to 70%, while a separate product direction moved product Pin exposure up to 39% at the tested maximum.
- In online A/B tests on roughly 10 million Pinterest users per group over about one week, save-oriented weight edits increased saves per user from the edited two-tower retrieval source by 8.4% to 10.7% without changing serving infrastructure.
- The authors observed offline metric gains across Pinterest’s broader recommendation funnel, including a +2.3 point unordered recall@1 improvement on the PinRec generative retriever via bias edits and checkpoint interpolation, and daily ranking gains on a 1.37B-parameter ranker by weakening expert layers.
The main takeaway. On Pinterest’s production recommender models, an LLM agent can substantially alter retrieval recall, item freshness, product exposure, and user saves by directly editing a small fraction of model parameters rather than running full gradient-based retraining.
The abstract, as written
Web-scale recommender models evolve primarily through retraining or fine-tuning. We propose \emph{weight coding}, a methodology for model evolution through direct, executable weight edits. A large language model (LLM) agent inspects model structure and parameters, formulates hypotheses, and implements edits using evaluation feedback. The loop progresses from localized changes to targeted searches and composition, allowing edited components to adapt to one another. A cached engine enables rapid forward evaluation without backpropagation. On Pinterest’s 147M-parameter Image Search two-tower retriever, weight coding improves held-out recall@10 of production model by up to 15.0 percentage points (+24% relative) with few edits in about 1/4 GPU hours of a full post-training finetune, while a common launch only improves around 1%. After reinitializing the entire 13.6M-parameter interaction module randomly while retaining the surrounding trained model, searching 2,448 mixing and normalization parameters yields 9.8 points above production. Offline gains span the full funnel including dense retrieval, generative retrieval and ranking, with up to 1.37B learnable parameters and different edits for each architecture. Steering edits provide explicit control of model performance over segments like freshness and product. Weight coding requires no serving change and online A/B tests increase saves per user from the edited retrieval source by 8.4% to 10.7%, aligned with the target business objectives. Our results establish weight coding as a practical and useful tool for model development and and behavioral control in a real web-scale production system, with potential to extend to both pre-training and post-training stages across the funnel.
Key terms
- Weight coding: A gradient-free model development method where an LLM agent inspects a neural network’s structure and parameters, proposes direct numerical edits to specific weights, and refines those edits using evaluation feedback.
- Two-tower retriever: A recommendation architecture that encodes user queries and candidate items into separate vector representations so millions of items can be retrieved quickly via similarity search.
- DHEN interaction module: Deep Hierarchical Ensemble Network, a neural network component inside Pinterest’s query tower that combines multiple feature interaction branches and normalization layers.
- Activation and weight steering: Adding a scaled concept direction vector (such as the difference between fresh and non-fresh item embeddings) to a model’s bias or hidden states to shift output exposure toward target attributes.
- Recall@10: An offline retrieval metric measuring the proportion of relevant engaged items that appear within the top 10 candidates returned by the retriever.
From the paper
This passage reports the main offline recall@10 improvement and compute cost on Pinterest’s Image Search two-tower retriever.
On Pinterest’s 147M-parameter Image Search two-tower retriever, weight coding improves held-out recall@10 of production model by up to 15.0 percentage points (+24% relative) with few edits in about 1/4 GPU hours of a full post-training finetune, while a common launch only improves around 1%.
This passage explains how adjusting a single steering coefficient controls the share of fresh and product Pins in the top-10 retrieved results.
Fresh share in the top-10 spans 2% at to 70% at , while product share reaches 39% at . Strong product steering also concentrates results. The share of the top-1% most popular Pins rises from 0.10 to 0.42 at , delimiting the useful range of this control.
This passage summarizes the online A/B test results when the agent optimizes for save-type engagements on a serving index of over 50 million Pins.
These edits raise saves from the source by 8.4-10.7% per user and 4.3-5.3% per impression. They also increase closeups while reducing long clicks and product share. The same editable sites therefore support different business goals under different evaluation objectives.
This passage describes the cannibalization effect observed when the edited retriever competes with other retrieval sources in the online ranking stack.
One caveat to call out is that the ranker tends to rank the Pins from the edited model much higher and such a cannibalization reduces impression share and engagements from other retrievers.
Figures from the paper
Look at panel (b) to see how successive weight-coding edits and parameter searches progressively increase relative recall@10 on Pinterest’s Image Search retrieval model.
Figure from the paper, arXiv:2611.29613, by its authors. Caption as written: Figure 1. Weight coding by LLM agents. (a) Training and direct editing of trained or randomized weights through an agent-driven loop. (b) Relative metric changes after successive weight-coding iterations on the Image Search retrieval model at Pinterest.
Look at panels (c) and (d) to see how varying the freshness and product steering coefficients trades off overall recall@10 against targeted Pin exposure.
Figure from the paper, arXiv:2611.29613, by its authors. Caption as written: Figure 5. Edits across models and objectives. (a) PinRec interpolation from production ( λ = 0 \lambda=0 ) to its fine-tune ( λ = 1 \lambda=1 ). (b) Relative changes in ranker utility NDCG and hit@3 after expert scaling and recalibration. (c,d) Two-tower recall@10 under fresh and product steering. Four panels show PinRec interpolation, ranker expert scaling, and recall under freshness and product steering.
What the authors say it means
- Standard single-schedule training can leave normalization gains, shared offsets, and branch strengths poorly balanced for downstream objectives, allowing direct parameter edits to realign model behavior while preserving learned representations.
- Because effective edits differed across the two-tower retriever, the PinRec generative retriever, and the multi-expert ranker, useful weight modifications are architecture-specific even though the agent-driven editing workflow applies across models.
- Direct weight editing can construct useful feature interactions even inside a randomly initialized interaction module when surrounding encoders and item indexes remain trained, pointing to potential uses in both pre-training and post-training stages.
What to do with it
- Evaluate weight-edited recommender checkpoints across multiple held-out dates, unseen item corpora, and unoptimized engagement metrics before online deployment. Supported by: In offline validation on Pinterest’s Image Search retriever, searched edits lost an average of 4.5 recall@10 points between the development day and held-out days while remaining positive across held-out days and reaching +9.7 points on a separate corpus.
- Monitor popularity concentration when applying attribute steering coefficients to retrieval head biases. Supported by: Increasing product steering on Pinterest’s two-tower retriever pushed product share to 39% in the top-10 results but also raised the share of the top-1% most popular Pins from 0.10 to 0.42.
- Track impression share and engagement across competing retrieval sources during online A/B tests of an edited retriever. Supported by: In Pinterest’s one-week online A/B test on roughly 10M users per arm, saves per user from the edited two-tower source rose by 8.4% to 10.7%, while downstream rankers ranked those Pins higher and reduced impression share from other retrievers.
- Require human engineer review and reproducible artifact tracking before deploying agent-generated weight edits to production traffic. Supported by: The authors report that reusing edits across checkpoint refreshes requires revalidation against dependent artifacts and explicitly keep human engineers responsible for deployment approval.
Caveat. All experiments were conducted exclusively on Pinterest’s internal recommendation models and datasets over roughly one-week online tests, and the authors note that offline cross-validation does not rule out adaptive overfitting or biases shared across dates. Furthermore, source-level online gains on the edited retriever partially cannibalized impressions from other retrievers, and whether successful edits persist across routine checkpoint refreshes or generalize to other platforms remains untested.
In short
Pinterest researchers developed weight coding, an iterative workflow in which an LLM agent directly inspects and edits recommender weights using cached forward evaluation. Across Pinterest’s Image Search retriever, PinRec generative model, and ranker, targeted edits improved offline recall by up to 15.0 percentage points, controlled fresh and product Pin exposure, and increased source-attributed online saves by 8.4% to 10.7%. The study demonstrates an alternative to full retraining on Pinterest’s stack, though generalization to other systems and long-term checkpoint refreshes remains open.
Written from the paper's own text. Quoted passages are verbatim and the numbers are the authors' own. For the method and full results, read the paper.