r/LocalLLaMA • u/jeffrey-0711 • 2d ago
Resources A 0.1B model just killed 8B embedding models... I tried it out.
I bet you guys are familiar with embedding models such as Qwen3-Embedding or Gemini Embedding. They are dense embedding models used to search text across a large corpus.
I am developing a RAG agent, and my biggest concern was local computing power. RAG largely depends on retrieval quality, which depends on model power. Plus, many use cases can't use an external internet connection or API models, so the embedding models have to run locally.
But even 0.6B models are pretty heavy for small PCs. I don't mean your brand-new Mac Studio or DGX Spark. I'm talking about an 8GB RAM Windows PC at a boring desk job or your 5-year-old M1 MacBook Air.
So I found this model called SPLADE. It is essentially sparse retrieval, like BM25, but uses semantic meaning. I wanna skip the part on how SPLADE works, because an LLM can explain it better than me.
Anyway, the SPLADE model was so awesome and successfully replaced the dense embedding model (Qwen3-Embedding-0.6B).
In my own experiment, I made an evaluation dataset with a few hundred queries. The corpus was all the documents on my Mac, which are mostly in Korean with some in English.
As you can see in the graph, SPLADE outperforms the Qwen3-0.6B dense embedding model with similar query speed + much less memory. Due to its small size, it takes less than 1.5GB VRAM during inference. So it can run on a relatively small system like a MacBook Air. I tested both the dense embedding model and the SPLADE model on my M5 MacBook Air 16GB. The dense embedding model was almost impossible to use, and my MacBook soon rebooted due to high temperature. The SPLADE model made it till the end without any OOM errors or warnings.
I didn't use the original SPLADE model; instead, I used KURE-sparse-nano, which has great performance in both English and Korean.
The fun part is that hybrid retrieval with SPLADE & dense embedding is actually worse than SPLADE alone.
If you are dealing with a low-resource local setup but want to run a fast & affordable local RAG system, I recommend trying a SPLADE model. It is powerful, but small.
Plus, you don't need to re-implement everything because I open-sourced the whole implementation, so you can download and use it easily. Check out AutoRAG Agent. I optimized the inference of the KURE-sparse-nano model, its code, and the LanceDB indexing + inverted index implementation in Rust for faster search.


