Minish Lab's potion-base-8M Runs 500x Faster Than Transformers at 30MB
A 7.56M parameter static embedding model distilled from BGE-base delivers roughly 92% of MiniLM quality while running hundreds of times faster on CPU.
Takeaways
- potion-base-8M is a 7.56M parameter static embedding model distilled from BGE-base-en-v1.5.
- Reaches about 92% of all-MiniLM-L6-v2 quality on MTEB with a 51.32 average score.
- Roughly 500x faster than BGE-base on CPU, around 30 MB on disk, numpy-only inference.
- Trained with Tokenlearn: distillation, mean-embedding targets, PCA and SIF reweighting.
- Integrates with Sentence Transformers, LangChain, txtai, and ships an ONNX export.
- MIT licensed and best suited to classification, clustering, dedup, and first-stage retrieval.
Hugging Face’s download counter for Minish Lab’s potion-base-8M exceeded 870,000 at the time of writing. The English embedding model contains roughly 8 million parameters, occupies about 30 MB, and produces 256-dimensional sentence vectors through token lookup and pooling. The surrounding Model2Vec project provides tools for distillation, training, inference, and deployment.
For CPU-bound retrieval and classification services, the design removes transformer computation from the request path. Minish Lab reports an aggregate MTEB score of 51.32, compared with 55.80 for all-MiniLM-L6-v2, alongside CPU inference around 500 times faster than bge-base-en-v1.5. The result is a compact option for systems constrained by latency, memory, or cold-start time.
The transformer leaves the request path
A conventional sentence transformer contextualizes every token by processing the full sequence through attention layers. Model2Vec shifts that computation into a one-time distillation step. It processes tokens from the teacher model’s vocabulary, stores their resulting vectors, and can add domain-specific tokens before deployment.
potion-base-8M uses BAAI/bge-base-en-v1.5 as its teacher and adds corpus-level training with Tokenlearn. Its training pipeline has four stages:
- Vocabulary distillation: Model2Vec converts the teacher’s vocabulary into a table of static token vectors.
- Target generation: The teacher encodes a large text corpus, producing sentence-level targets from its mean output embeddings.
- Corpus training: Tokenlearn adjusts the static vectors to reproduce those teacher-generated targets.
- Post-training cleanup: Frequency weighting limits common-token dominance, principal component analysis projects the vectors into a compact space, and smooth inverse frequency weighting improves sentence pooling.
During inference, the model tokenizes each input, retrieves a fixed vector for every token ID, applies the learned weights, and averages the sequence. The same token ID always maps to the same vector, and word order is absent from the final representation. This simple path accounts for both the model’s speed and its contextual limits.
The 4.48-point gap
MTEB combines retrieval, classification, clustering, semantic similarity, and related embedding tasks into category and aggregate scores. The potion-base-8M model card reports the following results on its evaluated task set:
| Model | MTEB average | Retrieval | Architecture |
|---|---|---|---|
potion-base-8M |
51.32 | 31.11 | Static token embeddings |
all-MiniLM-L6-v2 |
55.80 | 42.92 | Transformer encoder |
| GloVe | 45.49 | Not listed | Static word embeddings |
| BPEmb | 42.33 | Not listed | Static subword embeddings |
Across the reported suite, potion-base-8M trails MiniLM by 4.48 points while outperforming the classical static baselines. Its 11.81-point retrieval deficit against MiniLM is more consequential for search systems handling ambiguous queries, nuanced intent, or documents that require word-order awareness.
The model card also reports CPU inference around 500 times faster than the BGE teacher. Minish Lab says a basic Model2Vec model can be distilled from a vocabulary in about 30 seconds on a CPU. That estimate covers vocabulary distillation; potion’s corpus-level Tokenlearn stage adds separate training work. Actual throughput depends on hardware, input length, batch size, tokenization, and serialization overhead.
From install to embeddings
The base Python workflow requires one package installation and a pretrained model download:
pip install model2vec
from model2vec import StaticModel
model = StaticModel.from_pretrained("minishlab/potion-base-8M")
embeddings = model.encode([
"It's dangerous to go alone!",
"It's a secret to everybody."
])
print(embeddings.shape)
encode returns a NumPy array with one row per input and 256 values per row. The core inference path uses NumPy and requires no PyTorch runtime. Model2Vec also supports task-specific training for classification, semantic similarity, regression, and text-pair scoring, with integrations for Sentence Transformers and LangChain.
An official ONNX export runs through ONNX Runtime or Transformers.js, allowing deployment without the Model2Vec package. The weights and library use the MIT license.
Where static vectors hold up
The model card’s category results are strongest in classification, clustering, semantic textual similarity, and word similarity. Those tasks often depend on broad lexical meaning, which weighted token averages can preserve efficiently.
- CPU-only APIs with strict latency or memory budgets
- On-device semantic search and classification
- Deduplication or clustering across large document collections
- Frozen embedding features for lightweight classifiers
- First-stage candidate generation followed by a contextual reranker
- High-volume similarity jobs where transformer inference dominates cost
Static token vectors cannot directly represent word order or assign different vectors to the same token in different contexts. Negation, ambiguous terms, compositional phrases, and subtle query-document relationships can therefore reduce recall. For demanding dense retrieval workloads, Minish Lab recommends potion-retrieval-32M, a task-specific fine-tune with more capacity.
Production evaluation should compare recall, p95 and p99 latency, memory use, cold-start time, and index size on the target corpus. Test sets should include domain terminology, names, negation, ambiguous queries, and long documents. When those cases meet the application’s quality threshold, potion-base-8M can remove a substantial amount of inference cost from retrieval and classification pipelines.