Skip to content

Calibrating a decision judge

The Decision rubric judge asks a decision model (the AI module's Decision operation, for example TypeSafe Jev) each rule of a house-style rubric and scores the answer by the rubric's arithmetic. Besides the score it reports a pass probability: the chance that the errors it found stay within what the rubric's pass score allows. With 5 points per error and a pass score of 90, a page passes with at most 2 errors.

By default the judge sees only the answer, sent under the rubric's state_key. A rule such as "do not add facts that answer a different question" needs the question too: set input_key in ai_eval.decision_rubric (for example question) and the judge also gets the test question under that name. Word the rubric's question to say so ("This is a visitor's question and the assistant's reply...").

A model's probabilities are often off. If the answers it calls 80% likely to pass are right only half the time, a calibration learned from answers people have reviewed corrects the model probability. The judge then reports both: "Pass probability 0.982, calibrated 0.810". Calibration corrects the pass probability, never the score.

Calibrations live under Manage > Calibrations (/admin/config/ai/ai-eval/calibrations) and need the Validate AI Eval judges permission.

Fit a calibration has one tab per source of reviewed answers: Judge (the decision rubric judge, from reviewed test results), Answer file (any question and model, from a file of labeled answers) and, with the submodule, Decision automators (from recorded decisions). A line under the tabs says the same.

New calibrations use a smooth S-shaped curve (Platt scaling) that keeps the model's order and never returns exactly 0% or 100%. Calibrations fitted before keep their steps. The curve table shows a few probabilities along a smooth curve, or the ranges of an older step curve.

A calibration is refused when the reviews run against the model's order, so that higher probabilities pass less often than lower ones. A correction cannot fix the order; check the question and the reviews instead.

Extra decision rubrics

Open Manage > Decision rubrics (/admin/config/ai/ai-eval/decision-rubrics) to add a named rubric. This needs Validate AI Eval judges. Enter its question, optional note, state and input keys, points per error, pass score (0 to 100), and one rule per line.

Each rubric appears on Judges as Decision rubric: , with plugin id decision_rubric__<machine_name>. Choose its own Decision provider and model on Edit prompt, then select that judge on the tests that should use it. Each rubric judge needs its own model; it cannot use the site chat judge. The built-in Decision rubric keeps using ai_eval.decision_rubric.

On either calibration fitting tab, select the Decision rubric judge and press Choose judge before fitting. This refreshes the current-rubric and model-use checks for that judge. The built-in judge is selected by default. The saved curve records the chosen judge. On a saved calibration, the same selector lets you check whether a rubric judge would use that curve without changing which judge it belongs to. Curves match judge, provider, model, and rubric fingerprint, so editing a rule or scoring allowance requires a new fit. Reusing another rubric's earlier wording does not share its calibrations. A rubric cannot be deleted while any test or calibration for its current wording uses its judge; the delete page lists those uses, including inactive curves. Calibrations for its earlier wording are listed as dependent configuration and deleted with the rubric.

Fitting from results reviewed on this site

Every run with the decision rubric judge keeps each answer's raw pass probability, and the provider, model and question it came from. When you mark those answers pass or fail on the results page, each reviewed answer pairs the model probability with what it should have been.

Open Fit a calibration. The Judge tab lists the reviewed answers grouped by provider, model and question, with how many passed, failed or were deferred, whether the group is for the judge's current rubric, and whether it can be fitted:

  • Only the first review of an answer counts; a second reviewer's verdict on the same answer is ignored, as in judge validation. Deferred answers are counted but not fitted on.
  • A group needs at least 30 pass or fail answers.
  • Answers to the same dataset question stay together: they are all fitted on or all held back to check the calibration. A group whose answers are for too few questions cannot hold any back yet, and one whose fitted answers all passed or all failed cannot be fitted either. The table says which.

Choose a group that can be fitted, optionally name it, and Fit and save. Counts are checked again when you submit, in case reviews changed.

Fitting from answers reviewed elsewhere

The Answer file tab fits answers you bring with you. Fill in:

  • Provider and model: the provider and the model as the provider reports it with each answer, chosen from the models your site offers for the Decision operation. For TypeSafe that is a version such as jev-1.14.0, not the alias jev-latest. It starts on the model the decision rubric judge last reported, or on the judge's own model before its first grade. On a site whose AI module lists no decision models, type it as provider__model, for example typesafeai__jev-1.14.0. A calibration belongs to one provider and model: the same model name under another provider is a different model.
  • Question: choose Decision rubric judge (current) to calibrate the judge as it is configured now. The option shows the rubric's question, its number of rules and how many errors still pass. It is missing when the judge could not grade with the rubric either: no rules, points per error below 1, or two rules with the same id. Choose Other wording (outside data) only for answers from another module that asks its own question; then paste that wording and its criteria exactly as the model receives them.
  • Answers: one reviewed answer per line, id,probability,verdict, where the verdict is 1 for yes, 0 for no, or the share of reviewers who said yes. For the decision rubric judge the probability is its raw pass probability, before any calibration, which a run stores with each grade as grader_scores.decision_rubric.decision.p_pass; not one rule's probability and not the calibrated probability. At least 30 answers with both verdicts among them. Paste them, or upload the same lines as a CSV file, which is used instead of the pasted text.

A calibration records the model version that answered. When the provider moves an alias such as jev-latest to a new version, an active calibration fitted on that version takes priority. If there is none, the newest active calibration for the same judge or selected automator and the same question keeps applying. The judge uses calibrations recorded for its configured alias, including older calibrations stored under that alias. An automator's calibration carries over only while the automator asks for the same model it asked for when the answers were recorded, so switching the automator to another model stops it. Automator calibrations fitted before this was added do not carry over: fit them again. Calibrations from another provider or question never carry over. If calibrations have the same date, the larger calibration id decides which is used.

The correction is shown as carried over from the version it was fitted on. Record answers from the new version, review them, and fit again. An active calibration on the new version replaces the carried correction.

On both tabs, half the answers fit the curve and the other half check it. The detail page shows the average gap on the checking half before and after the correction.

If someone edits the rubric while you are on the form, saving is refused with "The rubric changed while you were on this page." Reload and check the question before fitting again.

A calibration that makes things worse

A calibration fitted on a few answers can make the probabilities worse on the answers held back. AI Eval checks the overall error (the Brier score, 0 to 1, lower is better) on those answers before and after the calibration:

  • Better: neither the overall error nor the average gap rose. The calibration is saved and applies, replacing any earlier one for the same model and question.
  • Mixed: the overall error did not rise but the average gap did. It still applies, and the list says the two measures disagree.
  • Worse: the overall error rose, by any amount. The calibration is saved but not active. The earlier calibration, if there is one, keeps applying; if there is none, the answers stay uncorrected.

The list shows each calibration's name, status, what it corrects (the selected decision automators, and the decision rubric judge when it asks that question with that model) and result. A calibration fitted without a name shows the question it calibrates, on all three tabs. An older calibration saved without a name on the Answer file tab still shows its model id. To apply a worse calibration anyway, open it and choose Activate it anyway, or use Activate in the list. Activating deletes the other calibrations for that model and question. Only one inactive calibration is kept per model and question: a newer worse calibration replaces it.

If two calibrations for the same model and question are ever active at once (for example after importing configuration), neither is applied and the detail page says so. Delete all but one.

When a calibration stops applying

A calibration applies only to the exact question it was fitted on. For the decision rubric judge that is the question, the note, every rule's text in order, the answer levels, the names the page and the question are sent under, and the error allowance that the pass score and points per error give. Change any of them and the judge stops applying the old calibration; its grades read "uncalibrated" until you fit a new one. Settings that leave the error allowance the same (for example a pass score of 91 with 4 points per error) keep the calibration.

Each calibration's detail page says whether the judge applies it now:

  • "asks this question now with this model": the judge corrects its pass probability with this calibration.
  • "carried over from": the judge now answers as another version and uses this calibration until an active calibration on that version replaces it.
  • "uses another calibration for it": the judge answers as a version with another calibration that applies.
  • "this calibration was fitted for another model": the judge is set to a different model, so this calibration is not used.
  • "uses another provider": the judge's provider differs from this calibration's.
  • "does not ask this question now": the rubric or its pass setting has changed since the calibration was fitted, or the calibration was fitted on other wording. Another module may still read it.

Calibrations fitted before AI Eval included the levels and pass setting in this check (#3594764), or before it recorded the provider (#3594777), no longer apply. Their detail page says so. Fit them again from the current rubric.

Use a calibration for other decision automators

Enable AI Eval Decision Calibration. Open a calibration from Manage > Calibrations, then open its Decision automators tab. Select the decision automators that must use it. Select Save decision automators. The field's AI Automator Settings list the calibrations that select its automator, for people who may view calibrations.

A calibration fitted on the Answer file tab can match only Decision: Boolean automators. That tab cannot enter array instructions or true/false criteria. A calibration fitted from recorded decisions (see below) uses the wording that the decision automator sent, so it can match any decision automator.

A decision automator is a feature that asks an AI model a question. An active calibration applies when the question wording, provider, model that answered, and a selected decision automator all match. Criteria are part of the question wording. When an automator asks for the same model but another version answers, the newest active calibration for that decision automator and question keeps applying until a calibration for that version replaces it. The calibration must record the requested model; switching the automator to another model stops this correction. If the model that answered is empty, no calibration applies. With no selected decision automators, no decision automator uses the calibration.

The correction applies to true/false probabilities. Score and choice answers stay the same. The decision rubric judge continues to correct its own pass probability. The raw probability stays in the answer's raw data under ai_eval_calibration, with the calibration ID and the matching decision automator tag.

An eval run of a scoped automator records the raw probability. The field that the automator fills gets the calibrated probability.

A new active calibration for the same provider, model and question keeps the decision automators of the calibration it replaces, unless the new calibration already has its own selection.

Saved tags for decision automators not listed on the form are checked by default. This includes deleted automators and tags saved when AI Automators is not enabled. Uncheck a saved tag to remove that decision automator.

Record and review decision automators' decisions

A user with administer ai eval permission chooses what the site records. On Calibrations, open Record decisions. Select the decision automators whose true/false answers you want to review. Choose a sample rate greater than 0 and at most 1. The default, 1, records every answer. Saved decision automators stay listed when an automator is removed.

Stop after limits how many answers of a decision automator are stored. Leave it empty for no limit. When a decision automator reaches it, recording for that decision automator stops and Record decisions shows Recording stopped. If the stored count is already above the limit, it shows Recording stopped: 42 recorded, limit 3. Calibrations still apply to its answers. Requests running at the same time can exceed the limit by at most the answers in flight at that moment. Deleting entities removes their recorded answers; recording resumes when the decision automator is below its limit. When a request has more than one recorded tag, each answer is stored once, under the first open tag whose sample draw succeeds.

A record keeps the entity reference, field name and question wording. It also keeps the provider, model that answered, raw probability and calibration applied, if any. With Keep the text sent to the model, for review, it also keeps the state as text or pretty JSON, up to 64 KB, only when the request names a known content entity type and an entity ID (for a new entity, once it is saved). This option is off by default. A separate flag shows when text was shortened; the text itself has no added marker. Files are never kept. Only their names, MIME types and sizes in bytes are stored with the text, for example "1 file(s) sent: photo.png (image/png, 1024 bytes), not kept". A missing name is shown as "unnamed file".

Stored answers, text and file summaries are kept until their entity is deleted. Unchecking the option stops storing new text and file summaries and keeps what is stored. Kept text and file summaries are visible only to reviewers who can view the entity; otherwise the page says "Text hidden: you cannot view this item."

An answer is not recorded when:

  • the response does not report which model answered;
  • the question wording contains text from the state.

Keep content out of the question wording and send it in the state. If a prompt puts content into a question (for example with a {{ context }} token), its answers are not recorded. A calibration also cannot apply to them, because the wording is different for every entity.

An entity not saved yet has no ID when the answer is recorded. When the AI module reports the entity's UUID, the answer is linked to the entity, and its text is kept if you chose that, as soon as the entity is saved. It then works like any other answer, and is deleted with the entity. Without the UUID, or when the entity is never saved, the answer stays without a link or text and the review page says the entity was not saved yet.

Open Review decisions and select a group: one decision automator, provider, model and question. The page shows the question once and up to 50 answers not reviewed yet, oldest first. Follow the entity link to read the content, if you have access to it. When text was kept, open Text the model judged under the entity. Choose True, False or Skip, then select Save reviews. The page does not show the model's probability, so it does not influence your review. Skipped answers stay in the list. If another reviewer labeled an answer first, your label is not saved and the page says so.

The group page always shows how many answers the decision automator recorded and how many of this question and model are reviewed; fitting needs 30. When recording stopped with fewer than 30 reviewed, a user who can change Record decisions can select Record 50 more. This raises the limit by 50 from the higher of its previous limit and the stored count. The Reviewed tab lists reviewed answers with your label, the model's probability and, when a calibration corrected it, the corrected probability and calibration name.

Fit from recorded decisions

On Fit a calibration, open the Decision automators tab. A group needs at least 30 reviewed answers, both true and false on the fitted side, and answers on the side held back. Answers about the same entity stay on the same side of the split. If a group is not ready, review answers about more entities.

Fit and save checks readiness again. The new calibration applies only to the decision automators in its scope that ask the question with the same wording. Its scope is the group's decision automator. Decision automators that ask the same question of the same model share one calibration: if a calibration for that question is active, the new calibration replaces it and also applies to its decision automators. The Also applies to column lists them before you fit. A calibration that makes the overall error on the held-back answers worse is saved inactive, as on the other fitting tabs.

Check newer answers

The Decision automators tab of an active calibration has a section Since this calibration was fitted. It uses the answers recorded after the calibration was fitted and then reviewed, for the same provider, question and selected decision automators. Answers from another version of the model count when this calibration corrected them. It counts each entity once, using the entity's most recently recorded reviewed answer; an answer that names no entity counts on its own. Answers recorded before the decision automator was selected still count, because the check applies the calibration to the raw probabilities. The calibration stores when it was fitted, not when it was activated, so for a calibration activated later this includes answers from before activation. The section compares the overall error of the raw probabilities with the overall error after correction. With fewer than 30 entities it gives no verdict. When the calibration makes the overall error higher, the Decision automators tab shows a warning and suggests fitting again. The calibration stays active until you replace or delete it.