Skip to content

Behavioural detectors: what they find

The Audit GUI's behavioural lane (see Audit GUI) runs seventeen transparent detector rules over a snapshot. This chapter is their acceptance record for this release: how often each finds the pattern it is meant to find, what it raises on benign look-alikes, what it raises on a real trail where nothing was planted, and how long a scan takes. Read it before you act on a candidate: a candidate is a rule's measurement, never a finding of misconduct.

All numbers are for the example profile docs/examples/detector-profiles/classroom-r2.json (classroom-r2, version 1). There is no default profile: a different profile has different numbers, and the threshold workbench measures them for yours.

The labelled corpus

pm-sim-scenarios records sessions that plant one pattern on purpose, and four benign look-alikes. Each of the 21 scenarios was recorded at seeds 0-3 with a 10-minute continuous phase (84 sessions, about 17,500 records each), pinned, prepared and scanned:

poetry run python tools/detector_eval.py docs/examples/detector-profiles/classroom-r2.json \
    --minutes 10 --seeds 0,1,2,3 --out eval.json

A label is found when a candidate group of its pattern's detector overlaps its episode (one second of slack) on its gateways and symbol. A group is true when it finds a label of its pattern, and a false positive otherwise: in a look-alike session, in another pattern's session, or in its own session's background. The time error is how far a found group starts from its label (median).

Detector Labels Found Recall Groups Precision Escalated Escalated precision False positives: look-alikes / other patterns / own background Time error
adverse_selection 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 14.4 s
auction_steering 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 1.7 s
breaker_gaming 4 4 1.00 4 1.00 0 — 0 / 0 / 0 20.2 s
churn 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 5.9 s
circular_ring 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 8.2 s
close_window 4 4 1.00 4 1.00 0 — 0 / 0 / 0 2.2 s
counterparty_concentration 8 8 1.00 9 0.89 8 1.00 0 / 1 / 0 11.3 s
iceberg_pinging 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 7.2 s
layering 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 5.9 s
lead_lag 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 16.4 s
liquidity_withdrawal 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 20.3 s
momentum_ignition 8 8 1.00 10 0.80 8 1.00 0 / 2 / 0 5.2 s
paired_round_trips 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 5.2 s
pre_publication 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 10.2 s
price_run_reversal 8 8 1.00 11 0.73 8 1.00 0 / 3 / 0 6.8 s
self_trade_smp 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 5.3 s
stop_hunting 8 8 1.00 8 1.00 8 1.00 0 / 0 / 0 5.7 s

breaker_gaming and close_window occur once per session, so with escalate_after: 2 they never escalate within one scan: recurrence across sessions is for the profile to weigh. The false positives in other patterns' sessions are shapes those scripts share: a price push that looks like a price run, a stop cascade that looks like momentum ignition.

Benign look-alikes

Each look-alike imitates the patterns it resembles, so a detector that cannot tell them apart shows here. Every candidate a look-alike raises is false.

Look-alike Resembles Sessions Candidates raised Escalated Rules not completed
mm_repricing churn, layering 4 0 0 0
halt_cancels layering, liquidity_withdrawal 4 0 0 0
news_reaction pre_publication, price_run_reversal 4 0 0 0
ioc_sweep iceberg_pinging, momentum_ignition 4 0 0 0

What this does not show

A perfect score on this corpus says the detectors find what the scenarios plant and leave the look-alikes alone. It does not say they are precise in a real classroom: the corpus's patterns are cleanly separated from its background, and each look-alike imitates one pattern at a time. The real trail below is the check that matters for false positives.

A real trail, where nothing was planted

A 1,555,833-record slice of an overnight simulation (96 AI traders and market makers, 300 symbols, 9.5 hours; no preset is manipulative). Every candidate here is a benign shape-match, or, for adverse selection, a real outcome rather than a pattern.

Detector State Comparisons Groups Escalated
adverse_selection completed 122,320 26 10
auction_steering completed 461,480 0 0
breaker_gaming completed 122,320 0 0
churn completed 4,136 0 0
circular_ring completed 13,464 6 0
close_window completed 461,480 0 0
counterparty_concentration completed 384,076 51 0
iceberg_pinging completed 122,320 2 0
layering completed 122,320 1 0
lead_lag completed 220,000 0 0
liquidity_withdrawal completed 122,320 66 0
momentum_ignition completed 122,320 2 0
paired_round_trips completed 384,076 1 0
pre_publication unsupported (CLOCK_OFFSET_UNKNOWN) 0 0 0
price_run_reversal completed 122,320 39 0
self_trade_smp completed 122,320 6 0
stop_hunting completed 122,320 0 0

200 groups in all, 10 escalated, every escalation an adverse_selection outcome: AI traders picked off almost every time. That is what the rule measures, not evidence of intent; its counter-explanations lead with a stale quoting strategy. pre_publication is unsupported because this trail has no measured simulator clock offset (it predates the co-observations that measure it), and says so rather than reporting none.

How long a scan takes

Trail Records Detectors Scan Worker peak memory
The real slice above 1,555,833 17 266 s 306 MiB

Measured on 36 logical cores (the scan uses one), with tools/audit_gui_bench.py --scan PROFILE --scan-only. The slice is larger than the supported size for preparation (see "Supported size" in the Audit GUI chapter); the scan itself stays small, at about 200 bytes per record. A scan runs in the worker, so the GUI stays responsive and shows its progress. The 10-million-record reference trail was not scanned for this release: its snapshot must be prepared again first, which needs more memory than the supported size allows (see "Supported size" in the Audit GUI chapter).

Using these numbers

  • Read a candidate's card before anything else: the rule, what it does not establish, the thresholds, the baseline and the counter-explanations.
  • Escalated means the key recurred in the scan: review it first. It does not mean more likely.
  • Before changing a threshold, sweep it in the threshold workbench over your own sessions and the labelled corpus, and read the found, missed and false columns side by side. Each value is a new profile version: earlier results are never rewritten.