Skip to content

When Metadata Remembers: Ordered Provenance Enables Document-Level Embedding Inversion

Conference: EMNLP 2026
Paper: ACL Anthology
Code: https://github.com/LevenKoko/MIRAGE
Area: LLM Safety
Keywords: Embedding Inversion, RAG Security, Vector Database, Provenance Metadata, Privacy Attack

TL;DR

Addressing the vulnerability where vector stores and RAG systems leak embeddings alongside document identifiers and chunk sequences, this paper introduces MIRAGE, a zero-victim-pair attack that extracts typed anchors verified by counterfactual encoder probes to guide left-to-right document-level regeneration.

Background & Motivation

Dense text embeddings serve as the default representation layer across modern vector databases, retrieval-augmented generation (RAG) pipelines, enterprise knowledge repositories, and autonomous agent memories. Prior research on embedding privacy risks has predominantly focused on single-vector inversion—attempting to recover words, phrases, or full sentences from an isolated dense vector via supervised paired models (such as Vec2Text) or zero-shot search techniques. However, in real-world infrastructure, embeddings are virtually never stored or exposed as isolated floating-point vectors. Instead, vector search engines (like Milvus) and retrieval architectures routinely store dense vectors paired with rich provenance metadata—such as document identifiers (doc_id), sequential chunk indices (chunk_idx), and relative chunk offsets—to support hybrid filtering, windowed context reconstruction, and source attribution. Consequently, whenever database backups, retrieval API logs, or cached responses leak, attackers typically obtain structured tuples of \((doc\_id, chunk\_idx, e_i)\) rather than a disordered bag of embeddings.

This ordered provenance represents an active and perilous privacy leakage channel. Sensitive private information distributed throughout a document exhibits strong sequential dependencies: personal names and corporate email addresses are frequently severed across neighboring chunks by chunking algorithms; specific transaction dates in early sections disambiguate later contractual approval events; and account identifiers, API keys, or Canary strings recur across fixed structural slots. When an attacker attempts to invert leaked vectors independently, the lack of cross-chunk contextual grounding leads to isolated local hallucinations and prevents the recovery of subtle or rare entities that lack sufficient discriminator signal within an isolated chunk representation.

Recognizing that ordered provenance converts passive metadata into an active attack surface, this work bridges the gap between single-vector inversion and document-level reconstruction. Core idea: model ordered chunk leakage as a sequential recovery process, using public-shadow local generators to propose initial candidates, filtering extracted typed anchors via counterfactual encoder support checks, and driving left-to-right memory-guided regeneration and document-level beam selection.

Method

Overall Architecture

MIRAGE operates under a strict threat model with zero victim-domain training pairs and a hard per-chunk online query cap (\(Q=512\) black-box queries to the victim encoder). The framework decouples local candidate generation from document-level cross-chunk propagation. At the local level (MIRAGE-SC), an offline public-shadow adapter produces an initial candidate bank for each leaked embedding and applies localized span calibration. At the document level, the system scans chunks sequentially from left to right, extracts typed anchors (entities, dates, identifiers, URLs, rare terms, and canaries), verifies candidate anchors using counterfactual insertion/removal embedding checks, and accumulates validated facts into a persistent memory. This memory then conditions autoregressive regeneration for subsequent chunks, before a final joint scoring beam search resolves cross-chunk consistency and boundary overlaps.

%%{init: {'flowchart': {'rankSpacing': 24, 'nodeSpacing': 28, 'padding': 6, 'wrappingWidth': 400}}}%%
flowchart TD
    A["Input: Ordered Leakage Sequence<br/>(doc_id, chunk_idx, e_1:K)"] --> B["Public-Shadow Local Inversion & Calibration<br/>(MIRAGE-SC Candidate Bank Construction)"]
    B --> C["Typed Cross-Chunk Anchor Extraction<br/>(Entities, Dates, IDs, Canaries, Rare Terms)"]
    C --> D["Counterfactual Encoder Support Verification<br/>(Keep/Insert vs. Remove/Replace Probing)"]
    D --> E["Memory-Guided Autoregressive Regeneration<br/>(Condition on Supported Facts & Banned Strings)"]
    E --> F["Document-Level Joint Scoring & Beam Selection<br/>(Similarity + Memory Match + Overlap Penalty)"]
    F --> G["Output: Reconstructed Document x_1:K"]

