betaFeedback

WorksComputer Science

DeepWeave: Weaving Neural and Symbolic Evidence for ML-Based Network Intrusion Detection System

Abstract

Machine learning-based network intrusion detection systems can recognize complex traffic patterns, but often require substantial labelled attack data, degrade under deployment shift, and provide limited evidence for analysts. We present DeepWeave, a probabilistic neuro-symbolic Network Intrusion Detection System (NIDS) that makes logic an integral part of detection. DeepWeave automatically constructs and validates interpretable rules, represents neural predictions as probabilistic predicates, and reconciles both evidence sources through explicit coupling policies over packet-, flow-, and hybrid-views. The resulting proofs provide intrinsic explanations for rule-supported alerts. Across multiple datasets, DeepWeave improves low-data detection, false-positive control, transferability, and robustness. With only 50 labelled packet observations per attack class, it improves macro-F1 from 0.632 to 0.924 and reduces the attack false-positive rate from 0.075 to 0.008 over the matched neural baseline. Its proofs are also more stable than post-hoc neural attributions, while batched inference keeps probabilistic reasoning practical. These results demonstrate label-efficient, adaptable, and inspectable neuro-symbolic intrusion detection.

Introduction

Network Intrusion Detection Systems (NIDSs) are a fundamental component of defense architectures. By continuously inspecting packets, flows, or aggregated network events, a NIDS seeks to distinguish benign activity from traffic associated with malicious behaviour. Malicious events are rare, benign traffic is heterogeneous, while both traffic patterns and adversaries evolve. Moreover, sustained volumes of low-value alerts contribute to costly triage and alert fatigue [4, 54]. A practical NIDS must not only be accurate on a static benchmark, but rather control false alarms, remain useful under traffic shifts, and provide evidence that an analyst can inspect [56, 51, 57].

Existing NIDSs largely follow symbolic or machine learning (ML) paradigms [47, 39, 20, 14, 45, 6]. Signature-based engines such as Snort and Suricata match explicit conditions over payloads, protocol fields, and flow state [47, 41, 13]. Their rules are auditable and dependable for known behaviors, but authoring and maintaining them requires substantial expertise, and environment-specific assumptions can produce false positives or miss unseen attack variants [48, 30].

ML approaches instead infer decision boundaries from packet bytes, flow statistics, or temporal behavior and can capture patterns that are cumbersome to specify manually [1, 24, 57, 39, 5]. Yet, supervised models require labelled traffic that is costly and time-consuming to collect and annotate, particularly at the scale of operational networks [51, 61]. Moreover, learned models may rely on dataset-specific correlations and fail under distribution shift, changing benign traffic, or previously unseen attacks [51, 9]. Their limited transparency further complicates operational use since they provide little actionable evidence and post-hoc explanations fail to capture a meaningful rationale for the decision of the security analyst [57, 52]. Finally, because an adversary can manipulate observable traffic characteristics while preserving malicious functionality, the learned decision boundary itself becomes a target for evasion [22]. Thus, although ML provides flexibility and powerful pattern-recognition capabilities, its limited generalization, explainability, and adversarial robustness prevent ML-based NIDS from constituting a complete solution.

To overcome such limitations, recent studies have begun to explore neuro-symbolic intrusion detection [8, 55]. Neurosymbolic approaches broadly integrate prior symbolic knowledge into neural learning by encoding logical constraints into the learning objective, compiling symbolic structure into neural architectures or coupling neural perception with discrete or probabilistic symbolic reasoning [36, 18]. Existing work provides an initial exploration of neuro-symbolic NIDS, but remains limited in the scope of the symbolic knowledge and reasoning considered, offering neither a systematic procedure for constructing and validating expressive security rules nor a principled mechanism for resolving conflicts between neural and symbolic evidence.

This paper addresses these challenges through DEEPWEAVE, a probabilistic neuro-symbolic NIDS which treats the neural and symbolic components as distinct, potentially conflicting attack evidences. The neural component learns from packet-, flow-, or hybrid-level traffic and defines a neural predicate over benign and attack classes. In parallel, the symbolic component evaluates interpretable predicates over traffic features. DEEPWEAVE constructs candidate rules automatically, identifying class-relevant features on held-out traffic data, deriving candidate predicates, and calibrating their behavior on traffic data. Lastly, DEEPWEAVE combines neural and symbolic evidence through a coupling policy that may enforce strict agreement between neural and logic or favor either component.

Relying on the neural symbolic weave, DEEPWEAVE requires fewer data to optimize, as the knowledge encoded in the symbolic rules is excluded from the neural training process. Additionally, DEEPWEAVE generalizes well even under network or – possibly adversarial – traffic changes, as the symbolic guidance enables DEEPWEAVE to ignore spurious signals coming from noisy data during learning. Lastly, making its coupling policy explicit and relying on intelligible symbolic rules, DEEPWEAVE exposes the supporting proof path for its predictions. These proofs identify the satisfied predicates and rules supporting an alert, providing an explanation that is intrinsic to the model’s inference rather than generated by a separate post-hoc explainer.

This paper makes the following contributions:

  • We introduce DEEPWEAVE, a Neuro-Symbolic NIDS combining neural attack evidence with symbolic reasoning over packet, flow, and hybrid traffic views.

  • We design and develop a data-driven rule-construction pipeline that discovers and validate candidate rules without requiring any manual signature base.

  • We formalize coupling policies that govern agreement and conflict between neural and symbolic evidence and generate proof-based explanations.

  • We extensively evaluate DEEPWEAVE through predictive performance, false alerts, cross-distribution generalization, explainability, and robustness to adversarial traffic.

The remainder of this paper is organized as follows. § 2 presents the paper motivation and the necessary background. § 3 describes DEEPWEAVE architecture, while § 4 details its implementation and § 5 elaborates on its evaluation. Lastly, § 6 discuss limitations and § 7 the related work, while § 8 concludes the paper.

Motivation and Background

Motivating Rationale

Learning with scarce attack labels. Operational NIDSs often deal with limited labelled attack traffic. Although benign observations may be abundant, representative labels for each attack family are expensive to obtain and attacks are rare. A practical NIDS must therefore learn from scarce attack labels. Fitting dataset-specific correlations, ML-based detectors may fail to learn less frequent attack manifestations and their performance improves only when additional labels become available. Anomaly-based ML detectors such as Kitsune [39] reduce dependence on labelled attack data but still require the collection of large amount of benign traffic data to be optimized. Meanwhile, symbolic detectors provide a complementary starting point as explicit conditions encoding attack-relevant properties require little data to be defined. However, their accuracy plateaus as more data become available, since they require substantial effort to be maintained. As Figure 1a illustrates, a neuro-symbolic detector can instead use symbolic knowledge as a structured prior in the low-data regime, while allowing its neural component to learn additional patterns as labelled evidence increases.

Figure 1. NeSy vs. ML-based and Symbolic NIDS.

Accuracy and explainability. Figure 1b illustrates a second limitation of state-of-the-art NIDSs. ML-based systems may achieve strong detection accuracy, but fail to provide a security rationale for their prediction. Post-hoc explainability methods can associate neural decisions with influential features [57], yet the explanation is generated after inference and may not correspond to an explicit reasoning process used to produce the decision. Conversely, symbolic systems expose the exact conditions that triggered an alert, but their detection accuracy is bounded by rule coverage. These limitations become more consequential when a detector moves from training to production. Changes in topology, services, benign traffic, measurement processes, or attacker behavior can invalidate correlations learned by the neural model and signatures assumed by symbolic rules. A neuro-symbolic detector can achieve high detection accuracy and intrinsic transparency, since the neural component provides flexible pattern recognition, while validated rules provide inspectable evidences of their decision.

Background

Network Intrusion Detection Systems. A NIDS monitors traffic at network observation points to detect malicious activity or security-policy violations [28, 31]. Signature-based NIDSs match traffic against explicit descriptions of known attacks, providing inspectable evidence but requiring continued rule maintenance and sufficient signature coverage [25, 29]. Anomaly-based NIDSs instead learn expected traffic behavior and identify deviations, potentially detecting previously unseen activity but also flagging benign changes and providing limited explanations [31, 2]. Both paradigms may operate on individual packets, aggregated flows, or packet–flow pairs. Packet representations preserve local protocol and header evidence, while flow representations summarize communication-level properties such as duration, volume, directionality, timing, and transport flags. Instead, hybrid representations combine the current packet with its evolving flow context.

Detection task

We formulate intrusion detection as classification over a label set Y={y1,…,yK}\mathcal{Y} = \{y_1, \ldots, y_K\} containing one benign class and one or more attack classes. For a packet, flow, or packet–flow representation x∈Xx \in\mathcal{X}, a NIDS parameterized by θ\theta estimates pθ(Y=y∣x)p_\theta(Y = y \mid x) and predicts y^θ(x)=arg⁡max⁡y∈Ypθ(Y=y∣x)\hat{y}_\theta(x) = \arg\max_{y \in\mathcal{Y}} p_\theta(Y = y \mid x). An alert is raised when y^θ(x)\hat{y}_\theta(x) belongs to an attack class.

Neuro-Symbolic AI. Neuro-symbolic AI (NeSy) encompasses a broad family of architectures that combine the representation-learning capabilities of neural networks with explicit knowledge representation and symbolic inference. These architectures differ in how knowledge, learning, and reasoning interact [36]. Symbolic knowledge may be translated into differentiable constraints that regularize neural learning [60, 37], compiled into neural architectures that approximate logical operations [44], or represented in an explicit reasoning system whose predicates are partly evaluated by neural models [34, 59, 62]. DeepWeave follows the last paradigm. Neural models map unstructured inputs to distributions over symbolic values, which subsequently participate in logical inference. For example, a neural component may recognize a digit in an image, while symbolic arithmetic rules determine what that digit contributes to the result of a computation.

DeepProbLog

We instantiate DeepWeave using DeepProbLog [34], a neuro-symbolic language that extends the probabilistic logic programming language ProbLog [12] with neural predicates. ProbLog represents uncertainty through probabilistic facts and annotated disjunctions and computes query probabilities over the possible worlds induced by these choices. DeepProbLog preserves this semantics while allowing selected probabilities to be produced by neural networks.

Given an input xx, a neural predicate produces a distribution over a finite set of symbolic outputs z1,…,zKz_1, \ldots, z_K. These outputs represent concepts that participate in inference together with the program’s facts and rules. For example, the annotated disjunction nn⁡(Nθ,x,Y)::traffic_class(x,Y)\operatorname{nn}(N_\theta, x, \mathcal{Y}) :: \text{traffic\_class}(x, Y) uses NθN_\theta to assign probabilities to the possible traffic classes of xx. To answer a query, DeepProbLog grounds the relevant program, evaluates its neural predicates, and compiles the resulting proof structure into an arithmetic circuit [34]. The query probability aggregates all valid proofs, including those containing neural predictions and satisfied symbolic rules. During end-to-end training, gradients of the query-level loss propagate through probabilistic inference to the neural parameters, enabling learning without direct supervision of the intermediate concepts z1,…,zKz_1,\ldots,z_K.

DeepWeave

Overview

DeepWeave architecture is depicted in Figure 2. DeepWeave operates in an offline preparation phase and an online detection phase. During offline preparation, the system constructs candidate symbolic rules, calibrates their predicates using reference traffic, and trains the neural and coupling architecture parameters. The result is a detector containing a learned traffic model, a symbolic knowledge base, and the parameters governing their coupling. During online detection, DeepWeave parses incoming traffic and transforms it into traffic view observations. For each observation, the system constructs two complementary sources of evidence: (i) a neural path which learns statistical patterns from the traffic representation, and (ii) a symbolic path which evaluates attack-oriented predicates and rules. A probabilistic neuro-symbolic reasoning layer combines these evidences to produce the final decision. Lastly, DeepWeave returns both an alert and its symbolic proof path to support its decision whenever it detects a malicious.

Figure 2. DeepWeave system overview. Incoming traffic is represented at the packet level, flow level, or jointly. Neural and symbolic paths derive complementary evidence from the selected representation. A probabilistic reasoning layer integrates this evidence to produce a class prediction and an accompanying symbolic explanation. Dashed arrows denote offline model preparation and rule construction; solid arrows denote online detection.

Traffic views

DeepWeave supports packet, flow, and hybrid traffic views. Views vary in the available traffic context and symbolic knowledge, but share the same neuro-symbolic inference pipeline. The packet view enables immediate prediction, but may miss behaviors that emerge only across multiple packets or connections. The flow view aggregates packets from the same communication to capture temporal, directional, and rate-based behavior. The hybrid view jointly reasons over packets and their evolving flow context, allowing cross-view relationships to participate directly in inference rather than combining independent predictions. We provide the complete formulation of the traffic views representation in § 3.2.1.

Neuro-Symbolic Detection

For each traffic observation, DEEPWEAVE derives neural and symbolic evidence in parallel. The neural component learns traffic features patterns to output the candidate class probability, while the symbolic component evaluates rule-based attack oriented conditions. These conditions – specified using rules – relate observable traffic properties to higher-level attack behavior. DEEPWEAVE defines its symbolic conditions automatically during offline model preparation, where it constructs candidate rules, removes uninformative or redundant ones, and calibrates them (see § 3.2.2 and 3.2.3). The rules are structured to capture behavioral relationships associated with an attack, whereas they are calibrated to reflect the normal operating conditions of a particular environment. For example, a SYN-flood rule may detect repeated connection attempts that do not complete the TCP handshake, while the number of attempts required to trigger an alert must be calibrated to the network normal connection rate. Thus, DEEPWEAVE can apply the same rules across different networks and adapt them as network conditions change.

Rather than treating the neural and symbolic components as independent detectors, DEEPWEAVE combines them inside a shared probabilistic reasoning model, which triggered the name “Weave”. This combination is defined by a coupling architecture (see § 3.2.5) which determines how neural and symbolic evidence interact during inference. Following the previous example, the neural network may predict the probability that an observed packet is a TCP SYN request, while additional symbolic predicates describe whether its flow contains a high rate of SYN packets and many incomplete handshakes. The coupling architecture then relates these uncertain observations to the SYN-flood class. A strict coupling may require agreement between neural predictions and symbolic conditions, whereas a more selective coupling may invoke symbolic reasoning only to refine uncertain neural predictions. These alternatives expose different trade-offs among detection coverage, false alarms, and robustness which we explore experimentally in § 5.

Lastly, when the selected coupling architecture produces an attack class prediction, DEEPWEAVE raises an alert. In addition to the predicted class and its probability, DEEPWEAVE exposes its reasoning process via the symbolic proof paths that contributed to the prediction. These proofs identify the satisfied predicates and rules supporting an alert, providing an explanation that is intrinsic to the model’s inference rather than generated by a separate post-hoc explainer (see § 3.2.7).

Design

We first define the common representation through which packet, flow, and hybrid observations are supplied to the neural and symbolic components. We then formalize the structure of the symbolic rules and describe the procedure used to construct them automatically. Finally, we present the neural evidence, its integration into DEEPWEAVE, and the coupling architectures that combine neural and symbolic evidence.

Traffic Representation

Let ptp_t denote a packet observed at time tt, and let FtF_t denote the state of its associated flow. The packet, flow, and hybrid observations are represented as

xtP=ψP(pt),xtF=ψF(Ft),xtH=(xtP,xtF,ztF),(1)x_t^P = \psi_P(p_t), \qquad x_t^F = \psi_F(F_t), \qquad x_t^H = \left(x_t^P, x_t^F, z_t^F\right), \tag*{(1)}

where ψP\psi_P and ψF\psi_F are packet-level and flow-level feature extractors. The variable ztFz_t^F indicates whether the flow context required by the hybrid representation is available. For the remainder of this section, xvx^v denotes an observation under v∈{P,F,H}v \in\{P, F, H\}.

Packet representation and flow assembly. The packet representation xtPx_t^P contains features such as network- and transport-layer protocol fields, packet length, flags, and other header-derived properties. Packets are assigned to flows using a communication key derived from their network and transport endpoints and protocol. For TCP and UDP traffic, this key corresponds to the conventional five-tuple: source address, destination address, source port, destination port, and transport protocol. When directional tracking is enabled, the endpoint ordering is normalized so that packets exchanged in either direction update the same flow. Lastly, rather than recomputing the flow representation from all preceding packets, DEEPWEAVE incrementally maintains the statistics required by ψF\psi_F. For instance, these statistics include packet and byte counts, communication direction, inter-arrival times, and packet-length distributions (for the full list see § B.1). To allow hybrid detection to operate before the flow completion, neural or symbolic operations that depends on unavailable flow context – i.e., ztF=0z_t^F = 0 – are not evaluated.

Neural and symbolic feature interfaces. The neural and symbolic components access the same underlying observation through different feature interfaces. The neural component receives an encoded representation ηv(xv)\eta_v(x^v), in which numeric features are standardized while categorical features are transformed into numeric encodings. The symbolic component receives the semantically preserved feature values vf(xv)v_f(x^v), where vfv_f returns the original value of feature ff for input xvx^v. This separation prevents neural preprocessing from altering the meaning of a symbolic condition. For example, a rule referring to a packet-length threshold is evaluated in the original unit of the feature rather than against its standardized neural encoding.

Symbolic Knowledge Representation

The symbolic component operates over a vocabulary of predicates and a set of class-specific rules with their assigned roles. The design does not require the rules to originate from a particular source. They may be written by experts, imported from an external knowledge source, or constructed automatically. In the evaluated system, DEEPWEAVE uses the automated construction procedure described in § 3.2.3. We use automatic construction because expert knowledge is not generally available in the probabilistic rule representation required by DEEPWEAVE [57, 56], while data-driven construction derives and calibrates rules directly from the features observable to the detector. We then manually remove rules tied to capture-specific identifiers or known benchmark artifacts, reducing the risk of learning non-transferable correlations [51, 9].

