Fix Zero‑Shot Prediction Errors: Easy Calibration Steps in Laya

Laya is a fast, non‑autoregressive decision engine that scores multiple typed questions in a single forward pass with zero output tokens. When putting it to work on real labelled data (the banking slice of CLINC150) several practical problems appear that teams hit in production:

  1. Mis‑calibrated probabilities – the shipped temperature for choice questions with 11+ options is clamped to 0.5, which sharpens scores and yields over‑confident answers (ECE ≈0.10).
    Fix: Fit a temperature on a held‑out validation set, but install only the bucket you measured; otherwise the fit wipes temperatures for other question types.

  2. Sensitivity to wording and option order – using one‑line intent descriptions lowered zero‑shot accuracy to 0.804, while bare intent names raised it to 0.878. Reversing the order flipped ≈4% of individual answers even though overall accuracy barely moved.
    Fix: Route on bare names and keep the option order exactly as tested; validate wording on a small labelled set.

  3. Abstention gating – a confidence threshold fitted to a 5% error budget on validation kept 95.7% of validation queries but only 92.2% on test, nearly doubling the realized error.
    Fix: Fit the gate on a sample of real traffic, re‑check it periodically, and leave margin below the target; thresholds must be per‑option‑count bucket.

  4. Out‑of‑scope detection – the calibrated confidence separated banking queries from other‑domain and OOS traffic, letting a 5% gate stop >90% of irrelevant requests while abstaining on ~8% of in‑scope traffic. Adding an explicit “not a banking request” option works without labels but shifts the decision boundary and reduces in‑scope accuracy.
    Fix: Prefer the confidence gate when you have labelled validation data; otherwise use a catch‑all option and monitor its impact.

  5. Biased yes/no questions – a question like “Is this about the user’s bank account?” ranked well (AUROC 0.945) but was skewed toward “no”, so the default 0.5 cut caught only 29% of banking queries. Temperature scaling cannot fix an offset.
    Fix: Treat the probability as a score and choose its cut on labelled data (e.g., 0.09 gave 92% recall/83% specificity).

  6. Typed outputs – pulling Laya’s answers into a Pydantic schema gives strongly typed objects, but the schema’s boolean cut is hard‑coded at 0.5.
    Fix: Return the full probability details and apply the calibrated cut you validated in step 5.

In short, Laya delivers speed and zero‑token scoring, but teams must measure calibration, wording, order, abstention thresholds, out‑of‑scope handling, and yes/no cuts on their own labels before trusting the model in production.

AI #Product #ML #NLP #DecisionMaking #LLMOps