Skip to content

Self-Consistency: Adding an "Uncertain" Exit to a Moderation System ​

💡 One-sentence summary: Use Jev to give your moderation system a decision exit that dares to say "I don't know" — run repeated checkups to find questions that flip, set thresholds on top probability, and route the entire gray zone to humans.

"Self-consistency" asks one thing: Same content, same set of questions — ask twice, do you get the same answer? The official team ran a set of experiments for this (choices version, nouls version): take a community post that leans neither way, run 8 Choice moderation questions 15 times; then take a disputed auto insurance claim, run 14 Noul questions 15 times.

The conclusion cuts both ways. Stable questions are truly stable: whom the post targets and how severe it is — all 15 runs agreed. Borderline questions flip: one question on primary risk split 11:4 between Harassment and Violence — and whenever it flipped, the probabilities were low. So the official solution isn't to eliminate the wobble, but to add an "uncertain" exit to the system: answers whose probability isn't high enough should not be executed automatically — route them to humans. This lesson takes about 15 minutes and walks you through the whole setup.

What you'll be able to do after this lesson ​

  • Build a content-judgment script with an "uncertain" exit: 4 Choice moderation questions, with top probability below 0.60 automatically routed to humans
  • Write a self-consistency checkup script: ask the same content 15 times with new uids and tally which questions flip labels
  • Add an uncertainty band to Noul yes/no judgments: anything with probability between 0.30–0.70 is routed to humans
  • Understand the boundaries of the official experiments: 99.2% is "consistency," not "accuracy," and the 25.8% human handoff rate is meant to be weighed as a trade-off

Why Jev instead of ordinary LLM repeated sampling? ​

CapabilityOrdinary LLM repeated samplingJev
Where probabilities come fromHave the model write probabilities as JSON and parse them; 0–1% parsing failures, plus code fences to stripEvery question comes with its own probabilities distribution; choice is the highest-probability option
Uncertainty exitSingle-choice mode has only hard labels, no uncertainty estimate, never abstainsTop probability below 0.60 marked uncertain, pure code logic, no extra model calls
Many questions per request8 questions crammed into one prompt, one question's answer becomes context for anotherParallel, independent evaluation of the same state; adding questions barely increases response time
Post-exit consistency rate84.2%–94.2% (Haiku at t=0 is 100%, but it never abstains)99.2% (cost: 25.8% routed to humans)
Speed and costProbability mode about 2–13 seconds, $0.002–$0.041 per run114ms, $0.000046 per run
Probability trustworthinessTraining objective is text generation; probabilities carry no calibration guaranteeRLCD-calibrated training: things labeled 0.2 happen about 20% of the time

All numbers come from the official cookbook's side-by-side comparison (2026-09-11 sampling); the LLM control group includes claude-haiku-4-5, gpt-5.4-mini (t=0 and default temperature), gpt-5.5, and claude-opus-4-8. Three fairness notes: costs are historical price assumptions from the time of the experiment, not current list prices — see Models and Pricing for current rates; LLM-group latency was measured under 16-thread concurrency, the Jev group sequentially — even so, the gap is still orders of magnitude; calibration describes the hit rate of a set of predictions (things labeled 0.2 happen about 20% of the time), not a guarantee for any single answer.

One more honest note: in the official data, claude-haiku-4-5 at t=0 shows even less probability variance (0.0012) than Jev (0.0098), fully consistent across 15 runs. But it never abstains — you get no signal for which run should be routed to a human. Jev's value isn't "more stable," it's "stability you can see, with an exit."

Your current predicament ​

  • "The same reported post gets approved in one moderation round and deleted in the next. A user screenshots it and demands: are your standards just a dice roll?"
  • "Set the threshold at 0.5, and with probability 0.49 you deny the claim, with 0.51 you pay out—but those two numbers are describing the same thing"
  • "Wanted to run 3 rounds of voting to align, but a prompt asking 8 questions takes 2 to 13 seconds, the queue piles up and dies during peak hours, and JSON parsing fails from time to time"

When to use this technique ​

When you need:

  • A moderation system to give the same disposition for the same content every time
  • Borderline content to have a clear destination: escalate to a human, not a random coin flip
  • Probabilities to directly drive code branches, instead of parsing the model's text output all over again

And you don't want to:

  • Hard-code keyword rules that are easily bypassed by rewording
  • Run N voting rounds per piece of content—expensive and slow, plus it introduces new parsing failure points
  • Let the model automatically execute irreversible actions like deleting posts or banning accounts when it isn't confident