Symbolic Predicates

A predicate evaluates an interpretable condition over one feature or a small group of related features. For a numeric feature ff, DEEPWEAVE supports upper-tail and lower-tail conditions:

ϕf,τ↑(xv)=I[vf(xv)≥τ],(2)\phi^{\uparrow}_{f,\tau}(x^v) = \mathbb{I}\left[v_f(x^v) \ge\tau\right], \tag*{(2)}
ϕf,τ↓(xv)=I[vf(xv)≤τ],(3)\phi^{\downarrow}_{f,\tau}(x^v) = \mathbb{I}\left[v_f(x^v) \le\tau\right], \tag*{(3)}

where τ\tau is a threshold, I[⋅]\mathbb{I}[\cdot] is the indicator function, and the symbols ↑\uparrow and ↓\downarrow identify whether unusually high or low values satisfy the predicate. To further enhance the expressiveness of DEEPWEAVE symbolic predicates and avoid the noisy character of pure thresholding, we also define their differentiable extension. Rather than changing abruptly at a threshold, differentiable predicates provide a smooth transition near the predicate boundary leveraging a logistic sigmoid function. The steepness of the logistic sigmoid is optimized through the neuro-symbolic training objective (see § 3.2.6). Thus, we extend Equations (2) and (3) to

ϕf,τ↑(xv)=σ(κi(vf(xv)−τ)),(4)\phi^{\uparrow}_{f,\tau}(x^v) = \sigma\left(\kappa_i(v_f(x^v)-\tau)\right), \tag*{(4)}
ϕf,τ↓(xv)=σ(κi(τ−vf(xv))),(5)\phi^{\downarrow}_{f,\tau}(x^v) = \sigma\left(\kappa_i(\tau-v_f(x^v))\right), \tag*{(5)}

where σ\sigma is the logistic sigmoid and κi>0\kappa_i > 0 is the learnable parameter that controls the steepness. For categorical features, predicates have the form

ϕf,C(xv)=I[vf(xv)∈C],(6)\phi_{f,C}(x^v) = \mathbb{I}\left[v_f(x^v) \in C\right], \tag*{(6)}

where CC is a set of values that the categorical feature can take. Lastly, DEEPWEAVE assigns a value pθ∈[0,1]p_\theta\in[0,1] expressing the probability to which the observation satisfies the predicates ϕf,τ↑,ϕf,τ↓,ϕf,C\phi^{\uparrow}_{f,\tau}, \phi^{\downarrow}_{f,\tau}, \phi_{f,C}. pθp_\theta is optimized during end-to-end training of the DeepProbLog program as it depends on the available traffic data (see § 3.2.6).

Symbolic Rules

A symbolic rule combines predicates into a class-specific condition. A rule rjcr^c_j referring to class cc has the general form

rjc(xv)=⋀ϕi∈Φjϕi(xv),(7)r^c_j(x^v) = \bigwedge_{\phi_i \in\Phi_j} \phi_i(x^v), \tag*{(7)}

where Φj\Phi_j contains the predicates used by the rule. A rule therefore specifies three elements: (i) the class cc to which the rule refers; (ii) the predicates that form its antecedent; and (iii) the evidential role assigned to the rule. The class-specific interpretation is important since a condition that supports one attack class does not necessarily provide evidence against every other class.

Rule Roles

Each rule rjcr^c_j receives one of three roles:

Sufficient: a high-precision rule with a sufficiently low false-positive rate on benign traffic data, which identifies its associated attack class independently of the neural prediction. These resemble the type of detection rules that a signature-based NIDS would use in practice.

Helper: identifies behavior associated with an attack, while not being sufficiently selective to determine the class independently. It may reinforce compatible neural evidence or challenge an uncertain benign prediction.

Disqualifier: captures a condition that is inconsistent with a candidate class and blocks the assignment of prediction to the class they refer to.

The role assigned to a rule is distinct from its semantic, i.e., predicates and thresholds. The semantic condition determines when the rule is satisfied, while its role determines how a coupling architecture is permitted to use it. This separation allows the same rule to be used under different coupling architectures without modifying its conditions.

Symbolic Knowledge Construction

The automated construction procedure transforms labelled traffic into a set of symbolic rules following the pseudoalgorithm detailed in § B.2. For each attack class AA, it performs the following steps: (i) identify features that distinguish AA from benign traffic; (ii) instantiate predicates from the selected features; (iii) combine compatible predicates into candidate rules; (iv) validate the candidate rules on held-out construction data; and (v) assign a role to each retained rule. The automated procedure can optionally be followed by expert review to further remove statistically retained rules that are semantically implausible, operationally unsafe, or likely to encode artifacts of the traffic collection process. The rule proposal and validation steps use disjoint traffic. A construction partition is used for feature discovery, predicate instantiation, and candidate generation, while a separate validation partition is used for rule acceptance and role assignment. In our experiments this traffic data belong to neither training nor testing set to avoid information leakage and performance overestimation.

Attack-Specific Feature Discovery. For each attack class AA, the construction procedure compares the distribution of every candidate feature with its corresponding distribution in benign traffic. This comparison identifies features whose values differ systematically between the attack and benign observations. Additionally, for numeric features, DEEPWEAVE records the directionality of such difference—i.e., if the attack class AA distribution contains values that are higher or lower than the benign ones.

Both numeric and categorical features are eventually ranked. For the former DEEPWEAVE uses complementary measures of distributional separation, effect magnitude, ordering, shape, and univariate discrimination. Instead, the latter are ranked using distributional distance, statistical association, and smoothed category-specific attack rates. The evaluated measures include the Kolmogorov-Smirnov statistic [23], Cliff’s delta [11], Hellinger distance [19], and the univariate ROC-AUC for class discrimination [17].

Let M(f)\mathcal{M}(f) be the ranking measures applicable to feature ff. After normalizing the individual measures, their values are aggregated into the attack-specific feature score

S(f,A)=∑m∈M(f)wmm^(f,A)∑m∈M(f)wm,(8)S(f,A) = \frac{\sum_{m\in\mathcal{M}(f)} w_m\widehat{m}(f,A)}{\sum_{m\in\mathcal{M}(f)} w_m}, \tag*{(8)}

where m^(f,A)\widehat{m}(f,A) is the normalized value of measure mm for feature ff and attack class AA, and wmw_m is the configured weight of that measure.

Predicate Instantiation. DEEPWEAVE selects the top-K features to transform them into candidate predicates of the forms defined in Equations (4) to (6). For a numeric feature, the directionality established during feature discovery determines whether DEEPWEAVE constructs upper-tail (ϕf,τ↑)(\phi_{f,\tau}^{\uparrow}) or lower-tail (ϕf,τ↓)(\phi_{f,\tau}^{\downarrow}) predicates. Candidate thresholds are obtained from selected quantiles of the benign feature distribution. More in detail, let

τf,q=Qq(f∣Y=benign)(9)\tau_{f,q} = Q_q(f \mid Y = benign) \tag*{(9)}

be the qq-th quantile of numeric feature ff in benign reference traffic, where qq belongs to a user-specific set of quantiles. DEEPWEAVE then defines a candidate upper-tail (lower-tail) predicate following Equation (4) (Equation (5)) using τf,q\tau_{f,q} as the threshold. This directional predicate instantiation procedure allows DEEPWEAVE to maintain flexibility. The feature ff and directionality encode the behavioral relationship associated with an attack, while the threshold τf,q\tau_{f,q} determines what constitutes an unusual value in a particular environment. Therefore, DEEPWEAVE can preserve a predicate such as “unusually high flow rate” while recalibrating its threshold from benign traffic whenever changes in the network occur.

For each categorical feature ff, DEEPWEAVE constructs predicates of the form of Equation (6), by enumerating all the values that ff takes in the construction data. Values with insufficient target-class support or excessive prevalence in non-target traffic are discarded.

Candidate Rule Generation. For each attack class AA, DEEPWEAVE combines its most promising atomic predicates into logical conjunctions of the form shown in Equation (7). The maximal size of these conjunctions are user-defined. The search prioritizes predicates that provide sufficient support and discriminative performance, and avoids redundant combinations. Lastly, candidate conjunctions that lack sufficient support are discarded. Restricting rules to a small number of predicates controls the search space, preserves interpretability, and reduces the risk of capturing accidental relationships specific to the construction data. The search bounds and support requirements are configurable and their evaluated settings are reported in § B.2.

Rule Validation and Role Assignment. Each candidate rule is evaluated on the construction and validation partitions. For a rule associated with attack class AA, DEEPWEAVE measures its precision and benign false-positive rate on both partitions, as well as its attack recall on the validation partition. The comparison between the two partitions acts as a stability check. A rule is rejected when its precision deteriorates substantially on validation data or when its benign false-positive behavior does not remain within the permitted tolerance. The remaining rules are assigned a role according to their validated behavior. A rule with high attack precision and a very low benign false-positive rate is retained as a sufficient rule. A rule that covers a sufficiently large portion of AA while maintaining an acceptable benign false-positive rate is retained as a helper rule. Finally, a condition that identifies a class different from AA with high precision and low benign false-positive rate is retained as a disqualifier for class AA. Candidates that satisfy neither the stability requirement nor the role-specific validation criteria are discarded. The exact hyperparameters of validation criteria together with candidate quantiles and role-assignment thresholds are reported in § B.2.

Neural Evidence Interface

The neural component maps the observation ηv(xv)\eta_v(x^v) – encoded under view vv – to a categorical distribution over the set of classes Y\mathcal{Y}:

nv(xv)=hv(ηv(xv);θv),(10)\mathbf{n}^v(x^v) = h_v\left(\eta_v(x^v); \theta_v\right), \tag*{(10)}

where hvh_v is a trainable classifier with parameters θv\theta_v. The output expresses the neural evidence – i.e., probability – for class c∈Yc \in\mathcal{Y} to be true. In this paper, we consider Y\mathcal{Y} to be the set of attack classes A1,…,AkA_1,\ldots,A_k and the benign class. Nevertheless, DEEPWEAVE design is general and supports any output class that can be defined to enable the identification of attacks—e.g., the neural component can predict the probability that an observed packet is a TCP SYN request. Lastly, the neural outputs are to be interpreted as probabilistic inputs to the reasoning program through the coupling architectures. They are not the final DEEPWEAVE prediction.

DEEPWEAVE design does not depend on a particular neural architecture. It requires only that the model produces a probability for each value in the class vocabulary and that these probabilities can be exposed through a neural predicate. The concrete architecture and training configuration used in the evaluation are reported in § B.3.

Coupling Architectures

A coupling architecture specifies which evidence combinations constitute successful proofs of an attack class. The architectures share the same neural predicates and symbolic rules but differ in the authority assigned to the two evidence sources. DEEPWEAVE characterizes a coupling architecture according to two properties: (ii) whether symbolic evidence can independently support a class or must accompany neural evidence, and (iiii) whether symbolic reasoning is applied to every observation or only when a condition on the neural prediction is satisfied. Considering these two properties, DEEPWEAVE instantiates the following coupling architectures.

Guarded. requires class-matched agreement between the neural and symbolic components for every attack prediction. Let NcN^c, ScS^c, and HcH^c denote the probabilistic outcomes of the neural prediction, sufficient rules, and helper rules for attack class cc, respectively. The attack-class support is then defined as Cc=Nc∧(Sc∨Hc)C_c = N^c \land(S^c \lor H^c), whereas benign support is Cb=Nb∧¬⋁jSjC_b = N^b \land\neg\bigvee_j S^j. Thus, sufficient and helper rules may corroborate a neural attack prediction, but neither can independently assign an attack class. Only the higher-precision sufficient rules may challenge a neural benign prediction by suppressing it. Guarded coupling therefore filters unsupported neural attacks and false benign predictions while avoiding independent symbolic classification.

Anchored. generates classification support in one of two ways. First, a satisfied rule ScS^c with sufficient role can independently support the class cc. Alternatively, classification support can arise from the conjunction of a neural prediction NcN^c and the aggregate satisfaction of the class-specific rules with helper roles ⋀jHjc\bigwedge_j H_j^c. In both cases, the resulting support is accepted as valid only when no disqualifier rule is valid. Consequently, sufficient rules can recover cases missed by the neural model, whereas less decisive helper rules must be corroborated by neural evidence, and all candidate classifications remain subject to symbolic rejection.

Deferred. relies mainly on the neural component and invokes symbolic rules only when the neural model is insufficiently decisive. Let Δ(xv)\Delta(x^v) be the difference between the largest and second-largest class probabilities predicted by the neural component. When Δ(xv)≥τΔ\Delta(x^v) \geq\tau_\Delta, the Deferred coupling leverages the neural prediction without symbolic intervention, thus being equivalent to pure neural inference. Meanwhile, when Δ(xv)<τΔ\Delta(x^v) < \tau_\Delta, the Deferred coupling reverts to predicting the attack class while leveraging the neural component together with sufficient, helper and disqualifier rules. The intuition behind this coupling is that the margin Δ(xv)\Delta(x^v) is a measure of relative neural decisiveness which identifies when neural inference alone is sufficient to predict an attack instance. Lastly, the threshold τΔ\tau_\Delta determines the fraction of observations for which symbolic intervention is activated and thus is a hyperparameter that allows to balance the neural-symbolic trade-off.

Hard Gate. predicts a class cc only when both the neural and symbolic – either sufficient or helper rules – components provide evidence for cc. Thus, this coupling policy represents a logic AND gate between the neural and symbolic components and the stricter policy for attack detection.

Same-Class Boost. relaxes the Hard Gate requirements, adding the probability of sufficient symbolic evidence to the neural evidence, without requiring explicit agreement to support the same class. Therefore, the role of the symbolic component is to reinforce uncertain neural predictions when the defined rules are consistent with the information provided by the input.

Safety Net. predicts an attack class cc when either the neural or symbolic – either sufficient or helper rules – components provide evidence for cc. Therefore, this coupling represents the logical complement of the Hard Gate policy, giving the symbolic component the greatest independence.

Product of Experts. applies specifically for hybrid traffic view. It predicts an attack class cc when neural agreement is achieved between both neural components – i.e., packet- and flow-view – or when the symbolic evidence coming from sufficient rules ScS^c is satisfied. Thus, the Product of Experts coupling favors classes jointly supported by both components, while not being as strict as Hard Gate.

Learning and Inference

For every class c∈Yc \in\mathcal{Y}, DEEPWEAVE evaluates the probability of class cc being true using the DeepProbLog program PΓP_{\Gamma} which implements the coupling architecture Γ\Gamma, the symbolic rules rjcr^c_j and the neural component hvh_v. Within DeepProbLog, the class probability is obtained identifying a successful proof of the query classify⁡(xv,c)\operatorname{classify}(x^v,c), which asks what combination of neural and symbolic evidence permitted by Γ\Gamma leads to class cc being true and the associated probability. Several proof paths may support the same class and DeepProbLog grounds the dependencies among probabilistic predicates before aggregating the probabilities of the successful proofs to obtain the final probability of class cc.

For end-to-end training, DEEPWEAVE minimizes the negative log-probability of the ground-truth class query LNS(xv,y)=−log⁡PPΓ(classify⁡(xv,y))\mathcal{L}_{NS}(x^v,y)=-\log P_{P_{\Gamma}}(\operatorname{classify}(x^v,y)). Gradients propagate through the probabilistic program to the neural, predicate, and any learnable coupling parameters. The logical rule structure, selected features, and semantic directionality of each predicate remain fixed after symbolic knowledge construction. Meanwhile, environment-dependent thresholds are calibrated separately from the learned model parameters. For example, for a threshold represented by benign quantile qq, recalibration consists of estimating Equation (9) from benign reference traffic in the target environment. This changes the numeric boundary without changing the feature, directionality, associated class, or logical structure of the rule.

Proof-Based Explanations

For a predicted class, DEEPWEAVE retains the successful proofs contributing to its class-query probability. Therefore, a proof records: (ii) the neural predicates used by the proof, (iiii) the symbolic predicates satisfied by the observation, (iiiiii) the feature values and thresholds involved in those predicates, (iviv) the rules constructed from the predicates, (vv) the role of each contributing rule, and (vivi) the coupling through which the evidence supported the class. A proof can therefore distinguish, for example, between a sufficient rule that independently supported an attack, a helper rule that reinforced a neural prediction, and an attack signal that prevented acceptance of a benign prediction. Meanwhile, the proof probability determines the contribution of a path to the class query. When several proofs support the predicted class, DEEPWEAVE ranks them according to their contribution and reports the most influential paths. A visual example of one such explanation is provided in § 5.5.

Implementation

We implement DEEPWEAVE in Python using PyTorch [42] and DeepProbLog [35].

Neural models. The neural components of the packet- and flow-view DEEPWEAVE models are implemented as feed-forward Multi-Layer perceptrons (MLP) with identical hidden-layer architectures and view-specific input dimensions (see § B.3). In our experiments, we define a neural-only baseline which uses the same classifier as the corresponding neuro-symbolic model to isolate the effect of neuro-symbolic integration on attack detection performance. In hybrid-view operation, DEEPWEAVE instantiates two feed-forward MLPs as the packet and flow classifiers which remain separately accessible to the probabilistic program, allowing symbolic rules to distinguish packet- and flow-level evidence.

DeepProbLog Optimizations. Each query carries a tensor handle that identifies the traffic view and observation, allowing neural and symbolic predicates to access their respective encodings through a shared reference. During training, DEEPWEAVE evaluates the ground-truth class query and minimizes its negative log-probability. Instead, during inference, it evaluates all candidate classes and selects the most probable one. A naive implementation would ground and compile a separate arithmetic circuit for every observation and class query. Here, an arithmetic circuit is the compiled computation graph of a probabilistic query. Its leaves contain neural or symbolic probabilities, while its internal operators combine them according to the program’s logical structure. Instead, we reformulate queries so that observations share the same symbolic structure and differ only through tensor substitutions. The resulting circuits are compiled once using placeholder handles and reused across observations. A batched graph semiring then supplies observation-dependent neural and symbolic probabilities as leaf vectors and evaluates each shared circuit elementwise over the batch. We further reduce substitution overhead through direct placeholder lookup and reuse of input templates across neural predicates. Together, these optimizations enable batch-level inference and produce a 26.8× speedup in our development benchmark without changing predicted labels. Their impact on end-to-end latency is reported in § B.4.

