---
title: 'MiA-Emb: Mindscape-Guided Retriever'
url: https://www.emergentmind.com/topics/mindscape-guided-retriever-mia-emb
type: topic
---

# MiA-Emb: Mindscape-Guided Retriever

The Mindscape-Guided Retriever (MiA-Emb) is the retrieval module within the Mindscape-Aware Retrieval-Augmented Generation (MiA-RAG) system, engineered for enhanced long-context understanding. MiA-Emb introduces explicit global context conditioning through hierarchical summarization, constructing a document-level “mindscape” that guides the retrieval of semantically relevant content from lengthy input corpora. By fusing this mindscape with user queries through a residual integration mechanism, MiA-Emb generates enriched, context-aware query embeddings that bias the retrieval process toward coherence with the global semantic structure, in contrast to local or unconditioned embedding approaches [2512.17220].

## 1. System Architecture and Role in MiA-RAG

MiA-Emb serves as the retriever component in the MiA-RAG pipeline, producing global-context–conditioned query embeddings. Its central objective is to leverage document-level semantic structure to (a) direct retrieval toward the topical scope of the input document (“Selective Retrieval”) and (b) enable enriched understanding by fusing explicit query intent with holistic semantic signals. The architecture is built atop Qwen3-Embedding-8B, further adapted with LoRA parameter-efficient adapters (rank=128, $\alpha=256$), and incorporates special control tokens for mode signaling. A residual fusion mechanism ensures that global cues are integrated while preserving the discriminative local features of the original query.

## 2. Mindscape Construction via Hierarchical Summarization

To construct the global semantic scaffold (“mindscape”), MiA-Emb applies a two-step hierarchical summarization procedure, operationalized through a large language model summarizer ($\mathcal{M}_s$, e.g., GPT-4o):

1. **Chunk-level summarization**: For each chunk $c_i$ from a document decomposition $\{c_1, \ldots, c_n\}$, generate chunk summary $s_i = \mathcal{M}_s(\text{[INST]}_{sum_c}; c_i)$.
2. **Global summarization**: Generate the mindscape $S = \mathcal{M}_s(\text{[INST]}_{sum_g}; [s_1, s_2, \ldots, s_n])$.

The result is a global summary $S$ (approximately 500–1,000 tokens), capturing the essential semantics of the entire document. This mindscape serves as contextual input for both subsequent retrieval and generation.

## 3. Mindscape-Guided Query Embedding and Residual Fusion

MiA-Emb constructs the retriever input by concatenating the user query $q$, the mindscape $S$, and task-specific control tokens: 
$$ Q = [\text{[INST]}_{emb} \| q \| d_q \| S \| d_n \| d_c] $$
where $\text{[INST]}_{emb}$ is the embedding instruction, $d_q$ is an end-of-query marker, $d_n$ and $d_c$ are control tokens for node vs. chunk retrieval, respectively.

A transformer-based encoder $\mathcal{E}$ computes contextual representations $H = \mathcal{E}(Q) = (h_1, \ldots, h_{|Q|})$. To derive the mindscape-aware embedding, a residual fusion is applied:
$$ \tilde{q} = \delta h_q + (1 - \delta) h_t, \quad \delta \in [0,1] $$
where $h_q$ is the hidden state at $d_q$ (capturing query intent), and $h_t$ is the hidden state at the active task token (with full cross-attention to $S$). Empirically, $\delta=0.5$.

This fusion yields $f_{embed}(q,S) \coloneqq \tilde{q}$, maintaining compatibility with local query signals while integrating global context.

## 4. Retrieval Process and Scoring

Chunks of the document are indexed via static embeddings $e(d_i)$. For inference, MiA-Emb computes the cosine similarity between the mindscape-enriched query $\tilde{q}$ and each chunk embedding:
$$ s(q_m, d_i) = \cos(\tilde{q}, e(d_i)) $$
Top-$K$ chunks are selected based on descending score. No additional reranking is applied, as the global conditioning of the query embedding raises relevant context in the candidate list.

## 5. Training Objectives and Optimization

MiA-Emb employs a multi-task contrastive (InfoNCE) loss across chunk and node retrieval:
$$ L_{MiA-Emb} = \beta L_c + (1-\beta) L_n, \quad \beta=0.5 $$
For each retrieval task $t\in\{c, n\}$ and batch size $B$, the loss is formulated as:
$$
L_t = -\frac{1}{B} \sum_{j=1}^B
\log\frac{\exp(\operatorname{sim}(\tilde{q}_j, d_j^+)/\tau)}
{\sum_{d\in C_j} \exp(\operatorname{sim}(\tilde{q}_j, d)/\tau)}
$$
where $d_j^+$ is a silver-labeled positive and $C_j$ includes this positive and a mixture of hard and random negatives. Temperature $\tau$ is fixed at 0.01.

## 6. Generator Integration and Inference Workflow

At inference, MiA-Emb yields the top-$K$ relevant chunks $C_{ret}$ conditioned on the mindscape. The MiA-Gen generator (Qwen2.5-14B) is supplied with the mindscape, the retrieved chunks, and the original query in concatenated form:
$$ x^{gen} = [\text{[INST]}_{gen} \| S \| C_{ret} \| q ] $$
The generation process thus leverages a unified global semantic context, ensuring coherence between retrieval and evidence-based reasoning.

## 7. Empirical Performance and Evaluation

Evaluation uses retrieval recall@$K$ (for $K=3,5,10$) on long-context benchmarks:

| Dataset           | MiA-Emb Recall@3/5/10 | Qwen-Emb-8B Recall@3/5/10 | SitEmb-8B Recall@3/5/10 |
|-------------------|-----------------------|---------------------------|-------------------------|
| NarrativeQA       | 62.68/75.92/88.09     | 41.81/54.51/71.13         | 59.98/70.70/82.68       |
| DetectiveQA-ZH    | 46.75/59.17/72.50     | 28.58/39.08/55.58         | 42.50/54.50/69.30       |
| DetectiveQA-EN    | 42.08/54.17/69.75     | 24.17/34.17/49.25         | 36.75/49.25/63.83       |

MiA-Emb consistently outperforms strong baselines (including SitEmb-8B) by +3–5 recall points, and exceeds vanilla local/global-unconditioned retrievers by +15–20 points. This demonstrates the efficacy of explicit global semantic conditioning for selective long-context retrieval.

**Summary**: MiA-Emb operationalizes mindscape-aware retrieval through (1) hierarchical document summarization for holistic semantic context, (2) contextual query embedding via residual fusion, and (3) multi-task contrastive alignment to silver-annotated evidence. These design features enable more effective and human-like navigation of long document semantics compared to prior RAG retrievers [2512.17220].

Source: https://www.emergentmind.com/topics/mindscape-guided-retriever-mia-emb