garak icon indicating copy to clipboard operation
garak copied to clipboard

Automate updating the calibration process

Open leondz opened this issue 1 year ago • 1 comments

Summary

Calibration involves a lot of manual work; update what can be updated

Basic example

Currently the process is:

  • select a set of probes
  • build a garak config based on that
  • select a set of models
  • run that config on all those models
  • run the calibration script on the results
  • add the output into data/calibration
  • update data/bag.md
  • update the data/calibration.json pointer

Motivation

  1. To save time
  2. To make timely calibration updates more likely
  3. To improve consistency of our calibration

leondz avatar Jan 10 '25 14:01 leondz

Hi — following up on this with a concrete proposal, since calibration trustworthiness has two coupled problems:

1. Stale baseline (the automation gap this issue describes)

data/calibration/ currently ships two snapshots from 2024 (calibration-2024-summer.json, calibration-2024-09update.json). Z-scores for today's models are computed against a two-year-old distribution, and safety-relevant score distributions drift fast. The manual pipeline listed in the issue summary is exactly why timely updates don't happen.

2. Silent degradation on load failure

In garak/analyze/calibration.py, _load_calibration() swallows every failure path (missing file, JSON decode error, symlink checked out as a text file) with return None plus a warning. Evaluation then continues without a usable calibration, and nothing in the report marks that the z-scores were computed without one — a reader can't tell whether a rating is calibrated or not.

Proposal: a versioned, automated calibration pipeline

  • A scheduled job (or script) that runs a pinned benchmark model set through a pinned probe subset, then invokes the existing calibration script — automating the exact manual sequence listed in this issue.
  • Snapshots land in data/calibration/ as dated, versioned files (the current naming convention already supports this), with garak_calibration_meta recording the model set, probe subset, and generation date.
  • Calibration gains a loaded/stale/failed state; reports (and the JSONL output) annotate which calibration snapshot was used, or explicitly state "uncalibrated" when loading failed — fail-loud instead of fail-silent.
  • Optionally, snapshots older than N months flag a deprecation warning in reports.

Happy to draft a PR for the fail-loud + report annotation part first (small and self-contained), with the automation pipeline as a follow-up. Would that fit the direction you have in mind for #869?

tanbopiao avatar Nov 24 '26 06:11 tanbopiao