Experiments and Results

We evaluate DEEPWEAVE via detection performance and efficiency under low-data regimes (§ 5.2), generalization capability (§ 5.3), robustness to adversarial perturbations (§ 5.4), explainability (§ 5.5), and computational efficiency (§ 5.6). Unless stated otherwise, all methods rely on the same task definition, data preprocessing and partitions. To avoid information leakage across DEEPWEAVE optimization and testing, the test set is not used for symbolic knowledge construction, threshold calibration, hyperparameter selection, or model selection.

Experimental Settings

Datasets and tasks. The CIC-IDS2017 [50] dataset is used for DEEPWEAVE flow-view testing, as it represents the state-of-the-art benchmark for NIDS. Instead, for the packet- and hybrid-view testing we run experiments on the NF-CSE-CIC-IDS2018-v3 dataset [49] since it enables the reconstruction of flow features from packet captures using NetFlow-v3 [10]. Furthermore, we test DEEPWEAVE’s generalizability capabilities training it on one of the above mentioned datasets and testing it on the NF-ToN-IoT-v3 dataset [32]. This dataset is selected as it provides a distinct Internet-of-Things (IoT) environment which is radically different from the enterprise networks that characterize the other datasets. Moreover, it shares the same NetFlow-v3 schema of NF-CSE-CIC-IDS2018-v3, ensuring that transferred rules retain the same feature semantics. Lastly, in low-data experiments, we exclude classes with insufficient samples for reliable training and testing, mitigating instability caused by extreme class imbalance in the selected benchmarks [51, 3].

Data partitioning and preprocessing. Each dataset is divided into 60% training, 20% validation, and 20% test partitions using stratified sampling to maintain the natural classes distributions. The validation and test partitions remain fixed across model variants and training-set sizes to ensure fairness. For packet-view and hybrid-view experiments, we partition the data grouping them by flow so that all packets from the same communication remain in one partition and thus avoiding information leakage of packets coming from the same flow but belonging to train and test splits. Where packet labels are derived by matching packets to labelled flow records, matching is completed before partitioning and unmatched or ambiguous packets are excluded. Following established evaluation practice, we remove label-derived fields and capture-specific identifiers to prevent models from exploiting dataset-construction artifacts rather than attack behavior [3, 16, 51]. IP addresses and timestamps are retained only when required for flow assembly or packet-flow association, while they are removed from the neural inputs. Lastly, we standardize the input features only for the neural component, while symbolic predicates access feature values in their original format.

Baselines. We compare DEEPWEAVE with Decision Tree, Logistic Regression, Random Forests, Histogram-based Gradient Boosting Classification Tree (HGB), an MLP having the same architecture of the DEEPWEAVE’s neural component, a symbolic baseline containing only the symbolic rules in the DEEPWEAVE model, and state-of-the-art compatible NIDSs, such as CNN-WDLSTM [21], and SPHBI [15] for packet-view, Kitsune [39] and KnowML [20] for flow-view, and DST-IDS [43] for hybrid-view. Kitsune is implemented both using an original AfterImage flow constructor and relying on the same flow features used by DEEPWEAVE. Meanwhile, KnowML is implemented in combination with the KitNet model used in the original paper. KnowML and Kitsune are implemented in their original anomaly detection mode.

Metrics. We measure detection performance using F1 scores and attack false positive rate (FPR). For multi-class classification baselines, we consider Macro-F1 which assigns equal weight to every retained class. Meanwhile, for the anomaly detection baselines, such a score represents the binary-F1. Attack FPR is the fraction of benign observations classified as any attack. Where relevant, we additionally report per-class precision and recall, PR-AUC and ROCAUC. For adversarial robustness experiments, we use metrics related to attack success rate (ASR) and attacked F1 that represents the F1 score on perturbed data.

Detection Performance and Efficiency

To measure DEEPWEAVE detection performance and efficiency, we follow a low-data protocol where training subsets are parametrized by k∈{50,500,1000,2500,5000,10000}k \in\{50, 500, 1000, 2500, 5000, 10000\}. Each retained attack class contributes kk labelled observations. Benign observations are sampled to match the total attack count, maintaining a controlled balance between benign and aggregate attack traffic. For every value of kk, we draw five independent training subsets and re-initialize each model from scratch. Neural-only and neuro-symbolic models use matched subsets and random seeds. Rather than reconstructing symbolic rules for each kk batch, we derive them once from a larger historical knowledge pool. The resulting rule base is fixed and shared across experiments, reducing construction cost and preventing batch-specific rule variation.

Packet-view. Results for the packet-view detection are presented in Table 1 for k∈{50,1000,5000}k \in\{50, 1000, 5000\}, while the extended results are shown in Table 11 of § C.1. When compared to the simple neural baseline, DEEPWEAVE improves the F1 rate of up to 34.5% at k=50k = 50 using the Anchored coupling architecture. Similarly, DEEPWEAVE reduces false-positive rate from 0.075 to 0.001. Although CNN-WDLSTM [21] and SPHBI [15] systems improve over the simple neural baselines, they underperformed compared to DEEPWEAVE in low-data regime (k=50k = 50). The DEEPWEAVE Anchored coupling model achieves an improvement of 8.1% in terms of F1, while reducing the false positive rate by 0.011 points.

Systemk=50k=50k=1000k=1000k=5000k=5000
F1FPRF1FPRF1FPR
Neural baseline0.632±.0440.632 \pm.0440.075±.0290.075 \pm.0290.843±.0240.843 \pm.0240.020±.0100.020 \pm.0100.863±.0190.863 \pm.0190.013±.0060.013 \pm.006
Symbolic baseline0.725±.0050.725 \pm.0050.046±.0000.046 \pm.0000.834±.0130.834 \pm.0130.018±.0130.018 \pm.0130.857±.0060.857 \pm.0060.007±.0000.007 \pm.000
Decision tree0.688±.0350.688 \pm.0350.064±.0190.064 \pm.0190.776±.0590.776 \pm.0590.082±.1270.082 \pm.1270.881±.0480.881 \pm.0480.026±.0170.026 \pm.017
Logistic regression0.542±.0160.542 \pm.0160.318±.0310.318 \pm.0310.493±.0160.493 \pm.0160.362±.0170.362 \pm.0170.499±.0170.499 \pm.0170.366±.0230.366 \pm.023
Random forest0.884±.0520.884 \pm.0520.017±.0100.017 \pm.0100.924±.0610.924 \pm.0610.012±.0210.012 \pm.0210.995±.0030.995 \pm.0030.000±.0000.000 \pm.000
HGB0.811±.0450.811 \pm.0450.021±.0130.021 \pm.0130.857±.1280.857 \pm.1280.070±.1230.070 \pm.1230.943±.0310.943 \pm.0310.001±.0010.001 \pm.001
DEEPWEAVE (Anchored)0.977±.0130.977 \pm.0130.001±.0010.001 \pm.0010.969±.0230.969 \pm.0230.000±.0000.000 \pm.0000.985±.0070.985 \pm.0070.000±.0000.000 \pm.000
DEEPWEAVE (Guarded)0.924±.0090.924 \pm.0090.008±.0020.008 \pm.0020.936±.0260.936 \pm.0260.001±.0000.001 \pm.0000.916±.0840.916 \pm.0840.001±.0000.001 \pm.000
DEEPWEAVE (Hard Gate)0.823±.0230.823 \pm.0230.005±.0020.005 \pm.0020.931±.0120.931 \pm.0120.001±.0000.001 \pm.0000.927±.0120.927 \pm.0120.000±.0000.000 \pm.000
DEEPWEAVE (Safety Net)0.876±.0180.876 \pm.0180.030±.0080.030 \pm.0080.867±.0450.867 \pm.0450.018±.0080.018 \pm.0080.878±.0460.878 \pm.0460.012±.0060.012 \pm.006
DEEPWEAVE (Same-Class Boost)0.644±.0300.644 \pm.0300.071±.0170.071 \pm.0170.838±.0170.838 \pm.0170.021±.0090.021 \pm.0090.822±.0940.822 \pm.0940.016±.0150.016 \pm.015
DEEPWEAVE (Deferred)0.951±.0190.951 \pm.0190.007±.0030.007 \pm.0030.977±.0030.977 \pm.0030.001±.0000.001 \pm.0000.974±.0020.974 \pm.0020.000±.0000.000 \pm.000
SPHBI [15]0.896±.0190.896 \pm.0190.012±.0040.012 \pm.0040.992±.0050.992 \pm.0050.001±.0000.001 \pm.0000.992±.0100.992 \pm.0100.000±.0000.000 \pm.000
CNN-WDLSTM [21]0.742±.0300.742 \pm.0300.034±.0140.034 \pm.0140.845±.0170.845 \pm.0170.008±.0030.008 \pm.0030.884±.0160.884 \pm.0160.007±.0010.007 \pm.001
Suricata (ET Open)†0.4490.2790.4490.2790.4490.279
Suricata (ET Open + published)†0.6240.2800.6240.2800.6240.280

Table 1. Packet-view comparison on CIC-IDS2018, across per-class training sizes of k=50k=50, k=1000k=1000 and k=5000k=5000. F1 indicates the macro-F1 for multi-class classification models and binary-F1 for Suricata. Both F1 and FPR are reported as average ±\pm standard deviation. Best per column in bold.

Systemk=50k=50 F1k=50k=50 FPRk=100k=100 F1k=100k=100 FPRk=250k=250 F1k=250k=250 FPRk=500k=500 F1k=500k=500 FPRk=1000k=1000 F1k=1000k=1000 FPRk=2500k=2500 F1k=2500k=2500 FPRk=5000k=5000 F1k=5000k=5000 FPRk=10000k=10000 F1k=10000k=10000 FPR
Neural baseline0.632±.0440.075±.0290.702±.0290.063±.0110.774±.0520.033±.0170.776±.0260.031±.0070.843±.0240.020±.0100.856±.0170.011±.0040.863±.0190.013±.0060.869±.0110.012±.004
Symbolic baseline0.725±.0040.046±.0010.768±.0620.033±.0160.838±.0610.020±.0110.812±.0160.026±.0160.834±.0130.018±.0130.846±.0070.011±.0040.857±.0060.017±.0060.842±.0170.007±.000
Decision tree0.688±.0350.064±.0190.757±.0540.033±.0160.778±.0830.042±.0190.801±.0470.048±.0120.776±.0590.082±.0170.845±.0080.048±.0130.881±.0450.026±.0170.928±.0490.006±.009
Logistic regression0.542±.0160.318±.0310.493±.0270.343±.0210.490±.0470.352±.0250.553±.0250.303±.0070.493±.0160.362±.0170.489±.0240.380±.0110.499±.0170.366±.0230.500±.0110.378±.015
Random forest0.884±.0520.017±.0100.972±.0070.004±.0020.960±.0410.003±.0020.902±.0550.026±.0230.924±.0610.012±.0210.826±.0760.001±.0110.995±.0030.000±.0000.992±.0010.001±.001
HGB0.811±.0450.021±.0130.900±.0440.014±.0140.898±.0520.017±.0140.753±.0390.177±.0230.857±.1280.070±.0120.889±.0820.018±.0060.943±.0310.000±.0010.946±.0560.006±.012
DEEPWEAVE (Anchored)0.977±.0110.001±.0010.972±.0320.000±.0000.972±.0310.000±.0000.942±.0280.000±.0000.969±.0230.000±.0000.985±.0070.000±.0000.985±.0070.000±.0000.988±.0060.002±.001
DEEPWEAVE (Guarded)0.924±.0090.008±.0020.906±.0200.004±.0030.930±.0140.001±.0010.940±.0110.002±.0010.936±.0260.001±.0000.948±.0100.001±.0000.916±.0140.000±.0000.946±.0030.001±.000
DEEPWEAVE (Deferred)0.951±.0090.005±.0020.861±.0210.003±.0020.922±.0350.001±.0010.914±.0200.000±.0000.931±.0260.001±.0000.912±.0110.000±.0000.927±.0110.003±.0010.919±.0310.001±.000
DEEPWEAVE (Safety Net)0.876±.0180.031±.0050.893±.0250.021±.0050.855±.0370.040±.0150.894±.0250.006±.0060.867±.0450.018±.0150.879±.0190.015±.0060.878±.0460.012±.0050.846±.0550.024±.011
DEEPWEAVE (Class Boost)0.844±.0300.071±.0170.697±.0440.061±.0060.781±.0420.037±.0140.758±.0430.035±.0140.838±.0170.021±.0070.858±.0100.011±.0040.822±.0440.016±.0150.870±.0220.013±.011
DEEPWEAVE (Handler)0.951±.0190.007±.0030.970±.0060.003±.0010.987±.0020.001±.0000.982±.0040.000±.0000.977±.0030.001±.0000.975±.0100.001±.0000.974±.0020.000±.0000.987±.0010.003±.001
SPHBI [15]0.896±.0190.012±.0040.943±.0140.007±.0010.966±.0180.003±.0020.985±.0040.001±.0000.992±.0050.001±.0000.990±.0100.000±.0000.992±.0100.000±.0000.984±.0230.000±.000
CNN-WLDSTM [21]0.742±.0300.034±.0140.773±.0310.026±.0110.817±.0280.013±.0080.818±.0160.008±.0010.845±.0170.008±.0030.835±.0160.012±.0060.884±.0160.007±.0010.858±.0190.011±.001
Suricata (ET Open)0.4490.2790.4490.2790.4490.2790.4490.2790.4490.2790.4490.2790.4490.2790.4490.279
Suricata (ET Open + published)†0.6240.2800.6240.2800.6240.2800.6240.2800.6240.2800.6240.2800.6240.2800.6240.280

Table 11. Packet-view comparison on CIC-IDS2018, across the per-class training-size kk. F1 indicates the macro-F1 for multi-class classification models and binary-F1 for binary classification baselines (Suricata). Both F1 and FPR are reported as average ± standard deviation. Best F1 (highest) and FPR (lowest) for each kk are shown in bold. Suricata is signature-based and training-size-independent, thus is not affected by kk.

As the available data grow in size, all data-driven baselines – including the symbolic baseline that learn symbolic rules thresholds from data – improve in performance with some of them achieving results similar to DEEPWEAVE. Across different values of kk, DEEPWEAVE shows high performance stability, highlighting the effectiveness of neuro-symbolic integration. Lastly, DEEPWEAVE shows substantial detection improvements over Suricata rules which become effective only when considering custom rules defined using the rate and behaviour of the attack derived from the documented CIC-IDS2017 attack profiles—i.e., ET Open + published. However, even custom made Suricata rules result in a high number of false positives compared to DEEPWEAVE, showing the limitations of purely signature-based NIDS and confirming our intuition of § 2.1.

Flow-view. Results for the flow-view detection are presented in Table 2 for k∈{50,1000,5000}k \in\{50, 1000, 5000\}, while the extended results are shown in Table 12 of § C.1. We implement Kitsune using both the same flow features used by DEEPWEAVE and the original AfterImage pipeline (noted with † in the table). Such a pipeline is unsupervised and trains once on the first 3 million packets of the benign Monday capture, so its performance does not change across ksks. Its testing runs over the raw Tue-Fri captures rather than the held-out 20% split and we report its most favourable run with threshold q=0.995q=0.995 found experimentally.

Systemk=50k=50 F1k=50k=50 FPRk=1000k=1000 F1k=1000k=1000 FPRk=5000k=5000 F1k=5000k=5000 FPR
Neural baseline0.595±.0160.071±.0150.762±.0240.021±.0070.789±.0040.013±.000
Symbolic baseline0.584±.0600.142±.0000.626±.0020.034±.0000.603±.0550.124±.009
Decision tree0.452±.0980.174±.0720.673±.0590.096±.0260.726±.0550.053±.014
Logistic regression0.443±.0140.275±.0260.496±.0090.231±.0130.508±.0040.221±.007
Random forest0.679±.0440.049±.0210.782±.0330.032±.0110.771±.0110.029±.003
HGB0.574±.0770.115±.0740.778±.0580.037±.0190.825±.0590.027±.018
DEEPWEAVE (Anchored)0.833±.0160.008±.0010.913±.0050.009±.0010.919±.0060.008±.001
DEEPWEAVE (Same-Class Boost)0.672±.0130.045±.0100.765±.0210.026±.0070.810±.0130.018±.007
DEEPWEAVE (Guarded)0.849±.0160.011±.0050.904±.0090.008±.0000.921±.0020.007±.000
DEEPWEAVE (Hard Gate)0.838±.0180.010±.0040.902±.0220.010±.0040.916±.0060.009±.004
DEEPWEAVE (Safety Net)0.703±.0290.016±.0070.673±.0220.069±.0100.715±.0420.061±.018
DEEPWEAVE (Deferred)0.593±.0200.074±.0200.728±.0080.032±.0010.789±.0080.020±.007
Kitsune [39] + Flow features0.754±.0220.066±.0170.740±.0050.028±.0040.752±.0040.018±.006
Kitsune [39] + AfterImage (faithful)†0.7340.1020.7340.1020.7340.102
KnowML [20] + KitNET (unsupervised)0.883±.0190.132±.0250.851±.0360.175±.0510.792±.0240.260±.035

Table 2. Flow-view comparison on CIC-IDS2017 across training k=50k=50, k=1000k=1000, and k=5000k=5000. F1 indicates the macro-F1 for multi-class classification models and binary-F1 for the anomaly-based baselines of Kitsune and KnowML. Both F1 and FPR are reported as average ± standard deviation. Best per column in bold.

