Checking an AI feature after every change

A team building a language model into a product changes it often. Someone edits a prompt, swaps the model or adds documents.

An evaluation loop tells the team whether the answers got better or worse after each change. The team runs the same test cases and scores the answers every time.

Inspect and its three parts

The UK AI Security Institute and Meridian Labs develop Inspect, which they describe as "a framework for frontier AI evaluations".

In Inspect, an evaluation is a task with three parts. A dataset holds the samples, a solver produces an answer for each one, and a scorer judges the answer.

Writing the test cases

Each sample has an input, which is the prompt. It can also have a target, which Inspect's documentation calls the "Ideal target output". The target can be a literal value or guidance for a model that grades the answer.

Inspect reads datasets "in the CSV, JSON, and JSON Lines formats", and from Hugging Face. You can start from a spreadsheet of questions your users have asked.

The UK government's AI Playbook says outputs "should be tested against known good responses".

Scoring the answers

Inspect's scorers take one of four forms. They pick a specific answer out of the output, compare the text with the target, ask another model whether the answer meets the target's description, or apply some other rubric.

Metrics then bring the scores together. Inspect's accuracy() metric "computes what percentage of scores are correct".

Running the set after each change

Under the Playbook's rules on validation, "You must ensure that any updates to the AI system have a quantitative testing and validation process as part of the change control process."

In practice, the team runs the same set after every prompt, model or data change, and compares the scores with the last run.

Inspect View, a web-based tool, shows the results. From there the team can read the transcript behind each answer.

People alongside the scores

The Playbook calls it "good practice to test the accuracy and relevance of your model's outputs with a sample of your users".

It adds that people are particularly helpful on tasks that are hard to specify and easy to judge.

Useful links