Earlier quoted context omitted.
0.84 Spearman fidelity to the MiniLM teacher at ternary precision is a striking result. How much of that is the quantization-aware training doing the work, versus what a post-training ternary quant of the same encoder would give you?
It's entirely the QAT. The whole distillation process is quantization-aware from the start, so the ternary weights are learned rather than fitted after the fact. The only post-training quantization I applied was int4 on the embedding layer, and I ran a small ablation there to find the sweet spot between size and quality.
Ternlight – 7 MB embedding model that runs in browser (WASM)
41–50 of 82 posts
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#42Thank you for this! Local models will bring privacy at some point, and I already know an excellent use case for such a small embedding model (cheap and fast search in a product base). Relying on the CPU is also a plus in my case.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#43FWIW -- Granite r2 small is a 30M model, still small enough to run on CPU, and a good baseline for fine tunes.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#44Great, now my websites are gonna push entire LLMs onto my browser in order to use my CPU to make inferences about my shopping habits or whatever.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#45What I think is really cool is that the search happens using http range queries across statically hosted parquet files.
I think things like this could bloom into a relatively open and distributed search ecosystem that isn’t controlled by major corporations.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#46Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#47Hobby project, I wanted to "ship a useful model in a web browser". so I distilled a small sentence encoder from MiniLM with ternary quantization-aware training. Also wrote the inference engine from scratch and shipped in Rust → WASM SIMD. It's an embeddings model, not an LLM: text goes in, a 384-dim vector comes out, and cosine similarity between two vectors tells you how related the texts are — regardless of shared…
Nice, I'm really interested in using this for simple semantic search in a native desktop application. Any comparisons with other tiny embedding models? Did you start from MiniLM-L6 because it's an especially good model in its class? It's hard to figure this out since all you provide is "Retrieval (SciFact NDCG@10)". But the claimed performance seems way off, I get only 35 emb/sec in firefox on a i5-4570 rather than 4…
bge-small-en-v1.5 is one that is comparable and what we’re working with for now.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#48Earlier quoted context omitted.
Agree. But this also reminds me fondly of the days where the sounds of my computer so intimately indicated what’s going on.
Amiga floppy disk sounds are the deepest of sense memories.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#49Hobby project, I wanted to "ship a useful model in a web browser". so I distilled a small sentence encoder from MiniLM with ternary quantization-aware training. Also wrote the inference engine from scratch and shipped in Rust → WASM SIMD. It's an embeddings model, not an LLM: text goes in, a 384-dim vector comes out, and cosine similarity between two vectors tells you how related the texts are — regardless of shared…
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#50This is cool! but also maybe you could put a button on the landing page to trigger the demo because it's a bit startling to hear my fans go crazy when opening a webpage.
Agree. But this also reminds me fondly of the days where the sounds of my computer so intimately indicated what’s going on.