Systemk=50k=50 MF1BF1FPRk=100k=100 MF1BF1FPRk=250k=250 MF1BF1FPRk=500k=500 MF1BF1FPRk=1000k=1000 MF1BF1FPRk=2500k=2500 MF1BF1FPRk=5000k=5000 MF1BF1FPRk=10000k=10000 MF1BF1FPR
Neural baseline0.595±.0160.902±.0090.071±.0150.617±.0200.906±.0190.071±.0230.670±.0120.946±.0040.039±.0030.709±.0270.957±.0080.033±.0060.762±.0240.972±.0090.021±.0070.774±.0040.976±.0070.018±.0050.789±.0040.983±.0000.013±.0000.786±.0240.970±.0100.022±.008
Symbolic baseline0.584±.0600.837±.0000.142±.0000.584±.0600.837±.0000.142±.0000.554±.0730.837±.0000.142±.0000.623±.0050.867±.0150.070±.0370.626±.0020.876±.0000.034±.0000.617±.0000.839±.0000.119±.0000.603±.0550.838±.0010.124±.0090.664±.0600.840±.0000.117±.000
Decision tree0.452±.0980.774±.0410.174±.0720.514±.0840.827±.0340.102±.0510.594±.0380.896±.0340.064±.0350.662±.0300.873±.0450.088±.0310.673±.0590.878±.0250.096±.0260.730±.1320.926±.0500.062±.0470.726±.0550.936±.0150.053±.0140.853±.1040.966±.0430.029±.038
Logistic regression0.443±.0140.731±.0160.275±.0260.459±.0130.746±.0090.258±.0110.484±.0120.764±.0040.241±.0040.487±.0150.766±.0080.239±.0090.496±.0090.773±.0110.231±.0130.502±.0050.780±.0090.223±.0110.508±.0040.781±.0070.221±.0070.500±.0080.770±.0100.234±.012
Random forest0.679±.0440.925±.0200.049±.0210.741±.0280.947±.0170.034±.0140.759±.0090.954±.0100.032±.0080.768±.0090.958±.0090.031±.0080.782±.0330.959±.0140.032±.0110.800±.0120.975±.0130.019±.0110.771±.0110.963±.0030.029±.0030.891±.0550.993±.0040.005±.003
HGB0.574±.0770.853±.0550.115±.0740.636±.1300.921±.0650.051±.0660.709±.0590.950±.0250.028±.0200.727±.0430.941±.0280.040±.0170.778±.0580.954±.0220.037±.0190.887±.0500.987±.0140.010±.0110.825±.0590.967±.0210.027±.0180.936±.0100.998±.0000.002±.000
DEEPWEAVE (Anchored)0.833±.0160.955±.0140.008±.0010.842±.0110.965±.0030.009±.0030.841±.0240.969±.0050.011±.0020.899±.0180.977±.0020.010±.0020.913±.0050.980±.0010.009±.0010.915±.0030.982±.0000.009±.0000.919±.0060.983±.0010.008±.0010.921±.0060.981±.0020.009±.001
DEEPWEAVE (Same-Class Boost)0.672±.0130.894±.0220.045±.0100.677

Table 12. Flow-view comparison on CIC-IDS2017 across training sizes kk. Macro-F1 for multi-class classification models and binary-F1 for anomaly-based baselines of Kitsune and KnowML are reported. Both F1 and FPR are reported as average ± standard deviation. Best F1 (highest) and FPR (lowest) for each kk are shown in bold.

Across all kk values, DEEPWEAVE represents the best performing model. While at k=50k=50, KnowML achieves a higher F1 score, its score is based on a binary classification task – i.e., predicting either attack or benign –, while DEEPWEAVE is a multi-class classifier. When considering binary F1, DEEPWEAVE achieves a much higher performance around 0.95 (see Table 12). Moreover, DEEPWEAVE achieves a much lower FPR with a 0.124 points reduction when comparing the Anchored coupling architecture with KnowML.

Similarly to the packet-view results, as the value kk increases most baselines improve. However, they are not capable of reaching the same level of performance of DEEPWEAVE, as shown by the 9.6% F1 gap between the Guarded coupling and the best performing baseline (HGB). Anomaly-based approaches in Kitsune and KnowML, however, do not improve their performance with larger kk. We analyze this effect in App C.2 and find that it depends on these models being effective for detecting volumetric attacks that distort traffic statistics – e.g., DoS, DDoS, PortScan –, while collapsing on low-footprint attacks, where the anomaly score is uninformative. This confirms the findings of [20], showing how both Kitsune and KnowML perform particularly well mainly for DoS or DoS-related attacks.

Regarding the coupling architectures, the results show the importance of the symbolic component in detecting the attack at flow-view. Coupling architectures that rely mostly on the neural component, such as Deferred and Safety Net, show limited performance at low kk. Overall, these results confirm our intuition on low-data regime operation depicted in § 2.1.

Hybrid-view. Results for the hybrid-view detection are presented in Table 3 for k∈{50,1000,5000}k \in\{50,1000,5000\}, while the extended results are shown in Table 13 of § C.1. The neural baseline consists of a product embedding model composed of two neural networks that encode the packet and flow data and a product layer that combines the two neural embeddings before a final classification layer. Additionally, since DEEPWEAVE does not operate on payload features, we adapt the DST-IDS [43] fusion to the same packet and flow classifiers, rather than using the original payload-based mechanism for fair comparison. The neural product and DST-IDS baselines are trained using early stopping over fifty epochs, while all DEEPWEAVE models are trained for ten epochs.

Table 3: Hybrid-view comparison on CIC-IDS2018 across per-class training sizes of k=50k = 50, k=1000k = 1000, and k=5000k = 5000. Results report F1 and FPR as average ±\pm standard deviation. Best per column in bold.

Systemk=50k=50k=1000k=1000k=5000k=5000
F1FPRF1FPRF1FPR
Symbolic-only baseline0.841±\pm.0230.006±\pm.0000.857±\pm.0140.086±\pm.0180.849±\pm.0010.077±\pm.007
Neural product (baseline)0.782±\pm.0640.029±\pm.0150.950±\pm.0220.003±\pm.0010.970±\pm.0120.002±\pm.001
DST-IDS fusion [43]0.827±\pm.0650.024±\pm.0140.962±\pm.0140.003±\pm.0010.970±\pm.0080.002±\pm.001
DEEPWEAVE (Product of Experts)0.867±\pm.0350.020±\pm.0160.961±\pm.0230.006±\pm.0050.985±\pm.0020.005±\pm.004
DEEPWEAVE (Guarded)0.759±\pm.0360.008±\pm.0040.952±\pm.0150.004±\pm.0040.971±\pm.0150.002±\pm.001
DEEPWEAVE (Anchored)0.805±\pm.0190.003±\pm.0020.818±\pm.0320.091±\pm.0240.828±\pm.0440.096±\pm.035
DEEPWEAVE (Same-Class Boost)0.709±\pm.0400.049±\pm.0160.954±\pm.0070.005±\pm.0040.960±\pm.0110.003±\pm.000
DEEPWEAVE (Deferred)0.870±\pm.0370.018±\pm.0160.961±\pm.0230.006±\pm.0050.985±\pm.0020.005±\pm.004
DEEPWEAVE (Hard Gate)0.749±\pm.0410.016±\pm.0140.963±\pm.0140.004±\pm.0010.969±\pm.0100.003±\pm.000
DEEPWEAVE (Safety Net)0.862±\pm.0430.017±\pm.0110.956±\pm.0380.020±\pm.0200.982±\pm.0060.008±\pm.002

Table 3.

Systemk=50k=50 F1FPRk=100k=100 F1FPRk=250k=250 F1FPRk=500k=500 F1FPRk=1000k=1000 F1FPRk=2500k=2500 F1FPRk=5000k=5000 F1FPRk=10000k=10000 F1FPR
Symbolic-only baseline0.841±.0330.006±.0090.739±.0210.099±.0240.801±.0720.077±.0630.818±.0520.060±.0670.854±.0140.086±.0180.835±.0420.095±.0210.849±.0010.077±.0070.849±.0010.077±.007
Neural product (baseline)0.782±.0640.029±.0150.888±.0190.014±.0040.936±.0300.006±.0030.955±.0180.003±.0020.950±.0220.003±.0010.967±.0110.003±.0010.970±.0120.002±.0010.977±.0100.001±.001
DST-IDS fusion0.827±.0630.024±.0140.879±.0400.012±.0040.920±.0270.010±.0050.943±.0130.006±.0020.962±.0140.003±.0010.966±.0060.004±.0010.970±.0050.002±.0010.973±.0100.002±.001
DEEPWEAVE (PoE)0.867±.0330.020±.0160.925±.0310.009±.0040.978±.0060.004±.0030.974±.0050.001±.0010.961±.0230.006±.0050.967±.0290.036±.0190.985±.0020.005±.0040.952±.0250.002±.002
DEEPWEAVE (Guarded)0.759±.0360.008±.0040.823±.0770.023±.0050.865±.0240.008±.0040.899±.0240.005±.0030.952±.0150.004±.0040.962±.0190.002±.0020.971±.0150.002±.0010.970±.0100.003±.001
DEEPWEAVE (Anchored)0.805±.0190.003±.0020.753±.0290.092±.0240.834±.0470.067±.0400.815±.0550.048±.0510.818±.0320.091±.0440.867±.0190.071±.0420.828±.0440.066±.0350.840±.0190.079±.010
DEEPWEAVE (Same-Class Boost)0.709±.0490.049±.0160.820±.0590.051±.0240.813±.0390.012±.0060.934±.0150.004±.0050.918±.0320.005±.0040.957±.0130.002±.0020.961±.0140.003±.0030.968±.0140.003±.003
DEEPWEAVE (Deferred)0.870±.0470.018±.0160.760±.1760.026±.0350.894±.1020.003±.0030.974±.0050.001±.0010.961±.0230.006±.0050.967±.0290.036±.0190.985±.0020.005±.0040.932±.0310.005±.003
DEEPWEAVE (Hard Gate)0.749±.0410.016±.0140.818±.0560.027±.0270.987±.0210.008±.0060.927±.0140.001±.0010.963±.0140.004±.0040.966±.0120.004±.0040.969±.0100.003±.0040.974±.0040.002±.001
DEEPWEAVE (Safety Net)0.862±.0430.017±.0110.922±.0190.011±.0090.956±.0180.008±.0020.971±.0050.001±.0010.956±.0140.020±.0100.964±.0180.045±.0050.982±.0060.005±.0020.983±.0050.007±.003

Table 13. Hybrid-view comparison on CIC-IDS2018 across per-class training sizes kk. Results report F1 and FPR as average ± standard deviation. Best F1 (highest) and FPR (lowest) for each kk are shown in bold.

DEEPWEAVE represents the best performing model across all data sizes kk. Moreover, its performance improvement is more evident for smaller values of kk, achieving a 7.5% F1 improvement and a 0.027 FPR reduction at k=50k=50. For larger kk, the neural and DST-IDS baselines improve their performance, but never catch up with DEEPWEAVE, showcasing the effectiveness of neuro-symbolic integration when dealing with complex input data. Overall, these results confirm the findings of packet- and flow-view on the data efficiency of DEEPWEAVE. Moreover, they also prove that the explicit cross-view rules constructed during the DEEPWEAVE’s offline preparation are particularly useful when the packet and flow classifiers have insufficient data to learn an effective combination policy.

Generalization

We evaluate whether DEEPWEAVE generalizes well across datasets and network topologies operating a cross-environment transfer from the enterprise CIC-IDS2018 dataset to IoT NF-ToN-IoT-v3 dataset—i.e., training a model on the former and testing it on the latter. Although these datasets differ in network devices, traffic distributions, and attack families, both adopt NetFlow-v3 flow-views. Thus, symbolic rules constructed in the source environment can be evaluated in the target without modifying DEEPWEAVE’s logical structure.

Source models are trained using k=500k = 500 labelled samples per attack class of CIC-IDS2018. The fine-tuning to the IoT dataset then proceeds in two stages. First, the learned feature extractor is frozen, and only the classifier head and environment-dependent symbolic thresholds are updated. Second, the entire neural model is unfrozen and optimized with a reduced learning rate, while symbolic-threshold adaptation continues. Rules transferred from the source to the target environment retain their logical structure but are recalibrated using only information from the target environment. The fine-tuning uses k∈{0,10,50}k \in\{0, 10, 50\} samples per attack class, with k=0k = 0 representing the most challenging zero-shot generalization setting. We compare four models: (i) an oracle model trained and evaluated directly on the IoT target data which represents the achievable performance upper bound, (ii) a purely neural model trained only in the enterprise domain, (iii) a regularized neural model which applies weight decay during fine-tuning—to check whether DEEPWEAVE improvement is attributable solely to regularization—and, (iv) a DEEPWEAVE model where both the neural component and rule structures of the original DEEPWEAVE model are used without modifications. Lastly, we focus on the flow traffic-view and use the Guarded coupling architecture for DEEPWEAVE as it is the best performing coupling on average over the flow traffic-view. Figure 3 reports the enterprise-to-IoT transfer results. As expected, the oracle model achieves the highest performance on the target dataset, being directly trained on it. Meanwhile, DEEPWEAVE shows effective generalization capabilities—considering both F1 and FPR scores—, outperforming the purely neural counterparts—both with and without regularization—by 14% in the zero-shot setting and by up to 23% after fine-tuning. As more fine-tuning data become available, the purely neural baselines adapt to the target dataset, closing the gap with DEEPWEAVE. However, they never reach the same level of performance of DEEPWEAVE for the tested settings.

Zero-shot transfer

(a) Zero-shot transfer

Fine-tuning k=10

(b) Fine-tuning k=10k=10

Fine-tuning k=50

(c) Fine-tuning k=50k=50

Figure 3. Generalization testing from enterprise scenario (CIC-IDS2018) to IoT (NF-ToN-IoT-v3).

Adversarial Robustness

We evaluate the adversarial robustness of DEEPWEAVE on the CIC-IDS2017 flow-view. To model a realistic adversary, we adopt the attacker capabilities modeled in PANTS [26]. For ease of implementation, we update the affected flow features directly rather than replicating their full packet-level synthesis. Specifically, for a finite set of attacker admissible actions we modify the corresponding flow representations and evaluate the resulting attack flows without modifying the training data nor adversarially retraining the models. The threat model combines two attacker positions. An in-path attacker can delay packets in one direction, while a compromised end host can delay or pad its own forward packets, inject dummy forward packets, or both. For each flow, we limit adversarial packet injection to 20% of the original packet count, and bound the padding to the longest packet in the original flow. Lastly, reverse traffic is held fixed, so the attacker can modify only its own traffic.

To isolate the effect of neuro-symbolic integration on adversarial robustness, we compare the different DEEPWEAVE coupling architectures against a purely symbolic baseline – composed of only symbolic rules – and a purely neural baseline—the neural component. Moreover, because the CIC-IDS2018 is unbalanced – DoS and PortScan account for 68.2% and 28.5% of the malicious flows, respectively, – measuring only the ASR would obscure failures on minority attack classes. We therefore report weighted ASR along with the ASR for each attack class, and the F1 detection performance over the attacked flows.

As shown in Figure 4, the symbolic-only system is the most robust under adversarial attacks. Its ASR is 23.1%, while its F1 performance decreases from 0.803 to 0.761, corresponding to 94.8% performance retention. This robustness is consistent with the symbolic detection relying primarily on properties such as ports, flags, and categorical protocol conditions that a constrained attacker is not able to modify. Meanwhile, the neural baseline achieves a weighted ASR of 31.3%, showcasing surprisingly high robustness. This is largely due to it being robust mainly against perturbations that affect the DoS class, where its achieved ASR is only 13.3% (see Table 14 in § C.3). As DoS accounts for 68.2% of the malicious test flows, being robust against such perturbations make the model implicitly more robust. Nevertheless, the neural baseline does not represent a reliable model, since its F1 performance decreases to only 0.478 when considering adversarial flows. Further showing that ASR alone is not sufficient to measure the usable robustness of a NIDS.

Figure 4. Adversarial robustness analysis.

SystemDoS (68.2%)PortScan (28.5%)BruteForce (2.5%)WebAttack (0.4%)Bot (0.4%)Weighted ASRClass mean
Symbolic baseline32.2%3.6%0.0%9.9%4.1%23.1%10.0%
Neural baseline13.3%72.5%44.7%33.8%72.4%31.3%47.3%
DEEPWEAVE (Safety Net)26.2%48.8%49.6%13.0%59.7%33.3%39.5%
DEEPWEAVE (Guarded)31.2%50.3%38.0%2.5%4.4%36.6%25.3%
DEEPWEAVE (Anchored)28.5%61.5%55.3%2.0%44.0%38.5%38.3%
DEEPWEAVE (Hard Gate)31.2%75.8%36.5%7.5%32.0%44.0%36.6%

Table 14. Attack success rate (ASR) by attack class under the PANTS [26]-inspired proportional per-flow feature-space attack. Parentheses in the column headings give each class’s share of the 111,301 attack flows in the natural-prior test split. Weighted ASR is flow-weighted by these frequencies; class mean is the unweighted mean across attack classes. Lower is better.

Guarded represents the strongest coupling architecture, achieving a class-averaged ASR of 25.3% (see Table 14). Thus, DEEPWEAVE is more robust than its neural counterpart, although not being able to match the symbolic-only system. Moreover, DEEPWEAVE (Guarded) provides more consistent robustness across classes w.r.t. the neural baseline, thus being more reliable in practice (see Table 14). DEEPWEAVE robustness largely depends on the chosen coupling architecture as more neural-driven couplings result in weaker models such as Hard Gate and Safety Net (see Table 14). Lastly, as show in 4b, DEEPWEAVE allows to define coupling architectures that remain effective also on adversarially perturbed traffic. For example, Guarded achieves a post-attack macro-F1 performance of 0.748, thus achieving a 84.7% performance retention.

