Skip to main content

Evaluator

The Evaluator measures the accuracy of model checkpoints produced during the optimization pipeline. It compares model outputs before and after each optimization step to show how optimization affects accuracy.

Overview​

Evaluation runs automatically as part of np run when you define the evaluate section in run.yaml. You specify which model checkpoints to evaluate and which metrics to compute. The Evaluator records results in report.json. To display the results, run np report.

Pipeline position​

Supported metrics​

MetricApplicable taskTypeDescriptionDataset required
SNRAllComparisonSignal-to-noise ratio between 2 model outputsNo
MSEAllComparisonMean squared error between 2 model outputsNo
MAEAllComparisonMean absolute error between 2 model outputsNo
KLDAllComparisonKullback-Leibler divergence (KLD) between 2 model outputsNo
KURTOSISAllComparisonKurtosis of the output distribution shiftNo
PCTL_MAXAllComparisonMax-percentile deviation between 2 model outputsNo
TOP1_ACCURACYClassificationIndependentTop-1 classification accuracyYes
TOP5_ACCURACYClassificationIndependentTop-5 classification accuracyYes
ACCURACYText classificationIndependentClassification accuracyYes
F1Text classificationIndependentMacro-averaged F1 scoreYes
PAIR_ACCURACYVision-languageIndependentPairwise accuracy on paired image comparison (MMVP)Yes
QUESTION_ACCURACYVision-languageIndependentPer-question accuracy (MMVP)Yes
RECALL@10Text embeddingIndependentRecall@10 for retrieval-style embedding tasksYes
NDCG@10Text embeddingIndependentNormalized Discounted Cumulative Gain@10Yes
I2T_RECALL@1Image-text matchingIndependentImage→Text Recall@1Yes
T2I_RECALL@1Image-text matchingIndependentText→Image Recall@1Yes
MAPObject detection, face detection, audio classificationIndependentMean Average PrecisionYes
AP50Object detection, face detectionIndependentAverage Precision at IoU 0.50Yes
AP75Object detection, face detectionIndependentAverage Precision at IoU 0.75Yes
MIOU_PROMPTEDMask generationIndependentMean IoU for prompted (point/box-conditioned) mask generationYes
MASK_APMask generationIndependentAverage Precision over generated masksYes
PPLText generationIndependentPerplexity for language modelsYes
HELLASWAGText generationIndependentHellaSwag commonsense-reasoning accuracyYes
PSNRSuper resolutionIndependentPeak Signal-to-Noise RatioYes
SSIMSuper resolutionIndependentStructural Similarity IndexYes
WERSpeech-to-textIndependentWord Error RateYes
CERSpeech-to-textIndependentCharacter Error RateYes

Comparison metrics measure the difference between 2 model checkpoints (for example, original as opposed to quantized). These metrics do not require a labeled dataset.

Independent metrics measure the absolute accuracy of a single model checkpoint. These metrics require an evaluation dataset with ground-truth labels. Most independent metrics also take task-specific parameters in run.detail.yaml.

Face detection metrics are not available yet

MAP, AP50, and AP75 are the confirmed metrics for face detection (mediapipe_face) and match the object detection set. The evaluation dataset and evaluator are not implemented yet. Requests for these metrics currently fail instead of returning a result.

YAML configuration​

The evaluate section in run.yaml declares which models to evaluate and which metrics to compute.

evaluate:
- model: INPUT_MODEL
metric:
- SNR
- model: GRAPH_OPTIMIZE
metric:
- SNR
- model: OUTPUT_MODEL
metric:
- SNR
- TOP1_ACCURACY
FieldDescription
modelModel checkpoint to evaluate. Use the reference names in the following table.
metricList of metrics to compute

Model reference names​

NameDescription
INPUT_MODELOriginal model before optimization
ADVANCED_QUANTIZECheckpoint after AQ step
GRAPH_OPTIMIZECheckpoint after GO step
OUTPUT_MODELFinal output of the last step (after GQ)

Reference names are case-insensitive. SNR is measured relative to INPUT_MODEL by default. To change the baseline, use run.detail.yaml.

Advanced overrides (run.detail.yaml)​

run.detail.yaml mirrors the evaluate list in run.yaml by index (evaluate[0], evaluate[1], ...). Use it to override the default baseline for comparison metrics. You can also set task-specific parameters for independent metrics that delegate to an external evaluation framework, such as lm-evaluation-harness, VLMEvalKit, or Massive Text Embedding Benchmark (MTEB).

metrics is a list of single-key mappings rather than a mapping keyed by metric name. This structure preserves duplicate or repeated metric entries.

Comparison metrics: baseline override​

