The researchers propose the embedding inference attack EIA, which can identify the embedding model used in a black-box IR systemEmbedding Inference Attack
The authors propose EIA, which identifies the embedding model on black-box IR using unordered documents; at k=3, 1249 generated queries are distinguishable (Table 4).
Black-box API. The attacker can submit arbitrary queries and only receives unordered top-k documents, with no rankings, similarities, or embedding vectors. It is assumed the document collection is public and the victim embedding model belongs to known candidates. The goal is to infer ϕv.
- Embedding models are often only available via APIs, and inversion usually requires knowing which one is used. The authors study black-box IR: the attacker only sees unordered retrieved documents and must identify the embedding model from known candidates; this information could also be used for subsequent attacks such as query inversion.
- EIA compares the victim's and candidates' unordered top-k using the Jaccard index, and queries with high elimination scores are used to exclude incorrect candidates. In addition to questions generated per document, there are random strings, non-question instructions, and questions probing the system itself. Comparisons include a reranker and cosine similarity thresholds.
- On IR with k=3, generated queries have 1249 distinguishable ones (Table 4); the three types of adversarial queries are 11 each on both IR and RAG with k=3 (max 11). With k=5, IR generated queries are 4547 (Table 5). With a similarity threshold of 0.75 and k=3, generated queries are 8 (Table 6).
- The authors state that chunk size and overlap were not examined, and they plan to evaluate closed-source models such as OpenAI and Google (Section 9). The experiments include 13 open-source embedding models and 3 embedding models on AnythingLLM; hidden document chunks and added noise have no experimental numbers.
- Evaluated models
- e5-smalle5-small-v2e5-basee5-base-v2e5-largee5-large-v2all-MiniLM-L6-v2all-mpnet-base-v2paraphrase-multilingual-MiniLM-L12-v2LaBSEparaphrase-multilingual-mpnet-base-v2gtr-t5-baseQwen3-Embedding-4Bnomic-embed-text-v1
- Benchmarks
- MS MARCO passage developmentAlloprofAnythingLLM
- Metrics
- Jaccard indexelimination scorediscriminative query countMRR@10Recall@1000Docs/Retrieval
The researchers propose the embedding inference attack (EIA), which, under black-box conditions where only an unordered set of retrieved documents is observed without ranking or similarity scores, identifies the embedding model actually used by the system from known candidate models through tailored queries. The attack retains some discriminative ability when the system deploys a reranker as a potential defense, and is validated in a real RAG system, where tailored queries bypass the LLM's tendency to reject ill-formed questions. The authors also propose and evaluate mitigation strategies such as similarity thresholds.
Paper analysis
What problem does this paper attempt to solve?
In black-box IR where only unordered documents are visible, identify the embedding model from known candidates.
Identifying the embedding model used by a black-box IR system from known candidates when only seeing unordered retrieved documents, not the embedding vectors.
- Scenario: Embedding models are often hidden behind APIs; the authors claim that inversion attacks generally require knowing the victim model, and that RAG on public documents (such as policy or middle-school homework Q&A) makes user queries potentially expose sensitive information, and no longer relies on large amounts of leaked text–embedding pairs. The introduction also claims that knowing the model could be linked to corpus poisoning, vector database membership inference, and SEO attacks.
- Existing gap: Inversion methods mostly require embedding vectors, architecture, or leaked text–embedding pairs. The authors claim that, to their knowledge, this is the first attack that infers the embedding model under black-box conditions on IR.
- Core observation: Different embedding models can return different document sets for the same query, and queries with incomplete overlap can be used to eliminate candidates. The authors assume documents come from public sources and that the candidate set contains the victim model.
- This paper proposes: Embedding Inference Attack (EIA), which uses specially crafted queries to compare unordered top-k results and identify the victim model from known candidates, and examines which queries remain distinguishable under rerankers and similarity thresholds. Another part tests in RAG whether these queries can bypass the LLM's tendency to refuse malformed inputs.
- Threat model:
- Goal: Infer the embedding model ϕv used by the system.
- Knowledge: The paper calls it black-box, with no access to embedding vectors, rankings, or similarities. It assumes the document collection is public (examples in the paper include Wikipedia), and one candidate is the victim; the authors claim vendors make available the optional models and API identifiers.
- Capability: Can submit arbitrary questions, and only receives k unordered documents; the set is considered by membership only, and different orderings are treated as the same.
- Victim system: An IR system accessed only via API, where the same ϕ encodes queries and documents and returns top-k by similarity. Experiments also include a reranker pipeline and RAG.
What related research exists?
Related work covers model stealing, LLM inference, and embedding inversion; EIA does not look at embedding vectors.
The authors place EIA in a setting where embedding vectors are not visible and only unordered document sets are compared, and discuss it separately from model stealing, LLM inference, and embedding inversion.
Model Stealing
- Dziedzic et al. (2023): Steal sentence embedding encoders via a black-box API that only returns vectors; the API may also expose the architecture family (e.g., BERT or RoBERTa) and pretraining data. The attacker trains on sentence pairs from arbitrary open-source text using public checkpoints with the same architecture or same output dimension.
- Tamber et al. (2025): The attacker only sees input text and output embeddings, and can call the embedding API without limits, distilling a commercial embedding model into a local BERT model while retaining most retrieval performance.
Model Inference and Similarity
- Pasquini et al. (2024): Send a small number of specially crafted queries to a victim RAG, then use a separate ML model to predict the answerer among 42 LLM versions. The authors report its accuracy exceeds 95%.
- Caspari et al. (2024): Compare embedding models using CKA or document retrieval, with and without ranking. The authors report: on what they call a large top-k equivalent to the full library (3600 document chunks), intra-family and inter-family clusters are visible; at top-10, retrieval similarity between models is low and variable, indicating that similar models may still return very different document sets.
Embedding Inversion
- Vec2Text, GEIA, TEIA: Morris et al. (2023), Li et al. (2023), Huang et al. (2024) train inversion models or surrogate encoders on leaked text–embedding pairs or similarly distributed corpora. In Table 1, TEIA's encoder access is None, but it still requires small-scale leaked pairs. The authors report that on all dataset–encoder combinations they report, TEIA's Rouge-L and embedding cosine similarity are higher than their reproduced GEIA; e.g., on QNLI with OpenAI embeddings, Rouge-L goes from 0.1433 to 0.2226, and cosine similarity from 0.2797 to 0.4772.
- ZSInvert, ALGEN, Zero2Text: Zhang et al. (2025a), Chen et al. (2025), Kim et al. (2026) reconstruct text from embeddings with little or no training. In Table 1, ZSInvert requires no training data but needs target embeddings; ALGEN needs a small number of leaked victim embeddings; Zero2Text is marked as no leakage and assumes black-box query access to the encoder with visible output vectors.
Baselines and Data
- Experimental comparisons: The experiments do not use the above inversion or stealing methods as baselines. The comparison variables are k, query type, whether a reranker is used, and similarity threshold. Data are MS MARCO passage development and Alloprof; RAG experiments use AnythingLLM.
The authors state at the end of Section 3 that the inversion attacks in Table 1 all require access to the embedding model or a set of leaked text–embedding pairs. This paper, in contrast, does not take embedding vectors and only uses unordered retrieved documents to identify the model used by the IR system from known candidates.
How does the paper address this problem?
Use Jaccard to compare unordered top-k, then identify the model with queries that have high elimination scores.
EIA does not read embedding vectors; it only compares the unordered document sets returned by the victim and candidates, using queries that can eliminate incorrect candidates to identify ϕv.
Problem Setting and Set Comparison
- Encoding and similarity: Queries and documents are encoded into fixed-length vectors by the same embedding model ϕ, and the system takes top-k by similarity. Experiments only use cosine similarity; the authors' stated reason is that it does not depend on vector magnitude, making it convenient for comparing high-dimensional text embeddings of different lengths.
- Visible output: For query qi, the attacker only gets an unordered set. Different orderings are treated as the same. The victim set is denoted Siv, and the candidate set Sic.
- Overlap measure: The Jaccard index Ji=(|Siv∩ Sic|)/(|Siv∪ Sic|) represents the degree of overlap between the two sets. The authors treat Ji=1 over all queries as the criterion for two models being the same, and note that different models may also reach 1 on some queries.
- Multiple candidates: Compare candidates one by one, querying until only one candidate remains.
Brute-force Generation and Elimination Score
- Per-document questions: Use an LLM to generate one question per document in the victim's document library, then query the system, aiming to find questions that can eliminate all incorrect candidates with fewer API calls. The authors claim this brute-force approach still requires generating and testing many queries.
- Elimination score: E(qi)=|{m∈ M∣ Ji(v,m)≠ 1}| is the number of candidates whose retrieved set differs from the victim's. The authors claim higher scores indicate stronger discriminative power.
- Filtering: Queries with E(qi)=|M| can eliminate all incorrect candidates; queries with lower scores are discarded.
Three Types of Adversarial Queries
- Random strings (Rnd. Str.): Arbitrary character sequences. The authors' stated reason is to enter embedding regions not covered by LLM training. Section 4 has examples; the original strings are not quoted here.
- Non-questions (Non-Q.): Instructions rather than questions. The authors' stated reason is to reach embedding regions unrelated to documents.
- Probing questions (Prob. Q.): Questions used to obtain information about the victim system itself. The authors' stated reason is to probe model-related embedding regions. Section 5.2 states Prob. Q. are manually constructed by the attacker.
Mitigation Strategies
- Similarity threshold: In the IR pipeline, documents whose cosine similarity with the query is below a preset threshold are discarded. The authors evaluate this as a defense against EIA.
- Two other discussions: Only for RAG, either hide retrieved document chunks from the user, or add random or synthetic documents to the retrieved set. The former is linked by the authors to retrieval chunk leakage and answer leakage, and is claimed to reduce transparency. The latter, the authors claim, may mask retrieval patterns, while citing Cuconasu et al. (2024) that random and irrelevant distractor documents may change model behavior and reduce answer quality.
Success Determination
- Distinguishable: Ji≠1 indicates retrieval inconsistency, treated as potentially distinguishable. E(qi)=|M| is a query that can eliminate all incorrect candidates.
- Comparison method: In experiments, both candidates and the victim run in the authors' pipeline or AnythingLLM configuration, then their document sets are compared. Configurations for k, query type, and reranker are described in the next question.
What experiments did the paper conduct?
On IR with k=3, 1249 generated queries are distinguishable; on RAG, the three types of adversarial queries remain 11 each.
Counts of distinguishable queries are concentrated in Table 4 and Table 5; the tables are not broken down by individual embedding model.
Experimental Setup
- Embedding models: The 13 open-source models in Table 2, across five families—E5, English SBERT, Multilingual SBERT, T5 encoder, Qwen3—with dimensions from 384 to 2560. They are rotated as victims, with the rest as candidates (Section 5.4).
- RAG and generation-side models: AnythingLLM uses all-MiniLM-L6-V2, nomic-embed-text-v1, e5-small, and Qwen3 Vision 4B instruct. Refusal observations also include Gemma3 1B, Llama3.2 3b, pHI-3.5 3.8B, Mistral 7b.
- Data: MS MARCO passage development takes 7400 documents with qrels (originally stated as 7000 queries, 8.8 million passages, 7400 qrels); Alloprof English subset has 585 documents (full library 30000). Consistent with the assumption in Section 2, documents are treated as public.
- Queries and retrieval: Generated questions come from Qwen2.5-1.5B-Instruct, plus Rnd. Str., Non-Q., Prob. Q.; k is 3 and 5, and only cosine similarity is used. The reranker is cross-encoder/ms-marco-MiniLM-L6-v2 with initial retrieval of 25 documents.
- RAG configuration: LanceDB, tokenization 1000, overlap 20, k=3. There are Chat and Query interactions, and the paper does not report distinguishable counts separately by mode. The IR pipeline is hosted by the authors, not a remote commercial API.
- Metrics: Success is determined by comparing unordered sets via Jaccard and elimination score, with no LLM judge. On the defense side, MRR@10, Recall@1000, and Docs/Retrieval are reported on MS MARCO. The paper does not give the number of repetitions for Figure 1.
Main Results
According to Table 4 (k=3) and Table 5 (k=5). The max for Gen. Q. is 7433, and the max for the other three types is 11. Dashes are written as not reported.
Swipe horizontally to read the table
Setting k Gen. Q. Rnd. Str. Non-Q. Prob. Q. IR 3 1249 11 11 11 IR + reranker 3 1860 9 7 11 RAG 3 Not reported 11 11 11 RAG + reranker 3 Not reported 11 11 11 IR 5 4547 11 11 11 IR + reranker 5 4877 11 11 11 - Authors' statement on generated queries: The authors claim that at k=3, the 1249 generated queries for IR are sufficient to successfully distinguish among all evaluated models; all three adversarial query types in that row are 11. The table is not broken down by victim model and does not specify the dataset; the RAG rows in Table 5 are not reported.
- Direction of k: The authors claim that decreasing k lowers and increasing k raises the chance of distinction; generated queries for IR are 4547 at k=5. The curve readings in Figure 2 do not appear in the converted text. The authors claim this is consistent with Caspari et al. (2024)'s observation that at smaller k, retrieval similarity decreases as k increases.
- Reranker and table differences: The authors claim that when the victim uses a reranker and candidates do not, performance improves at k=3 (generated queries 1860). The authors also claim that under the reranker, the number of successful adversarial queries decreases; in Table 4, Rnd. Str. is 9, Non-Q. is 7, and Prob. Q. remains 11. In Table 5, at k=5, all three types for IR and IR+reranker are 11, with no decrease.
Interactions on RAG
- What was tested: Section 6.2 uses MS MARCO on AnythingLLM, where the attacker only submits queries and observes returned document chunks. The authors first observe that Query mode does not apply retrieval threshold filtering by default unless specified by the user; and claim that Query and Chat have the same retrieval behavior across query types.
- Refusal and retrieval: Random strings generally cause refusal at the generation layer across the listed 5 generation models, but retrieval still returns top-k document chunks. Whether Non-Q. includes a question mark changes the generation response (often clarifying or refusing without a question mark, often vague affirmation with one), but retrieval still returns document chunks. Prob. Q. triggers both generation and retrieval.
- Authors' interpretation: The authors claim these queries bypass the LLM's tendency to refuse inputs not recognized as well-formed questions. They also claim that embedding models with a reranker remain distinguishable from other embedding models without a reranker under adversarial queries; corresponding counts are in the RAG rows of the table above.
Similarity Thresholds
- Distinguishable counts: Table 6 sets cosine thresholds on IR. Gen. Q. at k=3 is 1247 (0.25), 580 (0.50), 194 (0.60), 8 (0.75); at k=5 it is 4545, 2244, 721, 35. The authors claim 0.25 has little effect on generated queries, and distinguishable queries decrease after rising to 0.6. The table does not specify the dataset.
- Adversarial queries to zero: At 0.25, Rnd. Str. is 9, Non-Q. is 10, Prob. Q. is 11 (same for k=3 and k=5). At 0.50 and above, all three types are 0. The authors do not explain this separately.
- Retrieval quality: Table 7 compares thresholds on MS MARCO passage retrieval. e5-large-v2's MRR@10 and Recall@1000 remain 0.3587 and 0.9777 from 0.00 to 0.75. LaBSE's Recall@1000 is 0.5419 at 0.00 and 0.0007 at 0.75, with MRR@10 from 0.0603 to 0.0005. The authors claim thresholds should be adjusted per retrieval model.
Other Ablations and Analyses
- Figure 1: Randomly sample documents, generate questions, eliminate candidates until only the victim remains; includes MS MARCO and Alloprof. The authors claim on average only a few queries are needed; the converted text has no histogram readings.
- gtr-t5-base, Table 7: MRR@10 is 0.3494 from 0.00–0.60 and 0.3405 at 0.75; Recall@1000 is 0.7690 at 0.75 (0.9793 at 0.00); Docs/Retrieval is 999.5 at 0.60 and 36.8 at 0.75.
- all-MiniLM-L6-v2, threshold 0.75: MRR@10 0.2092, Recall@1000 0.3937, Docs/Retrieval 11.9 (at 0.00: 0.3046, 0.9653, 1000.0).
- paraphrase-multilingual-MiniLM-L12-v2, threshold 0.75: MRR@10 0.1460, Recall@1000 0.3397, Docs/Retrieval 29.7 (at 0.00: 0.1957, 0.8586, 1000.0).
- e5-large-v2, threshold 0.75: Docs/Retrieval 998.6 (at 0.00: 1000.0).
- LaBSE's Docs/Retrieval: 47.3 at 0.50, 1.0 at 0.60, 0.0 at 0.75 (Table 7).
What are some points that can be further explored?
The authors state they did not examine chunk size and overlap, and plan to extend to closed-source embedding models.
Section 9 only lists two follow-up items: chunking parameters and closed-source embedding models.
Limitations and Future Directions Noted by the Authors
- Chunking parameters: The evaluation did not examine the impact of document chunk size and chunk overlap on the attack; the authors claim future work could study these parameters to understand robustness across different configurations (Section 9).
- Closed-source systems: Experiments mainly target open-source embedding models. The authors claim future work will extend EIA to closed-source and proprietary systems, such as OpenAI or Google, to assess whether the attack remains effective (Section 9).
Experimental Coverage
- Embedding models: The 13 open-source models in Table 2, across five families, are rotated as victims per Section 5.4; k is 3 and 5, and only cosine similarity is used. AnythingLLM additionally uses all-MiniLM-L6-V2, nomic-embed-text-v1, e5-small (Section 5.3).
- Data and tables: Section 5.1 uses a 7400-document subset of MS MARCO, and the Alloprof English subset of 585 documents. Figure 1 includes both datasets. Tables 4–6 do not specify dataset names.
- RAG: Section 6.2 uses MS MARCO on AnythingLLM with k=3; the generation layer observation includes 5 LLMs. Chat and Query are not reported separately for distinguishable counts. The RAG rows in Table 5 are not reported.
- Defense numbers: Section 7 and Tables 6–7 report distinguishable counts at thresholds 0.25, 0.50, 0.60, 0.75, and MRR@10, Recall@1000, Docs/Retrieval for 5 models on MS MARCO. Hiding document chunks and adding random or synthetic documents are only discussed in Section 7; the paper does not report experimental numbers for these two.
- Not provided counts: The paper does not give the number of repeated samplings for Figure 1. The reranker experiment uses cross-encoder/ms-marco-MiniLM-L6-v2 with initial retrieval of 25 documents (Section 5.2). AnythingLLM's chunking settings are tokenization 1000, overlap 20 (Section 5.3).
Summarize the main content of the paper
EIA identifies the embedding model from candidates using differences in unordered document sets, and provides counts under reranker and threshold settings.
EIA is an attack to identify the embedding model used on black-box IR.
- Problem: Inversion usually requires knowing the embedding model first, and systems behind APIs often do not provide vectors; the attacker only sees unordered top-k. The authors' direct motivation is that inversion could leak sensitive user queries.
- Approach: Use Jaccard to compare the victim's and candidates' document sets, keeping queries with elimination scores that can exclude incorrect candidates. In addition to questions generated per document, there are random strings, non-question instructions, and probing queries. It is assumed documents are public and the candidate set contains the victim.
- Main counts: In Table 4, for IR with k=3, distinguishable generated queries are 1249 (max 7433), which the authors claim is sufficient to distinguish all evaluated models; all three adversarial query types are 11. At k=5, this generated query count is 4547 (Table 5).
- Reranker and RAG: With k=3 and when the authors claim the victim uses a reranker and candidates do not, generated queries are 1860 and Non-Q. is 7. On AnythingLLM with k=3, all three adversarial query types remain 11; the listed 5 generation models refuse random strings, but retrieval still returns document chunks.
- Thresholds: With k=3 and threshold 0.75, generated queries are 8 (Table 6). Table 7 on MS MARCO shows e5-large-v2's MRR@10 remains 0.3587 up to 0.75; LaBSE's Recall@1000 is 0.0007 at 0.75. The authors claim thresholds need to be adjusted per model.
- Authors' conclusion: The authors claim public documents and known candidates relax the assumption of model knowledge for inversion. Section 9 states that chunk size and overlap were not examined, and plans to extend to closed-source embedding models.