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
Safetensors
Model size
22.7M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for memvara/selector-minilm-l6

Dataset used to train memvara/selector-minilm-l6