Abstract
Text embeddings are widely considered a privacy-preserving representation of raw text in modern NLP pipelines. However, this study introduces a novel "Transferable Embedding Inversion Attack" that challenges this assumption. By leveraging a surrogate model trained on a small leaked dataset and optimized through consistency regularization, an attacker can reconstruct sensitive raw text from vector embeddings without any query access to the original victim model. Our results demonstrate that this attack can recover private clinical information with up to 99% accuracy, highlighting a significant and previously underestimated security risk in vector-based data storage.
Introduction
The proliferation of Large Language Models (LLMs) has made text embeddings the standard for tasks like semantic search, vector databases, and Retrieval-Augmented Generation (RAG). Service providers often claim that storing embeddings is inherently "safe" because the original text is not explicitly shared. Previous research into embedding inversion—the process of reconstructing original text from its vector representation—has typically assumed a "white-box" or "query-based" scenario where the attacker has access to model weights or can perform millions of queries.
This paper addresses a more realistic and dangerous threat: the query-free black-box attack. In this scenario, an attacker gains access to a leaked vector database containing a limited number of text-embedding pairs but cannot query the original model. We demonstrate that even under these restrictive conditions, private information can be effectively reconstructed.
Methodology: The Transferable Attack Pipeline
The proposed attack utilizes a three-stage pipeline designed to bridge the gap between a hidden victim model and the attacker’s reconstruction tools.
1. Encoder Stealing (The Surrogate Model)
Since the victim model $\phi$ is inaccessible, the attacker constructs a surrogate model $\hat{\phi}$. This is achieved by taking an off-the-shelf encoder (e.g., GTR-T5) and appending a multi-layer perceptron (MLP) "adapter" to align its output space with the victim's.
2. Consistency Regularization
To ensure the surrogate model mimics the victim's behavior, two key loss functions are employed:
- Intra-sample Regularization: Minimizes the point-to-point distance between surrogate and victim embeddings for the same input.
- Inter-sample Regularization: This novel component ensures that the semantic relationships between different documents in a batch are preserved. By mimicking how the victim model relates Document A to Document B, the surrogate captures the underlying semantic structure of the victim's embedding space.
3. Adversarial Threat Model Transfer
A discriminator $\mathcal{C}$ is used in a GAN-like setup to make the surrogate embeddings $E_T$ indistinguishable from the victim's private embeddings $E_P$. This adversarial training facilitates the "transfer" of the inversion attack from the surrogate domain to the target domain.
4. Embedding-to-Text Inversion
Finally, a GPT-based decoder (e.g., DialoGPT) is trained on the surrogate's data to translate vector representations back into human-readable text.
Experimental Evaluation
The attack was evaluated across diverse domains, including QNLI (Wikipedia QA), IMDB (sentiment), AG News (long-form news), and MIMIC-III (clinical records).
Key Findings
- Performance Gap: The transfer attack significantly outperforms standard "direct" attacks. As shown in the experimental results, the embedding similarity achieved by the transfer attack consistently exceeds that of direct attacks, especially as the size of the leaked dataset $|D_L|$ increases.
- Stealing Efficiency: The surrogate model becomes highly effective with as few as 2,000 leaked pairs, reaching over 70% stealing efficiency at 8,000 pairs.
- Domain Robustness: The attack remains potent even when the surrogate is trained on a different data distribution (e.g., PersonaChat) than the victim (e.g., MIMIC-III). This suggests that attackers do not need perfectly matching data to succeed.
- Clinical Data Risks: In a case study on the MIMIC-III dataset, the attack recovered sensitive attributes with alarming precision: Age (98.84%), Sex (99.47%), and Symptoms (~79%).
Conclusion and Future Work
This research serves as a critical wake-up call for the AI industry. The assumption that embeddings are "privacy-preserving" by default is flawed. Simply hiding model weights or restricting query access is insufficient if even a small portion of the data is leaked. Future work must focus on developing "defense-aware" embeddings that maintain utility for search and retrieval while remaining resilient to inversion attacks.
Summary updated