IMRNNs

Official Project Website · EACL 2026

Interpretable retrieval via embedding modulation.

Interpretable Modular Retrieval Neural Networks (IMRNNs) augments frozen dense retrievers with two lightweight adapters: one uses the query to modulate document embeddings, the other uses retrieved documents to refine the query. The base retriever stays frozen. The semantic shift is visible, attributable, and inspectable.

+6.35% nDCG
+7.14% Recall
+7.04% MRR
Reported paper averages across seven BEIR benchmarks

Affiliations & Release Surfaces

Method

How IMRNNs modulates embeddings

Starting from a frozen dense retriever, IMRNNs projects embeddings into a compact working space and applies two learned MLP adapters bidirectionally, exposing interpretable semantic shifts between queries and documents.

Live Visualization

Embedding Space Modulation

Step 1 / 4
Query

What is the currency of Mexico?

Q Query D+ Relevant D Support D- Irrelevant
Current Step

Projection into the working space

IMRNNs starts from the frozen retriever's static embedding space and projects query and document embeddings into a compact working space for modulation.

Aq

Query-conditioned document modulation

The query adapter predicts an affine transform from the projected query and applies it to each candidate document, pulling relevant ones closer and pushing irrelevant ones away.

Ad

Document-conditioned query refinement

The document adapter produces document-side transforms whose aggregate shifts the query toward the relevant semantic neighborhood before final cosine scoring.

Token-level attribution via back-projection

Modulation vectors are back-projected via Moore-Penrose pseudoinverse to expose the token concepts, such as Peso and Mexico, that causally drove each ranking change.

Paper

What the paper establishes

The paper presents IMRNNs as a retrieval adapter that works directly in embedding space. The base retriever remains frozen, the adapters are lightweight, and the ranking changes can be traced back to concrete token concepts.

Core idea

IMRNNs adds two MLP adapters on top of a frozen dense retriever. One modulates document embeddings using the query, and the other refines the query using the candidate documents.

Training setup

The adapters are trained with margin-based ranking loss and hard negatives while the underlying encoder is kept fixed. This preserves the original retriever and limits training cost.

Serving path

Document embeddings are cached offline. At runtime, IMRNNs applies lightweight modulation and cosine scoring on top of those cached representations, which keeps the system practical for real retrieval pipelines.

Interpretability

The explanation is part of the model itself, not a separate post-hoc layer. The same modulation vectors that change rankings can be back-projected to reveal the concepts that mattered most.

Citation

Cite the paper

@misc{saxena2026imrnns,
  title={IMRNNs: An Efficient Method for Interpretable Dense Retrieval via Embedding Modulation},
  author={Yash Saxena and Ankur Padia and Kalpa Gunaratna and Manas Gaur},
  year={2026},
  eprint={2601.20084},
  archivePrefix={arXiv},
  note={Accepted to EACL 2026}
}

Use IMRNNs

Start from released adapters or train your own

Use Hugging Face for published checkpoints. Use the GitHub package to cache embeddings, train on new datasets, or attach adapters to a different dense retriever.

from imrnns import IMRNNAdapter

# Load base retriever + IMRNN adapter checkpoint from Hugging Face
adapter = IMRNNAdapter.from_pretrained(
    encoder="minilm",
    dataset="webis-touche2020",
    repo_id="yashsaxena21/IMRNNs",
    device="cpu",
)

scores = adapter.score(
    query="Should social media platforms ban political advertising?",
    documents=[
        "Restricting political ads can reduce targeted misinformation.",
        "A recipe for roasted cauliflower with tahini sauce.",
        "Ad transparency archives improve auditing of campaign messaging.",
    ],
    top_k=3,
)

print(scores)

Ecosystem

Paper, package, checkpoints