Zero2Text: Training-Free Cross-Domain Text Embedding Inversion AttackZero2Text: Zero-Training Cross-Domain Inversion Attacks on Textual Embeddings
Zero2Text inverts text vectors without training; on MS MARCO, 3-large, ROUGE-L is 26.08.
The attacker only holds the target vector ev produced by the unknown victim model ϕ, and the goal is to recover the original text so that, after encoding by ϕ, the candidate's distance to ev is minimized. The paper calls this strict black-box: ϕ can be queried via API, but there are no parameters, gradients, training distribution, or leaked embedding–text pairs. The victim target is text embeddings in a RAG vector store.
- RAG vector databases store text as embeddings and are often treated as irreversible. Existing inversion methods either require massive leaked pairs or same-domain aligned data; the authors claim they fail under strict black-box settings and across domains.
- Zero2Text does not train the decoder. The LLM generates candidates token by token, ridge regression aligns local vectors to the target embedding online, only queries a subset of candidates and decays the query amount, then uses a hybrid score and beam search to keep sequences.
- Across four victim embedders, MS MARCO, and PubMed, Zero2Text's BLEU, ROUGE, and COS in Table 2 are higher than Vec2Text, TEIA, and ALGEN. The authors claim scores rise with more queries; noise and LDP lower them.
- The paper does not specifically discuss its own limitations; the Conclusion only calls for stronger embedding defenses. Experiments cover four victim embedders, two datasets with 200 samples each, and Random, LapMech, and PurMech; no repetition counts or human review are reported.
- Evaluated models
- GTR-BaseQwen3-Embedding-0.6BText-Embedding-3-smallText-Embedding-3-large
- Benchmarks
- MS MARCOPubMedMultiHPLT
- Metrics
- BLEU-1BLEU-2ROUGE-LROUGE-1COS
The researchers propose Zero2Text, a training-free cross-domain text embedding inversion attack framework that can recover text from embeddings under strict black-box conditions and without in-domain training data. The method is based on recursive online alignment, combining LLM priors with a dynamic ridge regression mechanism to iteratively align target embeddings during generation without relying on static datasets. In experiments against OpenAI victim models on MS MARCO, it achieves ROUGE-L 1.8 times higher and BLEU-2 6.4 times higher than baselines, and recovers sentences from unknown domains without any leaked data pairs. The research also notes that standard defenses such as differential privacy cannot effectively mitigate this adaptive threat.
Paper analysis
What problem does this paper attempt to solve?
Existing inversion methods either require massive leaked pairs or struggle across domains; Zero2Text uses online alignment and zero-training inversion.
Recovering original text from a victim embedder's vectors under strict black-box conditions, with no leaked text–vector pairs and an unknown target domain.
- Scenario: The authors claim RAG stores emails, trade secrets, etc., in vector databases and assumes embeddings are irreversible one-way functions. Anyone who accesses these vectors via data leakage or public APIs could leak personally identifiable information or intellectual property if they can recover the original text.
- Existing methods: Direct inversion (Vec2Text, GEIA) requires extracting massive victim text–vector pairs to train a decoder; the authors cite magnitudes often in the millions, e.g., 5M pairs. Alignment methods (ALGEN, TEIA) train a decoder on general corpora, then align with typically 1–8K leaked pairs, assuming the training or leaked data matches the target domain.
- Limitations and assumptions: The authors claim domain shift degrades both method types. They argue a pretrained LLM's language prior can generate candidates, then optimize only against the current target vector at inference time, avoiding the need to know the target domain in advance.
- This paper's approach: The authors propose Zero2Text: no decoder training, no offline alignment with leaked pairs, and recursive online alignment at test time with a limited number of API queries. They describe this as search and recovery based on online verification.
- Threat model:
- Objective: Recover text x solely from target vector ev, minimizing the distance D between the candidate encoded by the victim model ϕ and ev.
- Knowledge: The paper calls this strict black-box. ϕ is unknown, with no parameters θ, gradients, or training distribution, and no leaked embedding–text pairs.
- Capabilities: ϕ can be queried via API at inference; the attacker has their own pretrained LLM and local embedder. No assumption of knowing the target domain.
- Victim system: Text embeddings generated by ϕ in a RAG vector database. The authors claim entry points can be data leakage or public API endpoints.
What related research exists?
The paper divides inversion into direct inversion and embedder alignment, and discusses noise and LDP defenses.
Per Section 2, related work is divided into inversion and defenses; experimental comparisons are in Section 4.
Embedding inversion
- Early and white-box: Fredrikson et al. (2015) reconstruct sensitive inputs from image and medical model outputs. Song and Raghunathan (2020) recover input tokens from gradients; Pan et al. (2020) extract user data from general language models; Zhu et al. (2019) and Gupta et al. (2022) recover private text from federated learning updates. Carlini et al. (2021) discuss LLMs memorizing training data, which can be elicited with targeted prompts.
- Black-box sentence embeddings: The introduction and Table 1 classify Vec2Text (Morris et al., 2023) and GEIA (Li et al., 2023) as direct inversion. Li et al. report that sentence embeddings leak semantics; Vec2Text iteratively corrects input to match a target vector; Dimitrov et al. (2022)'s LAMP uses discrete optimization to extract text from gradients. This paper claims direct inversion relies on large-scale leaked pairs and has training-domain bias.
- Alignment-based few-shot: Chen et al. (2025b)'s ALGEN uses cross-model alignment for generative few-shot inversion; the paper claims it is more query-efficient than optimization-based methods. Huang et al. (2024a)'s TEIA performs transferable embedding inversion. This paper claims both still train a decoder on a surrogate embedder and use leaked pairs for victim–surrogate alignment, and alignment-domain bias limits generalization (Table 1).
Inversion defenses
- Adversarial training: Song and Raghunathan (2020) use adversarial training as a defense. This paper claims it is ineffective in black-box scenarios where the attacker's model is unknown.
- Noise: Morris et al. (2023) inject Gaussian noise. Chen et al. (2024) claim its effect weakens in multilingual settings.
- Differential privacy: Lyu et al. (2020) use differential privacy during training. Du et al. (2023b) use metric-based local differential privacy (LDP) to purify embeddings at inference. This paper claims protecting embeddings remains difficult against few-shot inversion, and evaluates with Random, LapMech, and PurMech in Section 4.7.
Baselines and data
- Baseline methods: Vec2Text (with/without Corrector), TEIA, ALGEN. For fair comparison, baselines construct training or alignment pairs by querying the victim model with 1,000 texts from MultiHPLT English, a set different from the evaluation domain; the query cap is 1,000, following ALGEN's setup. ALGEN's decoder is additionally trained on 150,000 MultiHPLT and open-source embedder vector pairs.
- Evaluation data: MS MARCO (general retrieval) and PubMed (biomedical abstracts). 200 samples each, following Chen et al. (2025b).
The authors position this work as zero-shot with no auxiliary dataset: no offline decoder or static alignment, but recursive feedback at test time for online alignment against a single target vector, removing the assumption that training and target domains must match.
How does the paper address this problem?
Zero2Text uses an LLM to generate token by token, then uses ridge regression online to align the local vector to the target embedding.
Zero2Text does not train a decoder and does not use leaked pairs for offline alignment. An open-source LLM proposes candidates token by token based on context, and ridge regression projects the local embedder's vectors into the victim space; only a portion of candidates are sent to the victim API, and the returned vectors update the projection, then beam search keeps sequences (Figure 2).
Problem setting
- The victim model ϕ maps text to ev. The attacker can only query ϕ via the API and must find candidates in text space with smaller distance.
- The objective is written as x̂∗=argminx̂∈ XD(ϕ(x̂),ev), i.e., minimizing the distance between the candidate encoding and the target vector. D is a distance metric; the paper does not write it as a fixed formula.
- Unlike Chen et al. (2025b), the authors assume no leaked pairs are available for offline training of a surrogate model or adapter.
Design principles
- Language prior: Instead of an in-domain decoder that easily overfits external data, a pretrained LLM's probability distribution generates candidates from scratch. The experimental generator is Qwen3-0.6B; the text also mentions Llama as an available open-source LLM example, but the experiments did not run Llama.
- Single-vector online optimization: Static alignment learned on open corpora is abandoned. The projection matrix is updated at inference time only for the current ev. The authors state this avoids needing to know the target domain in advance.
Iterative generation and diversity filtering
- At step t, the LLM gives logits for the next token given context s(t-1) (initially [BOS]). The vocabulary is restricted to ASCII tokens.
- Diversity filtering does not take top-K by probability but selects KS candidates such that the pairwise cosine similarity of candidate embeddings is below threshold T_hw, to avoid collapsing to a single mode. This paragraph does not specify which embedder computes this similarity.
- Beam search keeps KB sentences until [EOS] or maximum length T. Experiments set beam size to 10, KS=1000, T_hw=0.9, T=32. At the first step, a logit penalty of -5 is applied to non-letter tokens.
Online projection, scoring, and query decay
- Projection matrix W_t maps local vectors into the victim space. The update is written as ridge regression: using the local and victim vector pairs queried up to step t, with regularization term λ. Experiments set λ=0.1. Unqueried candidates are re-projected with the new W_t.
- Each step sends KA×γ^(t-1) candidate sentences to the victim API. γ<1, so query volume decreases with steps. Experiments set KA=50, γ=0.8. At the first step there is no W_0, so grouping by confidence is skipped, and 3×KA queries are sent exceptionally.
- The hybrid score is S(ei,t)=Z(yi)+conft× Z(cos(ei,ev)). Z is the z-score. The authors state the logit term maintains grammar and context, and the cosine term measures semantic closeness to ev.
- conf_t is the average cosine similarity with the victim vector, computed on the samples queried at this step, using the previous round's projection. At t=1, W_0 is undefined; the paper writes conf_1 as the same average multiplied by 0.7, with the projection in the formula using W_1. The authors state that when confidence is low, less reliance on embedding similarity reduces the risk of early divergence.
- After sorting by this score, beam search selects sequences for the next step. The local embedder in the main experiments is all-mpnet-base-v2.
What experiments did the paper conduct?
Across four victim models and two datasets, Zero2Text's n-gram and ROUGE are higher than three baselines.
Experimental setup
- Victim models: GTR-Base, Qwen3-Embedding-0.6B, Text-Embedding-3-small (OPENAI(3-small) in tables), Text-Embedding-3-large (OPENAI(3-large) in tables).
- Attack side: Generation uses Qwen3-0.6B, and the local embedder defaults to all-mpnet-base-v2. The scaling experiments additionally use Qwen3-1.7B; the replacement experiments use mE5-Large-Instruct.
- Data: MS MARCO and PubMed, 200 items each. Baselines query 1,000 items from MultiHPLT English offline, whose domain differs from the evaluation sets. ALGEN's decoder additionally uses 150,000 pairs.
- Baselines: Vec2Text's Base and Corrector are both T5-base (235M), with 50 iterations and beam size 8 during recovery, reported with/without Corrector. TEIA trains an adapter with DialoGPT-small (117M). ALGEN's main experiments use Flan-T5-small (80M), and the scaling experiments additionally use Flan-T5-large (0.78B).
- Metrics: BLEU-1/2 measure n-gram precision; ROUGE-1 and ROUGE-L measure word overlap and longest common subsequence; COS is the cosine similarity between the recovered sentence, re-encoded by the victim model, and the target vector. No LLM review.
- Hardware: Two NVIDIA RTX 5090s, Intel Xeon 6530. The paper does not report repetitions or statistical tests.
Main results
According to Table 2, on MS MARCO for Zero2Text and ALGEN:
Swipe horizontally to read the table
Victim model Method BLEU-2 ROUGE-L COS GTR-Base Zero2Text 10.95 18.73 0.7514 GTR-Base ALGEN 2.35 14.16 0.5574 Qwen3-Embedding-0.6B Zero2Text 13.45 22.55 0.7323 Qwen3-Embedding-0.6B ALGEN 2.63 15.65 0.4022 OPENAI(3-small) Zero2Text 17.14 25.55 0.6983 OPENAI(3-small) ALGEN 1.87 13.69 0.2524 OPENAI(3-large) Zero2Text 16.42 26.08 0.6634 OPENAI(3-large) ALGEN 2.38 14.79 0.2483 - The authors state that Vec2Text and TEIA degrade due to little offline data, and the Corrector's benefit is limited. On the same table, MS MARCO, OPENAI(3-large), Vec2Text (without Corrector) has BLEU-2 of 2.55 and ROUGE-L of 9.23; TEIA has 1.01 and 6.00.
- The authors state that although ALGEN trains its decoder on large-scale open data, it is still affected by the mismatch between alignment data and the target domain. The abstract writes that on MS MARCO and OpenAI victim models, ROUGE-L is 1.8 times the baseline and BLEU-2 is 6.4 times; the main text maps the 1.8 times to ALGEN's ROUGE-L of 14.79 and the 6.4 times to Vec2Text's (without Corrector) BLEU-2 of 2.55, with the model being OPENAI(3-large). Following the main text's calculation, the "times" here is a ratio of scores, not an excess of that many times.
- The authors state that Zero2Text is higher on all metrics, victim models, and datasets. On PubMed in Table 2, Zero2Text for GTR-Base has ROUGE-L of 16.81 and BLEU-2 of 8.38; for OPENAI(3-small) it has 25.64 and 17.97, with BLEU-1 of 35.42. In the table, every Zero2Text cell is higher than the three baselines under the same setting.
Query cost
- Table 3 for OPENAI(3-small): offline tokens are counted by MultiHPLT, online by PubMed. Vec2Text has 1,000 offline sentences and 28.45×10^3 tokens, and 3,144 online sentences and 82.60×10^3 tokens. ALGEN has the same 1,000 offline sentences and 28.45×10^3 tokens, and 0 online. TEIA has 1,000 offline sentences and 30.15×10^3 tokens, and 0 online. Zero2Text has 0 offline, and 2,180 online sentences and 13.88×10^3 tokens. The main text calls 3,144 and 2,180 sentences, and 13.88k and 82.60k tokens, averages.
- The authors state that Zero2Text is more token-efficient because early sequences are short, and later γ reduces the number of query sentences. The paper does not report wall-clock time.
- Figure 3's horizontal axis is the number of offline plus online API queries (scale up to 5,000), and the vertical axis is ROUGE-L, ROUGE-1, BLEU-1, BLEU-2. The legend includes Zero2Text's BEAM (5, 10, 20), KA (25, 50, 100), γ (0.5, 0.8, 0.9), Vec2Text's iterations (1, 10, 20, 50) and BEAM (1, 2, 4, 8), and ALGEN's offline budgets {100, 500, 1000, 2000, 3000, 4000, 5000}. The authors state that increasing beam, KA, and γ monotonically improves Zero2Text; ALGEN rises with offline queries but with decreasing growth and tends to saturate; Vec2Text's gain is negligible when queries increase greatly. Curve endpoints cannot be read from plain text.
Defense evaluation
- Section 4.7 compares ALGEN and Zero2Text on PubMed. Defenses are Random noise, and the LDP-based LapMech and PurMech; ε/d takes 0.25, 0.5, 1, 2, 4, with smaller values meaning stronger noise. The table title does not state the victim model; the None row's values match the PubMed, OPENAI(3-small) row in Table 2.
- Without defense, Zero2Text's BLEU-1 is 35.42, ROUGE-L is 25.64, and COS is 0.6859. Random drops to 15.57, 9.67, 0.1463. LapMech at ε/d=0.25 has BLEU-1 of 20.36 and ROUGE-L of 13.75, and at ε/d=4 has 34.04 and 25.11. PurMech at ε/d=0.25 has 19.93 and 13.50, and at ε/d=4 has 34.65 and 25.20 (Table 6).
- The authors state that both decline, but Zero2Text under defense is still comparable to undefended ALGEN (BLEU-1 19.87, ROUGE-L 14.19), citing PurMech, ε/d=0.25's 20.36 and 13.75. In Table 6, 20.36 and 13.75 are in LapMech, ε/d=0.25; PurMech at the same budget has 19.93 and 13.50. The Random row is below undefended ALGEN.
Alignment and model scale
- Table 5 compares, on PubMed, the COS between real text after alignment and the victim vector. TEIA offline for OPENAI(3-small)/(3-large) is 0.0039/0.0056; ALGEN is 0.3229/0.2848; Zero2Text online is 0.6063/0.5447. The authors state that offline alignment fails to map when data are scarce and cross-domain, while online per-instance optimization achieves cosine similarity above 0.5.
- Figure 4's horizontal axis is model scale (B, scale 0 to 1.5), and the vertical axis is BLEU-1, BLEU-2, ROUGE-L, ROUGE-1, COS, split into MS MARCO and PubMed. Generators are Qwen3-0.6B and Qwen3-1.7B, with Flan-T5-small (0.08B) and Flan-T5-large (0.78B) as comparisons. The authors state that recovery generally improves with scale, but larger ALGEN is still below Zero2Text; and state that on MS MARCO, OpenAI (3-large), Zero2Text's ROUGE-L is about 1.6 times ALGEN's. Curve endpoints in the figure are not readable in plain text. This is not the same setting as Table 2's 1.8 times.
Other ablations and analyses
- Replacing the local embedder with mE5-Large-Instruct (Table 4): on MS MARCO, GTR-Base's ROUGE-1 is 35.44 and COS is 0.8660; OPENAI(3-small)'s BLEU-1 is 40.36 and ROUGE-L is 29.30. The authors state that the embedder can be swapped without additional training, and believe this may further improve recovery.
- Table 7 provides qualitative comparison on MS MARCO, Qwen3-Embedding-0.6B. The authors state that baselines often spell out isolated words and fail to recover proper nouns or continuous word sequences, while Zero2Text can. The original text is not reproduced. The paper states that supplementary Section D has more examples, but the attached text does not provide these examples.
- In Table 2, on MS MARCO, after Vec2Text adds the Corrector, Qwen3-Embedding-0.6B's ROUGE-L drops from 8.40 to 8.00, and OPENAI(3-large)'s BLEU-2 drops from 2.55 to 2.44. The authors only say the Corrector's benefit is limited, without separately explaining these drops.
What are some points that can be further explored?
The paper does not specifically discuss its own limitations; the Conclusion only calls for stronger embedding defenses.
Limitations and future directions noted by the authors
- The paper has no dedicated Limitations, Discussion, or Future Work section, nor does it frame any set of lower scores as a limitation of Zero2Text itself.
- The Conclusion states that these results expose critical vulnerabilities, hence robust defenses against such generalizable attacks are needed. The contributions likewise state that differential privacy and noise injection are insufficient to mitigate this adaptive threat, and emphasize the need for stronger embedding security. This is a call for defenses, not a self-imposed limitation on the attack method's coverage.
Experimental coverage
- Victim embedders are GTR-Base, Qwen3-Embedding-0.6B, Text-Embedding-3-small, Text-Embedding-3-large, 4 in total. The main generation-model experiments use Qwen3-0.6B, and the scaling experiments add Qwen3-1.7B (Sections 4.1, 4.5).
- Evaluation sets are MS MARCO and PubMed, 200 items each. Baselines additionally use 1,000 items from MultiHPLT English for offline queries, and ALGEN's decoder uses 150,000 pairs (Section 4.1).
- Baselines are Vec2Text (with/without Corrector), TEIA, ALGEN. Metrics are BLEU-1, BLEU-2, ROUGE-1, ROUGE-L, COS. The paper does not report repetitions, statistical tests, or human review.
- Defenses include Random, LapMech, PurMech, with ε/d values of 0.25, 0.5, 1, 2, 4; the table only gives PubMed (Table 6). The table does not specify the victim model.
- There are also query-budget curves (Figure 3), aligned COS for two OpenAI models on PubMed (Table 5), local embedder replacement (Table 4), and qualitative examples on MS MARCO for Qwen3-Embedding-0.6B (Table 7). The vocabulary is restricted to ASCII, with maximum length T=32. The paper does not report wall-clock query time.
Summarize the main content of the paper
Zero-training online alignment can reconstruct sentences from black-box embeddings in unknown domains and without leaked pairs.
Zero2Text is a text embedding inversion that trains no decoder and uses no leaked text–vector pairs, targeting recovery from RAG vector databases under strict black-box conditions with an unknown target domain.
- Problem: Direct inversion requires massive same-domain leaked pairs; alignment methods additionally rely on a small number of leaked pairs and assume domain consistency. The authors argue domain shift makes both method types fail.
- Method: A pretrained LLM generates candidates token by token; a local vector is projected online into the victim space via ridge regression. Scoring combines logits with cosine similarity, query count decreases with γ, and beam search retains sequences. At test time the victim API can be queried, but no offline alignment data is needed.
- Main results: In Table 2, on MS MARCO and OPENAI(3-large), Zero2Text achieves ROUGE-L of 26.08 and BLEU-2 of 16.42. The authors claim the former is about 1.8 times ALGEN (14.79) and the latter about 6.4 times Vec2Text without Corrector (2.55); the abstract writes these multiples relative to baselines, and the conclusion relative to SOTA methods. On PubMed and OPENAI(3-small), BLEU-1 is 35.42 and ROUGE-L is 25.64.
- Queries and defenses: For OPENAI(3-small), Zero2Text has no offline queries, with online averages of 2,180 sentences and 13.88k tokens (Table 3, online tokens counted on PubMed). In Table 6, scores drop after adding noise or LDP. The authors claim existing defenses remain insufficient; under Random, Zero2Text's ROUGE-L is 9.67, below the undefended ALGEN's 14.19.
- Authors' conclusion: The authors believe unknown-domain sentences can be recovered without domain-dependent pretraining, and claim this exposes the risk of treating embeddings as one-way functions, thus requiring defenses that can handle generalizable attacks.