The 30-Millisecond Judge — Multilingual Voice-Turn Matcher (v4.1)
A tiny cross-encoder that decides, in ~30 ms on two CPU threads, whether what a caller just said matches what you predicted they'd say. Built and battle-tested in production by Dialnexa to gate our voice agents' predictive response cache: when the match is right we answer in ~80 ms instead of ~1.5 s; when it's wrong the agent confidently answers a question nobody asked — so this model's job is to be paranoid, fast, and multilingual.
📖 The full story (three model generations, the base-model bake-off, concept-grid training, quantization resurrecting bugs): The 30-Millisecond Judge
What it does
Input: a pair of short utterances — (what_the_user_actually_said, what_you_predicted_they_would_say).
Output: a single probability that they are the same conversational turn-intent — same meaning, same polarity, same slot values.
It is deliberately strict. These score near 0, not "medium":
| pair | why it must fail |
|---|---|
| "yeah" vs "nah" | polarity (cosine similarity scores these ~0.7!) |
| "चलेगा" vs "नहीं चलेगा" | polarity, Hindi |
| "at 6 AM" vs "at 6 PM" | slot value |
| "can I call you back?" vs "please call me back" | a question is not its answer |
| "I can make it" vs "I can't make it" | negation across surfaces |
And these score near 1: "not now" ~ "I'm busy right now", "हाँ जी" ~ "haan ji bilkul" (Devanagari ↔ romanized), "tomorrow" ~ "कल", "It's for myself" ~ "this is for me".
Files
| file | what | size | use when |
|---|---|---|---|
onnx/model_quantized.onnx |
int8, per-channel (the production artifact) | 113 MB | CPU serving — this is the one we run on live calls |
onnx/model.onnx |
fp32 | 449 MB | re-quantization, GPU, further fine-tuning via ONNX tooling |
tokenizer.json + configs |
XLM-R tokenizer (shared by both) | 16 MB | always |
Per-channel int8 matters: per-tensor quantization silently resurrected hard negatives we had trained out (borderline pairs crossing back over the decision boundary). If you re-quantize, re-run your adversarial suite on the exported artifact — not the checkpoint. Details in the blog.
Quickstart (onnxruntime + tokenizers — no framework needed)
import numpy as np
import onnxruntime
from tokenizers import Tokenizer
from huggingface_hub import hf_hub_download
repo = "DialNexa/dialnexa-turn-match-cross-encoder-en-hi"
tok = Tokenizer.from_file(hf_hub_download(repo, "tokenizer.json"))
tok.enable_truncation(max_length=256)
tok.enable_padding(pad_id=1, pad_token="<pad>")
sess = onnxruntime.InferenceSession(
hf_hub_download(repo, "onnx/model_quantized.onnx"),
providers=["CPUExecutionProvider"],
)
def match_probability(actual: str, predicted: list[str]) -> list[float]:
enc = tok.encode_batch([(actual, p) for p in predicted])
feeds = {
"input_ids": np.array([e.ids for e in enc], dtype=np.int64),
"attention_mask": np.array([e.attention_mask for e in enc], dtype=np.int64),
}
logits = sess.run(None, feeds)[0].reshape(-1)
return (1 / (1 + np.exp(-logits))).tolist()
print(match_probability("haan main aa jaunga", ["Yes, I will come", "No, I can't come"]))
# → [~0.999, ~0.0001]
Threshold guidance: we serve at 0.995 in production. Choose by economics, not accuracy: for us a false positive speaks a wrong sentence to a live human, while a false negative just costs one turn's latency win. If your errors are symmetric, lower thresholds buy substantial recall.
Benchmarks
Fine-tuned on ~6,900 labeled pairs (production-mined + synthetic concept grids; details below). Test split is call-disjoint, real-traffic only.
| metric (int8 per-channel artifact) | value |
|---|---|
| test AUC | 0.945 |
| recall @ threshold 0.998 (FPR 2.5%) | 0.59 |
| recall @ threshold 0.995 (FPR 4.1%) | 0.66 |
| adversarial suite (100 hand-built traps: negation, value-slots, swaps, Q↔A) | 0 same-script false positives |
| 20-candidate batch, 2 CPU threads (avx512-vnni) | 26 ms p50 / 59 ms p95 |
| single pair | ~3 ms |
| RAM (session + tokenizer) | ~450 MB |
Production (first weeks, human-judged serve audits): hard false positives halved vs our previous English-only matcher, zero polarity-flip serves in the first soak, Hindi/Hinglish/code-mixed traffic served correctly at scale. Sample production wins: 'नहीं सर, अभी बात करने का समय नहीं' correctly matched a busy-deferral prediction at 0.9996; 'Three will be better.' matched 'Three works for me' at 1.0000; Devanagari↔Latin name transliterations matched.
Languages
- Trained & production-validated: English, Hindi, Hinglish (Devanagari + romanized + code-mixed).
- Works surprisingly well untrained (multilingual mMARCO inheritance): several Indic languages showed zero false positives with partial recall in our probes (ta/te/bn/mr/kn/ml/gu/pa).
- Not safe untrained: languages with zero training signal can score confidently wrong (we observed Urdu polarity flips at 0.99+ before gating). In production we allowlist scripts and bypass the matcher for everything else — recommended.
How it was trained (the short version)
Base: cross-encoder/mmarco-mMiniLMv2-L12-H384-v1 — chosen over a domain-language MLM (MuRIL) after a bake-off where the relevance-pretrained head won decisively (a raw MLM ranked well, AUC 0.90, but recalled nothing at our FPR ceiling: pre-trained ≠ pre-aligned). Bonus: despite 118M params vs the 66M English model it replaced, it runs 2.8× faster — the params are embedding-table lookups, and the 12×384 stack does ~half the FLOPs of 6×768.
Data, three layers: (1) production-mined pairs including our real false-positive inventory — synthetic rows never enter val/test; (2) intent clusters (16 clusters × 17 negative relations, each weighted by how badly that confusion hurt us in production); (3) concept grids — generated negation frames, value-slot grids, token swaps, and question↔answer pairs that took our adversarial suite from 23 failures to 0. When a model fails a category, don't add examples — add the axis.
Limitations
- Single-turn, text-only: it judges utterance pairs, not conversation context. Pair it with turn-scoped retrieval.
- Known residual gaps (all improving in v4.2): numeral↔word value aliases ("10th" ~ "tenth"), compound day+time slots, dangling-fragment suppression, machine-speech (voicemail/IVR) utterances, sentiment-grade values ("good" vs "just okay").
- Bare "yes"/"no" match their expansions by design ("Yes." ~ "Yes, that's correct") — correct only when your candidate set is scoped to the current turn.
About Dialnexa
Dialnexa builds production voice-AI agents for real phone calls — sub-second responses, multilingual (English, Hindi, Hinglish and counting), running at telephony scale. This model is one small, heavily-audited piece of that latency stack. If you're building voice agents and this kind of engineering resonates, talk to us.
Citation & license
Apache 2.0, same as the base model. If this model or the training methodology helps your work:
@misc{dialnexa2026turnmatcher,
title = {The 30-Millisecond Judge: a Multilingual Voice-Turn Matcher},
author = {Dialnexa Engineering},
year = {2026},
url = {https://huggingface.co/DialNexa/dialnexa-turn-match-cross-encoder-en-hi}
}
- Downloads last month
- 8