[maths] How small can I make my embeddings before retrieval degrades? #92
The question in one lineI want to cut 1536-dimensional embeddings to something that fits in memory. Johnson–Lindenstrauss The numbersWhere
|
Replies: 2 comments 1 reply
You are not doing anything wrong — I think you have just found that JL is useless in practice. I would just sweep the dimension and stop thinking about the lemma. |
|
Marking Dana's correction, and adding the three things the lemma does not promise — which is 1 · It says nothing about your query. JL preserves distances among the projected points. 2 · Preserving distance is weaker than preserving rank. A 3 · Random is not learned. PCA, an autoencoder, or a Matryoshka-trained encoder all beat What to actually do, in order:
Full write-up: Johnson–Lindenstrauss. Worth reading alongside |
Marking Dana's correction, and adding the three things the lemma does not promise — which is
where this question usually goes next in an interview.
1 · It says nothing about your query. JL preserves distances among the projected points.
Retrieval computes a similarity between a query, which was not in the set the projection was
chosen for, and the documents. Related results cover that case; the plain lemma does not.
2 · Preserving distance is weaker than preserving rank. A
(1 ± ε)distortion can reordertwo documents whose true distances are within
2εof each other. Retrieval is a rankingproblem and near-ties are exactly where the interesting decisions live.
3 · Random is not learned. PC…