From: wmwsagara (@wmwsagara) <noreply+wmwsagara@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #442: OpenAI's text-embedding-3-large model not compatible with pgvector 5.1
Date: Sun, 28 Jan 2024 08:04:41 +0000
Message-ID: <gh-pgvector-pgvector-442-c1913507926@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-442@github.com>
References: <gh-pgvector-pgvector-442@github.com>
Andrew (@ankane) please let me ask to reopen this issue for the benefit of wider pgvector user community.
1. Which embedding model is suitable for a specific application?
text-embedding-3-small:
"text-embedding-3-small is our new highly efficient embedding model and provides a significant upgrade over its predecessor..."
NOTE: "new highly efficient embedding model"
Comparing text-embedding-ada-002 to text-embedding-3-small, ... the average score on a commonly used benchmark for English tasks (MTEB) has increased from 61.0% to 62.3%.
text-embedding-3-large:
"text-embedding-3-large is our new next generation larger embedding model and creates embeddings with up to 3072 dimensions."
NOTE: "new next generation larger embedding model"
text-embedding-3-large is our new best performing model. Comparing text-embedding-ada-002 to text-embedding-3-large: ... while on MTEB, the average score has increased from 61.0% to 64.6%.
Other models:
voyage-lite-02-instruct:
MTEB the average score: 67.13 (Best performer on MTEB leaderboard)
https://docs.voyageai.com/embeddings/
Note, "But More advanced and specialized models are coming soon:
voyage-finance-2: coming soon
voyage-law-2: coming soon
voyage-multilingual-2: coming soon
voyage-healthcare-2: coming soon"
This means, voyage-lite-02-instruct may not be good enough for finance, law, healthcare.
Therefore, text-embedding-3-large (MTEB 64.6%) may be better for finance, law, healthcare than voyage-lite-02-instruct (MTEB 67.13%) unless tests prove otherwise.
Similarly, text-embedding-3-large (MTEB 64.6%) may be better for finance, law, healthcare than text-embedding-3-small (MTEB 62.3%) unless tests prove otherwise.
Of course, from the text-embedding-3-small one may retrieve 1024 dimensions, or may use a lower dimension model and save storage and RAM but what's the point, if real world tests shows for a user a significant loss of accuracy?
See: https://huggingface.co/spaces/mteb/leaderboard
Is MTEB average score 64.6% (text-embedding-3-large) good enough? How about a future model proves to be over 95%?
Please note, I'm not saying higher dimensions are always better, but I'm stressing is, users must have the ability to test which model is suitable for them.
2. Why two different maximum dimensions?
src/vector.h
#define VECTOR_MAX_DIM 16000
src/hnsw.h
#define HNSW_MAX_DIM 2000
Is there a technical reason that HNSW index cannot support VECTOR_MAX_DIM?