Skip to main content
QUICK REVIEW

[Paper Review] Vec2Vec: A Compact Neural Network Approach for Transforming Text Embeddings with High Fidelity

Andrew Gao|arXiv (Cornell University)|Jun 22, 2023
Hate Speech and Cyberbullying DetectionComputer Science3 citations
TL;DR

This paper introduces Vec2Vec, a lightweight neural network that maps open-source MPNet embeddings (768-d) to OpenAI's proprietary text-ada-002 embeddings (1,536-d) with high fidelity. Trained on 50,000 food reviews over 75 epochs, the model achieves a mean cosine similarity of 0.932 on unseen test data, enabling near-identical performance in vector search while offering offline, private, and cost-effective inference.

ABSTRACT

Vector embeddings have become ubiquitous tools for many language-related tasks. A leading embedding model is OpenAI's text-ada-002 which can embed approximately 6,000 words into a 1,536-dimensional vector. While powerful, text-ada-002 is not open source and is only available via API. We trained a simple neural network to convert open-source 768-dimensional MPNet embeddings into text-ada-002 embeddings. We compiled a subset of 50,000 online food reviews. We calculated MPNet and text-ada-002 embeddings for each review and trained a simple neural network to for 75 epochs. The neural network was designed to predict the corresponding text-ada-002 embedding for a given MPNET embedding. Our model achieved an average cosine similarity of 0.932 on 10,000 unseen reviews in our held-out test dataset. We manually assessed the quality of our predicted embeddings for vector search over text-ada-002-embedded reviews. While not as good as real text-ada-002 embeddings, predicted embeddings were able to retrieve highly relevant reviews. Our final model, Vec2Vec, is lightweight (<80 MB) and fast. Future steps include training a neural network with a more sophisticated architecture and a larger dataset of paired embeddings to achieve greater performance. The ability to convert between and align embedding spaces may be helpful for interoperability, limiting dependence on proprietary models, protecting data privacy, reducing costs, and offline operations.

Motivation & Objective

  • To enable offline, private, and cost-effective inference by replacing reliance on proprietary embedding APIs like OpenAI's text-ada-002.
  • To bridge the gap between open-source and proprietary embedding spaces through a compact neural network.
  • To achieve high-fidelity transformation of 768-dimensional MPNet embeddings into 1,536-dimensional text-ada-002 embeddings.
  • To demonstrate that a lightweight model can preserve semantic similarity for downstream tasks like vector search.
  • To reduce dependency on closed models by enabling interoperability between different embedding spaces.

Proposed method

  • A simple feedforward neural network was trained to map 768-dimensional MPNet embeddings to 1,536-dimensional text-ada-002 embeddings.
  • The model was trained on a curated dataset of 50,000 online food reviews with paired MPNet and text-ada-002 embeddings.
  • Training was conducted for 75 epochs using mean squared error loss to minimize embedding space discrepancy.
  • The final model, Vec2Vec, is under 80 MB and designed for fast inference in resource-constrained environments.
  • Model performance was evaluated via cosine similarity on a held-out test set of 10,000 unseen reviews.
  • Manual assessment validated retrieval quality of predicted embeddings in vector search tasks.

Experimental results

Research questions

  • RQ1Can a compact neural network accurately map open-source MPNet embeddings to proprietary text-ada-002 embeddings with high semantic fidelity?
  • RQ2To what extent can a lightweight model replicate the performance of a large proprietary embedding model in downstream retrieval tasks?
  • RQ3How does the cosine similarity between predicted and ground-truth text-ada-002 embeddings compare on unseen data?
  • RQ4Can the predicted embeddings maintain sufficient quality for practical vector search applications?
  • RQ5What trade-offs exist between model size, inference speed, and embedding fidelity in cross-embedding space transfer?

Key findings

  • The Vec2Vec model achieved a mean cosine similarity of 0.932 between predicted and actual text-ada-002 embeddings on a held-out test set of 10,000 unseen reviews.
  • Manual evaluation confirmed that predicted embeddings could retrieve highly relevant reviews, approaching the performance of real text-ada-002 embeddings.
  • The final model is under 80 MB, making it suitable for deployment in offline or privacy-sensitive environments.
  • The model demonstrates strong transferability from MPNet to text-ada-002 space with minimal architectural complexity.
  • The approach enables interoperability between embedding spaces without requiring access to proprietary models or APIs.
  • The results suggest that high-fidelity embedding space alignment is feasible using small, efficient neural networks trained on paired data.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.