Dataset versioning for LLM evaluations and label corrections
Sources checked 3 min read · By the Eval Suites editors
In brief
Dataset versioning gives each evaluation a fixed set of inputs and expected outcomes. Keep a case ID when you correct its label and save the correction in a new snapshot. When a score moves, grade both saved outputs against the same snapshot before attributing the change to the model.
Record the case snapshot and scoring setup for each run
Keep an immutable case ID for each input and its starting state. A correction to what that case should do keeps the ID and increments the reference revision. A new prompt or starting state gets a new case ID with a link to the one it replaces. Keep a reason for each correction or replacement so a later reviewer can tell which part of the test changed.
| Record | Details to retain | Question it answers |
|---|---|---|
| Dataset snapshot | Stable version, file locations and byte hashes for inputs, references and split membership | Which cases and labels did the runner load? |
| Reference changelog | Case ID, old and new labels, reviewer, evidence revision and reason | What made the expected answer change? |
| Run configuration | Application revision, model identifier, prompt, sampling settings, scorer revision and decision threshold | What produced and scored the answers? |
| Run outputs | Saved result by case ID, with timeout and missing outcomes recorded | Can you rescore the same responses later? |
An access-controlled versioned object store can hold larger or restricted snapshots while Git records the manifest. DVC’s file format illustrates this arrangement: Git tracks the metadata that points to the versioned data. Verify the referenced bytes are still retrievable and store the run output under the same retention policy. A digest identifies bytes, and replaying a live model can still produce a different answer.[1][2]
Rescore the two saved outputs after a label correction
In this illustrative Riverside Library release, case LIB-02 asks where to collect a held book. The draft label says north desk. A reviewer checks the same branch map the answer used and finds it says east desk. Version 2 corrects the reference while keeping the same case ID, inputs, and map. An exact-match scorer grades the same four saved responses from each version.
| Case | Reference v1 | Reference v2 | Baseline output | Candidate output |
|---|---|---|---|---|
| LIB-01 | west | west | west | west |
| LIB-02 | north | east | north | east |
| LIB-03 | workshop | workshop | workshop | workshop |
| LIB-04 | returns | returns | loans | loans |
With the old snapshot, the baseline passes 3 of 4 and the candidate 2 of 4. With the corrected snapshot, the same baseline passes 2 of 4 and the same candidate passes 3 of 4. Record both comparisons and use v2 for the next decision. The correction changes the interpretation of LIB-02. Both versions still fail LIB-04.
Fingerprint the reference bytes and reproduce the score
The example serializes the label map as UTF-8 JSON with sorted keys, compact separators and a terminating newline. It verifies the SHA-256 of those exact bytes against the manifest. In a release job, do the same for every data file the runner loads. A line-ending or reformatting change can alter a byte hash with the labels intact.[2]
from hashlib import sha256
from json import dumps
v1 = {
"LIB-01": "west", "LIB-02": "north",
"LIB-03": "workshop", "LIB-04": "returns",
}
v2 = {**v1, "LIB-02": "east"}
baseline = {
"LIB-01": "west", "LIB-02": "north",
"LIB-03": "workshop", "LIB-04": "loans",
}
candidate = {**baseline, "LIB-02": "east"}
manifest = {
"v1": "ec328b85dff8ebb7ea5f9a2898f2ad90316ce5a9d91b9883b42f39bdf0a3164e",
"v2": "1e52941c6fb21d52c70ae01d665bfcc4fc7199aa45bd100b9f00d69d00945854",
}
for version, labels in (("v1", v1), ("v2", v2)):
payload = dumps(labels, sort_keys=True, separators=(",", ":")) + "\n"
digest = sha256(payload.encode("utf-8")).hexdigest()
if digest != manifest[version]:
raise ValueError(f"{version} label snapshot differs from the manifest")
scores = [sum(saved[key] == labels[key] for key in labels)
for saved in (baseline, candidate)]
print(version, *scores)The example prints v1 3 2 and v2 2 3 after verifying both full digests. Change one version’s label or serialization and it raises an error before scoring. Before joining runs, confirm that IDs are unique, the expected outputs are present and both runs have the same case IDs. Record coverage separately if a case has to be removed or restored.
If the library opens a new east desk after the original evaluation, create a new scenario with the new map. That change belongs to the environment rather than to the reviewer’s correction. Preserve the old snapshot where retention rules permit so you can explain the earlier release decision. Keep scenario families together when splitting an evaluation dataset.
Related suites
Related reading
Sources
- 1. DVC files and data version references · DVC · Official docs · Sources checked
- 2. Python hashlib documentation · Python Software Foundation · Official docs · Sources checked