Explainability

We evaluate whether DEEPWEAVE produces explanations that reflect its predictive reasoning and provide meaningful evidence for security analysis. Unlike post-hoc attribution methods, DEEPWEAVE explains predictions through the proof paths used to compute their class probabilities, making its explanations intrinsic to the model. Figure 5 illustrates both a global explanation of the model’s decision structure (Figure 5a) and a local explanation of one prediction Figure 5b. The example uses Hard Gate coupling and the flow-view model trained on CIC-IDS2017 for SYN-flood detection, while ×\times and ++ denote logical AND and OR, respectively. The optimized rule checks for an unusually high SYN rate and repeated incomplete TCP handshakes. SYN-rate evidence is evaluated at two thresholds, whose steepness is optimized during training (§ 3.2.3), to distinguish clearly anomalous high rates from stealthier medium-rate flooding. The symbolic result is gated by a neural component that directly estimates SYN-flood evidence. Consequently, DEEPWEAVE predicts SYN flood only when the neural traffic pattern and the symbolic attack conditions agree. For a particular alert, Figure 5b reports the activated predicates and their probabilities, allowing an analyst to inspect detected patterns rather than isolated features—e.g., a very high SYN rate with probability 0.94 and repeated incomplete handshakes with probability 0.88. Additional global and local examples appear in Figure 9 of § C.4.

Global explanationLocal explanation

Figure 5. Visualization of DEEPWEAVE’s global and local explanations.

DEEPWEAVE global explanation for detection of bot attacks

(a) DEEPWEAVE global explanation for detection of bot attacks.

DEEPWEAVE global explanation for detection of port scan attacks

(b) DEEPWEAVE global explanation for detection of port scan attacks.

DEEPWEAVE local explanation given for the detection of a brute force attack

(c) DEEPWEAVE local explanation given for the detection of a brute force attack.

DEEPWEAVE local explanation given for the detection of a DoS attack

(d) DEEPWEAVE local explanation given for the detection of a DoS attack.

Figure 9. DEEPWEAVE’s explanations visualization.

Following the xNIDS evaluation setting [57], we compare DEEPWEAVE with SHAP [33] and Integrated Gradients (IG) [53], applied to the matched neural flow classifier. Across five CIC-IDS2017 training replicates, DEEPWEAVE selects the same winning rule for 96.4% of observations, whereas IG and SHAP select the same top feature for only 24.3% and 18.8%, respectively. § C.4 provides the complete protocol, representative comparisons, and per-class stability results.

Lastly, we replicate xNIDS’s deletion-based fidelity evaluation [57]. For each alert, we progressively nullify features selected by its explanation and measure the probability retained by the original predicted class; lower retention indicates that the removed evidence was more important to the prediction. DEEPWEAVE selects the conditions of the clause responsible for the alert, whereas IG and SHAP rank features by the absolute magnitude of their per-sample attributions. As shown in Table 4, removing the complete DEEPWEAVE explanation—only 2.4 conditions on average—reduces probability retention to 0.11. By comparison, removing the highest-ranked IG or SHAP feature retains 0.90 and 0.91 of the original decision, respectively, while removing their top ten features still retains between 0.65 and 0.77. DEEPWEAVE is also substantially sparser: its explanations contain 2.4 conditions on average, compared with 28 IG features and 16 SHAP features required to account for 90% of total attributions. Thus, DEEPWEAVE identifies a compact set of conditions directly responsible for each prediction, while the post-hoc methods produce less sparse explanations whose highest-ranked features have a smaller effect when removed.

Explanation methodm=1m=1m=3m=3m=5m=5m=10m=10Explanation size (features/rules)
DEEPWEAVE0.130.110.110.112.4±0.72.4 \pm0.7
Integrated Gradients (MLP)0.900.850.770.6527.9±8.427.9 \pm8.4
SHAP (MLP)0.910.860.820.7715.7±4.315.7 \pm4.3

Table 4. Deletion fidelity on CIC-IDS2017 flow-view traffic with Guarded coupling. Values report the probability retained by the originally predicted class; lower is more faithful. Probability retention after deleting top-mm features/rules.

Computational Efficiency

We evaluate the cost of the complete detection pipeline as the number of analyzed flows increases, including both the transformation of incoming traffic into model-ready representations and prediction by an already trained detector. We compare DEEPWEAVE with the ML baselines in § 5.1, Kitsune [39], and KnowML+KitNET [20]. Figure 6 reports (a) the effective per-flow cost at the complete workload and (b) total runtime for increasing workloads. Processing covers the operations required to construct a valid detector representation from packets or flow records, whereas inference covers the operations required to produce a class or anomaly prediction from that representation.

Figure 6. Computational efficiency of DEEPWEAVE and the baselines: effective per-flow processing and inference cost at the complete workload (left), and total runtime by workload (right).

Packet-to-flow assembly dominates processing for all flow-input systems. Before assembly, DEEPWEAVE requires approximately 1.34 μs1.34\ \mu\mathrm{s} per flow for feature scaling, symbolic-atom evaluation, quantile lookup, and fact grounding, about 5×5\times the 0.27 μs0.27\ \mu\mathrm{s} required by the conventional ML baselines. After adding the shared 331.75 μs331.75\ \mu\mathrm{s} assembly cost, however, DEEPWEAVE’s total processing time is only 0.32%0.32\% higher. Thus, the similar processing times do not imply that symbolic representation is free, but rather that common packet ingestion and flow assembly dominate model-specific preparation.

Inference shows a larger difference. HGB processes the complete 565,525-flow workload in 13.21 seconds, or 23.35 μs23.35\ \mu\mathrm{s} per flow, whereas DEEPWEAVE requires 157.47 seconds, or 278.45 μs278.45\ \mu\mathrm{s} per flow. Despite being slower than the flow-based ML classifiers, DEEPWEAVE remains substantially faster than the evaluated packet-native systems in their current implementations. Kitsune requires 418.8 μs418.8\ \mu\mathrm{s} per packet for AfterImage processing and 377.4 μs377.4\ \mu\mathrm{s} for inference through its 19-autoencoder KitNET ensemble. KnowML processes features faster than Kitsune – approximately 3.08 versus 6.81 ms per resulting flow – but its 148-autoencoder KitNET ensemble requires approximately 43.82 ms of inference per flow, compared with 6.14 ms for Kitsune. Consequently, Kitsune’s estimated complete-workload runtime is approximately 21×21\times DEEPWEAVE’s measured runtime, while KnowML+KitNET is approximately 77×77\times slower.

Packet- and flow-level timings are not directly interchangeable, but they contextualize probabilistic-reasoning cost relative to complete NIDS pipelines. For deployment planning, the total-runtime curves are the most informative comparison because they include batching, vectorization, query construction, and framework overhead. The isolated inference bars should therefore be interpreted as workload-specific effective costs rather than workload-independent constants. § C.5 separately examines how symbolic-program structure affects cost under a fixed workload.

Discussion and Limitations

Value and limits of symbolic knowledge. Reusable rules provide structured evidence when labels or traffic context are scarce, reducing what the neural component must learn and helping control false alarms [35, 56]. However, rules may capture environment-specific or collection-specific correlations and therefore require provenance tracking, recalibration, and periodic validation under deployment shift [51, 9]. Our label-efficiency results consequently assume limited current labels supplemented by historical symbolic knowledge, rather than equal information budgets for rule discovery and neural training. DeepWeave’s probabilities should likewise be interpreted as structured classification evidence, not a complete generative model of network traffic.

Coupling is an operational policy. Coupling is an operational policy. It determines the authority assigned to neural and symbolic evidence, so no policy is universally optimal: precision-oriented deployments may prefer strict corroboration, whereas noisy or adversarial environments may require greater evidential independence. DeepWeave makes this precision–robustness trade-off explicit rather than embedding it within an opaque fusion layer.

Faithful proofs do not guarantee analyst utility. DeepWeave’s explanations are intrinsic because the reported predicates and clauses belong to proofs contributing to the prediction, avoiding the semantic gap of post-hoc explanations [57]. Our results establish proof coverage, clause reliability, and stability, but do not show that proofs improve analyst decisions or reduce investigation effort. Operational studies indicate that explanations are useful only when they fit analyst workflows and support appropriate reliance [40, 46, 27]. Analyst studies are therefore needed to measure comprehension, triage time, decision quality, and automation bias.

Computational and external validity. DeepWeave is slower than optimized ML classifiers because inference includes grounding, predicate evaluation, symbolic solving, and answer decoding. Batching makes this overhead practical for the evaluated workloads, although line-rate packet deployment may require parallelization or lightweight screening, as explored by in-network detection systems [6, 14, 38]. Scalability also depends on rule interactions, since dense logical dependencies may increase compiled-circuit size. Finally, public benchmarks do not capture long-term drift, sensor failures, evolving applications, or analyst feedback. Our results therefore establish DeepWeave’s behavior in the evaluated environments, not universal superiority in operational networks.

Related Work

ML-based NIDS. Learning-based NIDSs reduce dependence on manually maintained signatures by learning from packet, flow, or contextual observations. Kitsune models benign traffic online with an autoencoder ensemble [39], while HorusEye combines in-switch anomaly screening with deeper flow analysis [14]. ARGUS models contextual IoT-device behavior [45], and 5G-SPECTOR applies protocol-aware analysis to cellular attacks [58]. These systems demonstrate flexible or context-aware detection, but their attack knowledge is either implicit in learned models or specialized to one protocol environment; learned detectors can also degrade across network distributions [51, 9]. Deployment-oriented systems instead optimize data collection and inference: FlowLens constructs compact flow markers for programmable switches [6], and ISDC distributes flow selection and aggregation across the network [38]. DEEPWEAVE complements this work by integrating packet-, flow-, and hybrid-level learning with explicit probabilistic reasoning and proof-based explanations.

Explainable and Robust ML-based Intrusion Detection. xNIDS produces post-hoc explanations that account for temporal context and feature dependencies and can generate defense rules [57]. However, its explanations are produced after prediction, whereas DEEPWEAVE uses symbolic clauses directly in inference and reports contributing proofs. Robustness work emphasizes that adversarial network inputs must remain realizable and preserve malicious functionality. PANTS combines adversarial search with SMT constraints to generate valid network inputs and robustify a target classifier [26]. PANTS uses symbolic reasoning externally for adversarial generation; DEEPWEAVE embeds symbolic attack conditions within the detector and evaluates explicit neural–symbolic coupling under shift, corruption, and constrained evasion.

Neuro-Symbolic NIDS. Bizzarri et al. guide neural training with logical constraints over benign and malicious traffic [7], while other recent pipelines combine neural representations with clustering, tree-based prediction, uncertainty, or transfer learning [55]. These studies establish the promise of symbolic supervision, but do not reason through a shared probabilistic logic program whose proofs determine predictions. In DEEPWEAVE, neural outputs instantiate probabilistic predicates and symbolic rules contribute directly to training, inference, and explanation. The system additionally addresses how rules are constructed and validated, how multiple uncertain rules are aggregated, and how conflicts between neural and symbolic evidence are resolved through explicit coupling policies.

Conclusions

This paper presents DEEPWEAVE, a probabilistic neuro-symbolic NIDS that combines learned traffic patterns with validated symbolic rules through explicit coupling policies. Across packet-, flow-, and hybrid-views, DEEPWEAVE improves low-data detection and false-positive control, transfers useful knowledge across networks, and produces more stable explanations than post-hoc neural attributions. Despite the additional reasoning overhead, batching enables DEEPWEAVE to process the complete flow workload at 278.45 μs278.45\,\mu\mathrm{s} per flow, remaining substantially faster than the evaluated packet-native pipelines. Nevertheless, accuracy and robustness depend on the chosen coupling policy as symbolic reasoning cannot recover absent information. Overall, DEEPWEAVE demonstrates that explicit integration of logic into ML-based NIDS provide data-efficient, adaptable, and inspectable detection at practical computational cost.

Use of Generative AI

Generative AI tools – mainly GPT 5.6 – were used to improve the English language, clarity, and readability of the manuscript. Their use was limited primarily to grammar correction, sentence restructuring, and stylistic refinement. The authors developed the research methodology, implemented the system, conducted and interpreted the experiments, and wrote the substantive content of the manuscript. All AI-assisted text was reviewed, revised, and approved by the authors, who take full responsibility for the final content.

Additional DeepWeave Details

Detailed list of used features

Packet view

B.1.0.1 Packet view. As shown in Table 5, the packet view is restricted to 22 header fields readable at parsing time, with no payload inspection, so the detector remains applicable to encrypted traffic and can emit a verdict per packet without waiting for flow termination; address and timestamp columns are excluded from the model input to prevent identity and temporal leakage. Furthermore, using the standardized NetFlow-v3 version of the CSE-CIC-IDS2018 allows for a complete construction of the flow features proposed by the NetFlow-v3 through these 22 packet header features.

FeatureDescriptionFeatureDescription
ip.proto (c)IP protocol number (6 TCP, 17 UDP, . . . )ip.lenIP total length field
ip.ttlIP time-to-live valuetcp.seqTCP sequence number (relative)
ip.dsfield (c)IP differentiated-services field (DSCP/ECN)tcp.ackTCP acknowledgement number (relative)
frame.lenTotal captured frame length in bytestcp.lenTCP payload length in bytes
srcportTransport-layer source porticmp.type (c)ICMP message type
dstport (c)Transport-layer destination porticmp.code (c)ICMP message code
tcp.flags (c)TCP flags byte of the segmentdns.idDNS transaction identifier
tcp.window.size.valueAdvertised TCP receive window (unscaled)dns.qry.type (c)DNS query type (A, AAAA, MX, . . . )
tcp.hdr.lenTCP header length in bytesdns.resp.ttlTTL of the DNS answer record
udp.lengthUDP datagram length (header + payload)ftp.response.code (c)FTP server response code
frame.time.deltaInter-arrival time since previous packetframe.protocols (c)Protocol stack string (e.g. eth:ip:tcp:http)

Table 5. Packet-level feature set of the standardized CSE-CIC-IDS2018 view (22 per-packet header fields). Identifier and label columns (ip.src, ip.dst, frame.time_epoch, Attack) are excluded from the model input. Features marked (c) are treated as categorical.

Flow view

B.1.0.2 Flow view. As shown in Table 6, the flow view uses all 79 CICFlowMeter features proposed in the CIC-IDS2017 dataset: volumetric counts, packet-size and inter-arrival-time statistics per direction, TCP flag counts, and activity/idle timing. No manual feature selection is applied, resulting in a fair comparison with the machine-learning baselines (every model sees the same input) as well as SOTA models, and because the rule-mining stage performs its own feature selection, extracting a small interpretable subset as symbolic predicates while the neural branch consumes the full vector.

FeatureDescriptionFeatureDescription
Source Port (c)Transport-layer source portBwd IAT TotalSum of IATs between backward packets
Destination Port (c)Transport-layer destination portBwd IAT MeanMean backward IAT
Protocol (c)IP protocol number (6 TCP, 17 UDP, . . .)Bwd IAT StdStd. deviation of backward IAT
Flow DurationTime between first and last packetBwd IAT MaxMaximum backward IAT
Total Fwd PacketsPacket count, forward directionBwd IAT MinMinimum backward IAT
Total Backward PacketsPacket count, backward directionFwd PSH Flags (c)Forward packets with TCP PSH set
Total Length of Fwd PacketsSum of payload sizes, forwardBwd PSH FlagsBackward packets with TCP PSH set
Total Length of Bwd PacketsSum of payload sizes, backwardFwd URG Flags (c)Forward packets with TCP URG set
Fwd Packet Length MaxLargest packet size, forwardBwd URG FlagsBackward packets with TCP URG set
Fwd Packet Length MinSmallest packet size, forwardFwd Header LengthTotal header bytes, forward
Fwd Packet Length MeanMean packet size, forwardBwd Header LengthTotal header bytes, backward
Fwd Packet Length StdStd. deviation of packet size, forwardFwd Packets/sForward packet rate
Bwd Packet Length MaxLargest packet size, backwardBwd Packets/sBackward packet rate
Bwd Packet Length MinSmallest packet size, backwardMin Packet LengthSmallest packet, both directions
Bwd Packet Length MeanMean packet size, backwardMax Packet LengthLargest packet, both directions
Bwd Packet Length StdStd. deviation of packet size, backwardPacket Length MeanMean packet size, whole flow
Flow Bytes/sFlow byte rate, both directionsPacket Length StdStd. deviation of packet size, whole flow
Flow Packets/sFlow packet rate, both directionsPacket Length VarianceVariance of packet size, whole flow
Flow IAT MeanMean IAT between consecutive flow packetsFIN Flag Count (c)Packets with FIN set
Flow IAT StdStd. deviation of flow IATSYN Flag Count (c)Packets with SYN set
Flow IAT MaxMaximum flow IATRST Flag Count (c)Packets with RST set
Flow IAT MinMinimum flow IATPSH Flag Count (c)Packets with PSH set
Fwd IAT TotalSum of IATs between forward packetsACK Flag Count (c)Packets with ACK set
Fwd IAT MeanMean forward IATURG Flag Count (c)Packets with URG set
Fwd IAT StdStd. deviation of forward IATCWE Flag Count (c)Packets with CWE set
Fwd IAT MaxMaximum forward IATECE Flag Count (c)Packets with ECE set
Fwd IAT MinMinimum forward IATDown/Up RatioDownload-to-upload packet ratio
Average Packet SizeMean size over all packetsSubflow Bwd BytesMean byte count per backward subflow
Avg Fwd Segment SizeMean payload (segment) size, forwardInit_Win_bytes_forwardTCP initial window announced forward
Avg Bwd Segment SizeMean payload (segment) size, backwardInit_Win_bytes_backwardTCP initial window announced backward
Fwd Avg Bytes/BulkMean bytes per bulk burst, forwardact_data_pkt_fwdForward packets with ≥1\ge1 byte of TCP payload
Fwd Avg Packets/BulkMean packets per bulk burst, forwardmin_seg_size_forwardMinimum segment (header) size, forward
Fwd Avg Bulk RateMean bulk transfer rate, forwardActive MeanMean active time before going idle
Bwd Avg Bytes/BulkMean bytes per bulk burst, backwardActive StdStd. deviation of active time
Bwd Avg Packets/BulkMean packets per bulk burst, backwardActive MaxMaximum active time
Bwd Avg Bulk RateMean bulk transfer rate, backwardActive MinMinimum active time
Subflow Fwd PacketsMean packet count per forward subflowIdle MeanMean idle time before becoming active
Subflow Fwd BytesMean byte count per forward subflowIdle StdStd. deviation of idle time
Subflow Bwd PacketsMean packet count per backward subflowIdle MaxMaximum idle time

