Instructions to use memvara/selector-minilm-l6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use memvara/selector-minilm-l6 with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("memvara/selector-minilm-l6") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Notebooks
- Google Colab
- Kaggle
memvara selector, MiniLM-L6
This model picks which turns of a past conversation answer a question. It is the model
behind LocalSelector, the selector in memvara that
ranks a memory read on your own machine, with no API key and nothing sent to a provider.
Given a question and up to 40 candidate turns, it scores each pair. memvara keeps the turns whose calibrated probability passes a threshold, shows them first and whole, and shows the other candidates after them in this model's order.
How to use it
from memvara import Memvara
from memvara.select import LocalSelector
mem = Memvara(read_selector=LocalSelector("memvara/selector-minilm-l6", revision="<commit>"))
result = mem.recall("what did I decide about the deadline?", ranked=True, include_episodes=True)
LocalSelector needs pip install 'memvara[rerank]'. Pin revision to a commit: memvara
ships the calibration for each published commit and refuses a model it has none for.
The repository also holds memvara_selector.json, the calibration the selector applies to
the raw score: Platt scaling (scale, shift), then a keep rule (threshold,
max_keep), measured on 45 LongMemEval questions the model never trained on.
What it was trained on
It starts from
cross-encoder/ms-marco-MiniLM-L-6-v2
at commit 233902d2 and is fine-tuned for one epoch on the gold labels of 256 LongMemEval-S
questions (MIT licence): 1,816 question and turn pairs, 454 of them the turns that hold the
answer. A missed answer turn counts three times as much as a wrongly kept one. Learning
rate 2e-5, 256 tokens, batches of 16, seed 0.
How well it works
All numbers count the answer-holding turns that fit, whole, into a 720-token block.
| Test | This model | Stock MiniLM | No model (reranker and routing) | Paid model selector |
|---|---|---|---|---|
| LongMemEval-S, 191 held-out questions | 0.928 | 0.903 | 0.903 | 0.958 |
| LoCoMo, 1,496 questions, never trained on | 0.777 | 0.758 | — | — |
Judged answers on 199 LongMemEval-S questions, with gpt-oss-120b reading and judging: 165 correct with this model, 162 with no model, 171 with the paid gpt-5.4-mini selector.
On 4 CPU threads it takes about 330 ms (p95) to score 40 candidates, and adds about 130 MB of memory to a process that already holds the reranker.
The full measurements, with the commands that produce them, are in memvara's
docs/BENCHMARKS.md, section "The local selector".
Limits
- It is a free alternative to the paid selector, not a replacement: it answers about six fewer questions in 199.
- It is weakest on questions about what the assistant said, where the answer sits in a long reply.
- It was trained on English, and on one dataset of conversations between a user and an assistant.
Licence
The weights are released under Apache-2.0, the licence of the base model. The base model was trained by its authors on MS MARCO, whose terms describe the data as intended for non-commercial research. Whether that affects your use of a model derived from it is for you to check. The fine-tuning data, LongMemEval, is MIT-licensed.
- Downloads last month
- 30
Model tree for memvara/selector-minilm-l6
Base model
microsoft/MiniLM-L12-H384-uncased