Skip to content

Interpret and Control Dense Retrieval with Sparse Latent Features

Skip →Sparks of Weight-Space Programming
Interp stage 2 #13extendedfrontierpaperrubric 8/122024 · ~30 min

Hao Kang, Tevin Wang, Chenyan Xiong

Status

TL;DR. Train a k-sparse (TopK) autoencoder on dense embeddings from BGE-base (and MiniCPM-Embedding). Add a KL loss so that reconstructed query–document scores match the originals. Both the reconstructed embeddings and the sparse latents nearly keep retrieval quality. The latents are interpretable via N2G explanations, and amplifying chosen latents steers which documents come back.

Encoder z=TopK(Wenc(x−bdec)+benc)z=\mathrm{TopK}(W_\text{enc}(x-b_\text{dec})+b_\text{enc}), decoder x^=Wdecz+bdec\hat x = W_\text{dec}z + b_\text{dec}. The loss is MSE plus a retrieval KL term, ∑d∈D+P(q,d)log⁡P(q,d)P(q^,d^)\sum_{d\in D^+} P(q,d)\log\frac{P(q,d)}{P(\hat q,\hat d)} with PP a softmax over f(q,d)f(q,d), which keeps the ranking geometry and not just the coordinates (§2).

Results. On MS MARCO with BGE and K = 128 active latents, reconstruction MSE is 0.0001 and MRR is 0.3455 vs 0.3605 for the original embeddings. Retrieval directly on sparse latents gives 0.3306 (0.2760 without the KL loss). Amplifying relevant features raises MRR and P@10, reaching MRR 1.0 for document-side manipulation at the largest scale. Too strong a query-side manipulation lowers performance (§4.3). BEIR results drop for both variants, less with the KL loss.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Mechanism

    Why is MSE reconstruction alone not enough for an SAE on retrieval embeddings, and how does the paper's KL contrastive term fix it?

    What a strong answer covers
    • MSE treats each embedding independently; small errors in many dimensions can still change which document a query ranks first.
    • Retrieval depends on relative scores f(q,d) between a query and its documents, not on exact coordinates.
    • The KL term matches the softmax distribution of scores over relevant documents for original vs reconstructed query and document embeddings.
    • With it, retrieval on sparse latents improves from MRR 0.2760 to 0.3306 on MS MARCO (BGE), so features stay faithful to what drives ranking.
  2. Connect

    Compare amplifying an SAE feature in a query embedding with activation addition in an LLM. What is the "steering vector" in each case, and what failure mode do both share?

    What a strong answer covers
    • ActAdd adds a scaled difference of residual activations at one layer; here the vector is an SAE decoder direction added to the reconstructed query embedding.
    • Both rely on the concept being a direction that the downstream computation reads linearly (here the dot product, there later layers).
    • Both break when the scale is too large: the paper sees query-side MRR drop when manipulation doubles typical latent values, just as large ActAdd coefficients hurt fluency.
    • The SAE gives a named, sparse direction found without contrast pairs, but its meaning comes from an automatic explanation (N2G) that may be imperfect.
  3. Critique

    The authors say the link between features and retrieval outcomes is correlational. Which of their experiments is closest to causal, and what is still missing?

    What a strong answer covers
    • Amplifying relevant features in queries or documents and observing MRR and P@10 rise is an intervention on the representation.
    • But features are labelled by N2G from top-activating text, so "this feature means job" is itself a correlational label.
    • Missing: controls with random or irrelevant features at the same scale, and checks that amplification does not change unrelated retrieval behaviour.
    • Also missing: scaling to larger embedding models and showing the features exist across training seeds.

Done with this page?

Status