Key Designs

1. Public-Shadow Local Inversion & Calibration: Decoupling from Victim Data while Ensuring High-Fidelity Base Proposals
Prior embedding inversion attacks typically rely on millions of in-domain paired examples from the target distribution, which is unrealistic in real-world black-box scenarios. MIRAGE bypasses this dependency with BASEINVERT, a generator trained entirely on an offline split of 80,000 public non-victim documents. It utilizes a two-layer MLP to map target encoder embeddings into 32 continuous soft prefix tokens that prefix a frozen Qwen3-1.7B language model. During victim-time inference, the model expends 224 queries to propose raw candidates and 32 queries on span-level local calibration (LOCALCALIBRATE) to adjust date formatting, numeric values, and entity boundary tokens. Edits are retained only when they directly increase cosine similarity against the target embedding \(e_i\), establishing a strong local candidate bank without requiring any victim training pairs.

2. Typed Cross-Chunk Anchor Extraction: Structured Preservation of High-Value Privacy Evidence
Allowing language models to generate unstructured document summaries introduces semantic drift and noise that degrades subsequent reconstruction. Instead, MIRAGE extracts typed facts \(a = (s, t, I, \rho)\) from the top-16 local candidates, where \(s\) is the surface text, \(t\) denotes the type (entities, dates, numbers, emails/accounts, URL paths, case IDs, rare n-grams, or canary tokens), \(I\) records supporting chunk indices, and \(\rho\) indicates candidate-level frequency. Anchors are categorized into repeated evidence (entities, dates, and domain terms that naturally recur across chunks) and structural slots (unique identifiers, account strings, and canaries matching strict finite-state templates).

3. Counterfactual Encoder Support Verification: Suppressing Hallucination Cascades via Physical Vector Probes
To prevent plausible-sounding but factually hallucinated spans from contaminating downstream chunks, MIRAGE subjects candidate anchors to counterfactual embedding validation. For each anchor \(a\) and candidate text \(c_i\), the system constructs counterfactual pairs \(c_{ai}^+ = \text{INSERTORKEEP}(c_i, a)\) and \(c_{ai}^- = \text{REMOVEORREPLACE}(c_i, a)\), submitting both variants to the target black-box encoder to evaluate the support margin: $\(\Delta_i(a) = \cos(E(c_{ai}^+), e_i) - \cos(E(c_{ai}^-), e_i)\)$ An anchor is accepted into the active left-to-right memory \(M_{<i}\) only if \(\Delta_i(a)\) satisfies type-specific thresholds (\(\tau_{rep}=0.018\) for repeated evidence; \(\tau_{slot}=0.031\) for structural slots). Rejected anchors are explicitly recorded in a banned list, preventing subsequent generation steps from repeating unsupported private-looking strings.

4. Memory-Guided Autoregressive Regeneration & Document Selection: Closing the Loop on Cross-Chunk Consistency
When processing chunk \(i\), the regeneration controller \(G\) receives the target embedding \(e_i\), local calibrated candidates, accepted prior anchors in \(M_{<i}\), and banned tokens. Allocating 96 encoder queries, it generates 24 new candidates conditioned on verified facts, enabling crucial identifiers (e.g., sender names or account codes) established in early chunks to cross chunk boundaries into later slots. A beam search (size 8) across candidate sequences evaluates the document-level objective: $\(\text{score}_i(x) = \alpha \cos(E(x), e_i) + \beta m(x, M_i) + \gamma o(x, \hat{x}_{<i}, \tilde{C}_{>i})\)$ where \(m(x, M_i)\) computes memory consistency and \(o(\cdot)\) penalizes textual overlap mismatch and ordering conflicts across the 32-token chunk boundaries (fixed weights \(\alpha:\beta:\gamma = 1:0.28:0.12\)).

