Abstract
A network intrusion detector can perform well on familiar traffic yet confidently miss attacks from unseen families. This work studies whether selective verification can repair that failure at a controllable cost.
An LSTM fast path screens network flows and routes ambiguous predictions to a compact Random Forest verifier. The pipeline is evaluated on CIC-IDS-2017: the fast path learns from benign and denial-of-service traffic in one capture and is tested on benign and unseen web attacks from another.
With 50 disjoint target-attack examples for verifier adaptation, the gated pipeline recovers most of the always-on verifier's F1 while invoking it on 55% of samples. An optional LLM branch generates structured audit rationales after verification and never changes the detection decision.
Published online on 23 October 2026 in the ICICS 2026 proceedings, LNCS 17219, pp. 456–467. The citation below follows the DOI export's online year; the print proceedings volume is dated 2027.
Method
Fast screening, selective verification
The gate uses the LSTM attack score as a routing signal. Only scores between 0.01 and 0.99 trigger the five-feature Random Forest verifier.
Screen every flow
A 64-unit LSTM produces an attack score from a ten-step input. Scores at or below 0.01 produce a benign label; scores at or above 0.99 produce an attack label.
Escalate the ambiguous cases
Scores strictly inside the interval are passed to a Random Forest with 100 trees and a maximum depth of ten. For these samples, the RF output is the final detection label.
The verifier uses destination port, flow duration, average packet size, maximum packet length, and flow inter-arrival-time standard deviation. Its reported mean single-sample inference latency is 3.00 ms; this measurement excludes preprocessing, I/O, padding, and serialization.
The gate's cost measure is the fraction of flows that invoke the verifier. It is a routing-cost proxy, rather than a measured reduction in total system runtime. The thresholds are an engineering setting, not a learned optimum or a guarantee that the LSTM's extreme scores are correct.
Evaluation
A disjoint cross-class stress test
The source is the Friday afternoon DDoS capture; the target is the Thursday morning WebAttacks capture. This protocol combines a change in attack family with cross-day and cross-capture differences.
A pool of 50 target attacks is reserved for verifier adaptation and excluded from the final evaluation subset of 500 benign and 500 attack samples. The study compares 0-shot, 10-shot, and 50-shot verification, always-on and gated variants, calibration, and five-seed stability.
Identifier columns are removed, rows containing infinite or missing values are excluded, and MinMax scaling is fitted on the training data only. During evaluation, the selected flow occupies the final position of a zero-padded ten-step sequence. This input construction is part of the reported stress-test protocol.
The strongest recovery depends on 50-shot target-side adaptation. It is not evidence of pure zero-shot transfer.
Results
Recovering F1 with fewer verifier calls
The gated 50-shot pipeline achieves F1 0.6780, close to the always-on verifier's 0.6893, while reducing verifier invocation from 100% to 55%.
| Setup | Attack recall | Attack F1 | Verifier calls |
|---|---|---|---|
| LSTM fast path | 0.021 | 0.034 | 0% |
| 0-shot RF, always-on | 0.0000 | 0.0000 | 100% |
| 0-shot pipeline, gated | 0.0000 | 0.0000 | 55% |
| 10-shot RF, always-on | 0.0520 | 0.0987 | 100% |
| 10-shot pipeline, gated | 0.0460 | 0.0878 | 55% |
| 50-shot RF, always-on | 0.5280 | 0.6893 | 100% |
| 50-shot pipeline, gated | 0.5180 | 0.6780 | 55% |
Reported values from the paper's Table 4 on the balanced 1,000-sample subset. The 0-shot verifier misses the target attacks, and ten adaptation examples yield limited recovery. The main improvement appears with 50 disjoint target examples, making adaptation an essential part of the result.
Across five seeds, gated F1 is 0.678 ± 0.072 and verifier invocation is 55.0 ± 2.1%. The gate retains similar F1 to always-on verification in this setting while leaving 45% of flows on the fast path.
Failure analysis
Recovery differs by attack subclass
Aggregate F1 hides an important gap: the 50-shot gated pipeline recovers Brute Force and XSS attacks unevenly, while SQL injection remains undetected in this split.
The result supports selective recovery of a stressed detector, rather than uniform coverage of every unseen attack family. A high benign true-negative rate does not compensate for the missed SQL-injection cases.
Calibration
Confidence breaks under shift
The LSTM's expected calibration error rises from 0.0214 in-distribution to 0.4869 on the cross-class test. Its confidence score is an engineering routing signal rather than a calibrated estimate of risk.
The mean predicted attack probability under shift is 0.086, while half of the evaluation samples are attacks. Brier score also deteriorates, from 0.018 in-distribution to 0.441 under shift. The failure involves confident misclassification as well as missed attacks.
Audit layer
Keeping LLMs outside the decision loop
The optional LLM receives a verifier label and compact flow summary after the detection decision. It produces a JSON rationale for inspection, without changing the label.
| Backend | Mean latency | P95 latency | Valid audit JSON |
|---|---|---|---|
| RF verifier | 3.00 ms | 3.05 ms | Not an LLM audit |
| Llama3 8B q4 | 3,548 ms | 3,798 ms | 100% |
| Qwen3 7B q4 | 4,368 ms | 4,594 ms | 100% |
| Gemma2 9B q4 | 6,111 ms | 6,340 ms | 100% |
| DeepSeek R1 8B q4 | 20,484 ms | 20,833 ms | 0% |
Reported inference-only measurements from Table 6; each LLM is tested on 50 escalated cases. The DeepSeek backend emits reasoning text before JSON and fails the strict parser in this configuration. Invalid output receives a fixed fallback rationale while the RF decision remains unchanged.
Schema compliance measures whether the audit interface can be parsed. It does not establish explanation faithfulness, improved analyst effectiveness, or a detection benefit from the LLM.
Interpretation
What this study establishes
Within this source–target split, a compact adapted verifier recovers much of the lost attack-detection performance, and a confidence gate controls how often that verifier is called. The source of recovery is the adapted verifier; the gate exposes a quality–invocation trade-off.
Evidence is limited to CIC-IDS-2017, one source–target split, heuristic thresholds, and a balanced evaluation subset. That subset does not represent operational attack base rates. The paper does not establish production alert precision, robustness against adversarial evasion, state-of-the-art detection, or generalization to other datasets.