Converts embedding vectors from amazon-titan-embed-text-v2.0 (1024d) to openai-text-embedding-ada-002 (1536d) without re-embedding the source text.
This is a vector conversion model. It takes pre-computed embeddings as input and writes out equivalent embeddings in the target model's vector space, preserving retrieval order. It does not process text. For an end-to-end text -> target-vector pipeline, pair it with the source model or use the hosted API at https://univec.ai.
What is vector conversion?
A corpus embedded with a particular model is bound to that model's vector space: queries must be encoded by the same model for nearest-neighbour search to remain meaningful. Migrating to a different embedder (whether driven by deprecation, an upgrade or a provider change) normally requires re-embedding every document. The cost scales with corpus size and recurs each time the underlying model changes.
A conversion model takes pre-computed source-space vectors and outputs target-space vectors. The training objective is retrieval-order preservation: top-K nearest neighbours in the converted space should align with top-K in the target space despite differences in dimensionality, distance distribution and noise structure.
When to use this
A corpus is already embedded with amazon-titan-embed-text-v2.0.
The target use case calls for openai-text-embedding-ada-002 (better quality, model deprecation, multi-vendor strategy or cost).
Re-embedding is impractical at scale: cost, time, rate limits or loss of access to the original provider.
For embedding new text from scratch this isn't the right tool. Go straight to openai-text-embedding-ada-002 instead.
Evaluation
Metrics measured on a held-out eval split, comparing converted vectors against ground-truth openai-text-embedding-ada-002 embeddings of the same texts.
Metric
Value
Description
MRR
0.9980
Mean reciprocal rank against the target-space corpus
P@1
0.9961
Top-1 retrieval precision
P@5
1.0000
Top-5 retrieval precision
P@10
1.0000
Top-10 retrieval precision
Cosine (mean)
0.8977
Mean cosine similarity to the ground-truth target embedding
Cosine (median)
0.9037
Median cosine similarity
Cosine (std)
0.0352
Standard deviation across the eval set
Kendall tau
0.5376
Rank correlation of pairwise similarities
MRR and P@K measure retrieval quality, which is what downstream search and RAG depend on. Cosine values report how close each converted vector sits to its ground-truth target embedding in the target space.
Training data
Field
Value
Training pairs
393,034
Held-out eval pairs
43,671
Inputs and outputs are unit-normalized 2D arrays with shape (batch, dim).
The ONNX file is t2s.direct.inn.amazon-titan-embed-text-v2-0.openai-text-embedding-ada-002.onnx.
1import numpy as np
2import onnxruntime as ort
34session = ort.InferenceSession(5"t2s.direct.inn.amazon-titan-embed-text-v2-0.openai-text-embedding-ada-002.onnx",6 providers=["CPUExecutionProvider"],# or ["CUDAExecutionProvider", "CPUExecutionProvider"]7)8input_name = session.get_inputs()[0].name
910# amazon-titan-embed-text-v2.0 embeddings, shape (N, 1024)11embeddings = np.random.randn(8,1024).astype(np.float32)12embeddings /= np.linalg.norm(embeddings, axis=1, keepdims=True)1314converted = session.run(None,{input_name: embeddings})[0]15converted /= np.linalg.norm(converted, axis=1, keepdims=True)1617# converted has shape (N, 1536) in openai-text-embedding-ada-002 space.18print(converted.shape)
For batching, GPU execution and .npy / .jsonl file IO, use the companion script univec_inference.py published alongside this model. The requirements.txt file in this repo pins the inference dependencies.
Reproduce or verify metrics
A self-contained evaluate.py is included in this repo. It runs the converter against a paired evaluation dataset and reports the same metrics shown in the table above (cosine, MRR, P@K, Kendall tau). Useful for verifying the published numbers or measuring quality on a different corpus.
The expected dataset is JSONL, one record per line, each holding both a source-space and a target-space embedding of the same text:
cap the number of pairs evaluated (handy for very large eval files)
--device {auto,cuda,cpu}
auto
pick the ONNX execution provider
--batch-size N
1024
inference batch size
--num-anchors N
1024
number of query anchors used for MRR / P@K
--kendall-subset N
2048
sample size for Kendall tau pairwise rank correlation
--seed N
0
deterministic sampling seed
--output FILE.json
none
write metrics to JSON for downstream comparison
The script prints a summary table and writes the same numbers to JSON if --output is set. Without scipy installed, Kendall tau is skipped and the other metrics are still reported.
Limitations
One-way mapping. The reverse direction (openai-text-embedding-ada-002 -> amazon-titan-embed-text-v2.0) requires the corresponding reverse model.
Quality on out-of-distribution data (specialised jargon, languages outside the training mix) can drift away from the eval numbers above. Spot-check on real data before migrating production traffic.
Inputs are assumed to be unit-normalized. Stored embeddings that aren't normalized should be normalized first.
Production use
This release is one of several public conversion pairs published under Apache 2.0. The full UniVec catalog covers around 100 source/target pairs and includes bridge conversions (routing through an intermediary model when no direct pair is trained). Managed inference, batch processing and additional pairs live at https://univec.ai.
License
Apache 2.0. The weights are free to self-host, redistribute and use commercially.
Citation
bibtex
1@misc{univec2026,
2 author = {UniVec},
3 title = {UniVec: Embedding interoperability for retrieval tasks},
4 year = {2026},
5 url = {https://univec.ai}
6}