Advanced

Budgeting an eval run

An eval run is a bill: cases times calls times tokens. The budget is what keeps the loop honest, because an expensive loop that nobody times is a loop nobody can price.

What you will see

A written budget. A run over the budget is a report, not a gate.

About 1 min of reading

Try It

Price one eval run

1

Count cases and calls

echo $(( $(wc -l < /tmp/cases.txt) * 2 ))

Before you run it, say out loud what it will print. Then open the answer.

What it prints
Cases times two judge calls. That product is the bill driver.
2

Time one case end to end

time grep -c 'token' /tmp/out.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
A time in milliseconds for one case. Multiply it by the set to get the run.
3

Compare to the change cycle

echo 'budget: 10 min per run'

Before you run it, say out loud what it will print. Then open the answer.

What it prints
A written budget. A run over the budget is a report, not a gate.

Data Flow

A set to a priced run
1 Cases are counted
↓
2 Calls per case are counted
↓
3 Tokens per call are averaged
↓
4 Cost and time are printed per case and per run
Why this works
Why cost is printed per case

Per case cost is the number that decides set size. Total cost only says the set is too big.

Where the budget forces a cut

When the budget is exceeded, cases are cut by rank, not at random. A random cut changes which failures can be seen.

Examples

Counting the calls, not the words

Cost is driven by call count. A grade that calls a judge twice per case costs twice what a rule grade costs.

The time budget is the real limit

A run that takes longer than the change cycle is not a gate. It is a report, and reports do not block anything.

Caching the model output

The same input to the same model gives the same output often enough to cache. Caching the model, not the grade, is what makes reruns cheap.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Grading faithfulness
Previous Lesson
Grading faithfulness
Next Lesson
The eval gate
The eval gate →