AnyJev Engine: Calibrated Open-Weight Decisions
How AnyJev turns compact open-weight models into zero-training, CPU-native calibrated decision engines by eliminating prompt-order and label bias.
AnyJev: Cyclic Permutation & Prior Calibration for Open-Weight Models
AnyJev turns compact, CPU-native open-weight models (such as ModernBERT-large-421M, SmolLM2-360M-Instruct, and sub-1B encoders) into calibrated, deterministic decision engines for choice, yes_no, and score queries. Instead of generating tokens one by one on expensive GPUs, AnyJev evaluates terminal decision logits in a single forward pass on standard CPUs and substantially reduces both prompt-order bias and token-frequency label bias.
L0 mode, AnyJev requires zero training: you can swap or upgrade underlying open-weight models immediately while keeping calibrated probabilities.
1. Two-Stage Bias Mitigation Algorithm
Out-of-the-box LLMs suffer from two well-known failure modes when asked to pick from candidate options: position bias (preferring the first or last option in a list) and label prior bias (preferring common words like "YES" or "APPROVE" regardless of context). AnyJev substantially reduces both in two stages:
Stage A: Cyclic Permutation Averaging
Given $K$ candidate options $O = [o_1, o_2, \dots, o_K]$ and a configured rotation_count $R \le K$, AnyJev constructs cyclic shifts of the option list (for example, $[A, B, C]$, $[B, C, A]$, $[C, A, B]$) and averages the terminal answer-token logits across all rotations:
Stage B: Unconditional Prior Division
To remove the base model's intrinsic token preference $P_0(o_i)$, AnyJev subtracts the log unconditional prior from the rotation-averaged logit before applying temperature-scaled softmax:
prob[opt] = softmax(adjusted_logit[opt] / T)
2. AnyJev Calibration Levels (L0, L1, L2)
| LEVEL | MODE | TEMPERATURE | TRAINING REQUIRED | WHEN TO USE |
|---|---|---|---|---|
L0 |
Zero-Training Cyclic + Prior Division | T = 1.00 |
None (0 rows) | Default mode. Immediate deployment and seamless base model version upgrades without retraining. |
L1 |
Temperature Platt Scaling | T = 0.85 (tuned) |
Calibration split only | Sharpens softmax confidence distributions to minimize Expected Calibration Error (ECE < 0.03) for strict policy thresholds. |
L2 |
Supervised Domain Checkpoint | T = 0.85 (tuned) |
2,500 to 50,000 JSONL rows | Optional supervised fine-tuning on historical domain outcomes via POST /v1/teams/:team/models/:model/train. |
3. Supported Decision Primitives
choice(Categorical Arbitration): Evaluates arbitrary candidate arrays passed at runtime (e.g.["APPROVE", "REVIEW", "REJECT"]) across cyclic permutations and returns a normalized probability distribution summing to1.0.yes_no(Binary Guardrail): Evaluates["YES", "NO"]withrotation_count = 2to guarantee zero order preference on binary security and authorization gates.score(Continuous Ordinal Interpolation): Projects the query across 5 calibrated ordinal logit bins (bin_0throughbin_4) and computes the probability-weighted expectation over[min_score, max_score].
4. Provisioning & Querying AnyJev via API
You can invoke the built-in zirnay-anyjev / anyjev-fast-router model directly, or provision a custom team-scoped AnyJev instance:
curl -X POST https://api.zirnay.com/v1/teams/fraud-ops/models/anyjev-fast-router/decide \
-H "X-API-Key: $ZIRNAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"raw_text": "Enterprise renewal deal $180k ARR: Economic Buyer signed off on security review, legal redlines completed.",
"query": {
"type": "choice",
"target": "Evaluate MEDDPICC forecast readiness",
"options": ["COMMIT", "BEST_CASE", "PIPELINE"]
},
"config": {
"base_model": "SmolLM2-360M-Instruct",
"level": "L0",
"rotation_count": 3
}
}'
{
"request_id": "req_anyjev_91c40e2a",
"decision": "COMMIT",
"confidence": 0.9412,
"probabilities": {
"COMMIT": 0.9412,
"BEST_CASE": 0.0468,
"PIPELINE": 0.0120
},
"model_type": "anyjev",
"checkpoint_id": "chk_anyjev_l0",
"execution_nanos": 2140000,
"metadata": {
"base_model": "SmolLM2-360M-Instruct",
"level": "L0",
"rotations_evaluated": 3,
"bias_mitigation": {
"position_bias_eradicated": true,
"label_prior_corrected": true
}
}
}