Skip to content

Benchmark

What was compared

Five comparison rows, on the same 171 contexts. The first two do not use the model; the others use the same prompt and the same settings:

  • Always STOP: never runs a script.
  • Simple rule: fixed priority among the candidates, STOP if none matches.
  • Phronesis Safetensors: the model used by nmap_select.py and by the suggest path.
  • Phronesis GGUF Q8_0: the portable format for llama.cpp, with strict JSON or with json_schema.
  • Oracle: the best action observed for each context. It is a theoretical ceiling, not an executable method.

The set has 171 lab contexts, spread over 57 families with 3 states per family. For 114 contexts, the best decision is STOP. For 57, one action brings a gain. Decoding is greedy, with 32 tokens and a fixed seed.

The regret is the gap between the reward of the best action and the reward of the chosen one. Lower is better. The Agreement excluding STOP column only counts the 57 contexts where an action is useful. An invalid output is an answer that is neither a supplied identifier nor STOP.

Results

Current version, in-sample (these contexts were used in training):

Method Agreement with optimal action Agreement excluding STOP Mean regret STOP Invalid outputs
Always STOP 66.7 % 0.0 % 0.1141 100 % 0 %
Simple rule 0.6 % 1.8 % 0.0458 0 % 0 %
Phronesis Safetensors, ranking (top 1) 87.1 % not measured 0.000081 66.7 % 0 %
Phronesis Safetensors, free generation 94.3 % of valid answers not measured not measured not measured 8.2 %
Phronesis GGUF Q8_0, strict JSON 86.6 % 59.7 % 0.1096 66.7 % 8.2 %
Phronesis GGUF Q8_0, JSON schema 94.2 % 82.5 % 0.0000 66.7 % 0 %
Oracle (ceiling, not executable) 100 % 100 % 0 66.7 % 0 %

Latency on CPU (16 threads, 64 GB of RAM), current version: median 2.5 s for Safetensors (153 test contexts), median 1.7 s and p95 1.9 s for GGUF (171 contexts). The previous release measured median 7.4 s for Safetensors and 1.8 s for GGUF on a 16-thread CPU with 64 GB of RAM. On GPU (RTX 4070 Ti SUPER), the median scoring time per context is 0.56 s on the test split.

Reading

With json_schema, the GGUF picks the optimal action on 94.2 % of the contexts and produces no invalid output. Without a schema, 8.2 % of its answers are unusable, because of Markdown fences or an invented identifier. The suggest path and free generation give the same decision on every valid test answer.

Always STOP reaches 66.7 % agreement only because 114 of the 171 contexts have STOP as the right answer. It finds none of the 57 useful actions. The simple rule never stops and rarely finds the right action, but its regret is still better than always-STOP.

The 66.7 % STOP rate reflects the makeup of the set. It does not mean a third of scans could be skipped in practice.

Limits

  • This is not a generalization test. The 171 contexts were used in training. The benchmark measures situations the model has already seen.
  • The lab is controlled: known services and versions, no client engagements.
  • Single run, one seed, greedy decoding.
  • Latency depends on the machine and its load.
  • The two formats share the same weights, but Q8_0 quantization changes decisions unless a grammar is enforced.
  • The benchmark measures the model on fixed candidate lists. The bundled library may propose other candidates in real use.

Quick check

python nmap_select.py --xml examples/quickstart-scan.xml --top 8

This command checks that the model loads and picks a script on the demo XML, with no network traffic. It is not a reproduction of the table.

Reproduction data

The training and evaluation contexts are not published in the repository. The measurement commands on this page document the protocol.

Ranked suggestions

The phronesis suggest path scores each candidate of the list with the same model, then normalizes the scores.

Measurements at temperature 1.0 (the shipped value). The test split comes from the distillation corpus: these numbers are in-sample.

Split Contexts Top-1 MRR NDCG@5 NLL Brier ECE STOP Regret Median (GPU)
test 171 87.13 % (82.5 to 91.2) 0.921 0.9997 0.286 0.150 0.063 66.7 % 0.000081 0.56 s

On the test split, top-1 agreement between sequence ranking and generation is 100 % on valid answers: ranking reproduces the decision of the single-action mode. NDCG stays close to 1 because candidate rewards are tightly grouped; the useful signal is in top-1, MRR and regret.

Out of training

The 171 test contexts are in the distillation corpus. To measure something else, 124 contexts were taken from rlvr-53, rlvr-real and rlvr-synth, absent from the distillation rows. The non-overlap proof is exact: zero identical inputs with the distilled rows. Nineteen contexts stay close after masking host, port and service.

These 124 contexts were used to diagnose the previous release, then to choose the current one. They are therefore no longer a clean validation set: treat them as a check.

Set Contexts Top-1 MRR NDCG@5 NLL ECE STOP Regret
test, in-sample 171 87.13 % 0.921 0.9997 0.286 0.063 66.7 % 0.000081
fresh, check 124 13.7 % 0.368 0.596 2.625 0.216 9.7 % 0.127

Of these 124 contexts, 80 have at least one useful script (reward above 0.01 of the maximum) and 44 have none. Measured on the 124, taking the best-ranked useful script:

Metric Value
Useful script in top 1 65.0 %
Useful script in top 3 76.3 %
Useful script in top 5 92.5 %
STOP chosen where nothing is useful 7 of 44
STOP chosen where a script is useful 2 of 80

Strict top-1 is low because the exact optimal script is one choice among several reasonable ones on these states. Ranking holds up better than strict top-1. The stop decision is the weak point: the model suggests scripts where a human would stop.

The shipped nseft/calibration.json stays at calibration_scope: none, temperature 1.0, calibrated: false. On the check set, the temperature that minimizes NLL is 3.0; it lowers ECE from 0.216 to 0.043 without changing top-1. It is not shipped, because these contexts already helped choose the model.

In practice, the displayed probabilities only mean something on states close to the training lab. On an unknown target or environment, the recommendation is not reliable.

Guard rail

phronesis suggest flags each port whose state falls outside the training range, that is more than 14 candidates or more than 1,572 prompt tokens. The JSONL output then carries "in_training_range": false, and a warning summarizes how many ports are affected.

python scripts\benchmark_suggestions.py --split-dir data\rlvr-full\prepared --split test --generation
python scripts\benchmark_phronesis.py --split test --model-dir ship\hf --gguf ship\hf\phronesis-q8_0.gguf --json-schema

python scripts\benchmark_suggestions.py --contexts data\fresh-contexts.jsonl --generation --tag fresh

Calibration writes nseft/calibration.json by default

calibrate_probabilities.py overwrites the shipped file unless --output is given. The shipped file says calibration_scope: none and temperature 1.0. An in-sample fit changes the displayed probabilities: keep --output pointing to a separate file until the fresh set is validated.

benchmark_suggestions.py writes reports/<tag>-<split>.json, .md, .csv and the per-context scores. benchmark_phronesis.py measures the GGUF through llama-server, with or without --json-schema. calibrate_probabilities.py fits the temperature on validation and writes nseft/calibration.json when asked to.