Jev Recovery Router
Author: Murad Mustafayev
Code, installation and technical documentation on GitHub · Model weights and this card on Hugging Face
[Definition] Jev Recovery Router is a small research system for deciding whether to commit to a retrieved intent, retrieve a wider candidate set, or hand the query off. It combines an adapted Qwen3-1.7B belief model, a frozen MiniLM retriever, held-out probability calibration, and a separate cost-conditioned recovery actor. It is independently inspired by Jev; it is not affiliated with TypeSafe AI and does not reproduce Jev's undisclosed training procedure.
[Claim boundary] The belief model uses supervised cross-entropy. Sampled-action reinforcement learning trains the separate actor. The results support an improvement on the specified CLINC comparisons, especially out-of-scope rejection. They do not establish a general recovery advantage, an advantage of sampled RL over exact optimization, production readiness, or a deployment speedup. BANKING77 transfer remains a substantial failure case.
Labels below distinguish measured results, implementation facts, assumptions and interpretations. This is a custom adapter/head/actor bundle, not a standalone AutoModel.from_pretrained or text-generation model.
Installation and inference
[Implementation] Use Python 3.12. Install the matching implementation from the pinned GitHub commit, then download this model repository. The commands below download upstream model weights on first use unless already cached.
python -m pip install "git+https://github.com/Muradmustafayev-03/jev-recovery-router.git@6e6ea40c3156a0b971c22bdb3ea3ef9f26924c80"
python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='Quicksort-fr/jev-recovery-router', local_dir='artifacts/model')"
python -m recovery_router.inference --model artifacts/model/model --policy artifacts/model/policy --calibration artifacts/model/calibration.json --data-dir artifacts/model/data/processed --catalog clinc_base --device cpu --text "How can I change my password?"
[Implementation] Use --device cuda with a compatible CUDA-enabled PyTorch installation. Other supplied catalog names are clinc_updated and banking. No Jev API key is required. Downloaded artifacts can be pinned using the Hugging Face commit's revision argument; preserve publication_manifest.json to verify the release's file hashes. After prefetching the base Qwen and MiniLM revisions, HF_HUB_OFFLINE=1 and TRANSFORMERS_OFFLINE=1 enable offline loading.
[Interface] The input is an English utterance and a supplied catalog, with configurable simulated costs. Output JSON contains commit or handoff, whether expansion occurred, an optional selected intent, candidate probabilities including NONE, stage traces, and measured timing. A second retrieval/model pass occurs only when the actor chooses expansion. Handoff means unresolved by this model; it does not imply successful human resolution.
[Implementation] Keep model/adapter/ and model/tokenizer/ unchanged, including the adapter's README.md: all their files participate in the bundle fingerprint. The actor checks its links to the model fingerprint and calibration hash during CLI loading. The base backbone and MiniLM weights are fetched from their pinned upstream repositories; they are not duplicated here.
Components and provenance
| Component | Recorded configuration |
|---|---|
| Backbone | Qwen/Qwen3-1.7B, revision 70d244cc86ccca08cf5af4e1e306ecf908b1ad5e |
| Adaptation | LoRA rank 16, alpha 32, dropout 0.05, q_proj/v_proj; learned candidate-position head plus NONE |
| Frozen retriever | sentence-transformers/all-MiniLM-L6-v2, revision 1110a243fdf4706b3f48f1d95db1a4f5529b4d41 |
| Supported schedule | One initial candidate; five after at most one expansion |
| Input bound | At most 512 tokens including candidates; excess length is rejected, not silently truncated |
| Calibration | Separate first/expanded temperatures: 2.312891 / 1.874854 |
| Released actor | Seed 42, two-step REINFORCE with a value baseline; conditioned on observed state and costs |
| Selected checkpoint | Step 3,227, epoch 7; selected from 5,532 executed updates across 12 epochs |
| Model fingerprint | 5e65eddaec468129ef4ae54049fdade38fac4229e1b0c89a8abcce58bf034ea7 |
[Provenance] Model metadata, training report, complete training summary and selection curve, policy selection record, and publication file manifest retain artifact identity and selection evidence. The exact follow-up training source was commit ed2c8ad877d3286dfa4b9fdc56e6093b00b2ec81; public inference/release code is separately pinned to 6e6ea40c3156a0b971c22bdb3ea3ef9f26924c80. These distinguish execution source from later documentation and packaging work. The extended experiment protocol records the follow-up design and its exploratory status; measured outcomes and limitations are reported below.
[Definition] NONE includes both truly out-of-scope queries and supported intents absent from the shown shortlist. Its probability does not identify which cause applies. The head contains twenty candidate-position columns plus NONE, but only the trained one/five schedule is supported by this release. The actor's action probabilities are not factual confidence.
Training and validation selection
[Protocol] Belief training uses 7,362 CLINC queries, each supplying first and expanded views. Separate partitions contain 2,429 actor-training, 1,248 calibration and 1,249 tuning queries. Fitting uses 120 intents. The other 30 CLINC intents are excluded from fitting and checkpoint selection; their labeled exemplars enter the expanded catalog without a weight update. BANKING77 supplies a separate labeled retrieval index, not belief- or actor-weight training. The data manifest records deterministic preparation and overlap filtering.
[Protocol] The follow-up restarts the pinned backbone with fresh LoRA/head fitting. It uses peak learning rate 1e-4, 5% warm-up, cosine decay to 1e-5, microbatch eight, four-step accumulation and deterministic candidate permutations each epoch. Every half epoch, the complete fixed-order tuning set is evaluated. Selection minimizes the mean of first/expanded raw FP32 negative log-likelihood (NLL), with each stage standardized to out-of-scope prior 2/11. Improvements must exceed 1e-4; ties retain the earlier checkpoint. Step zero is diagnostic and ineligible.
[Result] Training executed all twelve epochs in 2,518 seconds on one A100 80 GB GPU, including periodic validation and checkpoint saving; this is not total project time. Validation selected epoch seven with NLL 0.140475; the final epoch-twelve checkpoint was worse at 0.208386 and is not the released model. The selected model's later full-split audit measured standardized train/tuning NLL 0.018062 / 0.139856. That audit used batch 32 rather than selection batch eight and produced a small numerical difference with unchanged weights; batch-dependent BF16/padding effects are a plausible explanation, not a separately isolated cause.
[Interpretation / limitation] The strong training fit and late validation deterioration do not support simply adding more epochs as the next remedy. Their cause is not isolated. Compared with the original two-epoch run, duration, learning-rate schedule, candidate permutations and checkpoint selection changed together: the improvement is not a causal estimate of the effect of more epochs.
[Exploratory disclosure] This follow-up was designed after inspection of the original run's test results. Tuning data select both the checkpoint and routing thresholds; tests are reused for exploratory evaluation. The two CLINC populations overlap, and only one backbone-training seed was run. The comparisons below are not an untouched confirmatory trial.
Measured routing results
[Assumption] Utility is correct_route - 5 × wrong_route - 0.2 × handoff - 0.05 × expansion. These costs are simulated utility units, not measured business costs. Automatic coverage is the fraction committed; accepted error is the error rate among those commitments.
| Natural test | Queries | Released actor utility | Automatic coverage | Accepted error | Utility change from original two-epoch system, paired 95% interval |
|---|---|---|---|---|---|
| CLINC-120 | 4,600 | 0.553891 | 75.39% | 2.97% | +0.041424 [0.018634, 0.064662] |
| CLINC-150 | 5,500 | 0.497082 | 77.75% | 4.72% | +0.027655 [0.003831, 0.050598] |
| BANKING77 | 3,080 | -0.001672 | 88.54% | 16.06% | +0.060731 [0.011507, 0.112250] |
[Result / interpretation] On CLINC-120, the released actor exceeds its matched confidence gate by +0.058946 [0.040585, 0.078435], but differs from the same-architecture exact expected-utility actor by only +0.003043 [-0.002687, 0.009425]. These data do not establish a distinct benefit of sampled RL. Approximately 92.55% of the point-estimate improvement over the confidence gate comes from out-of-scope queries. The confidence gate is better on naturally recoverable-candidate queries and on all three initial-gold-removal stress arms; a general retrieval-recovery advantage is not demonstrated.
[Result / transfer limitation] BANKING77 utility remains negative. The same model's never-expand policy scores 0.308052, and the matched Jev-plus-router comparator scores 0.346055. Jev was jev-1.13.0 accessed through the project's constrained-choice and recovery-policy protocol; this is not a comparison against the entire Jev product or a native vendor benchmark. The project system performs better on the two CLINC populations in that protocol. A MiniLM direct calibrated classifier with greater labeled-data access scores 0.556873 on CLINC-150, also above this actor. These supervision and interface differences preclude a universal ranking.
[Comparator result / deviation] Matched Jev-plus-router utility was 0.394065 on CLINC-120 and 0.394382 on CLINC-150. The API comparison covered all three natural populations; Jev stress arms were not run. Its ledger records 30,197 attempts, 30,074 validated successes and 123 failed attempts. Strict response validation rejected 108 responses, including 107 recorded probability-mass failures and one earlier failure without detailed diagnostics. During transfer prediction, one payload exhausted the two-validation-retry cap; a disclosed post-seal override raised that cap to five. Probabilities were not renormalized or accepted with relaxed validation, and model/policy parameters were not refitted. Failed attempts retained their budget reservations. Retrying can resample provider outputs; this operational deviation limits interpretation of the comparison. No matched end-to-end Jev latency claim is made.
[Method] Paired intervals use 1,000 parent-query bootstrap resamples, seed 2026. They quantify resampling uncertainty for the evaluated populations, not training-seed uncertainty. Secondary intervals are descriptive and unadjusted for multiple comparisons. Comparisons above concern configured systems under the same simulated utility, with the model-interface and labeled-data differences disclosed above; they are not a ranking of general model capability.
[Result / latency limitation] Warm batch-one adaptive p50/p95 latency was 49.202 / 82.286 ms, compared with 32.750 / 58.511 ms for directly scoring five candidates. Measurements use the first 100 CLINC queries, three warm-ups, fixed block order and no timing intervals; artifact/index loading is excluded. This small experiment shows no speed advantage and does not establish deployment throughput or equal accuracy.
Intended use and limitations
[Intended use] Reproducible research and clearly labeled demonstrations of selective intent routing, catalog changes and explicit cost tradeoffs. It is not a chat assistant or a validated autonomous business agent.
[Limitations] Evaluation uses small static English benchmarks and simulated costs. No production traffic, reviewer effectiveness, multilingual evaluation, fairness audit or adversarial robustness guarantee is established. Held-out project labels do not rule out foundation-model pretraining contamination. Probability calibration and actor behavior can fail after domain, catalog, retrieval or cost shifts. The actor saw finite cost grids; conditioning on costs does not guarantee reliable behavior at arbitrary new values. BANKING77 supplies no native out-of-scope test group.
Licenses and attribution
[Environment record] Recorded GPU dependencies describe the executed environment, not an installation recipe. Its editable-source entry reflects the original VM checkout metadata; use the pinned public source installation above.
[Licensing record] Original project code and project-owned adapter/head/actor artifacts use Apache-2.0. Public catalog text retains its source licenses: CLINC CC BY 3.0 and BANKING77 CC BY 4.0. See NOTICE.md. The Apache license does not relabel those examples.
- CLINC150/OOS: Stefan Larson and collaborators, An Evaluation Dataset for Intent Classification and Out-of-Scope Prediction, EMNLP-IJCNLP 2019. Preparation retains source text while filtering overlaps, assigning deterministic partitions and adding candidate metadata.
- BANKING77: Iñigo Casanueva and collaborators, Efficient Intent Detection with Dual Sentence Encoders, 2020. Preparation selects official-training exemplars and removes overlapping examples to form the retrieval index.
- Backbone and retriever: Qwen3-1.7B by the Qwen team and all-MiniLM-L6-v2 by the sentence-transformers contributors, both recorded as Apache-2.0 at the pinned revisions above. No Jev weights are redistributed.
Citation
@misc{mustafayev2026jev,
author = {Murad Mustafayev},
title = {Jev Recovery Router: Cost-Conditioned Intent Routing},
year = {2026},
url = {https://huggingface.co/Quicksort-fr/jev-recovery-router}
}
GitHub code and documentation · Hugging Face model repository