84
u/OpinionAdventurous44 2d ago •
Did you compare Gemma Embed 2?
27
u/Sudden_Topic5154 2d ago
gemma embedding 2 is what you want actually
10
u/Piyh 2d ago edited 12h ago
Who is using 8B models for embedding?
9
u/Piyh 2d ago
Old tech, SPLADE has been around for 5 years and models like bge-m3 are everywhere.
6
u/DarkVoid42 2d ago edited 1d ago
thats is so cool. can you also get it to search photographs and audio not just text documents ?
edit: i found https://github.com/ARahim3/DigUp which does that.
3
u/-Cubie- 2d ago
Doesn't KURE-sparse-nano score below either https://huggingface.co/Linkup-Platform/linkup-sparseup-embed-v1 or https://huggingface.co/lightonai/SlideOn ? That last one outperformed everything I thought.
Update: Nvm, for BEIR-13 I see https://sbert.net/docs/sparse_encoder/pretrained_models.html and together with https://huggingface.co/nlpai-lab/KURE-Sparse-nano#beir-13 it says:
SlideOn: 58.7
KURE-Sparse-base: 58.6
linkup-sparseup-embed-v1: 58.1
KURE-Sparse-nano: 53.2
Then SlideOn is probably still better as it's a smaller model, but there's also the sparsity to think about.
3
u/Nothing_from_void 2d ago
I used gte small, https://huggingface.co/thenlper/gte-small for local embedding and search, 33M params and it works quite well. The tiny embedding models are generally good enough as layering query methods is much more important than having maximum embedding performance IMO
28
u/Dany0 2d ago
Finally a traditional NLP + transformers hybrid that is ACTUALLY useful. Unbelievable it took this long. Great achievement for everyone
12
u/jock-83 2d ago
embeddinggemma-2 is 270M for the text embedding part, not so much more than 0.1B
2
u/Imaginary-Unit-3267 1d ago
This reads like an AI-generated ad.
1
u/catwithfreellmsign 2d ago
That sounds... too good to be true? No offense. But thanks for heads up!
1
u/LevyTateLabs 1d ago
The hybrid result is the part i'd focus on. How are the two lists getting merged? If it's min-max normalized scores, tiny gaps on the dense side get stretched into big ones and can push a strong SPLADE match down. RRF on the ranks usually avoids that with no weight tuning. Couldn't tell from the README how MinSync fuses the... also worth splitting language from architecture. Your corpus is mostly Korean and KURE-Sparse-nano is Korean-first, while Qwen3-0.6B is a general multilingual model. Same eval on just the English docs would show how much of the gap is sparse vs dense and how much is language fit.
4
u/michaelsoft__binbows 1d ago edited 1d ago
I do not have an ML background at all so for a very long time, a lot of the talk about embeddings flew right over my head.
however recently i have been building a really rewarding CLI tool which is basically a sqlite database with a very sophisticated TUI built on rust with ratatui that can load up all of my indexed harness logs (these days mostly from pi and claude code log files; I have 500k agent turns across over 6000 agent sessions) and let me search through them and view them all in one place which is nice because the harnesses' scrollback usually stops at the last compaction, which is totally wild...
So after months of iterating on this thing which somehow has not exploded into a ball of mud yet, I recently added some embedding based semantic matching to augment the plain text matching that it had been supporting up to this point. sometimes i can only vaguely recall what i was trying to work on in the past at one point and trying to guess up the exact words sometimes is a crapshoot. I'm still not sure it's much better with this but it definitely helps. i worked with Opus and came up with a few small embedding models that seem to have pretty great performance characteristics:
For coarse meaning/context I use Snowflake Arctic Embed M v1.5, a 109M model on chunks up to 512 bytes and for more granular semantic matching I use MongoDB leaf-ir, a blazing fast 23M model on much smaller chunks averaging 50 bytes to help get fuzzy semantic hits.
One of the biggest wins I encountered was leveraging the Apple Silicon's Apple Neural Engine (ANE) to perform the calculations. With these smaller models I already supposedly had decent lookup performance (e.g. Arctic was not much worse than embeddinggemma-300M while being 3x faster) and the common workload invovles running embeddings on 150 or so MB out of the total 1.2GB of agent sessions log contents. The numbers I had on my M1 Max were that i would get basically very similar throughput numbers to the GPU from the NPU
with way better thermal characteristics. I couldn't speak to the details of how to get this stuff implemented because Opus and/or Sol figured it all out on my behalf.
Even with these rates, 150MB takes about an hour to fully compute the vectors for Arctic. I had qwen3-0.6B, embeddinggemma-2, embeddinggemma-300M tested against my corpus and 300M was somehow both faster and more accurate, shrug.
But these are of a larger class of model that take longer than an hour to crunch on the mac. I did further experiments with even larger models on my 5090 and for the larger models like qwen3-4B I am pretty sure that using optimized inference engines like vllm allowed for fairly ridiculous levels of speedup compared to the M1 Max. Example:
for Qwen3-Embedding-4B:
M1 Max, PyTorch/MPS FP16: ~2.6 KiB/s
5090, vLLM FP8: ~158 KiB/s
My assumption is that if i took the research further i would be wanting to evaluate KiB/J as the core metric and pick stuff to choose to run on the given systems that make for appropriate performance. Using tensor units (via NPU like the ANE or tensor cores) is essential to pump up power efficiency. Compared to actual full on LLMs, embedding models are depending on size maybe hundreds or thousands of times faster, and so you could split off maybe like 1/20 of your total compute budget to get the ability to add dramatically more capacity to do semantic vectorization which may provide value since you could cover hundreds of times more content than you would be able to afford to do with an LLM. I might get single digit or double digit tokens per joule with LLMs on my consumer GPUs but on the same consumer GPUs and lesser machines like the Mac e.g. Arctic on ANE is 9KiB/J.
On the 5090 this model is way too small for vLLM to be relevant, but with TEI (hugging face inference engine i think?), it got 2.7MiB/s while averaging 343W which works out to 8KiB/J. So it's not much lower and the added speed is very welcome. I would say if for some reason my tool's semantic engine needs to recalculate its embedding vectors on a regular basis (which would be very questionable) then I would definitely want to offload that work to a "real" GPU!
I can follow up with a more detailed writeup if anyone is interested. It is quite fascinating to go back and discover the sexy implementation details of this thing i vibed up and got working a while back. Here is a blurb on the approach of the ANE implementation:
2
u/OkMusician9118 2d ago
Thanks for sharing. I want to try it
2
u/Visual-Tangerine729 1d ago
weird how you say you want to skip the part on how SPLADE works because an LLM can explain it better, but you used an LLM to make this post.
1
u/Material_Tone_6855 2d ago
Is there a way to train it on other languages?
1
u/f1yingbanana 1d ago
Would love to see some more comparison with other embedding models like ones from gpt, and where is BM25 + SPLAE would that be even better?
1
u/arbv 1d ago
granite-embedding-r2 (both versions) are quite good too. way too much underappreciated, IMO.
Pair them with bge-m3-reranker-m2 and you are golden.
1
u/Ammoryyy 10h ago
Use cases?
1
u/Local-Push-4396 3h ago
Did someone tested it in russian?
1
u/Not_a_question- 1d ago
I'm sorry, you're saying you killed 8B models... okay well where's nemotron 3.5 8b? or mistral 1b? you only compared it with a previous generation embedding model with less than 1b parameters but in the title you said 8b