Best embedding model for RAG: mxbai vs nomic vs bge-m3
RAG is an app that first finds passages, then answers from them. An embedding model is the part that turns text into numbers so passages can be compared. There is no single best embedding model for RAG. There is only the best one for your text, your questions and your machine. This note explains what to check before you choose, how to test fairly, and what won when I tested three models and stopped a fourth.
In short
Picking this model is like hiring a librarian. A famous one from a big library may not know your shelves. The only fair test is to give each one your real questions and see who finds the right book.
Before the test, check five things.
Language. Some models know only English. Others know many languages but may be bigger and slower.
How much text it reads at once. Text past that limit is cut or refused, depending on the program. This decides how you split your documents.
How it sums up a passage. Each model has its own way. Start with that one, but test it, because a wrong choice makes a good model look bad.
Small extras. Some models want a short label before each passage and each question.
Speed on your machine. A model that is too slow to finish is no use.
Then test. Write real questions with the right answers first. Keep some questions aside that you never tune on. Give each model the same questions and the same search. Use enough questions, because five can fool you.
The technical details
Where the model sits in RAG
documents -> split into chunks -> embedding model -> vectors -> index
question ------------------------> embedding model -> vector -> search index
|
top passages -> LLM -> answer
An index is where the vectors are stored for search. An LLM is the language model that writes the answer. The embedding model is used twice: once for every chunk, once for every question. If it ranks the right passage too low, the answer step never sees it. Later steps cannot use what was never found.
What to check before you test
| Check | Why it matters | Example |
|---|---|---|
| Language | A model for many languages is often bigger than you need | mxbai embed large reads English only |
| Window | Text past it is cut or refused, so it sets your chunk size | 512 tokens forces chunks of about 500 |
| Pooling | Wrong pooling gives wrong vectors | mean, CLS or last token |
| Prefixes | Some models expect a label on each text | nomic embed text wants search_document: and search_query: |
| Speed | You must embed every chunk, and again for each new model | Qwen3 embedding was too slow on my laptop |
A longer window costs time and memory. If your passages are short, it adds nothing. If they are long, you can keep each one as a single chunk instead of splitting it in two:
window 512: [ part 1 of passage ][ part 2 of passage ] split into two chunks
window 2,048: [ whole passage ] one chunk
Check the setup before you score
When you run a model through Ollama or any server, its output may not match the official code. Compare them on real chunks first, with cosine. A score near 1.0 means the vectors are right. Chunking, prefixes and the rest of your search can still be at fault. Include your longest real chunk, because that is where limits bite.
Test fairly
Keep everything the same except the model: the questions, the search, the chunks if you can. Count how many questions find a right answer in the top 10. Also count how many have it in the top 3, which shows how high the right passage ranks. Run each question as typed and in the form your app really sends it.
Small samples lie. A change that wins on 5 questions can lose on 50. And read how mean vs CLS pooling can change a model’s score.
My test: mxbai embed large vs bge m3 and others
Nooor finds Quran commentary for a problem you describe in your own words. It searches two English commentaries, Maududi and Ibn Kathir, plus hadith. Each test below used one commentary. I tested on 50 questions, 30 I tuned on and 20 held out. Terms are extra search words a language model writes for each question. More is on the Nooor project page.
| Model | Pooling | How it ran | Window |
|---|---|---|---|
| mxbai-embed-large-v1 | Mean (its card says CLS, mean tested better) | int8 ONNX file, in the app | 512 tokens |
| bge-m3 | CLS | Ollama, f16 | 8,192 tokens |
| nomic-embed-text v1.5 | Mean, then layer norm | Ollama, F16 | 2,048 tokens in Ollama |
| Qwen3-Embedding-4B | Last token | Ollama, q8_0 | 32K tokens |
Parity came first: Ollama against the official code, lowest cosine. bge-m3 gave 0.99998. nomic gave 1.0000, including a 2,047 token chunk. The small Qwen3 0.6B gave 0.99904 on 12 real chunks and 8 questions.
| Test, found and top 3 out of 50 | mxbai | Other model |
|---|---|---|
| Maududi only, as typed | 27, 12 | bge-m3: 16, 6 |
| Maududi only, with terms | 25, 17 | bge-m3: 21, 13 |
| Ibn Kathir only, as typed | 31, 20 | nomic: 26, 17 |
| Ibn Kathir only, with terms | 32, 27 | nomic: 27, 20 |
Each test searched one commentary, so compare inside a row, not across rows. In mxbai embed large vs bge m3, bge-m3 trailed by 11 as typed and by 4 with terms. nomic lost even with its longer window. That window kept Ibn Kathir’s footnotes whole: 2,637 footnotes became 2,722 chunks, and only 76 were split. Qwen3 ran at about 8 chunks a minute and I stopped it at 272 of 5,720. For Nooor, the best embedding model for RAG was the English model I started with, and it is the smaller of the two.
What went wrong
My parity texts were all under 512 tokens. Then a 2,427 token footnote got HTTP 400 from Ollama, although num_ctx was 4,096. The real limit was num_batch, 2,048 by default. Setting both to 4,096 fixed it, and the half done run started again.
The tests are narrow. Each model searched one commentary, chunking differed between models, and the questions and terms were written while mxbai ran, which may favour it. Qwen3 has no score at all.
What I will try next
Run Qwen3 on a machine with a GPU, on both commentaries, with the same 50 questions.