Embedding Surgery Fixes Rankings in Place; +60.64% nDCG@10 on DL-Hard

Embedding Surgery: Localized Updates for Adaptive Ranking Correction in Dense Retrieval

Maddalena Amendola, Antonio Mallia, Raffaele Perego

cs.IR

2026-09-04

Embedding surgery solves a convex QP that nudges vectors to honor ranking constraints. TAS-B nDCG@10 on DL-Hard rises 0.376→0.604 under editorial labels; ANN updates in place.

What problem this solves

Dense retrievers freeze document vectors in an offline index. Queries are encoded online; documents are not. When feedback, editorial fixes, or intent drift arrive, the usual answer is to fine-tune the encoder and re-embed the collection, which is slow and too coarse for a single misranked query. Online LTR updates the ranker. Query-side methods such as CoRocchio move the query vector. Local edits to stored document embeddings have barely been tried.

Method

Embedding surgery is a convex quadratic program. Given query vector q and the top-k documents, feedback supplies pairwise preferences: relevant dᵣ should outscore non-relevant dₙ by a margin ε. The objective minimizes total L2 movement of the edited vectors. The program is convex with a unique optimum. A single pair has a closed form; batches go to CVXPY.

Three variants: symmetric (both sides move, the default), demotion (only the non-relevant vector moves), and promotion (only the relevant one). Symmetric wins on most datasets.

Feedback comes in three flavors. Editorial judgments treat the gold ranking as the target; Kendall Tau distance enumerates the adjacent swaps needed to get there, each swap a constraint. Clicks are simulated with Perfect, Noisy, and Near-Random user models; a click at rank i>1 becomes a preference over rank i-1. When logs are missing, Qwen3-Reranker-8B or bge-reranker-v2-gemma reranks the top-20 and that order becomes the target. ε is the min of the pair's score gap and 0.01. Vectors are not re-normalized after the update; scores stay raw inner products.

Models: Contriever, TAS-B, E5, Snowflake-Arctic Embed. Benchmarks: TREC DL 2019/2020, DL-Hard, Robust 04 (zero-shot OOD), CAsT 2019, QSharedRel, and 56k MS MARCO Dev queries. Cutoff is top-20.

Results

Editorial feedback is the ceiling. Contriever nDCG@10: DL'19 0.674→0.845 (+25.37%), DL'20 0.672→0.878 (+30.65%), DL-Hard 0.377→0.591 (+56.76%), Robust'04 0.466→0.687 (+47.42%). The largest relative gain is TAS-B on DL-Hard, +60.64% (0.376→0.604). Swap constraints are satisfied at 99%+ in almost every cell.

Clicks are weaker. After 1,000 Perfect-user clicks, Contriever reaches 0.702 on DL'19 (+4.15%) and 0.454 on DL-Hard (+20.42%). Noisy tracks Perfect. Near-Random barely moves and has a small, non-significant dip on Robust'04. LLM feedback sits in between: +3.59% at the low end (Snowflake, DL'19) and +24.56% at the high end (E5, Robust'04). Relative gains are largest on hard queries.

Normalized L2 of the updates is typically below 0.05. After editorial surgery on all 56k Dev queries, Dev nDCG@10 jumps 0.407→0.716 while held-out DL'19/20/Hard stay flat (0.674→0.669 and similar; paired t-test n.s.). On CAsT, editing only the first turn leaves later nDCG@20 almost unchanged. On QSharedRel, paired queries that share a relevant passage mostly keep or gain RR. HNSW overwrites 185,006 vectors in place without touching edges; IVF overwrites 183,106, with 0.38% that would change cluster. Held-out ANN metrics do not move significantly.

Surgery stacks with CoRocchio. Perfect user: baseline 0.674, CoRocchio 0.799, surgery 0.702, both 0.809. Noisy combined 0.720 versus 0.70 alone. Near-random: CoRocchio drops to 0.632, surgery stays at 0.680. One constraint solves in about 8ms.

Why it matters

Search, recommendations, and RAG all hit "this ranking is wrong and it has to change tonight." The paper offers a patch that slots into a FAISS pipeline: no retraining, no index rebuild, a few document vectors nudged by feedback. Editorial rules, fairness constraints, and business overrides fit better than noisy clicks. Under click noise it is more stable than query-side adaptation, and the gains are also much smaller.

Limitations

+60% is an oracle number: gold editorial labels are fed to the optimizer. Simulated clicks turn off position bias; real SERP logs are dirtier. LLM judges carry the systematic weaknesses Clarke and Dietz have already flagged. Constraints come from a single target ranking, so the preference graph is acyclic and the QP is always feasible; conflicting live feedback has no relaxation scheme yet. There is no head-to-head with online LTR. Sensitivity to ε and the surgery cutoff is untested.

Terms

Source

What people are saying

Related papers

All paper explainers