Run a free red teaming scan on your AI agent
AttackPublished May 2, 2026

What is Embedding Inversion?

Embedding inversion is an attack that reconstructs the original text from its vector embedding, breaking the assumption that embeddings are one-way and privacy-preserving.

On this page

Embedding inversion is an attack class that reconstructs the original input — text, image, or other content — from its vector embedding alone. It breaks a common security assumption: that embeddings are an opaque, one-way transformation safe to share, store, or expose. They aren't. Given access to embeddings of sensitive text, attackers can recover meaningful approximations of the original — sometimes near-verbatim.

How embedding inversion works#

Two approaches dominate the research:

  1. Decoder-based inversion. Train a generative model (a text-to-text transformer) to take embeddings as input and output text that produces those embeddings. Once trained on a representative corpus, the decoder can invert any embedding from the same embedding model with high fidelity.

  2. Optimization-based inversion. Initialize a candidate text, embed it, compute distance from the target embedding, and use gradient descent or beam search to iteratively refine the candidate. Slower than decoder methods but works without a separate training corpus.

Recent research (Vec2Text, GEIA, and follow-ups) has demonstrated:

  • High recovery rates on embeddings from popular models (OpenAI text-embedding-ada-002, sentence-transformers, BGE)
  • Near-verbatim recovery on common phrasings and structured text (emails, support tickets, code snippets)
  • Sufficient recovery for re-identification — even imperfect inversions often retain enough specifics to identify documents or individuals

Why this matters#

Embeddings get treated as if they were hashes — a one-way digest that's safe to store and transmit. Inversion attacks invalidate that assumption:

  • Vector databases are sensitive data. If your vector DB holds embeddings of customer support tickets, internal documents, or PII-laden text, the embeddings should be access-controlled at the same level as the source content.
  • Embedding APIs leak. Sending sensitive text to a cloud embedding API and assuming the embeddings are "anonymized" is incorrect — the embeddings are recoverable to the original content.
  • Logs and telemetry that capture embeddings can leak data. A log line with "user query embedding: [0.12, 0.45, ...]" can be inverted to recover the user's query.
  • Federated and cross-tenant deployments need to treat embeddings as plaintext-equivalent. Sharing embeddings between tenants leaks content between tenants.

Defending against embedding inversion#

  • Treat the vector store like the source data. Apply the same encryption-at-rest, access controls, and audit logging.
  • Restrict who can query the embedding model on sensitive corpora. The threat model includes anyone who can submit candidate texts to the embedding API and observe the output.
  • For high-sensitivity deployments, use per-tenant embedding spaces — different fine-tuned embedding models per tenant make cross-tenant inversion much harder.
  • Don't log raw embeddings. Store hashes or use differential privacy at the storage layer.

For long-form treatment of embedding-inversion attacks alongside RAG poisoning, hybrid retrieval defenses, and the broader vector-layer threat model, see Repello's vector embedding security cornerstone.