Table 6. Flow-level feature set of the CIC-IDS2017 view (79 CICFlowMeter features). Durations and inter-arrival times (IAT) are in microseconds; Fwd denotes the direction of the flow’s first packet, Bwd the reverse. Features marked (c) are treated as categorical.

Hybrid View

B.1.0.3 Hybrid View. As shown in Table 7, the hybrid view follows the 49 features of the NetFlow-v3 schema of the standardized datasets but are computed incrementally from the packet stream itself, per bidirectional 5-tuple. This gives the hybrid model the aggregate context that single packets lack (directional volumes, durations, retransmission and inter-arrival statistics) while preserving streaming semantics.

FeatureDescriptionFeatureDescription
L4_SRC_PORTSource port of the flow’s first packetSRC_TO_DST_AVG_THROUGHPUTAverage throughput in, bits per second
L4_DST_PORTDestination port of the flow’s first packetDST_TO_SRC_AVG_THROUGHPUTAverage throughput out, bits per second
PROTOCOLIP protocol number of the flowNUM_PKTS_UP_TO_128_BYTESPackets with frame length ≤128 bytes
L7_PROTOApplication protocol code (from protocol stack, well-known-port fallback)NUM_PKTS_128_TO_256_BYTESPackets with frame length 129–256 bytes
IN_BYTESTotal bytes, client to serverNUM_PKTS_256_TO_512_BYTESPackets with frame length 257–512 bytes
IN_PKTSTotal packets, client to serverNUM_PKTS_512_TO_1024_BYTESPackets with frame length 513–1024 bytes
OUT_BYTESTotal bytes, server to clientNUM_PKTS_1024_TO_1514_BYTESPackets with frame length 1025–1514 bytes
OUT_PKTSTotal packets, server to clientTCP_WIN_MAX_INMaximum TCP window advertised in
TCP_FLAGSCumulative OR of TCP flags, whole flowTCP_WIN_MAX_OUTMaximum TCP window advertised out
CLIENT_TCP_FLAGSCumulative OR of TCP flags, inICMP_TYPEICMP type and code (type × 256 + code)
SERVER_TCP_FLAGSCumulative OR of TCP flags, outICMP_IPV4_TYPEICMP type alone
FLOW_DURATION_MILLISECONDSTime between first and last packetDNS_QUERY_IDDNS transaction identifier
DURATION_INDuration of the in packet streamDNS_QUERY_TYPEDNS query type
DURATION_OUTDuration of the out packet streamDNS_TTL_ANSWERTTL of the DNS answer record
MIN_TTLMinimum IP TTL in the flowFTP_COMMAND_RET_CODEFTP server response code in the flow
MAX_TTLMaximum IP TTL in the flowSRC_TO_DST_IAT_MINMinimum packet IAT, in
LONGEST_FLOW_PKTLargest frame length in the flowSRC_TO_DST_IAT_MAXMaximum packet IAT, in
SHORTEST_FLOW_PKTSmallest frame length in the flowSRC_TO_DST_IAT_AVGMean packet IAT, in
MIN_IP_PKT_LENSmallest IP total length in the flowSRC_TO_DST_IAT_STDDEVStd. deviation of packet IAT, in
MAX_IP_PKT_LENLargest IP total length in the flowDST_TO_SRC_IAT_MINMinimum packet IAT, out
SRC_TO_DST_SECOND_BYTESByte rate in, over in-stream durationDST_TO_SRC_IAT_MAXMaximum packet IAT, out
DST_TO_SRC_SECOND_BYTESByte rate outDST_TO_SRC_IAT_AVGMean packet IAT, out
RETRANSMITTED_IN_BYTESRetransmitted bytes, in (repeated TCP sequence numbers)DST_TO_SRC_IAT_STDDEVStd. deviation of packet IAT, out
RETRANSMITTED_IN_PKTSRetransmitted packets, in
RETRANSMITTED_OUT_BYTESRetransmitted bytes, out
RETRANSMITTED_OUT_PKTSRetransmitted packets, out

Table 7. Flow-level feature set of the hybrid view on the standardized CSE-CIC-IDS2018 data (49 NetFlow-v3-schema features, computed online from the packet stream per bidirectional 5-tuple). In denotes the client-to-server direction, out the reverse; durations and inter-arrival times (IAT) are in milliseconds.

Algorithm for automatic rule construction

Algorithm 1 gives the full offline rule-mining pipeline, with the concrete thresholds used in the experiments. The four stages – scoring, calibration, program assembly, and soft rewrite – run entirely on the scoring reference pool.

Candidate-generation configuration. In our experiments, atomic predicates are ranked by validation performance, and the search is restricted to the 40 highest-ranked candidates for each attack class. Predicates with fewer than 10 validation true positives are excluded. The pipeline evaluates non-redundant conjunctions of up to three predicates and applies the same minimum-support requirement to each conjunction. To bound construction cost, it emits at most 5,000 candidate conjunctions and terminates the search after 120 seconds. The predicate budget, rule length, support threshold, candidate limit, and time limit are configurable parameters rather than fixed properties of DEEPWEAVE. Table 8 features the criteria used for assigning a role for each candidate rule. A candidate that failed its role gate, stability requirement, schema check, or provenance check is rejected. For an accepted rule, the rule strength (i.e. its initial learnable probability weight) is set to its validation precision, clipped to the interval [0.05,0.99][0.05, 0.99].

Proposed RoleAcceptance criteria on validation set
SufficientPrecision ≥ 0.90 and FPR ≤ 0.015
HelperRecall ≥ 0.35 and FPR ≤ 0.050
DisqualifierPrecision ≥ 0.90 and FPR ≤ 0.020

Table 8. Shared validation gates for assigning roles to generated rules.

Hyperparameter settings for rule construction. The rule miner ranks features separately for each attack-versus-benign comparison and retains the 12 highest-ranked stable features. A feature is stable when its validation score is at least 0.50, its construction-to-validation score gap is below 0.20, and its rank shifts by at most five positions. The ranking combines the Kolmogorov-Smirnov statistic, Cliff’s delta, Hellinger distance, AUC, Cramér’s VV, and total variation distance with weights 0.30, 0.20, 0.20, 0.20, 0.05, and 0.05, respectively; weights are renormalized when a statistic does not apply.

Numeric predicates use lower-tail quantiles QL={0.001,0.003,0.005,0.03,0.10,0.30}Q_L = \{0.001, 0.003, 0.005, 0.03, 0.10, 0.30\} and upper-tail quantiles QU={0.80,0.90,0.97,0.995,0.997,0.999}Q_U = \{0.80, 0.90, 0.97, 0.995, 0.997, 0.999\}, including intervals between adjacent quantiles. A categorical value is retained when it occurs in the target class and its non-target occurrence rate is below 0.02.

Optimization Hyperparameters

Table 9 reports the parameters used in the experiments. We selected them through a two-stage search on the CIC-IDS2017 validation split. The first stage fixed training at five epochs and evaluated the 24 combinations

ComponentConfiguration
Neural modelMLP: 256–128–64
Activation and dropoutReLU, 0.3
OptimizerAdam
Neural learning rate3×10−33 \times10^{-3}
Rule-weight learning rate3×10−33 \times10^{-3}
Predicate learning rate1×10−31 \times10^{-3}
Training batch size8
Inference batch size8192
Initial predicate steepness50
Temperature schedule1.0→0.51.0 \rightarrow0.5

Table 9. Fixed DEEPWEAVE implementation parameters.

b∈{8,16,32},ηNN,ηDPL,ηpred∈{10−3,3×10−3},(11)b \in\{8,16,32\}, \qquad\eta_{\mathrm{NN}},\eta_{\mathrm{DPL}},\eta_{\mathrm{pred}} \in\{10^{-3}, 3 \times10^{-3}\}, \tag*{(11)}

where bb is the batch size and the three learning rates control the neural network, probabilistic logic parameters, and soft-predicate networks. We ranked each configuration by

S=F1,macro−0.5 FPRattack−0.25 σ(F1,macro).S = F_{1,\mathrm{macro}} - 0.5\,\mathrm{FPR}_{\mathrm{attack}} - 0.25\,\sigma(F_{1,\mathrm{macro}}).

The selected configuration, b=8b = 8, ηNN=ηDPL=3×10−3\eta_{\mathrm{NN}} = \eta_{\mathrm{DPL}} = 3 \times10^{-3}, and ηpred=10−3\eta_{\mathrm{pred}} = 10^{-3}, obtained 0.835 macro-F1, 0.030 attack FPR, and a selection score of 0.820.

The second stage fixed this configuration and compared E∈{5,10,25,50}E \in\{5, 10, 25, 50\} epochs over five replicates. The corresponding macro-F1 scores were 0.906 ± 0.004, 0.895 ± 0.025, 0.904 ± 0.018, and 0.891 ± 0.028. None differed significantly from the ten-epoch configuration, which we retained as a conservative balance between convergence and cost.

Algorithm 1 Offline symbolic-rule mining

Require: training/scoring pool SS, validation split VV, attack classes A\mathcal{A}, top count K=12K = 12, statistic weights ww Ensure: DeepProbLog program Π\Pi

  1. R←∅\mathcal{R} \leftarrow\varnothing

  2. for all attack a∈Aa \in\mathcal{A} do

  3. for all candidate feature ff eligible for the symbolic vocabulary do

  4. compute KS, Cliff’s δ\delta, Hellinger, folded AUC (numeric) or Cramer’s V, TVD, categorical AUC (categorical) on SS for aa versus benign

  5. score⁡(f,a)←\operatorname{score}(f,a) \leftarrow weighted mean of the per-attack min-max normalised statistics, using ww

  6. end for

  7. Fa←F_a \leftarrow top-KK features of aa by score⁡(⋅,a)\operatorname{score}(\cdot,a), each carrying its predicate hint (quantile tier or category)

  8. Ca←C_a \leftarrow candidate rule bodies: each top feature alone, plus short conjunctions of their hint predicates

  9. for all candidate body c∈Cac \in C_a do

  10. measure precision pp, recall rr, benign FPR ϕ\phi of cc on VV; measure ptrp_{\mathrm{tr}}, ϕtr\phi_{\mathrm{tr}} on SS

  11. stable←(ptr−p≤0.20)∧(ϕtr−ϕ≤0.05)\mathit{stable} \leftarrow(p_{\mathrm{tr}} - p \le0.20) \land(\phi_{\mathrm{tr}} - \phi\le0.05) {drop rules selective only on mining data}

  12. if stable∧p≥0.90∧ϕ≤0.015\mathit{stable} \land p \ge0.90 \land\phi\le0.015 then

  13. \operatorname{role}(c) \leftarrow\textsc{Sufficient} {may support aa on its own}

  14. else if stable∧r≥0.35∧ϕ≤0.050\mathit{stable} \land r \ge0.35 \land\phi\le0.050 then

  15. \operatorname{role}(c) \leftarrow\textsc{Helper} {fires only behind the neural prediction}

  16. else if stable∧p≥0.90∧ϕ≤0.020\mathit{stable} \land p \ge0.90 \land\phi\le0.020 on a rival class then

  17. \operatorname{role}(c) \leftarrow\textsc{Disqualifier}

  18. else

  19. discard cc

  20. end if

  21. R←R∪{c}\mathcal{R} \leftarrow\mathcal{R} \cup\{c\}

  22. end for

  23. end for

  24. group each class’s sufficient and helper rules into per-class pockets; wrap pockets in learnable predicates t(p)::symbolic_a_sufficient(X)t(p) :: \mathit{symbolic\_a\_sufficient}(X) whose initial pp is the calibrated confidence

  25. attach the query head classify/2\mathit{classify}/2 for the configured coupling; emit hard externals

  26. rewrite each hard external to its soft module and split multi-threshold bodies into single-external helpers

  27. return Π\Pi

Effect of vectorized inference on DeepWeave

The initial evaluator invoked the DeepProbLog solving path for each flow, repeating symbolic traversal and framework overhead even though all queries shared an arithmetic circuit. The optimized evaluator instead stacks the neural-leaf values of multiple queries and evaluates the shared circuit once per batch.

The diagnostic measured query construction, neural-predicate evaluation, symbolic solving, and answer decoding on 1,000 held-out CIC-IDS2017 flows. Three matched executions used a batch size of one for the original evaluator and 1,024 for the optimized evaluator. Training, backpropagation, feature preprocessing, and packet-to-flow assembly were excluded.

EvaluatorBatch sizeTime (s) [IQR]μ\mus/flowFlows/sSpeedupAgreement
Original DEEPWEAVE111.781 [11.646, 11.797]11,781.084.91.0×100%
Optimized DEEPWEAVE1,0240.440 [0.405, 0.443]439.62,274.926.8×100%

Table 10. Matched-checkpoint comparison of the original per-flow DEEPWEAVE evaluator and the optimized vectorized evaluator on 1,000 held-out CIC-IDS2017 flows.

Table 10 reports a reduction in median runtime from 11.781 to 0.440 seconds. The effective cost falls from 11,781.0 to 439.6 μ\mus per flow, while throughput increases from 84.9 to 2,274.9 flows per second. This corresponds to a 26.8× evaluator speedup and a 96.27% runtime reduction for the tested workload.

The same checkpoint produced identical predictions for all 1,000 flows. Vectorization therefore changes execution without changing the classifier output.

Packet, Flow and Hybrid Extensive Results

Detection Performance and Efficiency Extensive results

This section reports the training-size sweep for the packet, flow, and hybrid views. We compare multiclass macro-F1 (MF1), attack false-positive rate (FPR), and detection rate (DR), and measure data efficiency by the labelled budget kk needed to reach a given MF1.

Packet view

Table 11 shows the largest gains at small training sizes. At k=50k = 50, Anchored, Deferred, and Guarded reach 0.977, 0.951, and 0.924 MF1, respectively, compared with 0.632 for the neural baseline, 0.811 for HGB, and 0.884 for the random forest. These three couplings already exceed the neural baseline’s best result of 0.869 at k=10000k = 10000. They therefore reach the same performance level with 50 rather than 10,000 labelled examples per attack class, corresponding to a 200× reduction in required training data. The gap narrows with more labels: the random forest reaches 0.995 MF1 at k=5000k = 5000, while Anchored and Deferred reach 0.985 and 0.974.

The coupled models also maintain low FPR. Anchored records 0.001 at k=50k = 50 and values that round to zero thereafter, while Deferred, Guarded, and Hard Gate remain at or below 0.008. Most methods already attain high DR, so differences in FPR and attack-family assignment account for most of the MF1 gap. Suricata illustrates this distinction: dataset-specific rules raise its DR from 0.184 to 0.868, but its FPR remains 0.280.

Flow view

The flow results in Table 12 strengthen this low-data pattern. At k=50k = 50, Guarded, Anchored, and Hard Gate obtain MF1 scores of 0.849, 0.833, and 0.838, compared with 0.595 for the neural baseline and 0.574 for HGB. All three exceed the neural baseline’s best sweep result of approximately 0.79 at k=10000k = 10000, again reducing the equivalent labeled budget from 10,000 to 50 examples per attack class. Neither component produces this result alone, as the symbolic baseline remains between approximately 0.58 and 0.66, so neither branch alone explains the coupled result.

At the largest budget, however, HGB reaches 0.936 MF1 and exceeds the gated variants, which lie between 0.921 and 0.925.

The gated policies keep FPR at or below 0.014 while maintaining DR near 0.90 to 1.00. Logistic regression also detects many attacks, but its FPR remains between approximately 0.22 and 0.28. Safety Net is the main exception among the coupled models: its permissive rescue path raises FPR to roughly 0.02 to 0.08. The flow-view advantage therefore comes from combining high detection with low FPR and correct family assignment.

Hybrid view

Table 13 combines packet and flow neural evidence with predicates from both views. A DEEPWEAVE policy leads at every training size, although the best policy varies with kk. Deferred leads at k=50k=50 and k=500k=500, Product of Experts (PoE) at k=100k=100, 250250, 25002500, and 50005000, Hard Gate at k=1000k=1000, and Safety Net at k=10000k=10000. At k=50k=50, Deferred reaches 0.870 MF1, compared with 0.782 for the neural product and 0.827 for calibrated DST-IDS fusion. PoE reaches 0.978 at k=250k=250 and 0.985 at k=5000k=5000. By k=10000k=10000, Safety Net reaches 0.983, only 0.006 above the neural product and 0.010 above DST-IDS.

Policy choice has a larger effect on hybrid FPR. Anchored reaches 0.003 at k=50k=50, but rises to 0.048 to 0.096 at several larger budgets when evidence from either view can trigger an alert. PoE, Guarded, Same-Class Boost, and Hard Gate are generally better controlled. At k=10000k=10000, Safety Net combines 0.983 MF1 and 0.998 DR with an FPR of 0.007, compared with 0.001 for the neural product. Its small MF1 gain therefore carries a small false-alert cost.