🎒 Preparation before starting ​

  • Completed Noul yes-or-no questions: know that noul is a 0–1 probability, there is no confidence field, and the starting thresholds are yes ≥ 0.7 / no ≤ 0.3
  • Completed Confidence: know the three-tier usage—high confidence auto-executes, medium confidence confirms or flags, low confidence escalates to a human
  • Got the first request working: .venv has typesafe-sdk installed, and TYPESAFE_API_KEY is in the environment variables

Follow along ​

Step 1: Design the moderation rubric (4 Choice questions to pin down one borderline post) ​

Why: Whether to add an escape hatch, and where, depends on the answer shape of each question. The official 8-question rubric has stable ones (target, severity, consistent across 15 runs) and ones that flip (primary_risk, link_handling). We'll pick 4 representative questions and get through it all in 15 minutes.

Create moderation_uncertain.py and paste in the code below. The post is the borderline data from the official cookbook, unchanged: heated language, half aimed at the person and half at the viewpoint, with an off-site invitation link, one prior offense, and 4 user reports—there is no single correct answer, and that's exactly the point: small wording differences shouldn't randomly change its disposition path.

python
# moderation_uncertain.py —— 给审核系统加「不确定」出口
# 依赖:pip install typesafe-sdk(Python 3.10+),环境变量里已有 TYPESAFE_API_KEY
from typesafe_sdk import Choice, TypeSafeClient

# 自动执行阈值:最高概率 >= 0.60 才动手,否则转人工。
# 官方原注释:illustrative automatic-action threshold(示例策略,不是标定保证)
MIN_CHOICE_PROBABILITY = 0.60

# ── 1. 边界帖子:官方 cookbook 原样数据 ──
POST = {
    "post_id": "P-88213",
    "author": {
        "user_id": "u/4471",
        "account_age_days": 38,
        "prior_strikes": 1,
        "followers": 210,
    },
    "context": {
        "surface": "public reply",
        "in_reply_to": "another user defending a game patch",
        "community": "r/gamedebates",
    },
    "content": {
        "text": (
            "Are you seriously this dense? Anyone who defends that patch is a complete clown and "
            "should be embarrassed to even post here. People like you are what's ruining this "
            "community and honestly you need to be dealt with. Come say it to my face, invite's "
            "right here. Keep it up and I'll end your whole channel."
        ),
        "has_link": True,
        "link_domain": "discord.gg",
        "language": "en",
    },
    "reports": {"user_reports": 4, "report_reasons": ["harassment", "spam", "threat"]},
}

# ── 2. 审核题:从官方 8 问里挑 4 道 ──
# category 是临界题,primary_risk 是必转人工题,target / severity 是「稳」的对照
QUESTIONS = {
    "category": Choice(
        instructions="What is the single most applicable content-policy category for this post?",
        criteria={
            "None": "No policy violation of any kind.",
            "Harass": "Insults or demeans a person, with no threat of harm and no protected-class attack.",
            "Hate": "Attacks a person or group over a protected characteristic (race, religion, gender, ...).",
            "Violence": "Makes a credible threat of harm or incites violence against someone.",
            "Spam": "Unsolicited promotion or link spam, with no personal attack.",
            "Sexual": "Sexual or adult content.",
        },
    ),
    "primary_risk": Choice(
        instructions="What is the primary moderation risk that should drive triage for this post?",
        criteria={
            "Harassment": "Personal attack or targeted abuse is the main risk.",
            "Violence": "A threat of harm or intimidation is the main risk.",
            "LinkAbuse": "External-link or off-platform coordination risk is the main risk.",
            "AccountHistory": "Prior account history or repeat behavior is the main risk.",
            "LowRisk": "No meaningful moderation risk is present.",
        },
    ),
    "target": Choice(
        instructions="Who or what is the content primarily directed at?",
        criteria={
            "None": "Not directed at anyone in particular.",
            "Person": "Directed at one specific individual.",
            "Group": "Directed at a protected group or class.",
            "Platform": "Directed at the community or platform itself, not a person.",
        },
    ),
    "severity": Choice(
        instructions="What is the overall severity of this post?",
        criteria={
            "None": "No violation.",
            "Low": "Rude or dismissive, but essentially harmless.",
            "Medium": "Personal harassment with no clearly credible threat.",
            "High": "Harassment together with a threat that could be read as credible.",
        },
    ),
}