SNR, MSE, MAE, KLD, KURTOSIS, and PCTL_MAX compare against INPUT_MODEL by default. Override the baseline with source_model and target_model:

run.detail.yaml
detail:
evaluate[1]: # Corresponds to evaluate[1] in run.yaml
metrics:
- SNR:
source_model: graph_optimize # Override baseline (default: input_model)
target_model: graph_quantize

Text generation: HELLASWAG​

Delegated to lm-evaluation-harness. PPL takes no parameters.

run.detail.yaml
detail:
evaluate[0]:
metrics:
- HELLASWAG:
limit: 100 # Number of problems to score
num_fewshot: 0 # Number of few-shot examples (default: 0)
apply_chat_template: false # Set true for instruct models
MetricKeyTypeDefaultRange
HELLASWAGlimitint1001-10042
num_fewshotint00+ (prompts top out around 56 tokens, so there is no separate cap tied to few-shot count)
apply_chat_templateboolfalsetrue for instruct models

Speech-to-text: WER and CER​

Delegated to an internal audio adapter and speech-recognition evaluator.

run.detail.yaml
detail:
evaluate[2]:
metrics:
- WER:
limit: 100 # Number of utterances to score
dataset_path: <shard_path> # Required: data_*.pt shard directory
normalize_transcript: true # Lowercase + strip punctuation (default: true)
- CER:
limit: 100
dataset_path: <shard_path>
normalize_transcript: true
KeyTypeDefaultRange
limitint1001 to the shard count
dataset_pathstr(required)Path to the data_*.pt shard directory
normalize_transcriptbooltrueLowercases and strips punctuation

These parameters apply identically across every speech-to-text model, including conformer_ctc, executorch_conformer, whisper_base, and qwen3_asr_0_6b. Differences in component structure, such as encoder-decoder, pass-through, or Large Audio-Language Model (LALM), do not change this parameter surface.

Normalization is not Whisper-style

Unlike the Whisper EnglishTextNormalizer, which also expands numbers and abbreviations, normalize_transcript only converts to lowercase and strips punctuation.

Vision-language: PAIR_ACCURACY and QUESTION_ACCURACY​

Delegated to VLMEvalKit, evaluated on MMVP.

run.detail.yaml
detail:
evaluate[3]:
metrics:
- QUESTION_ACCURACY:
limit: 300 # Even numbers only; 300 = the full MMVP set
max_new_tokens: 31 # Generation length
judge: exact_matching
device: cuda # Default is cpu
backend: auto # Only exposed for hf/compressed_tensors outputs
- PAIR_ACCURACY:
limit: 300
max_new_tokens: 31
judge: exact_matching
device: cuda
backend: auto
KeyTypeDefaultRange
limitint300 (full set)2-300, even only (an odd value fails an assertion in the scorer)
max_new_tokensint311-2048 (MMVP answers are a single A/B letter, so 31 is generous)
judgestrexact_matchingexact_matching
devicestrcpucpu, cuda, cuda:N
backendstrautoauto, hf, vllm. .pt2 outputs are fixed to auto, and vllm errors; this key is only exposed at all for hf or compressed_tensors outputs

QUESTION_ACCURACY (scored per question) and PAIR_ACCURACY (both halves of a pair correct) share the same parameters and differ only in how the score is aggregated.

Metric name changed after the technical spec was written

The run.yaml and run.detail.yaml schema spec (dated 2026-07-22) still calls this metric ACCURACY. The confirmed metric decision (dated 2026-08-13) renamed it to QUESTION_ACCURACY to distinguish it from other ACCURACY metrics elsewhere in the taxonomy. VLMEvalKit's own output keys are MMVP_Overall_0 (pair accuracy) and MMVP_Average_0 (per-question accuracy). The previous parameter table above is unaffected by the rename. Only the metric name has changed. Use QUESTION_ACCURACY, not ACCURACY, unless this changes again.

Text embedding: NDCG@10 and RECALL@10​

Delegated to MTEB, evaluated on Benchmarking Information Retrieval (BEIR) SciFact. @10 is part of the metric name, not a runtime setting. Other values, such as NDCG@1 and RECALL@5, are separate metrics that are not currently exposed.

run.detail.yaml
detail:
evaluate[4]:
metrics:
- NDCG@10:
batch_size: 32 # hf outputs only; pt2 is fixed at batch_size 1
max_seq_length: 512 # hf outputs only
mteb_model_name: null # MTEB registry name
trust_remote_code: false
device: cuda # Default is cpu
- RECALL@10:
batch_size: 32
max_seq_length: 512
mteb_model_name: null
trust_remote_code: false
device: cuda
KeyTypeDefaultRange
batch_sizeint81-256 (hf outputs only; .pt2 graphs are fixed at batch 1, so this is ignored there)
max_seq_lengthintmodel default (512)1-512 (hf outputs only)
mteb_model_namestr | nullnullMTEB registry name
trust_remote_codeboolfalsetrue, false
devicestrcpucpu, cuda, cuda:N

