AnswerDotAI / AnswerDotAI/RAGatouille

Issue with indexing BGE-M3 (large dimensionality vectors)

Open
#150 8 comments 1 reaction 0 assignees View on GitHub
help wanted
Dominant language
Python
Stars
4k
Forks
276
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am trying to use the [BGE-M3](https://github.com/FlagOpen/FlagEmbedding/tree/master/FlagEmbedding/BGE_M3) model within the library. I managed to tweak the library a bit to be able to use the model to do the inference and get the same embeddings as the one I get using the original BGE-M3 code.

I checked with index-free querying and it works great when trying to build an index, the results just get random. On the same dataset, I go from `'Hit@1': '0.41', 'Hit@3': '0.72', 'Hit@5': '0.82', 'Hit@10': '0.89', 'Hit@30': '0.96', 'Hit@50': '0.98', 'Hit@100': '0.98'` with my index-free script, to `'Hit@1': '0.05', 'Hit@3': '0.12', 'Hit@5': '0.18', 'Hit@10': '0.28', 'Hit@30': '0.46', 'Hit@50': '0.62', 'Hit@100': '0.91'` when using an index. I built indexes with ColBERT models just fine, so it has to do with the indexing of this specific model.

One hypothesis might be that the embedding size is too large (1024) to be compressed to 8 bits, but I can't manage to put higher nbits.
If anyone has an idea of why the indexing might be failing, I am really interested!

Edit: If anyone is interested, I can explain how I made BGE compatible for inference

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository files or tests are named. Start by reproducing the index-free and indexed BGE-M3 comparison, then inspect the indexing path and the nbits configuration used for the 1024-dimensional embeddings. Done means indexed retrieval no longer produces the reported quality drop and is consistent with the index-free results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.