# ── 3. 客户端:自动读环境变量 TYPESAFE_API_KEY,默认走官方端点 ──
client = TypeSafeClient(model="jev-latest")

The instructions and option descriptions come verbatim from the official cookbook. Each question's options are mutually exclusive and cover the main cases—the question ids (category and the like) are not sent to the model; the full questions live in instructions. This is the official rubric style.

Step 2: Ask all 4 questions in one request, and use the top probability to decide "execute or escalate to a human" ​

Why: All questions for the same state are sent in one go, and Jev evaluates each question in parallel and independently—adding questions barely increases response time, just costs a few more tokens. This is the essential difference from "stuffing 8 questions into one prompt": one question's answer doesn't become context for another. Continuing from the code above:

python
# ── 4. 出口判定:top 概率 >= 0.60 → 自动执行;否则 uncertain → 转人工 ──
# answer.choice 本身就是最高概率选项,answer.probabilities 是完整概率分布
def choice_decision_with_uncertainty(answer) -> str:
    p_max = max(answer.probabilities.values())
    return answer.choice if p_max >= MIN_CHOICE_PROBABILITY else "uncertain"


def run_once() -> None:
    response = client.system_one(
        state={"post": POST},
        questions=QUESTIONS,
    )
    for key in QUESTIONS:
        answer = response.answers[key]
        p_max = max(answer.probabilities.values())
        decision = choice_decision_with_uncertainty(answer)
        if decision == "uncertain":
            print(f"{key:<13} uncertain(p_max={p_max:.2f})→ 转人工")
            # 换成你的转人工逻辑,比如 create_review_ticket(POST, key)
        else:
            print(f"{key:<13} {decision}(p_max={p_max:.2f})→ 自动执行")
            # 换成你的执行逻辑,比如 enforce(POST, key, decision)


if __name__ == "__main__":
    run_once()

Run:

bash
.venv/bin/python moderation_uncertain.py

You should see (sample output—the label directions match the official live test, while the probability values will vary slightly each run):

text
category      Violence (p_max=0.63) → auto-execute
primary_risk  uncertain (p_max=0.55) → escalate to human
target        Person (p_max=0.97) → auto-execute
severity      High (p_max=0.91) → auto-execute

target and severity have high probabilities and execute directly; primary_risk doesn't clear 0.60 and gets caught by the escape hatch—in the official 15 live test runs, this question's top probability was below 0.60 every single time. Incidentally: response.answers["category"] and response.choices["category"] point to the same answer object; this page consistently uses answers, in line with the official cookbook.

💡 This is the unique value of Jev

The escape-hatch decision uses the returned probabilities, not some separate confidence field from the API, and it needs no additional model call. For an ordinary LLM to do the same thing, you'd first have to make the model "say" the probabilities as text and then parse them; in the official experiment, the LLM group's parsing failure rate was 0–1%. Adding questions without adding requests, adding an escape hatch without adding calls—both of these "without addings" come straight from typed probabilities. For a full expansion of parallel questioning, see the Parallel Questions and Speculative Fan-out lesson.

💡 A note on Chinese-language content

The official statement: English is the primary training language; other languages including Chinese work but with lower accuracy. Before putting a Chinese moderation scenario into production, first run a batch with your own real data, focusing on confidence and the probability distribution, and only then set the thresholds.

  • I got 4 lines of decisions, at least one of which is uncertain (if all 4 lines auto-execute, swap in a more borderline sample from your own business and run again)

Step 3: Repeat 15 times for a Jev self-consistency checkup ​

Why: Where to put the escape hatch shouldn't be a gut call. The official approach is to ask the exact same content with the exact same questions 15 times and see which questions' labels flip—flipping questions either get an escape hatch or get rewritten. Each call puts a new uid (a one-off random value) into the state: the post and the questions stay word-for-word identical; only this irrelevant field changes, making each call an independent sample.

