Skip to content
echogeco
The model as a component · Tokens and sampling

The flaky classifier test

Diagnose a CI test that fails one run in fifteen at temperature 0, reject the retry fix, and replace the test with a measurement.

critiqueeasyExercise · 3 min · 10 of 77
On this page

A test that fails one run in fifteen is telling the team something. The proposed fix would stop it talking.

The situation

A support-triage classifier runs at temperature 0. CI has a test that sends one real ticket — "I was charged twice and now I can't log in" — and asserts that the label is billing. About one run in fifteen it fails, returning account. A pull request proposes retries: 3 on the test so that a failing run re-executes until it passes, with the comment "temperature 0 is deterministic, so this is an API glitch". Reviewers have approved it because the red build is blocking releases.

The team has a 200-item labelled set it ran once, four months ago, when the prompt scored 182 of 200. It has not been run since; the prompt has changed twice. Each classifier call is ~800 tokens in and 5 out, and finishes in under two seconds. Assume ¾ of a word per token; the price does not matter for this one — 20 calls of 800 tokens is 16k tokens, whatever P_in is. The relevant lesson is sampling and determinism.

The question

Find the defect in the test and in the proposed fix, and say what replaces them.

A strong answer · Rubric · Where answers go wrong

Write your answer first, then open