Tracing Query Expansion Effects through Sparse Autoencoder Features

Fangan Dong, Weiran Shi, Zhiwei Xu, Xuri Ge, Ben He, Xin Xin, Zhumin Chen, Ying ZhouarXiv 2026

TL;DR

Query expansion (QE) often degrades the performance of dense text retrievers because text-based expansions introduce unpredictable shifts in continuous embedding spaces. By applying Sparse Autoencoders (SAEs), this paper uncovers the internal latent concepts activated by effective expansions (such as search intent and entity attributes). Leveraging these insights, the authors introduce "activation steering"—a method to directly inject beneficial retrieval concepts into the model's hidden layers at test time, boosting accuracy while bypassing expensive LLM generation.

What Problem Does This Paper Address?

Query expansion is a classic technique in information retrieval where short or ambiguous user queries are enriched with extra context to improve search results. In traditional keyword-based (sparse) retrieval, QE works explicitly by matching terms. However, in modern dense retrieval models, appending text reshapes continuous vector representations in unpredictable ways.

As a result, vanilla text expansions often introduce noise or "semantic drift," causing off-the-shelf dense retrievers to lose track of the original intent and perform worse than the unexpanded baseline query. Because dense retrievers operate as black boxes, researchers haven't historically understood how QE alters their internal representations, making it difficult to fix this instability.

Figure 1: A motivating example showing that query expansion can improve sparse retrieval, but may hurt dense retrieval.

Methods

The authors turn to Sparse Autoencoders (SAEs) to perform mechanistic interpretability on dense retrievers (specifically analyzing Qwen-Embedding and SimLM).

  1. Decomposition: They train independent SAEs on the hidden states of each retriever layer. The SAE takes a dense representation and projects it into a massive, overcomplete latent space where only a few "features" or "latents" activate at a time.
  2. Latent Extraction: By pairing original queries with successful expansions (those that actually improved retrieval metrics), they calculate the activation shifts. They use Cohen’s $d$ effect size to isolate the specific latents that consistently amplify or suppress beneficial retrieval signals.
  3. Test-time Intervention (Activation Steering): Instead of using an LLM to rewrite queries at test time, they compute a "steering vector" from the decoder weights of the top-K beneficial latents. During a standard user query forward pass, they directly inject this vector into the retriever's hidden layers. This modulates the retriever's behavior without changing a single word of the input text or fine-tuning the model weights.
Figure 2: Overview of our sparse-latent analysis and steering framework. We use SAE to trace query expansion effects at the latent-feature level and reuse discriminative latent signals for query-side representation steering.

Datasets

The framework was trained and evaluated using several standard information retrieval benchmarks:

  • MS MARCO: The passage retrieval training split was utilized for training the SAEs and discovering the positive-gain query-expansion pairs. The dev set was used for evaluation.
  • Natural Questions (NQ): Used for cross-dataset evaluation.
  • TREC DL 2019 & TREC DL 2020: Deep learning track datasets used to evaluate the robustness of the retrieval performance.

Key Insights and Ideas

  • Functional Layering: The internal representations shift drastically by depth. Early layers are dominated by syntax and answer schemas (e.g., recognizing the phrase "what is..."). Middle-to-late layers transition heavily into encoding concrete retrieval intents and entity-attribute relationships.
  • Late-Layer Sensitivity: Interventions in early layers are largely attenuated or washed out during subsequent model forward propagation. For activation steering to successfully alter final query embeddings, the steering vector must be applied to deeper layers.
  • Subspace Separation: Effective query expansion doesn't just cause minor numerical jitter in the embeddings. When projected via PCA, original queries and expanded queries form two completely distinct clusters in the SAE latent subspace, proving that QE triggers a macro-level conceptual shift inside the model.
Figure 4: PCA projection of original and expanded queries in the SAE latent subspace.

Key Results

  • Consistency over Vanilla QE: Traditional text-based expansion methods (like Query2Doc or Query2CoT) frequently underperformed the baseline on MS MARCO dev and NQ due to text instability. SAE steering consistently delivered stable improvements across all four benchmarks.
  • Significant Retrieval Gains: On the encoder-only SimLM model, SAE steering achieved substantial improvements of +1.503 and +1.404 NDCG@10 on TREC DL 2019 and 2020, respectively.
  • Massive Latency Reduction: Bypassing test-time LLM generation saves immense computational overhead. While LLM-based contextual expansion (Query2CoT) added up to 1338 ms of latency per query, SAE steering added virtually zero overhead (2.66 ms vs. the baseline's 2.55 ms), making it highly viable for production environments.

Limitations and Future Work

  • Moderate Absolute Gains: While highly stable, the absolute performance gains from representation steering are moderate in some settings. The authors note it should be viewed as a lightweight complement to text-level expansion rather than a total replacement.
  • Upfront Offline Cost: The method relies on training independent SAEs for every single layer of the retriever, which incurs an additional offline computational footprint.
  • Generalization: The evaluation was restricted to a few dense retrievers. Future work is required to assess how well these exact latent structures generalize to much larger embedding models and highly domain-specific search tasks.

Summary updated

BibTeX
@misc{dong2026tracing,
  author = {Fangan Dong and Weiran Shi and Zhiwei Xu and Xuri Ge and Ben He and Xin Xin and Zhumin Chen and Ying Zhou},
  title = {{Tracing Query Expansion Effects through Sparse Autoencoder Features}},
  year = {2026},
  eprint = {2609.06968},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.06968},
}
Figure