Key Experimental Results

Main Results

Evaluated under the standard anchor configuration (e5-large-v2 encoder + Qwen3-1.7B decoder) with a strict online budget of \(Q=512\) queries per chunk. Metrics include parser-audited Privacy-Unit Recall (PU-R), Date Recall (Date-R), Identifier Recall (ID-R), Canary Recall (Canary-R), and Token F1 (Tok-F1).

Dataset Method PU-R (%) Date-R (%) ID-R (%) Canary-R (%) Tok-F1 (%)
Enron Mail Independent MIRAGE-SC 15.7 ± 0.8 6.4 ± 0.5 15.4 ± 0.6 — 35.7 ± 0.8
Enron Mail Fixed-Bank Rerank 18.2 ± 0.7 8.8 ± 0.6 15.4 ± 0.6 — 34.0 ± 0.8
Enron Mail LLM-Rerank 19.8 ± 0.7 9.9 ± 0.6 16.3 ± 0.6 — 34.6 ± 0.8
Enron Mail No-Support-Check Ablation 21.4 ± 0.8 12.3 ± 0.7 17.8 ± 0.7 — 37.7 ± 0.7
Enron Mail Shuffled-Memory Ablation 21.6 ± 0.8 12.0 ± 0.6 17.8 ± 0.7 — 37.7 ± 0.7
Enron Mail Full MIRAGE (Ours) 24.1 ± 0.7 14.8 ± 0.6 20.5 ± 0.6 — 39.3 ± 0.6
CanaryDocs Synthetic Independent MIRAGE-SC 16.6 ± 0.7 7.2 ± 0.5 7.7 ± 0.5 13.9 ± 0.6 36.8 ± 0.7
CanaryDocs Synthetic Fixed-Bank Rerank 19.4 ± 0.7 9.6 ± 0.5 7.4 ± 0.5 14.1 ± 0.7 34.4 ± 0.8
CanaryDocs Synthetic LLM-Rerank 20.0 ± 0.6 10.4 ± 0.5 8.1 ± 0.5 14.9 ± 0.7 34.8 ± 0.8
CanaryDocs Synthetic No-Support-Check Ablation 22.0 ± 0.7 12.9 ± 0.6 9.7 ± 0.6 19.5 ± 0.7 38.4 ± 0.7
CanaryDocs Synthetic Shuffled-Memory Ablation 22.2 ± 0.7 12.6 ± 0.6 9.7 ± 0.6 19.0 ± 0.7 38.5 ± 0.7
CanaryDocs Synthetic Full MIRAGE (Ours) 24.7 ± 0.9 15.9 ± 0.6 12.2 ± 0.5 22.7 ± 0.6 40.2 ± 0.6

Ablation Study

Ablation analysis on the macro-average of Enron and CanaryDocs under the anchor configuration isolates the contribution of each design component:

Config / Variant SC Tok-F1 (%) PU-R (%) ID-R (%) Canary-R (%) Note
Full MIRAGE 46.4 24.4 16.3 22.7 Anchor setting (e5-large-v2 + Qwen3-1.7B)
Weaker SC Base 42.0 21.3 13.4 19.4 Lower generator quality drops PU-R by 3.1 pts
No Support Check 46.4 21.7 13.7 19.5 Unverified anchors pollute context (-2.7 pts)
Shuffled Memory 46.4 21.9 13.8 19.0 Disrupted temporal order drops PU-R by 2.5 pts
Fixed Bank 46.4 18.8 11.4 14.1 Reranking only without regeneration (-5.65 pts)