Image-text matching: I2T_RECALL@1 and T2I_RECALL@1​

Delegated to an internal retrieval evaluator plus MTEB, evaluated on COCO2017 (Karpathy split).

run.detail.yaml
detail:
evaluate[5]:
metrics:
- I2T_RECALL@1:
batch_size: 32 # hf outputs only
mteb_model_name: openai/clip-vit-base-patch32 # Required
device: cuda # Default is cpu
- T2I_RECALL@1:
batch_size: 32
mteb_model_name: openai/clip-vit-base-patch32
device: cuda
KeyTypeDefaultRange
batch_sizeint81-256 (hf outputs only; .pt2 is fixed at batch 1)
mteb_model_namestr(required)MTEB registry name
devicestrcpucpu, cuda, cuda:N

I2T_RECALL@1 (image→text) and T2I_RECALL@1 (text→image) are separate metrics that share this parameter table; declare both if both directions are needed.

Built-in metrics: no parameters​

The Evaluator computes the following metrics directly, with no delegation to lm-evaluation-harness, VLMEvalKit, or MTEB. You do not need to configure additional parameters in run.detail.yaml. Specify the metric and dataset in run.yaml:

TaskDatasetMetrics
Image classificationImageNet-1KTOP1_ACCURACY, TOP5_ACCURACY
Object detectionCOCO2017MAP, AP50, AP75
Image super resolutionBSD100 (also SET5/SET14/URBAN100)PSNR, SSIM
Text classificationMNLI/SST2ACCURACY

Full examples​

GO + GQ​

This example uses metrics that apply to all tasks. SNR does not require a dataset.

version: '1.0'
steps:
- graph_optimize: null
- graph_quantize:
- scheme: W8-A8
profile:
- INPUT_MODEL
- GRAPH_OPTIMIZE
- OUTPUT_MODEL
evaluate:
- model: INPUT_MODEL
metric:
- SNR
- model: GRAPH_OPTIMIZE
metric:
- SNR
- model: OUTPUT_MODEL
metric:
- SNR

AQ + GO + GQ​

This example uses a large language model (LLM) for text generation. Replace PPL with a task-appropriate metric for other model types.

version: '1.0'
steps:
- advanced_quantize:
- algorithm: AWQ
scheme: W8-A8
- graph_optimize: null
- graph_quantize:
- scheme: W8-A8
profile:
- INPUT_MODEL
- ADVANCED_QUANTIZE
- GRAPH_OPTIMIZE
- OUTPUT_MODEL
evaluate:
- model: INPUT_MODEL
metric:
- PPL
- model: ADVANCED_QUANTIZE
metric:
- SNR
- PPL
- model: OUTPUT_MODEL
metric:
- SNR
- PPL

Log output​

============================================================
[Phase 5] Evaluation
============================================================
2026-08-21 17:15.00 [INFO ] [Evaluator] Evaluating: input_model → graph_optimize (SNR)
2026-08-21 17:15.02 [INFO ] [Evaluator] Input: data_000, output_0: 31.42 dB
2026-08-21 17:15.02 [INFO ] [Evaluator] Input: data_001, output_0: 29.87 dB
2026-08-21 17:15.03 [INFO ] [Evaluator] Input: data_002, output_0: 30.14 dB
2026-08-21 17:15.03 [INFO ] [Evaluator] Evaluating: graph_optimize → graph_quantize (SNR)
2026-08-21 17:15.05 [INFO ] [Evaluator] Input: data_000, output_0: 22.15 dB
2026-08-21 17:15.05 [INFO ] [Evaluator] Input: data_001, output_0: 21.73 dB
2026-08-21 17:15.06 [INFO ] [Evaluator] Evaluation complete. Results saved to report.json

Viewing results​

np report

np report shows the evaluation results for the np run pipeline in a top-level table. The table displays the dataset that produced each metric in a separate column. Evaluations that you run later with np evaluate appear in a separate table for each execution. They do not appear in the run table. See CLI Reference: np report for the exact column layout.

Notes​

  • Omitting the evaluate section skips evaluation entirely.
  • Layerwise evaluation (per-layer SNR and KLD, threshold pass or fail) is available as an expert option through np analyze sensitivity, separate from the evaluate section above.