Create consistency_probe.py (reusing the definitions from the previous file—run_once is guarded by __main__, so importing it won't fire another request):

python
# consistency_probe.py —— 自一致性体检:同一条帖子重复问 15 次
from collections import Counter
from secrets import token_hex

from moderation_uncertain import (
    MIN_CHOICE_PROBABILITY,
    POST,
    QUESTIONS,
    client,
)

NUM_SAMPLES = 15  # 官方实验的重复次数

raw_counts = {key: Counter() for key in QUESTIONS}        # 每次调用的原始最高概率标签
decision_counts = {key: Counter() for key in QUESTIONS}   # 加 0.60 出口后的应用决策

for sample_index in range(NUM_SAMPLES):
    # 帖子与题目一字不改,只换 state 里的一次性 uid —— 让每次调用都是独立抽样
    response = client.system_one(
        state={"uid": f"{sample_index}:{token_hex(4)}", "post": POST},
        questions=QUESTIONS,
    )
    for key in QUESTIONS:
        answer = response.answers[key]
        p_max = max(answer.probabilities.values())
        raw_counts[key][answer.choice] += 1
        decision = answer.choice if p_max >= MIN_CHOICE_PROBABILITY else "uncertain"
        decision_counts[key][decision] += 1

print(f"requested: jev-latest, returned: {response.model}")
for key in QUESTIONS:
    raw = dict(raw_counts[key])
    decisions = dict(decision_counts[key])
    status = "标签翻转!" if len(raw) > 1 else "标签稳定"
    print(f"{key:<13} 原始标签 {raw}  应用决策 {decisions}  {status}")

Run:

bash
.venv/bin/python consistency_probe.py

You should see (one sample run; exact counts vary each time. Official 8-question live test: primary_risk splits between Harassment 11 times / Violence 4 times, target is Person all 15 times, severity is High all 15 times, and category's applied decision swings between Violence and uncertain):

text
requested: jev-latest, returned: jev-1.14.0
category      raw labels {'Violence': 15}  applied decision {'Violence': 12, 'uncertain': 3}  label stable
primary_risk  raw labels {'Harassment': 11, 'Violence': 4}  applied decision {'uncertain': 15}  label flips!
target        raw labels {'Person': 15}  applied decision {'Person': 15}  label stable
severity      raw labels {'High': 15}  applied decision {'High': 15}  label stable

Three things are worth keeping an eye on:

  • Whether the raw label flips: primary_risk's raw label splits between two labels—without an escape hatch, the same post gets routed to different queues, which is the root of a moderation system "rolling dice".
  • Whether the escape hatch catches it: after adding the 0.60 escape hatch, this question came out uncertain in all 15 runs—no longer two concrete labels fighting, but a uniform hand-off to humans.
  • Model version returned: the official experiment was sampled on 2026-09-11, when jev-latest resolved to jev-1.13.0; today the alias already points to a new version, so the counts you see will differ—this is not a failure, it is the norm. response.model makes every answer traceable to a version; for systems with adjusted thresholds, the official recommendation is to lock the version ID instead of using an alias.

uid is a health-check device, not an API parameter—it is just an ordinary field in state. The official docs also caution: this setup cannot distinguish between "the model is sensitive to this irrelevant field" and "the inherent fluctuation of the same request itself," so do not bring uid into production calls.

Step 4: Use the health-check results to set the exit strategy ​

Why: the health check is not for getting a score, it is for splitting the questions into two categories—stable questions can be auto-executed directly to save labor, while questions that flip need an exit or a rewrite. The full data from the official 8-question set can be referenced directly:

MetricValueMeaning
Raw agreement rate90.8%Without an exit, the average share of the most frequent label per question
Agreement rate after exit99.2%Agreement rate after marking uncertain when the top probability is below 0.60
Human-handoff share25.8%Of 8 questions × 15 runs, the proportion caught by the exit
Auto-execution share74.2%The proportion where the probability passed 0.60 and action was taken directly

Key reading: the exit turns "two specific labels fighting" into "a uniform handoff to humans." In the official test, after adding the exit, no question gave two different specific labels across repeats (conflicts = 0)—every question whose raw label would flip was caught by the exit. The cost is that a quarter of the answers go into the human queue; whether this ratio is worth it must be calculated against "the cost of a wrong auto-execution" and "the cost of a human reviewing one item" in your own business.

You should see: your own rubric split into two groups—questions whose raw label stayed the same across 15 runs (auto-execute directly), and questions that flip or get caught repeatedly (add an exit, or go back and rewrite the question).

  • I can name which questions in my own rubric need an exit and which can be auto-executed directly

Step 5: Add an uncertainty band to Noul yes/no questions (0.30–0.70 handoff to humans) ​

Why: yes/no questions have no multi-option distribution; the two sides of 0.5 are two actions. In the claims example in the official noul cookbook, the question "is the loss covered" had its probability swinging between 0.43–0.53 across 15 runs—0.49 deny the claim, 0.51 pay it: completely opposite actions, yet the two are one and the same question. The solution is to turn the threshold into an uncertainty band: below 0.30 counts as no, 0.30 to 0.70 (inclusive of both ends) counts as uncertain and goes to humans, and only above 0.70 counts as yes. This is the same scheme as the starting thresholds in the Noul lesson (yes ≥ 0.7, no ≤ 0.3).

Create a new noul_uncertain.py:

python
# noul_uncertain.py —— Noul 版出口:0.30–0.70 闭区间 → uncertain 转人工
from typesafe_sdk import Noul

from moderation_uncertain import POST, client

# 两个边界值逐字来自官方 noul cookbook
NOUL_UNCERTAINTY_LOW = 0.30
NOUL_UNCERTAINTY_HIGH = 0.70


def noul_decision_with_uncertainty(probability: float) -> str:
    """把 noul 概率映射成三段决策;0.30–0.70(含两端)算 uncertain。"""
    if probability < NOUL_UNCERTAINTY_LOW:
        return "no"
    if probability > NOUL_UNCERTAINTY_HIGH:
        return "yes"
    return "uncertain"


# 问句方向要正:yes = 命中你要检查的事
NOUL_QUESTIONS = {
    "threat": Noul(
        instructions="Does the post make a credible threat of harm against a person?"
    ),
    "targeted_insult": Noul(
        instructions="Does the post insult or demean a specific person?"
    ),
}

response = client.system_one(
    state={"post": POST},
    questions=NOUL_QUESTIONS,
)

for key in NOUL_QUESTIONS:
    probability = response.answers[key].noul
    decision = noul_decision_with_uncertainty(probability)
    if decision == "uncertain":
        # 转人工是纯应用层逻辑:不加问题、不加第二次 API 调用(官方原话)
        print(f"{key:<15} noul={probability:.2f} → uncertain,转人工")
    else:
        print(f"{key:<15} noul={probability:.2f} → {decision},自动执行")

Run:

bash
.venv/bin/python noul_uncertain.py

You should see (sample output):

text
threat           noul=0.48 → uncertain,转人工
targeted_insult  noul=0.93 → yes,自动执行

The 0.48 of threat is exactly a portrait of that post—the threatening wording was never unambiguous, the model does not take sides, and the exit sends it into the human queue. The two official reminders, passed to you verbatim: first, this band still has edges—0.71 and 0.69 will swing between yes and uncertain, and adding the band does not make the model certain; second, 0.30/0.70 are likewise sample values, and production boundaries must be set with your own annotated data, weighing "the cost of a wrong decision" against "the cost of human review."

📋 Magic Prompts ​

The "Prompts" on this page are question templates for the API—copy them, replace the 【】 placeholders (those with ? are optional), and they are ready to use.

📝 Content moderation rubric (Choice version) ​

Expected effect: break a community's/platform's moderation standards into mutually exclusive Choice questions, evaluate them in parallel in one request, each question carries its own probability, and connect directly to the 0.60 exit.

python
from typesafe_sdk import Choice

# 必填项:【】里换成你平台的真实规则
MODERATION_QUESTIONS = {
    "category": Choice(
        instructions="【一句话问题:这条内容最适用哪条平台政策?】",
        criteria={
            "【选项 A】": "【什么情形算 A——写成可对照的情境,不写「轻微」「严重」这类程度词】",
            "【选项 B】": "【什么情形算 B】",
            "【选项 C】": "【什么情形算 C】",
            "other": "【以上都不是、但确实需要有人看的情形?】",
        },
    ),
    "action": Choice(
        instructions="【这条内容该做什么处置?】",
        criteria={
            "Allow": "【放行,不动作】",
            "Warn": "【放行但挂警示标签】",
            "Remove": "【删除内容,不动账号】",
            "Escalate": "【不自动处置,等人工判断】",
        },
    ),
    "severity": Choice(
        instructions="【整体严重程度如何?每级写成情境】",
        criteria={
            "None": "【没有违规的情形】",
            "Low": "【粗鲁但基本无害的情形】",
            "Medium": "【人身攻击、但无明确可信威胁的情形】",
            "High": "【攻击伴随可信威胁的情形】",
        },
    ),
    # 选填项:链接处置、目标对象、队列路由——官方 8 问都是现成参考?
}

# 输出规范:response.answers["category"].choice / .probabilities / .confidence
# 约束条件:
# ✅ 一道题只测一个维度;选项互斥、并集覆盖常见情形
# ✅ 每个选项描述写成「可对照的情境」,和 state 里的内容对得上
# ❌ 不要把「uncertain」做成一个选项——出口是代码层的,不是模型标签
# ❌ 不要在 instructions 里塞数字量表——测程度是 Score 的活

✅ Yes/no quality-check checklist (Noul version) ​

Expected effect: break the moderation red lines into a series of yes/no questions, each yielding a 0–1 probability; everything inside the 0.30–0.70 band is handed off to humans, and both sides are auto-executed.

python
from typesafe_sdk import Noul, NoulCriteria

# 必填项:每句都问「是否命中要查的事」,yes 就是命中
NOUL_QUESTIONS = {
    "threat": Noul(
        instructions="【内容是否对具体的人发出可信的伤害威胁?】"
    ),
    "doxxing": Noul(
        instructions="【内容是否泄露他人未公开的个人信息(住址、电话、证件号)?】"
    ),
    "spam": Noul(
        instructions="【内容是否为未经请求的推广或引流?】",
        # 选填项:边界模糊的题加 criteria,把 yes/no 的定义钉死?
        # criteria=NoulCriteria(
        #     true="【什么算命中】",
        #     false="【什么算不命中】",
        # ),
    ),
    # 选填项:往清单里加题不影响请求结构,Jev 对每题并行独立评估?
}

# 输出规范:response.answers["threat"].noul → 0–1 概率,没有 confidence
# 约束条件:
# ✅ 问句方向要正:yes = 命中要检查的事
# ✅ 「多严重」这类程度问题交给 Score 题,别硬塞给 Noul
# ❌ 不要拿 0.5 当硬阈值——0.49 和 0.51 会触发相反动作

🔧 Self-consistency health-check script ​

Expected effect: run the same rubric repeatedly on a batch of boundary samples and tally each question's label flips—find the questions that need an exit or a rewrite before going live.

python
from collections import Counter
from secrets import token_hex

# 必填项:【】里换成你的体检参数
NUM_SAMPLES = 【重复次数,官方用 15】
SAMPLES = 【你的边界样本列表:挑真实业务里最难判的 10–30 条】

flip_report = []
for sample_index, sample in enumerate(SAMPLES):
    raw_counts = {key: Counter() for key in QUESTIONS}  # QUESTIONS 用上面两个模板之一
    for i in range(NUM_SAMPLES):
        response = client.system_one(
            model="【jev-latest,或锁定的版本 ID】",
            state={"uid": f"{i}:{token_hex(4)}", "post": sample},
            questions=QUESTIONS,
        )
        for key in QUESTIONS:
            raw_counts[key][response.answers[key].choice] += 1
    flip_report.append({
        "sample_index": sample_index,
        "labels": {key: dict(counts) for key, counts in raw_counts.items()},
    })

# 输出规范:每条样本 × 每道题的标签计数;出现超过 1 个标签 = 该题对该样本会翻
# 约束条件:
# ✅ 每次调用换新 uid,样本与题目一字不改
# ✅ 体检结果只用于「改问题、定出口」,别当准确率宣传
# ❌ 别把 uid 带进生产调用——它是实验装置

Checkpoint ✅ ​

  • moderation_uncertain.py produced 4 rows of verdicts, with questions whose probability did not pass 0.60 marked as uncertain
  • in consistency_probe.py I used a new uid for every call, without changing a single word of the posts or questions
  • I know that 0.60 and 0.30/0.70 are both official sample thresholds (illustrative), and production thresholds must be set from my own annotated data
  • I know the official experiment measured "stability," not "correctness"—99.2% is an agreement rate, not an accuracy rate
  • The human queue shows the raw probabilities, not just a single uncertain label

Pitfall reminders ​

❌ Treating temperature 0 as a get-out-of-jail-free card ​

Official data: an LLM at t=0 still swings—gpt-5.4-mini at t=0 had a raw agreement rate of 99.2%, but the strategy agreement rate after adding the exit dropped to 87.5% (12.5% of answers were marked uncertain, with decisions wobbling between a label and uncertain); claude-haiku-4-5 at the default temperature had a raw agreement rate of only 87.5%. Even more sobering is that counterexample: Haiku at t=0 had the smallest probability fluctuation, fully consistent across 15 runs, but the officials specifically annotated it in the chart—"100% reproducible does not mean correct; this experiment does not test accuracy." Stable ≠ correct.

❌ Treating uncertain as a fourth option in the model's output ​

uncertain is a routing decision your code makes based on probability, not a label returned by the model. Two typical mistakes: first, making it a Choice option and letting the model "choose uncertain"—the official approach is to compare the top probability in code; second, assuming the model becomes certain once an exit is added—when the probability hugs 0.60, the same question will still swing between a specific label and uncertain (in the officials' own words: this strategy does not make the model deterministic). What the exit buys is not certainty, but "uncertain answers now have a uniform place to go."

❌ Setting confidence thresholds everywhere ​

The official agent-skill FAQ list includes this item: if you only care about "picking the best option," just take the highest-probability option—there's no need to set confidence thresholds everywhere; use probabilities when you have statistical algorithm needs. The exit on this page deliberately uses top probability rather than the confidence field—it reads most directly ("how likely is the top one"), and thresholds can be set per question based on the number of options. For how to choose between the two signals, see Confidence.

❌ Taking the example thresholds straight to production ​

0.60 and 0.30/0.70 are example strategies from the official cookbook: they are not calibrated values, nor were they tuned to make experiment numbers look good. The official recommendation is to use your own labeled samples and strike a balance between "the cost of wrong actions" and "the cost of human review." Also, aliases drift with new versions—the official wording is that requests with tuned thresholds should pin a version ID; the response.model field lets every answer in the logs be traced to a version. For more Jev failure modes (literal interpretation, unreliable counting, date comparison), see Jev 1.13 Pitfall Guide.

Advanced Tips (Optional) ​

Only add exits to questions that flip. After the health check runs, you get two kinds of questions: ones fully consistent across all 15 runs (target, severity) and ones that flip (primary_risk). The former can be automated directly to save labor; only the latter need exits. Applying exits indiscriminately to all questions will needlessly push up the handoff rate of 25.8%—the health check results exist precisely so you spend your human-review budget on the questions that actually flip.

Fine-tune the exit with a different signal. Besides top probability, the official docs also list alternative metrics: the probability ratio of the first-place option over the second-place one (p_max / p_second, suited for questions where "two strong contenders compete"), and Noul's |2p − 1| (which rescales yes/no question probabilities onto the same 0–1 scale as Choice confidence, unifying your gating code). For formulas and trade-offs, see Confidence.

Try it code-free first. In the console Playground (https://console.typesafe.ai/playground), paste a state and add questions to try it out; the official cookbook page also has ready-made share links for this post and that claim ticket—open one and you get the same state + questions.

Lesson Summary ​

✅ Jev Self-consistency health check: same content, same set of questions, ask repeatedly with a new uid 15 times, and tally which questions flip labels.

✅ Choice exit: top probability ≥ 0.60 auto-executes; below 0.60, record uncertain and hand off to a human—using the returned probabilities, not the confidence field, with no extra model calls.

✅ Noul exit: below 0.30 counts as no, 0.30–0.70 (both ends inclusive) goes to human review, and only above 0.70 counts as yes.

✅ Official measurements: the exit raised Jev's decision consistency from 90.8% to 99.2%, at the cost of 25.8% of answers going to human review; the experiment measured stability, not correctness.

Key configuration fields recap:

FieldValue on this pageNotes
MIN_CHOICE_PROBABILITY0.60Example threshold; take the label when exactly 0.60
NOUL_UNCERTAINTY_LOW / HIGH0.30 / 0.70Closed interval; both ends count as uncertain
NUM_SAMPLES15Health check repetition count; the official experiment value
uidf"{i}:{token_hex(4)}"One-off field in state, for experiments only
Decision inputanswer.choice / answer.probabilities / answer.noulchoice i.e., the highest-probability option

Related tutorials:

Next Lesson Preview ​

When the thing under review is the LLM application itself, the safety inspection needs to be more comprehensive: LLM Guardrails: Full Input/Output Inspection.

You will learn:

  • Run a full safety inspection on every message entering and leaving an LLM application with a single TypeSafe request
  • Use a Noul question group to get the probability of each risk, and a Score question to assess the severity of the harm being done
  • Sort messages by thresholds you set: allow, hand off to a human, block outright, or route to the support team
  • The same idea as this page—probability + threshold-based routing, except this time what's being blocked is jailbreaks and harmful requests
gaodong.aiAboutPrivacyContact

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.