Lion Cipher Lab

Build a confidence-calibrated abstention gate for an analyst LLM (know when it should say "I don't know")

Why it matters

The most dangerous thing an analyst-assist model can do is answer confidently and be wrong in the middle of triage. A tool that says "benign, 0.99" on a real intrusion doesn't just make one mistake -- it spends the analyst's trust, and after a few silent misses people either stop reading its output or start rubber-stamping it. The professional move is to make the model quantify its own uncertainty HONESTLY and abstain when it is out of its depth, routing that case to a human. But this only works if the confidence means what it says, and out of the box it does not: Guo et al. (2017) showed…

What you'll learn

Steps in this lab

  1. The problem: a model that always answers is a liability
  2. The trap: raw confidence lies (and why)
  3. Build the target and collect (confidence, correctness) on a held-out set
  4. Prove it's miscalibrated: ECE and a reliability diagram
  5. Calibrate with temperature scaling, and watch ECE collapse
  6. The sklearn alternative: CalibratedClassifierCV (and when to prefer it)
  7. Build the coverage-risk curve and pick an operating point
  8. Wire the gate: answer, or abstain to a human
  9. OPTIONAL: the same gate over a local LLM's self-reported confidence
  10. The judgment: calibrate before you gate, and when NOT to abstain

Open the full interactive lab →