Evaluation
EvalKit maintains versioned evaluation protocols, scoring, and the prediction generation loop. Scoring runs on CPU and needs neither torch, transformers, nor network access — only Python 3.12 and uv.
EvalKit registers all nine published task protocols, with SciTS NEU06 as the worked end-to-end example below.
Registered datasets
| Dataset ID | Task | Protocol | Optional runtime extras |
|---|---|---|---|
scits-neu06 | SciTS NEU06 | scits-neu06-v1 | none (stdlib) |
scits-phu01 | SciTS PHU01 | scits-classification-text-3dp-ecg100hz-v1 | none (stdlib) |
llm4mat-jarvis | JARVIS-DFT | llm4mat-jarvis-formation-energy-cif-v1 | none (stdlib) |
qm9s-allspectra | QM9S | diffspectra-compute-metrics-v1 | rdkit, myopic-mces, pulp (for molecular scoring) |
atom3d-psr | ATOM3D PSR | atom3d-psr-year-backbone-text-gdt-ts-v2 | scipy (lmdb only for raw LMDB input extraction) |
gue-splice | GUE splice | gue-splice-reconstructed-mcc-v1 | none (stdlib) |
beacon-ncrna | BEACON ncRNA | beacon-rna-bioinstructions-v1 | none (stdlib) |
mpbind-ba1 | MPBind | mpbind-ppi-reconstructed-ba1-sequence-sites-v1 | none (stdlib) |
simxrd-ol | SimXRD OL | simxrd-ol-crystal7-text-maxbin0.1deg-v1 | none (stdlib) |
Score saved predictions
Run from the repository root:
--dataset is accepted as an alias for --task, and --workers sets worker processes for datasets with parallel metrics such as qm9s-allspectra. The command prints a summary and writes summary.json and per-item scores.jsonl to --out-dir. The library entry point is evalkit.score.score_files(task, references, responses, *, only_responded=False, workers=1).
By default every frozen ID is scored, and an ID with no prediction counts as an empty answer. --only-responded scores only the IDs that have a prediction record, and marks the result as a subset.
Prediction file format
- Each JSONL line is one attempt, with
eval_id,content, and optionallystatus(ok,truncated,api_error). Other fields are ignored. For a repeatedeval_id, the last line wins. generation.runwrites arun_idinto every line and a<filename>.run.jsonnext to it, recording the run identity: task, ordered inputs, model, service address and model name, decoding parameters. A run with the same identity can resume and skip the IDs already written; a different identity writing to the same file is refused.- Only one generation process may use a path at a time, enforced by
<filename>.lock. A stale lock left by an abnormal exit must be removed by hand. - Older files without a
run_idstill score normally, but cannot be appended to; write the remaining items to a new file.
The scits-neu06-v1 protocol
| Item | Definition |
|---|---|
| Test set | The 1,024 rows of SciTS meta_data.jsonl whose task_id contains NEU06, with eval_id = "NEU06:" + id. Row count and the SHA-256 of [eval_id, label] are checked on load |
| Classes | Wake, N1, N2, N3, REM, with support 324, 101, 365, 94, 140 |
| Answer parsing | Take the body after the last </think>; if <answer>…</answer> is present, take the last one; strip the outer code fence. A line equal to a class name predicts that class |
| Validity | Valid when there is at least one line and every line is a class name. Validity is reported separately and does not clear the prediction: N2 plus a line unsure is invalid but still predicts N2 |
| Missing and status | A missing ID scores as an empty answer; status is reported only and does not affect parsing |
| Macro-F1 | The mean F1 over the reference classes present in the scored rows; TP/FP/FN count label-set membership |
| Accuracy | The predicted label set equals the reference set |
Parsing and scoring follow the rules used for the Sage-SciPerception v0.1.0 published scores.
Reproduce from raw EEG
The NEU06 example covers the full path: REVE-base feature extraction, generation against a vLLM server, and scoring. It lists every input with its source, revision, and license, and reports both the released run and a rerun:
| Run | Macro-F1 (%) | Accuracy (%) |
|---|---|---|
| Released (v0.1.0) | 72.01 | 76.46 |
| Rerun | 71.82 | 76.46 |
Both runs cover all 1,024 items. They are separate runs, and per-item predictions of the released run are not available.
Add a dataset or a model
| Module | Responsibility |
|---|---|
datasets/base.py | The small base class EvalDataset: name, protocol, load, metadata, score_items, score aligned by eval_id, and shared answer_span |
datasets/<suite>.py | One module (or package such as datasets/qm9s/) per upstream dataset or benchmark suite, holding references, questions, parsing and metrics; tasks within a suite register by task ID |
datasets/__init__.py | The DATASETS registry |
contract.py, score.py, cli.py | Prediction file reading, score dispatch, result writing, and scip-eval score |
generation.py | The generation loop: concurrency, OpenAI-compatible /completions requests recording http_status, run-bound appends and resume |
glm_prompt_embeds.py | The vLLM prompt_embeds adapters (GlmProjectorPrompt and reusable variable-length GlmProjectorSession) for GLM plus a projector payload across the nine atom projector modalities, with multi-object support, atom_numbering/payload_labels and optional discrete/side/counts passthrough; needs torch, transformers and safetensors at run time |
A new dataset or task: implement an EvalDataset subclass in a suite module, register it in datasets/__init__.py, and add fixtures under tests/. Dispatch and the CLI need no change.
A new model: a model called the same way needs only different weights, configuration and service name in the calling script. A different calling convention adds an adapter module that assembles the request and states the model identity, combined with generation.completion or your own transport into a generate(eval_id) passed to generation.run.