Cross-view assessment

The packet and flow sweeps show that symbolic predicates provide useful class structure before the neural models have seen enough examples to learn the same distinctions. The 20× comparison concerns performance-equivalent label budgets, not training time or uniform improvement at every operating point. The effect is smaller in the hybrid view because its neural baseline already combines complementary packet and flow representations.

The benefit also depends on the policy and the quality of the predicates. Strict policies control FPR but may suppress correct neural predictions when symbolic support is incomplete, whereas permissive policies preserve detection at the cost of more false alarms. At large budgets, HGB leads in the flow view, the packet random forest matches or exceeds the strongest couplings, and the hybrid baselines close most of the gap. The results therefore support a bounded conclusion: DEEPWEAVE is most useful when labels are scarce, while its high-data benefit depends on how the coupling handles incomplete or inaccurate symbolic evidence.

Threshold-free Detection Performance

The preceding results use a fixed operating threshold. To separate ranking quality from threshold selection, we compare DEEPWEAVE with two unsupervised detectors in a one-versus-benign setting. ROC-AUC measures rank separation independently of prevalence, whereas the PR-AUC baseline depends on attack-family prevalence and is more demanding for rare families. DEEPWEAVE uses P(family)P(\mathrm{family}) as its score; the unsupervised systems use their native anomaly scores.

The systems retain their native test bases: DEEPWEAVE and KnowML+KitNET use a held-out 20% split of 565,525 flows, while faithful Kitsune uses the streamed Tuesday–Friday original captures. The comparison therefore concerns family-level separation rather than identical test instances.

Per-class Detection Performance. Figure 7 shows that DEEPWEAVE separates all five families, with ROC-AUC between 0.997 and 1.000. PR-AUC remains 0.818 for web attacks and 0.674 for bot traffic despite their low prevalence, indicating that the lower precision-recall scores mainly reflect class imbalance.

Figure 7. Per-family threshold-free detection quality on CIC-IDS2017 flow: ROC-AUC (left) and PR-AUC (right), each attack family scored one-versus-benign. The dashed line marks chance (ROC-AUC = 0.5); bars below it are anti-correlated with the attack.

The unsupervised detectors have complementary blind spots. Faithful Kitsune performs well on DoS and PortScan but is near or below chance on web attacks, bot traffic, and brute force. FTP-Patator is its clearest failure (ROC-AUC 0.045), as the anomaly score ranks attacks below benign traffic. KnowML+KitNET separates DoS, web attacks, and brute force, but fails on PortScan (0.210) and is only slightly above chance on bot traffic (0.594). Since both baselines use KitNET, their different failures point to the feature representation. Neither covers all five families.

Overall Discrimination. Figure 8 pools all attacks against benign traffic. DEEPWEAVE reaches 0.996 ROC-AUC, compared with 0.962 for KnowML+KitNET and 0.890 for faithful Kitsune. Abundant volumetric attacks narrow the pooled gap and conceal some family-level failures. ROC-AUC provides the safer cross-system comparison because attack prevalence differs across the evaluations (0.20, 0.28, and 0.40); PR-AUC should be interpreted within each system.

Overall ROC-AUC and precision–recall curves

Figure 8. Overall pooled attack-versus-benign ROC (left) and precision–recall (right) curves, one per system. Prevalence differs per system and is annotated on the precision–recall panel.

Additional Adversarial Robustness Results

Table 14 provides a detailed view of the Attack success rate (ASR) per attack class.

Additional Explainability Results

Additional Explanation Visualization.

Proof-path coverage. Coverage measures the fraction of attack alerts whose decision can be attributed to at least one named symbolic clause. We evaluate coverage on CIC-IDS2017 flow traffic and NF-CSE-CIC-IDS2018-v3 packet traffic. The packet setting is particularly informative because its coupling retains an open neural path, allowing the model in principle to raise an attack alert without using a symbolic rule.

Figure 10a separates alerts decided by standalone sufficient rules, neural helper rules, and the neural path alone. Guarded coupling attributes every attack alert to a rule by construction. Under Anchored coupling, approximately three quarters of alerts are supported by standalone sufficient rules, while the remainder use neural-supported clauses. More importantly, the packet model produces no attack alerts through its open neural path alone, even though the architecture permits that outcome. Every observed alert is therefore associated with a named rule across the evaluated datasets and traffic views.

The composition of the explanations changes with the labelled-data budget. As shown in Figure 10b, sufficient rules account for 84.5% of attack alerts at k=5k = 5, compared with 46.3% at k=500k = 500. As the neural model receives more labelled examples, the model increasingly uses helper clauses that combine neural evidence with broader symbolic conditions. High-precision sufficient rules therefore dominate in the low-data setting, while neural-supported proofs become more prominent as the classifier improves.

Composition of attack-alert proof paths across coupling architectures and views

(a) Composition of attack-alert proof paths across coupling architectures and views.

Attack-alert proof composition across training sizes for CIC-IDS2017 flow traffic

(b) Attack-alert proof composition across training sizes for CIC-IDS2017 flow traffic.

Figure 10. DEEPWEAVE’s Attack-alert proof paths.

Clause fidelity. Coverage alone does not establish whether the deciding clause is reliable. We therefore measure each clause’s precision on held-out test traffic and the recall of the attack class it supports. Clause precision measures how often an alert attributed to the clause is correct, while class recall indicates whether high precision is obtained only by abstaining on most attacks. Table 15 shows that sufficient rules are highly selective, with test precision between 0.90 and 1.00. Helper clauses are intentionally broader and have precision between 0.59 and 0.97, which explains why their authority is conditioned on compatible neural evidence. Class recall remains between 0.80 and 0.99, indicating that the rule base does not obtain high precision simply by explaining a negligible fraction of attacks. The observed results therefore support both the role assignment and the decision to prevent lower-precision helper clauses from raising alerts independently.

ClauseRoleAlertsPrecisionRecall
Benign gateDisqualifier15,6250.9900.987
Bot sufficientSufficient820.9020.796
Bot helperHelper270.593
Brute-force helperHelper2450.7840.985
DoS sufficientSufficient2,4400.9930.964
DoS helperHelper2870.693
PortScan sufficientSufficient6050.9970.981
PortScan helperHelper5880.968
Web Attack sufficientSufficient1010.9900.877

Table 15. Clause fidelity for Guarded coupling on CIC-IDS2017 flow traffic at k=50k = 50.

Analyst-facing interpretation. We next examine whether the generated explanations can be expressed using traffic properties and attack behaviors familiar to an analyst. Table 16 translates representative clauses into plain-language descriptions and relates them to MITRE ATT&CK techniques. The mapping is an analyst interpretation of the recovered traffic conditions, not an automatically inferred ATT&CK classification.

ClauseAnalyst readingMITRE ATT&CK interpretationPrecision
Bot sufficientDestination port 8080 and forward-window tierT1071.001 Web Protocols0.90
Bot helperLow source port and small-payload tiersT1071 Application Layer Protocol / T1573 Encrypted Channel0.59
Brute-force helperDestination port 21 or 22 and minimum-segment tierT1110.001 Password Guessing0.78
DoS sufficientDestination port 80 and backward-length varianceT1499 Endpoint Denial of Service0.99
DoS sufficientDestination port 80 and FIN flagT1499.002 Service Exhaustion Flood0.99
DoS sufficientDestination port 80, ACK-only traffic, and very short inter-arrival timeT1499 Endpoint Denial of Service0.99
PortScan sufficientHigh backward-packet rate and default forward-window tierT1046 Network Service Discovery1.00
PortScan helperSmall packets and near-zero flow durationT1046 Network Service Discovery0.97
Web Attack sufficientRegular forward inter-arrival time and minimal payloadT1190 Exploit Public-Facing Application0.99

Table 16. Representative CIC-IDS2017 clauses and their analyst-assigned MITRE ATT&CK interpretations.

The recovered conditions align with recognizable behaviors, including web-based command and control, credential guessing, denial-of-service floods, service discovery, and exploitation of public-facing applications. These clauses are generated from feature statistics and validation behavior rather than manually authored attack descriptions. Their correspondence with documented behavior suggests that the construction pipeline can recover analyst-meaningful conditions.

This interpretation has two limitations. First, helper clauses are broader and less reliable than sufficient clauses by design. Second, some conditions, particularly port values, reflect the evaluated captures and may not generalize to different deployments. Timing, flag, size, and directional relationships often describe the attack shape more generally, but the mining procedure does not guarantee that every retained rule will correspond cleanly to a documented technique. The results should therefore be interpreted as evidence of structural interpretability rather than a substitute for analyst validation.

Stability across training replicates. A useful explanation should remain stable when the model is retrained on different samples from the same distribution. We train five replicates using a fixed test set and measure how often they produce the same explanation for each observation. For DEEPWEAVE, agreement means selecting the same winning clause. For the neural baseline, agreement means selecting the same highest-ranked feature using Integrated Gradients or SHAP.

Figure 11a shows that the symbolic winning clause agrees across replicates for 96.4% of observations. When all replicates also agree on the predicted label, clause agreement rises to approximately 99.9%. Integrated Gradients selects the same top feature for 24.3% of observations, while SHAP does so for 18.8%. Even top-three agreement reaches only 62% and 52%, respectively. Thus, the symbolic explanations are substantially less sensitive to training variation than post-hoc feature rankings.

This stability varies by attack family. Web Attack, benign traffic, and PortScan obtain agreement of 1.00, 0.99, and 0.98, respectively. Bot obtains only 0.54, consistent with its smaller test support and the presence of competing sufficient and helper proofs. Classes with selective, high-precision sufficient rules therefore also produce the most stable explanations.

Explanation agreement of explainability methods across five CIC-IDS2017 training replicates

(a) Explanation agreement of explainability methods across five CIC-IDS2017 training replicates

Per-class agreement of symbolic winning clauses across replicates

(b) Per-class agreement of symbolic winning clauses across replicates

Figure 11. Explanation stability of DEEPWEAVE

Contrast with neural attribution. Table 17 illustrates the aggregate findings using representative observations. The comparison places the winning DEEPWEAVE clause beside Integrated Gradients and SHAP attributions for the neural baseline on the same traffic sample.

True classDeepWeaveIntegrated GradientsSHAP
BotDestination port 8080 and forward initial-window tierDestination Port; neural prediction: benignSource Port
Brute ForceDestination port 21 and minimum-segment-size tierForward PSH Flags; neural prediction: benignForward PSH Flags
DoSDestination port 80 and backward-packet-length variancePacket Length Variance; neural prediction: DoSPacket Length Variance
PortScanBackward packets/s and forward initial-window tierDestination Port; neural prediction: PortScanTotal Backward Packets

Table 17. Intrinsic symbolic explanations and post-hoc neural attributions on representative CIC-IDS2017 flow observations.

The symbolic explanation identifies the concrete conditions and thresholds that participated in the decision. The attribution methods instead produce feature rankings whose leading feature often changes across replicates. For Bot and Brute Force, the neural baseline predicts benign, so its attribution explains a missed detection rather than the correct attack label. DEEPWEAVE’s proof explains the attack decision that the model actually made.

The DoS case demonstrates that the two explanation types can agree when the neural decision is stable. Both neural attribution methods emphasize packet-length variance, while the symbolic proof contains the corresponding packet-length condition. The largest contrast therefore occurs on uncertain observations, where the neural baseline and its post-hoc explanations are least stable and where explicit proof evidence is most valuable.

Summary. DEEPWEAVE provides named proof paths for all observed attack alerts in the evaluated settings. High-precision sufficient clauses yield reliable and stable explanations, while broader helper clauses contribute only with neural agreement. Many recovered clauses correspond to recognizable attack behaviors, although dataset-specific conditions still require analyst scrutiny. Compared with neural feature attribution, the symbolic explanations are more stable across retraining and describe the computation supporting the predicted class rather than approximating it after the decision.

Additional Computational Efficiency Results

Table Table 18 reports inference, memory, and training costs under the vectorized evaluator for six programs, from the rule-free L0 classifier to the Anchored-tiered (i.e. multiple quantiles per feature) L5 model. Each configuration is executed five times on CIC-IDS2017 flow data at k=500k = 500, with the test set, hardware, and evaluation batch size of 1,024 fixed.

ProgramNeural leavesSDD edgesThroughput (flows/s)Latency (ms/flow)Eval. RSS (MB)Train (s/epoch)
L0 neural-only126753,9640.01942,283.11.42
L1 single Anchored333320,3170.04932,200.32.56
L2 gated85386,9930.14311,408.85.95
L3 gated + numeric104845,9480.16961,493.98.09
L4 tiered104845,7490.1819583.613.32
L5 Anchored-tiered154613,9190.2707929.232.85

Table 18. System cost across six symbolic-program configurations on CIC-IDS2017 flow data at k=500k = 500. Peak RSS covers the complete evaluation process.

Figure 12a relates inference throughput to neural-leaf count: from L0 to L5, throughput falls from 53,964 flows per second and latency rises from 0.0194 to 0.2707 ms per flow. In contrast, Figure 12b shows the increase in training cost. L3 and L4 share ten neural leaves and 484 SDD edges, so their throughput differs by only 3.5%, yet training rises from 8.09 to 13.32 seconds per epoch. Tiered predicates (i.e. multiple quantiles per numerical feature) therefore affect training more than inference.

Inference throughput against neural-leaf countTraining time per epoch against rule-clause count

Figure 12. (a) Inference throughput against neural-leaf count. (b) Training time per epoch against rule-clause count. DEEPWEAVE inference throughput (left) and training time (right) with increasing complexity.

Figure 13 shows that compiled size peaks at 538 SDD edges at L2 before falling to 461 at L5. RSS is not a circuit-size proxy because it covers the complete process. Leaf count, circuit size, and tiered predicates therefore remain distinct costs; their absolute values are specific to the Apple M3 system used here.

Compiled SDD size across the six program rungs

Figure 13. Compiled SDD size across the six program rungs.

Automatic Rule Generation

Rule Generation Approaches

The pipeline supports three sources of candidate rules.

Scenario A derives rules from labelled traffic. For each attack class, it ranks features by their separation from benign or non-target traffic, instantiates numeric and categorical predicates, and forms short conjunctions. Identifiers, timestamp-derived attributes, constant features, and other disallowed variables are removed before candidates enter the common Rule IR.

Scenario B converts expert knowledge into dataset-compatible rules. MITRE ATT&CK techniques are expressed as network-observable behaviours and mapped to available features. Thresholds and categorical values are instantiated from the construction reference, and each mapping records whether the behaviour is fully, partially, or not observable. Claims that require unavailable temporal, payload, or cross-flow information are retained as documentation but not converted into predicates.

Scenario C asks an LLM to propose candidates from a fixed catalogue. The provider-neutral request supplies feature and rule schemas, class descriptions, complete feature rankings with directionality, construction and reference statistics, class-local literal catalogues, and the MITRE ATT&CK evidence used in Scenario B. The model may combine listed predicates but cannot introduce features, operators, or thresholds. It returns Rule IR JSON, and the pipeline rejects malformed or unsupported proposals before evaluation.

All three scenarios use the same validation and selection procedure. Candidates are rejected or assigned sufficient, helper, or disqualifier roles according to their precision, recall, FPR, and construction-to-validation stability. Pareto and firing-set filters remove dominated or near-duplicate rules, while per-class and per-role limits bound the shortlist. The coupling screen selects the final Rule IR, which is compiled deterministically into Prolog.

Generation pipeline hyperparameters. Shared parameters define the role gates, permitted stability gaps, redundancy threshold, shortlist limits, validation FAR budgets, screening depth, and final rule budget. These settings govern validation and selection rather than candidate generation.

Scenario-specific parameters only bound how each candidate pool is constructed. Scenario A configures feature ranking, quantile grids, categorical-value filters, conjunction length, support requirements, and search limits. Scenario B selects the expert profile, ATT&CK-to-feature mappings, template expansion rules, and proposal limits. Scenario C records the provider, model, structured request, supplied evidence, literal catalogue, output limits, and supported decoding settings. In every case, candidates must satisfy the same role and stability gates before they can enter the final program.

Rule sourceMacro-F1AccuracyDetectionFAR (%)
Scenario A: data-driven0.43000.90450.51710.0627
Scenario B: expert/MITRE0.43990.93960.70160.2080
Scenario C: Codex0.76710.94810.76910.7820
Scenario C: Claude0.70330.91980.61770.6032
Existing Rules (Guarded)†0.84080.98360.96481.1640

Table 19. CIC-IDS2017 fully automated rule generation results at k=500k = 500, one replicate, using Guarded coupling. Note: Macro-F1 covers benign and five attack classes. †The existing Guarded system is a historical baseline, not a fourth generation arm. Generated-arm results use one replicate.

Scenario Performance

Experiment hyperparameters. All scenarios emit the same Rule IR and use shared validation gates. Each arm starts from the same neural checkpoint and independently optimizes its neural and differentiable rule parameters under Guarded coupling with soft predicates. Shared gates require sufficient-rule precision/FPR of 0.90/0.015, helper recall/FPR of 0.35/0.05, and disqualifier precision/FPR of 0.90/0.02. Construction-to-validation precision and FPR gaps are limited to 0.20 and 0.05. Rules contain at most three literals. The shortlist retains 32 candidates per class and role, removes firing sets with Jaccard similarity above 0.98, and passes at most 12 rules to the coupling screen. Validation macro-F1 selects checkpoints under an active 1% FAR budget.