Key Findings

  • Regeneration Unlocks Previously Unreachable Units: Diagnostic tracing proves that 34.8% of newly recovered privacy units appear exclusively in regenerated candidates and are entirely absent from the initial fixed local candidate banks, explaining why rerank-only approaches saturate at lower recall.
  • Counterfactual Checks Drastically Elevate Anchor Quality: Counterfactual support validation increases accepted anchor precision from 43.6% to 69.4% and slashes the false anchor rate from 18.9% down to 7.1%, successfully preventing hallucinated facts from derailing multi-chunk generation.
  • Anchor-Sensitive Formats Gain Most: While generic text recall improves moderately, structured fields sensitive to cross-chunk propagation achieve the greatest relative recall gains: dates increase by +67% (+6.2 pts), canaries by +61% (+8.6 pts), and identifiers by +56% (+5.8 pts).
  • Broad Encoder and Domain Transfer: MIRAGE delivers consistent gains (+5.65 to +6.10 macro PU-R) across five diverse encoders (e5-large-v2, bge-m3, jina-embeddings-v3, Qwen3-Embedding-0.6B/4B) and preserves +3.7 to +4.4 points improvement on real, non-templated technical dialogue and customer support corpora.

Highlights & Insights

  • Turning Metadata into an Active Exploitation Vector: The paper challenges the common assumption that provenance metadata is merely harmless storage indexing, demonstrating that ordering and document grouping create an exploitable cross-chunk context channel.
  • Counterfactual Encoder Verification as a Hallucination Filter: Utilizing target encoder cosine margins (\(\Delta_i(a)\)) between insertion and removal counterfactuals establishes an effective, low-query physical gating mechanism for filtering language model hallucinations without access to ground truth text.
  • Universal Memory Layer Compatibility: The document-level memory and verification pipeline can be seamlessly layered on top of arbitrary external single-chunk inverters (such as ZSInvert or Zero2Text), providing an immediate +5.8 to +6.1 points performance boost.

Limitations & Future Work

  • Reliance on Parser-Visible Formats: The evaluation framework relies on typed NER and regex parsers to measure structured privacy units; unstructured relational facts, paraphrased proprietary logic, and implicit secrets remain outside the parser's audited scope.
  • Boundary Assumptions: Although the attack remains effective under chunk offset jitter (\(\pm 32\) tokens) and alternate chunk lengths (retaining 71%–90% of its margin), completely unknown or dynamically changing chunking policies present an added operational challenge.
  • Defense Trade-Offs: Coarsening or hiding chunk order significantly reduces inversion success (PU-R falls from 24.1 to 8.6), but such measures impair legitimate RAG systems that require ordered context assembly, highlighting the need for privacy-preserving yet retrievable data architectures.
  • vs. Single-Vector Inversion (Vec2Text / ALGEN / ZSInvert): While existing inversion methods focus on recovering text from an isolated vector using extensive victim-domain data or complex single-vector search, MIRAGE pioneers document-level inversion using ordered cross-chunk provenance and zero victim pairs.
  • vs. RAG Data Extraction via Prompts: Typical RAG extraction attacks manipulate prompt injection or exploitation of generation APIs; MIRAGE demonstrates that passive leaks of vector database stores and backups expose critical internal content without any interactive prompt generation.

Rating

  • Novelty: ⭐⭐⭐⭐⭐ Formulates ordered provenance as an active privacy channel, transitioning embedding inversion from single-vector to document-level.
  • Experimental Thoroughness: ⭐⭐⭐⭐⭐ Rigorous testing across 5 encoders, 4 decoders, 2 synthetic/real benchmark suites, complete query ledgers, and extensive defense stress tests.
  • Writing Quality: ⭐⭐⭐⭐⭐ Exceptionally structured presentation, rigorous mathematical formulation, and thorough ablation evidence.
  • Value: ⭐⭐⭐⭐⭐ Provides crucial practical guidelines for metadata minimization and access control in commercial vector databases and enterprise RAG deployments.