Scenario A retains the 12 highest-ranked stable features per attack-versus-benign contrast. Its ranking combines the Kolmogorov-Smirnov statistic, Cliff’s delta, Hellinger distance, AUC, Cramer’s VV, and total variation distance with weights 0.30, 0.20, 0.20, 0.20, 0.05, and 0.05. Numeric predicates use lower quantiles {0.001, 0.003, 0.005, 0.03, 0.10, 0.30} and upper quantiles {0.80, 0.90, 0.97, 0.995, 0.997, 0.999}. Conjunctions draw from the 40 highest-ranked predicates and are limited to 5,000 candidates, 120 seconds, and 10 validation true positives. The process generated 19,326 candidates and retained 12.

Scenario B uses the semantic-v4 expert profile and numeric quantiles {0.05, 0.25, 0.50, 0.75, 0.95}. Its 15 templates contain at most three literals and emit at most 4,096 candidates, with categorical search limited to 31 subsets.

Scenario C uses a structured request containing complete feature rankings, construction and reference statistics, class-local literal catalogues, and Scenario B’s MITRE ATT&CK evidence. Claude proposed 20 candidates and validation retained 10 helpers; Codex proposed seven and retained all seven. The corrected matcher equates integral integer and floating-point categorical values, allowing numeric port literals to match the dataset.

Automated Generation Results. Table XVIII reports the results after independent end-to-end optimization from a common checkpoint. Codex leads the automatic arms with 0.7671 macro-F1 and 0.7691 detection at 0.7820% FAR. Claude reaches 0.7033 macro-F1 and 0.6177 detection at 0.6032% FAR. Scenarios A and B reach 0.4300 and 0.4399 macro-F1, while the historical rules remain strongest at 0.8408.

References

  1. [1]Andrea Agiollo, Enkeleda Bardhi, Mauro Conti, Riccardo Lazzeretti, Eleonora Losiouk, and Andrea Omicini. Gnn4ifa: Interest flooding attack detection with graph neural networks. In 2023 IEEE 8th European Symposium on Security and Privacy (EuroS&P), pages 615–630. IEEE, 2023.DOI
  2. [2]Arwa Aldweesh, Abdelouahid Derhab, and Ahmed Z. Emam. Deep learning approaches for anomaly-based intrusion detection systems: A survey, taxonomy, and open issues. Knowledge-Based Systems, 189:105124, 2020.DOI
  3. [3]Daniel Arp, Erwin Quiring, Feargus Pendlebury, Alexander Warnecke, Fabio Pierazzi, Christian Wressnegger, Lorenzo Cavallaro, and Konrad Rieck. Dos and don’ts of machine learning in computer security. In 31st USENIX Security Symposium (USENIX Security 22), pages 3971–3988, 2022.
  4. [4]Tao Ban, Samuel Ndichu, Takeshi Takahashi, and Daisuke Inoue. Combat security alert fatigue with ai-assisted techniques. In Cyber Security Experimentation and Test Workshop, CSET ’21, pages 9–16. Association for Computing Machinery, 2021.DOI
  5. [5]Enkeleda Bardhi, Chenxing Ji, Ali Imran, Muhammad Shahbaz, Riccardo Lazzeretti, Mauro Conti, and Fernando Kuipers. O’mine: A novel collaborative ddos detection mechanism for programmable data-planes. In 2025 IEEE 10th European Symposium on Security and Privacy (EuroS&P), pages 771–788. IEEE, 2025.DOI
  6. [6]Diogo Barradas, Nuno Santos, Luís Rodrigues, Salvatore Signorello, Fernando MV Ramos, and André Madeira. Flowlens: Enabling efficient flow classification for ml-based network security applications. In NDSS, 2021.DOI
  7. [7]Alice Bizzarri, Brian Jalaian, Fabrizio Riguzzi, and Nathaniel D. Bastian. A neuro-symbolic artificial intelligence network intrusion detection system. In 2024 33rd International Conference on Computer Communications and Networks (ICCCN), pages 1–9, 2024.DOI
  8. [8]Alice Bizzarri, Chung-En Yu, Brian Jalaian, Fabrizio Riguzzi, and Nathaniel D. Bastian. A synergistic approach in network intrusion detection by neurosymbolic AI. arXiv preprint arXiv:2406.00938, 2024.arxiv.org/abs/2406.00938
  9. [9]Marco Cantone, Claudio Marrocco, and Alessandro Bria. Machine learning in network intrusion detection: A cross-dataset generalization study. IEEE Access, 12:144489–144508, 2024.DOI
  10. [10]Benoit Claise. Cisco systems netflow services export version 9. Technical report, 2004.DOI
  11. [11]Norman Cliff. Dominance statistics: Ordinal analyses to answer ordinal questions. Psychological Bulletin, 114(3):494–509, 1993.DOI
  12. [12]Luc De Raedt, Angelika Kimmig, and Hannu Toivonen. ProbLog: A probabilistic prolog and its application in link discovery. In Proceedings of the 20th International Joint Conference on Artificial Intelligence, pages 2462–2467, Hyderabad, India, 2007.
  13. [13]Lorenzo De Filippo, Enkeleda Bardhi, Andrea Agiollo, Alessandro Palma, Silvia Bonomi, and Fernando Kuipers. Beyond the syntax: Do security experts trust llms for nids rule engineering? arXiv preprint arXiv:2607.05916, 2026.
  14. [14]Yutao Dong, Qing Li, Kaidong Wu, Ruoyu Li, Dan Zhao, Gareth Tyson, Junkun Peng, Yong Jiang, Shutao Xia, and Mingwei Xu. HorusEye: A realtime IoT malicious traffic detection framework using programmable switches. In 32nd USENIX Security Symposium (USENIX Security 23), pages 571–588, Anaheim, CA, 2023. USENIX Association.
  15. [15]Mohamed El-Sherif, Ahmed Khattab, and Magdy El-Soudani. Intrusion detection using TCP/IP single packet header binary image for IoT networks. Cybersecurity, 8(1):104, 2025.DOI
  16. [16]Gints Engelen, Vera Rimmer, and Wouter Joosen. Troubleshooting an intrusion detection dataset: the cicids2017 case study. In 2021 IEEE Security and Privacy Workshops (SPW), pages 7–12. IEEE, 2021.DOI
  17. [17]Tom Fawcett. An introduction to ROC analysis. Pattern Recognition Letters, 27(8):861–874, 2006.DOI
  18. [18]Wandemberg Gibaut, Leonardo Pereira, Fabio Grassiotto, Alexandre Osorio, Eder Gadioli, Amparo Munoz, Sildolfo Gomes, and Claudio Filipi Goncalves dos Santos. Neurosymbolic AI and its taxonomy: A survey. arXiv preprint arXiv:2305.08876, 2023.DOI
  19. [19]Alison L. Gibbs and Francis Edward Su. On choosing and bounding probability metrics. International Statistical Review, 70(3):419–435, 2002.
  20. [20]Xin Fan Guo, Xinran Zheng, Albert Merono Penuela, Lorenzo Cavallaro, Sergio Maffeis, and Fabio Pierazzi. KnowML: Improving generalization of ML-NIDS with attack knowledge graphs. In IEEE European Symposium on Security and Privacy (EuroS&P), 2026.arxiv.org/abs/2506.19802
  21. [21]Mohammad Mehedi Hassan, Abdu Gumaei, Ahmed Alsanad, Majed Alrubaian, and Giancarlo Fortino. A hybrid deep learning model for efficient intrusion detection in big data environment. Information Sciences, 513:386–396, 2020.DOI
  22. [22]Ke He, Dan Dongseong Kim, and Muhammad Rizwan Asghar. Adversarial machine learning for network intrusion detection systems: A comprehensive survey. IEEE Communications Surveys & Tutorials, 25(1):538–566, 2023.DOI
  23. [23]J. L. Hodges. The significance probability of the smirnov two-sample test. Arkiv för Matematik, 3(5):469–486, 1958.DOI
  24. [24]Jordan Holland, Paul Schmitt, Nick Feamster, and Prateek Mittal. New directions in automated traffic analysis. In Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security, CCS ’21, pages 3366–3383, New York, NY, USA, 2021. Association for Computing Machinery.DOI
  25. [25]Neminath Hubbali and Vinoth Suryanarayanan. False alarm minimization techniques in signature-based intrusion detection systems: A survey. Computer Communications, 49:1–17, 2014.
  26. [26]Minhao Jin and Maria Apostolaki. Robustifying {ML-powered} network classifiers with {PANTS}. In 34th USENIX Security Symposium (USENIX Security 25), pages 7291–7310, 2025.arxiv.org/abs/2409.04691
  27. [27]Leon Kersten, Kim Beelen, Emmanuele Zambon, Chris Snijders, and Luca Allodi. A field study to uncover and a tool to support the alert investigation process of tier-1 analysts. In Proceedings of the Symposium on Usable Security and Privacy (USEC). Internet Society, 2025.DOI
  28. [28]Ansam Khraisat, Iqbal Gondal, Peter Vamplew, and Joarder Kamruzzaman. Survey of intrusion detection systems: Techniques, datasets and challenges. Cybersecurity, 2(1):1–22, 2019.DOI
  29. [29]Vinod Kumar and Om Prakash Sangwan. Signature based intrusion detection system using SNORT. International Journal of Computer Applications and Information Technology, 1(3), November 2012.
  30. [30]Max Landauer, Florian Skopik, and Markus Wurzenberger. Introducing a new alert dataset for multi-step attack analysis. In Proceedings of the 17th Cyber Security Experimentation and Test Workshop, CSET ’24, pages 41–53, New York, NY, USA, 2024. Association for Computing Machinery.DOI
  31. [31]Hung-Jen Liao, Chun-Hung Richard Lin, Ying-Chih Lin, and Kuang-Yuan Tung. Intrusion detection system: A comprehensive review. Journal of Network and Computer Applications, 36(1):16–24, 2013.DOI
  32. [32]Majed Luay, Siamak Layeghy, Mohanad Sarhan, Sayedehfaezeh Hosseinoorbin, Nour Moustafa, and Marius Portmann. NF-ToN-IoT-v3. Dataset, 2025. NetFlow-based network intrusion detection dataset.DOI
  33. [33]Scott M. Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.arxiv.org/abs/1705.07874
  34. [34]Robin Manhaeve, Sebastijan Dumančić, Angelika Kimmig, Thomas Demeester, and Luc De Raedt. DeepProbLog: Neural probabilistic logic programming. In Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.arxiv.org/abs/1805.10872
  35. [35]Robin Manhaeve, Sebastijan Dumančić, Angelika Kimmig, Thomas Demeester, and Luc De Raedt. Neural probabilistic logic programming in deepproblog. Artificial Intelligence, 298:103504, 2021.arxiv.org/abs/1907.08194
  36. [36]Giuseppe Marra, Sebastijan Dumančić, Robin Manhaeve, and Luc De Raedt. From statistical relational to neurosymbolic artificial intelligence: A survey. Artificial Intelligence, 328:104062, 2024.arxiv.org/abs/2108.11451
  37. [37]Giuseppe Marra, Francesco Giannini, Michelangelo Diligenti, and Marco Gori. LYRICS: A general interface layer to integrate logic inference and deep learning. In Machine Learning and Knowledge Discovery in Databases, volume 11907 of Lecture Notes in Computer Science, pages 283–298. Springer, 2019.
  38. [38]Seyed Mohammad Mehdi Mirnajafizadeh, Ashwin Raam Sethuram, David Mohaisen, DaeH​​un Nyang, and Rhongho Jang. Enhancing network attack detection with distributed and In-Network data collection system. In 33rd USENIX Security Symposium (USENIX Security 24), pages 5161–5178, Philadelphia, PA, 2024. USENIX Association.
  39. [39]Yisroel Mirsky, Tomer Doitshman, Yuval Elovici, and Asaf Shabtai. Kitsune: An ensemble of autoencoders for online network intrusion detection. In Proceedings of the Network and Distributed System Security Symposium (NDSS), 2018.arxiv.org/abs/1802.09089
  40. [40]Megan Nyre-Yu, Elizabeth S. Morris, Blake Moss, Charles Smutz, and Michael R. Smith. Explainable AI in cybersecurity operations: Lessons learned from xAI tool deployment. In Proceedings of the Symposium on Usable Security and Privacy (USEC). Internet Society, 2022.DOI
  41. [41]Open Information Security Foundation. Suricata: Open source ids, ips, and network security monitoring engine. Software repository, accessed August 10, 2026.
  42. [42]Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.arxiv.org/abs/1912.01703
  43. [43]Weicheng Qiu, Yinghua Ma, Xiuzhen Chen, Haiyang Yu, and Lixing Chen. Hybrid intrusion detection system based on dempster-shafer evidence theory. Computers & Security, 117:102709, 2022.DOI
  44. [44]Ryan Riegel, Alexander Gray, François Luus, Naweed Khan, Ndivhuwo Makondwo, Ismail Yunus Akhalwaya, Haifeng Qian, Ronald Fagin, Francisco Barahona, Udit Sharma, Shajith Ikbal, Hima Kananam, Sumit Neelam, Ankita Likhyani, and Santosh Srivastava. Logical neural networks. arXiv preprint arXiv:2006.13155, 2020.arxiv.org/abs/2006.13155
  45. [45]Phillip Rieger, Marco Chilese, Reham Mohamed, Markus Miettinen, Hossein Fereidooni, and Ahmad-Reza Sadeghi. {ARGUS}:{Context-Based} detection of stealthy {IoT} infiltration attacks. In 32nd USENIX Security Symposium (USENIX Security 23), pages 4301–4318, 2023.arxiv.org/abs/2302.07589
  46. [46]Neele Roch, Hannah Sievers, Lorin Schöni, and Verena Zimmermann. Navigating autonomy: Unveiling security experts’ perspectives on augmented intelligence in cybersecurity. In Twentieth Symposium on Usable Privacy and Security (SOUPS 2024), pages 41–60, Philadelphia, PA, August 2024. USENIX Association.DOI
  47. [47]Martin Roesch. Snort: Lightweight intrusion detection for networks. In Proceedings of the 13th USENIX Conference on System Administration, LISA ’99, pages 229–238, Seattle, Washington, USA, 1999. USENIX Association.
  48. [48]Desiree Sacher. Fingerprinting false positives: How to better integrate continuous improvement into security monitoring. Digital Threats: Research and Practice, 1(1), 2020.DOI
  49. [49]Mohanad Sarhan, Siamak Layeghy, Nour Moustafa, and Marius Portmann. Netflow datasets for machine learning-based network intrusion detection systems. In International Conference on Big Data Technologies and Applications, pages 117–135. Springer, 2020.DOI
  50. [50]Iman Sharafaldin, Arash Habibi Lashkari, and Ali A. Ghorbani. Toward generating a new intrusion detection dataset and intrusion traffic characterization. In Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP), pages 108–116, 2018.DOI
  51. [51]Robin Sommer and Vern Paxson. Outside the closed world: On using machine learning for network intrusion detection. In 2010 IEEE Symposium on Security and Privacy, pages 305–316. IEEE, 2010.
  52. [52]Omer Subasi, Johnathan Cree, Joseph Manzano, and Elena Peterson. A critical assessment of interpretable and explainable machine learning for intrusion detection. arXiv preprint arXiv:2407.04009, 2024.arxiv.org/abs/2407.04009
  53. [53]Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3319–3328. PMLR, 2017.arxiv.org/abs/1703.01365
  54. [54]Shahroz Tariq, Mohan Baruwal Chhetri, Surya Nepal, and Cécile Paris. Alert fatigue in security operations centres: Research challenges and opportunities. ACM Computing Surveys, 57(9), 2025.DOI
  55. [55]Huynh TT Tran, Jacob Sander, Achraf Cohen, Brian Jalaian, and Nathaniel D Bastian. Neurosymbolic ai transfer learning improves network intrusion detection. In MILCOM 2025-2025 IEEE Military Communications Conference (MILCOM), pages 496–501. IEEE, 2025.arxiv.org/abs/2509.10850
  56. [56]Lingzhi Wang, Xiangmin Shen, Weijian Li, Zhenyuan Li, R. Sekar, Han Liu, and Yan Chen. Incorporating gradients to rules: Towards lightweight, adaptive provenance-based intrusion detection. In Proceedings of the Network and Distributed System Security Symposium (NDSS). Internet Society, 2025.DOI
  57. [57]Feng Wei, Hongda Li, Ziming Zhao, and Hongxin Hu. {xNIDS}: Explaining deep learning-based network intrusion detection systems for active intrusion responses. In 32nd USENIX Security Symposium (USENIX Security 23), pages 4337–4354, 2023.
  58. [58]Haohuang Wen, Phillip Porras, Vinod Yeswanar, Ashish Gehani, and Zhiqiang Lin. 5G-SPECTOR: An O-RAN compliant layer-3 cellular attack detection service. In Proceedings of the Network and Distributed System Security Symposium (NDSS), San Diego, CA, 2024. Internet Society.DOI
  59. [59]Thomas Winters, Giuseppe Marra, Robin Manhaeve, and Luc De Raedt. DeepStockLog: Neural stochastic logic programming. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 10090–10100, 2022.arxiv.org/abs/2106.12574
  60. [60]Jingyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, and Guy Van den Broeck. A semantic loss function for deep learning with symbolic knowledge. In Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 5502–5511. PMLR, 2018.arxiv.org/abs/1711.11157
  61. [61]Renjie Xu, Guangwei Wu, Weiping Wang, Xing Gao, An He, and Zhengpeng Zhang. Applying self-supervised learning to network intrusion detection for network flows with graph neural network. Computer Networks, 248:110495, 2024.arxiv.org/abs/2403.01501
  62. [62]Zhun Yang, Adam Ishay, and Joohyung Lee. NeurASP: Embracing neural networks into answer set programming. In Christian Bessiere, editor, Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, pages 1755–1762. International Joint Conferences on Artificial Intelligence Organization, 2020.arxiv.org/abs/2307.07700

Paper details

vlnc:W_fb5h779m
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 11

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

GPT 5.6

View statement
Looking for related papers…
Contents