Shae McFaddenSM

More Is Never Less: Affordable Robustness to Additive Attacks via Monotone Multiple-Instance Learning

arXiv arXiv preprint (cs.CR), 2026

  • Alexander Herzog
  • Shae McFadden
  • Lorenzo Cavallaro
  • University College London
  • King’s College London
  • The Alan Turing Institute
  • Core64
  • MBZUAI

Abstract

Static malware detectors that represent each sample as a bag of extracted features, such as permissions, API calls, or imported functions, are cheap to deploy and remain state-of-the-art under temporal drift and in selective classification. Yet, attackers can evade them by adding benign-looking content that outweighs malicious evidence. Canonically, detectors encode the presence of a few thousand features, selected during training, as sparse multi-hot vectors over a fixed vocabulary. Features that emerge after training remain invisible. We show that linear models and multi-layer perceptrons (MLPs) over this input are sum-pooled set models in disguise. Sum-pooling lets added benign features cancel malicious evidence. Instead, we cast malware detection with set-shaped static features as a multiple-instance learning (MIL) problem. To this end, we propose MalSets, which uses max-pooled Deep Sets models with a monotone head to ensure that any malicious evidence remains undiluted; thus, more is never less. Under MIL, a general text encoder maps any feature string to an embedding, thus eliminating the long-standing out-of-vocabulary problem at test time. Max-pooling retains the malicious evidence regardless of how many benign features an attacker adds. Since max-pooling can only grow when features are added, constraining the head alone makes the malware score monotone under additions, even against a white-box attacker adapted to this architecture. While monotone detectors are never evaded by state-of-the-art black-box or white-box attacks, they often significantly pay for this robustness in clean performance since benign features cannot count as evidence. However, by combining a non-monotone set encoder with max-pooling and a monotone head, MalSets maintains the robustness of prior monotone classifiers while achieving state-of-the-art performance.

Introduction

More than twenty years ago, Lowd and Meek showed that adversaries could evade spam filters, using bag-of-words (BoW)-based representations, by embellishing a message with a few “good words” that were associated with legitimate email. However, to this day, the use of static analysis to construct BoW-like feature representations still remains state-of-the-art in malware detection as a key first line of defence because feature extraction remains lightweight allowing for inexpensive classification at scale.

Like the BoW-based representations considered by Lowd and Meek, these abstractions record the presence or frequency of extracted features. Commonly considered features for malware detection include: imported libraries and functions for executables; keywords and structural paths for PDFs; syntax-annotated tokens for JavaScript; and permissions, API usage, and metadata for Android applications and software packages. Although individual features may also encode local structure, their aggregation is permutation invariant. We call such feature abstractions, or extractors, set-shaped.

Depending on their design, these extractors omit structural or semantic relationships, such as caller-callee dependencies. This creates a representation gap between the sample, that is, the application, executable, or document under analysis, and the information available to the detector. An attacker can exploit this gap through additive attacks: inserting benign-looking code or data, subject to validity and attack-budget constraints. Modifications are commonly restricted to additions in order to avoid removing components that the malware relies on to execute malicious behavior.

Such attacks have been studied against PDF, executable, and Android detectors, both in feature space and on the samples themselves. Liang et al. evaded Chrome’s then-deployed phishing-page classifier by inserting benign-associated features. Šrndić and Laskov reduced PDFRATE’s scores from nearly 100% to a median of approximately 33% through content insertion. Pierazzi et al. evaded Android malware detectors by transplanting code from benign applications, an attack known as APG. In each case, features associated with benign samples outweigh evidence of maliciousness that is still present. To be robust against additive attacks, a detector must retain a malicious classification under every admissible functionality-preserving addition.

Static extractors analyze samples without executing their code. While the feature categories they produce are fixed, the vocabulary may be open-ended: identifiers, domain names, and structural paths absent from the training data may continue to appear under temporal drift. Nonetheless, detectors represent each sample as a multi-hot or count vector over a vocabulary selected at training time. Alternatively, they hash feature strings into a fixed number of bins at the cost of collisions. In both cases, they learn from this feature representation rather than from the raw data. Therefore, the chosen encoding decides what the detector can actually see. Kolter and Maloof keep only 500 of more than 255 million byte 4-grams. Šrndić and Laskov retain 6,087 of more than 9 million structural PDF paths.

Set models in disguise

Since the multi-hot vector encodes an application’s feature set, every detector computes a function of that set. Linear models and Multi-Layer Perceptrons (MLPs), two of the four detector classes, share a specific structure. For an application with feature set S, the multi-hot vector is the indicator vector 1V(S) over the fixed vocabulary V. The first layer of these models computes W11V(S) = ∑s∈S∩V ws, where ws is the column of W1 assigned to feature s. This layer is therefore a lookup table of learned feature embeddings followed by implicit SUM pooling; in linear models, the embeddings reduce to scalar weights. Tree ensembles also compute a function of the set, but they split on individual coordinates instead of summing embeddings. Hence, linear and MLP-based detectors on binary representations are set models in disguise, namely SUM-pooled Deep Sets models over a vocabulary fixed at training time. This explains both weaknesses discussed above.

Blind to unseen strings

First, strings outside the training vocabulary are never encoded, so these models are blind to out-of-vocabulary (OOV) strings.

Benign features outweigh malicious ones

Second, SUM pooling allows added benign features to outweigh malicious evidence, which is exactly how additive benign attacks succeed.

We break with this tradition and embed each feature, s ∈ S, with a general text encoder instead. Since DREBIN features are set-shaped and the cardinality varies between samples, we cast detection as multiple-instance learning (MIL). MIL has modeled network traffic and spam emails as bags before. We instantiate MIL via Deep Sets with MAX pooling, which retains malicious evidence of the sample, regardless of how much benign evidence is added.

MAX-pooled Deep Sets models preserve malicious evidence in the latent representation. However, a downstream classifier head may still map a larger latent representation to a lower score, which an attacker can exploit. To retain a malware classification under any addition that maintains malicious evidence, the score must never decrease when features are added. Gimenez et al. show that this monotonicity is both sufficient and necessary for robustness to additive attacks. Monotone malware detectors exist, but so far they have come at a twofold cost. First, they operate on a fixed vocabulary, so features seen after the training period add no evidence; thus, they are blind to OOV features. Second, they lose detection performance. Since no feature may lower the score, benign features cannot count as evidence. Incer et al. report a drop of approximately 13% in detection rate, which they consider the cost of security.

Background

Set-Shaped Static Features

A static feature extractor E maps a sample z, such as an application, to a finite set of strings S = E(z) ⊂ Σ∗, where Σ∗ denotes all strings. Each string, s ∈ S, represents one feature in z, such as a requested permission or an API call. The extractor, E, may yield features of different categories. For example, the Drebin extractor considers multiple categories, where a prefix, api_permissions, denotes the category of the feature: api_permissions::android_permission_SEND_SMS. These features are set-shaped, and their order carries no information (permutation-invariant). Furthermore, the number of features, |S|, varies among samples (varying set-cardinality).

Feature categories are known in advance, but the vocabulary is open: Σ∗ is infinite, whereas the set of strings observed during the training-phase of detectors is finite. We call a feature category closed if its strings come from a finite list known in advance, such as the permissions an operating system defines, and open otherwise. During the test-phase, a sample contains out-of-vocabulary (OOV) strings whenever S includes strings never observed during training.

Multi-Hot Encoding over a Fixed Vocabulary

Detectors on set-shaped features rarely consume S directly. Instead, the canonical approach during preprocessing follows two steps. (1) During Feature selection, each detector selects a vocabulary V from the strings observed in its training data. Feature selection can be supervised or unsupervised. To preserve temporal training consistency, selection must precede the test-period. (2) During multi-hot encoding, each sample is encoded as a binary vector x ∈ {0, 1}|V| with one coordinate per string in V, set to 1 if the string occurs in S.

The encoding inherits the permutation invariance of S and maps features s ∈ S to the selected |V| coordinates. This discards features outside V, therefore, two samples that differ only by strings outside V are encoded with the same feature-vector, x. Yang et al. mention this constraint: a temporal split “means we cannot use any new features that only appear in the testing set”.

85%of distinct strings in the Hypercube test period never occur in the training year
28%median share of an app’s strings kept by the top-10,000 vocabulary in the training year (27% over the test period)
545,333strings in the full Drebin feature set, which later work restricts to 10,000
Key Takeaway

While feature-selection may differ among methods, the representation, x, and its dependence on a fixed vocabulary, V, at training time do not.

Multiple-Instance Learning

Multiple-instance learning (MIL) labels bags of instances rather than single instances, and under its standard assumption, a bag is positive if at least one of its instances is positive. Since set-shaped features are bags by construction, with the sample as the bag S and each string as an instance, neural MIL embeds every instance and aggregates the embeddings by pooling into one bag representation. Under MEAN and SUM pooling, when instance embeddings can be negative, added instances can lower every coordinate of the set representation and thereby dilute the evidence of a positive instance. MAX pooling preserves the standard assumption under which a bag’s label is the maximum of its instance labels in the embeddings. Hence, each coordinate of the bag representation is the largest value among its instances. Lowering the value is not possible; values either increase or leave the representation unchanged.

Threat Model

We assume an adversary who controls the sample (Android APKs in our evaluations) but cannot change the deployed feature extractor or the trained model. The goal is evasion: to classify a malware sample as benign. A feature-space attack that perturbs the feature vector directly provides only a theoretical upper-bound, since an arbitrary vector does not necessarily correspond to a working APK. Hence, we evaluate in the problem space following Pierazzi et al., where an attacker applies a transformation T to the APK z, subject to four constraints: (i) available transformations, (ii) preserved semantics, (iii) plausibility, and (iv) robustness to preprocessing.

We take the available-transformations constraint to be addition only, E(z) ⊆ E(T(z)), preserving the host’s malicious functionality. To this end, we adopt organ transplantation, where bytecode slices harvested from benign donor apps are grafted into a malicious host. An organ o is the self-contained bytecode slice of a harvested gadget, and an ice-box O is the bank of organs assembled ahead of the attack time. A graft is the set union S ↦ S ∪ o, where o also denotes the strings that the organ adds, including side-effect features that satisfy the problem-space constraints. Removal and obfuscation are feasible but violate E(z) ⊆ E(T(z)); we treat them as out of scope.

Why Android?

Our findings apply to set-shaped static features in general, however, we chose Android malware detection (AMD) as the domain for our evaluations because it fulfills the following four requirements:

Set-Shaped Features with an Open Vocabulary

The Drebin extractor emits strings in nine fixed categories. Their vocabulary is open.

One Representation with Many Detectors

Linear, tree-based, and neural detectors, including drift-aware ones, share the multi-hot vector x over Drebin features. Hence, the representation is the only variable we change.

Realizable Additive Attacks

Organ transplantation yields an evasive variant for each malware sample in all four configurations studied by Pierazzi et al.

Time-Aware Evaluation at Scale

Time-aware evaluation protocols are established for Android, and Hypercube provides 224,965 applications from a single market (Google Play) over four years, each dated by its upload and labeled with its number of VirusTotal detections (VTT).

From DEEPDREBIN to MALSETS

DEEPDREBIN (Ⓐ) is a feed-forward network on input x. At its first layer, it computes the vector r = W1x with the weights W1 ∈ ℝ200×|V|. The classification head ρ comprises all subsequent operations. It starts with the first-layer bias b and activation σ, which give the first hidden layer h = σ(r + b) and maps r to a malware logit, which a sigmoid converts to P(mal). We focus on these layers as x treats the first layer as a lookup table (①) that is implicitly sum-aggregated (②) over a closed vocabulary (③) while ρ is easily overwhelmed by contrary evidence (④).

DEEPSETS (panels Ⓑ–Ⓓ) is multiple-instance learning (MIL) applied to learning functions over sets, where a shared element-wise MLP φ : ℝd → ℝdφ, the element network, maps each embedded feature to a latent representation. These representations form the rows of a matrix H. The set of these representations is then aggregated into a single vector, the pooled vector r, by a pooling operator ⊕,

r(S) := ⊕s∈S φ(e(s)) ∈ ℝdφ for any finite S ⊂ Σ∗,(1)

with r = r(S) for the application, e : Σ∗ → ℝd encoding each string, ⊕s∈S denoting the pooling operator ⊕, applied to all feature vectors φ(e(s)). The classification head ρ then maps r(S) to a malware logit. This formulation makes the individual feature representations explicit (①), allowing us to change the pooling operator (②), replace the fixed vocabulary with an encoder for unseen strings (③), and replace the unconstrained classification head ρ with a monotone head g (④).

  1. Features as Sets

    Step 1 splits x into the set U of one-hot elements;

  2. Max Pooling

    Step 2 replaces SUM by MAX, and φ is an MLP from panel C onward;

  3. Open-Vocabulary Encoder

    Step 3 maps every feature string with a frozen general text encoder e to an embedding;

  4. Monotone Head

    Step 4 classifies with a monotone head g.

From DEEPDREBIN to MALSETS: Step 1 splits x into the set U of one-hot elements; Step 2 replaces SUM by MAX, and φ is an MLP from panel C onward; Step 3 maps every feature string with a frozen general text encoder e to an embedding; Step 4 classifies with a monotone head g. Panels A to D are rows 1, 1a, 3 and 11 of Table 2.

Features as Sets

We show that MLPs including DEEPDREBIN on multi-hot encoded features can compute the same function as DEEPSETS models on one-hot features, following our construction. First, we convert the multi-hot encoding x, which encodes the feature strings of a sample S ∩ V = {s1, …, sk}, to a set of one-hot vectors U = {u1, …, uk} (①), encoding each feature si as ui. Second, we construct a DEEPSETS model, where we parameterize φ with a linear layer, W1. The product W1x in DEEPDREBIN then equals W1 applied to each ui ∈ U and summed:

r = ∑i φ(ui) = ∑s∈S∩V ws = W1 ∑i ui = W1x,(2)

While MLPs implicitly compute a sum over the selected row-vectors to obtain r, we explicitly select SUM pooling for our DEEPSETS model in this context.

Max Pooling

After having established DEEPDREBIN as a SUM-pooled set model, we replace the SUM pooling with a coordinate-wise MAX pooling, rj = maxi Hij (②).

We call the coordinates of DEEPDREBIN’s first hidden layer h and of the pooled vector r of DEEPSETS models channels. For each channel, we compute the gradient attribution, w̄j = E[∂f/∂rj], as the average gradient of the score over the training set. In the context of binary malware classification, we refer to its sign as the channel’s polarity: malware if w̄j > 0 and benign if w̄j < 0. As polarity is an average, it need not hold for every application.

Additive benign attacks dilute malicious evidence under SUM pooling (panels Ⓐ and Ⓑ), by: (i) lowering a malware-polarity channel or (ii) raising a benign-polarity channel.

Cancellation

First, evidence is lost due to cancellation. In DEEPDREBIN, sample features map to columns ws, aggregated by SUM pooling prior to activation. Since entries in ws can be either positive or negative, they may cancel out evidence. Specifically, when a benign organ o is grafted into a host S, malicious evidence in h may be diminished.

Accumulation

Second, the evidence is outweighed by feature accumulation. Suppose every contribution is non-negative and no cancellation occurs. A channel’s value no longer distinguishes one informative feature from many features with small contributions. Attacks can therefore raise benign-polarity channels by adding more benign features to outweigh the host’s malicious features.

The Effect of Attacks on Channels. Share of applications (%) in which a channel of h (DEEPDREBIN) or r (Deep Sets models) is active, split by polarity (benign left, malware right) and ordered by their average polarity over the training set. The shading reflects average polarity magnitude. Lines are smoothed as a running mean over 15 channels. Models are rows 1, 6, 5 and 11 of Table 2.

In DEEPDREBIN, the attack lowers the malware-polarity channels (28 → 13% active). In DEEPSETS[MAX, e, Σ∗], it cannot lower any channel and succeeds by raising the benign-polarity channels alone (63 → 71%), while the malware-polarity channels remain unchanged. Hence, MAX-pooling narrows the attack surface; however, the non-monotone head still allows raised benign-polarity channels to outweigh malicious evidence.

In our DEEPSETS models, φ embeds features individually and independently. Hence, grafting benign organs S ↦ S ∪ o leaves the host’s rows of H unchanged. Values of the MAX pooled vector, r, therefore, can only increase,

r(S ∪ o) = r(S) ∨ r(o) ≥ r(S).(3)

Which requires that perturbations are additive and that φ maps every string of the host to a row of H. For each channel j, the feature that sets its value is referred to as the channel’s witness, s⋆j ∈ arg maxs∈S φj(s). At most dφ witnesses produce the pooled vector r. An added feature changes a channel only if it exceeds that channel’s witness. Therefore, the largest impact that an attack can have on a channel is bound by the organ o ∈ O, which produces the greatest value in that channel.

The Classifier Bottleneck

Eq. 3 only holds for the pooled vector r and not for the score, which the classifier ρ computes from r (C). Therefore, if the weights of the classifier ρ are not strictly positive, then raising a channel can lower the score. The classifier is thus the only part of a MAX-pooled DEEPSETS model that an additive attack can exploit. A monotone head g, whose score never falls when a channel rises, leaves the attacker with nothing to exploit.

Open-Vocabulary Encoder

MLP-based detectors trained on multi-hot representations, x = 1V(S) over a fixed vocabulary V, map input-features to columns of the weight-matrix W1; features outside of V have no input coordinates and therefore no row in H. We remove this fixed-vocabulary constraint, see ③ and Ⓓ, and replace V with a general text encoder e : Σ∗ → ℝd that embeds each feature string:

r(S) = maxs∈S φ(e(s)).(4)

Which requires an open-vocabulary encoder, e, that is defined over all features of Σ∗. Hence, every feature that the extractor, E, emits receives an embedding. Therefore, the shared trainable instance network φ and the classifier ρ of our DEEPSETS models remain independent of the vocabulary V fixed at training time.

Monotone Head

Robustness requires that additions preserve a malicious decision. MALSETS guarantees the stronger property that additions cannot decrease the malware score by replacing ρ with a non-decreasing, monotone, head g such that f(S) = g(r(S)). Since Eq. 3 holds coordinate-wise in r:

f(S ∪ o) ≥ f(S) for every finite o ⊂ Σ∗.(5)

Therefore, under monotonicity, additive benign attacks can never lower a classifier’s score. This requires that the classifier’s input never decreases under additions.

MAX pooling provides this for any φ (Eq. 3), whereas SUM pooling only suffices if H is non-negative; for example, when φ is ReLU activated. Since DEEPDREBIN implicitly SUM pools and the columns of W1 can have negative entries, it does not suffice. Our proposed DEEPDREBIN+ therefore constrains every layer, including W1, to be strictly positive.

Since any choice of a monotone head suffices, we choose a trivial linear layer with non-negative weights for MALSETS and

glin(r) = w⊤r + b, while w = softplus(θ) ≥ 0

and θ ∈ ℝdφ are unconstrained trainable vectors.

Cost of Security

However, monotonicity comes at the cost of all benign evidence being ignored, whether added by an attacker or not. Therefore, if malware were only differentiable from benign samples by its absence of benign evidence, then per Eq. 3, the monotone head would score benign samples equally to those of malware. Thus, this would make the resulting detector unable to flag malware without also misclassifying benign samples.

Experimental Settings

We evaluate on Hypercube as it is, to the best of our knowledge, the least biased public dataset for Android malware detection. It is compiled from a single market (Google Play) and time-stamped at upload time. Applications with at least two VirusTotal detections (VTT2) are labeled as malware, at a benign-to-malware ratio of 9:1. For a longer temporal evaluation window, we use the extended release of Hypercube spanning 2021–2024 with 224,965 applications. Regarding cardinality, all apps contain between 0 and 36,265 strings (median 199; 24 to 636 between the 1st and 99th percentiles).

36 months of active learning, 400 labels per month Training 2021 67,953 apps Validation Jan–Jun 2022 33,394 apps Test (T=30) Jul 2022–Dec 2024 123,618 apps 2021 2022 2023 2024 2025
Hypercube (VTT2) timeline. Every detector is trained on 2021 and then updated monthly by active learning from January 2022 to December 2024. The first six months (January to June 2022) are the validation period with all results being reported on the remaining 30 test months (July 2022 to December 2024), following Chen et al. Malware: 10.7%, 10.8% and 9.5% over the three periods.

Every month, each detector scores the new applications, and the 400 with the lowest Maximum Softmax Probability (MSP) are labeled, simulating a human analyst. For headline performance, we report F1, FPR, and FNR. Additionally, we report reliability via E-AURC, Cap400 and F1∗, and stability via Sen[F1]. For robustness, we report the attack success rate (ASR) as the share of detected malware that an attacker turns benign. We limit the attack-budget to at most β=100 organs per application. We average all metrics over five seeds.

Malware Detectors

All DEEPSETS-based models share a common base design, where: (i) e is OpenAI’s text-embedding-3-large with all 3,072 dimensions, with empty feature groups skipped. (ii) The element network φ is a two-layer MLP with ReLU and dropout 0.3. (iii) The classifier head is a linear layer for ρ and a linear layer with softplus for the monotone head glin.

We compare our proposed detectors against twelve state-of-the-art malware detectors: DREBIN, SEC-SVM, RANDOMFOREST, DEEPDREBIN, RAMDA, HCC, DRMD, TIF, MALCERTAIN, LSE-FOREST, LIGHTGBM, and MONOGBT. With all baselines using the same top-10,000 Drebin features, V.

Attackers

Following our threat model, we consider additive attacks that graft organs, benign code fragments, onto malware applications. The attacks in this paper are conducted using an organ ice-box, O, harvested by prior problem-space work comprising 33,280 organs alongside their pre-computed feature-space effects. We call the number of grafted organs the dose β and report the attack success rate (ASR) at β=100, using the pre-computed feature-space effects, to provide a high-dose stress test.

The Five Attackers. V: the top-10,000 features of the baselines. Σ∗: all strings. Deduplication leaves 7,694 effective organs for Σ∗ and 3,143 for V.
AttackerOrgans selected byPool, VPool, Σ∗
B-RNDuniform draw across all organs33,28033,280
I-RNDuniform draw across the effective pool3,1437,694
EVDrandom draw, kept only if the score drops3,1437,694
ADZquery-guided search, plus own permission and intent edits3,1437,694
APGbest-ranked organ, exact form for MAX pooled DEEPSETS models3,1437,694

Adversarial Program Generation (APG) is a white-box attack proposed by Pierazzi et al. that, at each step, selects the organ that lowers a detector’s score the most. For MALSETS, parameterizing ρ with a linear layer eliminates the need for re-scoring candidates by ρ, since the score changes by Δ(o | S) = ∑j wj max(0, rj(o) − rj(S)). Hence, ranking organs in weight space reduces the cost by three orders of magnitude for MALSETS compared to the greedy procedure for MLPs, while remaining exact.

Three Settings

Setting 1: Clean AL

We report clean performance over the 30 test months (Jul 2022 to Dec 2024). Why? A robust detector is only useful if it continues to detect malware without an attacker. This experiment measures each detector’s clean performance under drift and serves as a baseline to measure the cost of security under attack.

Setting 2: Attacking over Time

We perform each of the five attacks monthly. Attackers only target malware, which was detected in that month, and the attacked samples never enter re-training. Here, we report the area-under-time of the ASR (AUT-ASR) from Jul 2022 to Dec 2024. Why? Active learning retrains the detector every month; hence, its robustness may change with every update. This experiment isolates the robustness of each deployed model from the training loop.

Setting 3: Attacked AL

From Jan 2022 onward, the attacker modifies every malware sample with APG. The adversarial samples then replace their original sample in active learning. In Setting 3 | A, the attacker stops once the sample is classified as benign. In Setting 3 | B, the attacker continues until the sample is both classified as benign and beyond the threshold for AL sampling based on a rolling average of the prior six months. Why? In deployment, attacked samples are selected for labeling and influence AL model updates. This experiment tests whether robustness holds when adversarial samples enter AL.

Results

0.0%AUT-ASR against MALSETS under all five attackers
38.4F1 of MALSETS under clean AL, unchanged under attacked AL
14.5F1 points above the best monotone baseline
20.2%of F1 paid for security, against 22.8% to 64.9% for the other monotone detectors

Ablations

For ①, we show that DEEPDREBIN is an implicitly SUM-pooled DEEPSETS model in two ways. First, we convert trained DEEPDREBIN models into a DEEPSETS model by moving the activation and the bias into the classifier, ρ. Without retraining (row 1a of Table 2), it reproduces DEEPDREBIN’s results exactly. Second, we train a DEEPSETS model matching the network architecture and hyperparameters of DEEPDREBIN (row 1b): F1 37.3 ± 0.5 against 37.5 ± 1.0, E-AURC 4.33 against 4.36, which is within normal seed variance (paired per-seed differences, p ≥ 0.30). Lastly, in row 2, we move the activation function and bias from ρ into φ, which yields an improvement in F1 to 40.9 ± 1.4.

We then replace SUM- with MAX-pooling (row 3). MAX-pooling lowers evasion (AUT-ASR) under three of the five attacks: Blind Random (66.1 → 48.5%), Informed Random (97.1 → 77.4%), and EvD (95.9 → 95.5%). However, APG still evades at 99.5% and ADZ increases from 61.1 to 76.2%. Under clean AL, F1 rises by 4.8 (40.9 → 45.7) and E-AURC falls from 5.49 to 4.62.

Next, we replace the one-hot encoding with a general text encoder e on the same 10,000 strings of V (row 4). At a fixed vocabulary, the encoder does not raise clean AL F1 (45.7% → 42.9%, E-AURC 4.62 → 4.73), but it lowers evasion under all five attackers (APG 99.5 → 97.1%, ADZ 76.2 → 32.4%). We then open the vocabulary to Σ∗, eliminating the OOV problem (row 5). Using Σ∗ improves clean AL performance by 5.2 points (42.9% → 48.1%). An open vocabulary also widens the attack surface, as the effective organ pool increases from 3,143 to 7,694. However, four out of the five attackers evade row 5 less than row 4, and only Blind Random gains (45.4 → 46.9%).

Lastly, we replace the classifier ρ with a monotone head glin (see rows 8–11), providing complete robustness to additive attacks; no adversarial true positives were evaded. On DEEPDREBIN, a non-negative output layer alone (DEEPDREBIN∗, row 7) is not sufficient. Since added features can lower the channels prior to the output layer, APG still achieves an average AUT-ASR of 100.0%, while costing F1 20.0 points (37.5 → 17.5). With all weights being non-negative (DEEPDREBIN+, row 8), no attack evades, but the cost of security is higher at F1 24.4 points (37.5 → 13.1). In contrast, robustness is achieved for DEEPSETS using MAX-pooling and a monotone head, ρ = glin (row 9), while only lowering F1 by 0.6 points on average (37.5 → 36.9, relative to DEEPDREBIN). Although e on V (row 10) further increases the cost of security to 2.5 points on average (37.5 → 35.0), when combined with an open vocabulary Σ∗ (MALSETS, row 11), it increases F1 to 38.4 while improving the reliability under a monotone head (10.38 → 6.67 E-AURC).

From DEEPDREBIN (row 1) to MALSETS (row 11)

F1 (%) under clean AL (Setting 1), mean over five seeds. Higher is better.

1 DEEPDREBIN37.5
1a DEEPSETS[SUM], φ = W137.5
1b DEEPSETS[SUM], φ = W137.3
2 DEEPSETS[SUM]40.9
3 DEEPSETS[MAX]45.7
4 DEEPSETS[MAX, e, V, ρ]42.9
5 DEEPSETS[MAX, e, Σ∗, ρ]48.1
6 DEEPSETS[SUM, e, Σ∗, ρ]37.8
7 DEEPDREBIN∗17.5
8 DEEPDREBIN+13.1
9 DEEPSETS[MAX, glin]36.9
10 DEEPSETS[MAX, e, V, glin]35.0
11 MALSETS38.4
12 DEEPSETS[SUM, e, Σ∗, glin]36.3
Table 2, Setting 1 and Setting 2.
Show every row as a table
#F1E-AURCSen[F1]B-RndI-RndEvDADZAPG
137.5±1.04.4±0.0−1.19±0.1249.5±2.676.8±1.099.4±0.130.2±3.4100.0±0.0
1a37.5±1.04.4±0.0−1.19±0.12=====
1b37.3±0.54.3±0.0−1.22±0.1849.3±0.876.9±0.799.4±0.229.1±1.3100.0±0.0
240.9±1.45.5±0.2−0.96±0.0966.1±5.897.1±1.295.9±1.361.1±6.899.9±0.1
345.7±0.74.6±0.1−0.94±0.0548.5±5.477.4±9.495.5±2.676.2±18.099.5±0.4
442.9±1.04.7±0.1−0.85±0.1145.4±8.963.7±8.786.4±3.832.4±9.297.1±2.3
548.1±0.84.2±0.2−0.82±0.0546.9±3.254.1±4.571.0±1.931.7±8.396.5±2.1
637.8±1.36.5±0.2−1.05±0.1691.9±3.498.3±1.798.1±0.875.1±7.2100.0±0.1
717.5±1.14.5±0.1−1.22±0.1851.370.298.937.9100.0
813.1±0.68.0±0.1−0.69±0.050.0±0.00.0±0.00.0±0.00.0±0.00.0±0.0
936.9±1.29.8±1.4−0.66±0.130.0±0.00.0±0.00.0±0.00.0±0.00.0±0.0
1035.0±0.810.4±0.8−0.76±0.100.0±0.00.0±0.00.0±0.00.0±0.00.0±0.0
1138.4±1.16.7±0.1−0.80±0.160.0±0.00.0±0.00.0±0.00.0±0.00.0±0.0
1236.3±0.98.6±0.9−0.76±0.070.0±0.00.0±0.00.0±0.00.0±0.00.0±0.0

Comparison with State-of-the-Art

We compare our models with twelve baselines from three architecture families: linear models, tree ensembles, and MLPs. Our DEEPSETS models form a fourth family, MIL.

Under clean active learning, MLPs are the strongest baselines, with DRMD (43.6) and TIF (39.6) having the highest performance. Following the top performing MLPs, are RANDOMFOREST (38.3), HCC (38.1), and LIGHTGBM (38.1). With the remaining baselines from those families, alongside linear models, trailing behind (13.1–37.5). Our non-monotone MIL model, DEEPSETS[MAX, e, Σ∗], reaches the highest F1 of all detectors (48.1), surpassing DRMD while having the best reliability (E-AURC, 4.22).

Clean against attacked active learning

F1 (%) over the 30 test months under Setting 1 and Setting 3 | B. Each label gives the percentage of malware evaded.

0 10 20 30 40 10 20 30 40 50 F1, clean AL F1, attacked AL Pareto front Linear Trees MLPs MIL
Clean versus Attacked Active Learning. Each detector is evaluated over a 30 month test period, on the Hypercube dataset, under both the clean (x axis) and attacked (y axis) active learning settings. With MALSETS being the only detector on the Pareto front that is never evaded. The numbers assigned to each detector reflect the percentage of malware evaded, whereas the shape corresponds to the model paradigm.
Show every detector as a table
DetectorSetting 1Setting 2Setting 3 | ASetting 3 | B
F1E-AURCASRF1E-AURCASRF1E-AURCASR
Linear
DREBIN30.55.2100.00.05.2100.00.06.8100.0
SEC-SVM26.95.2100.05.55.385.83.45.890.0
DREBIN+23.69.50.023.69.50.023.69.50.0
Trees
RANDOMFOREST38.34.9100.07.54.879.67.15.072.7
LSE-FOREST24.26.4100.00.26.399.30.56.897.6
LIGHTGBM38.14.3100.09.14.380.75.44.582.9
MONOGBT23.96.10.023.96.10.023.96.10.0
MLPs
MALCERTAIN29.96.595.72.78.290.73.89.087.9
RAMDA36.38.464.425.29.636.225.89.234.4
HCC38.16.4100.07.27.482.92.810.490.9
TIF39.66.4100.01.97.996.70.49.799.4
DRMD43.69.4100.032.317.726.034.110.020.7
DEEPDREBIN37.54.4100.017.44.455.417.74.649.5
DEEPDREBIN+13.18.00.013.18.00.013.18.00.0
MIL
DEEPSETS[MAX, e, V, ρ]42.94.797.133.75.119.731.74.615.4
DEEPSETS[MAX, e, V, glin]35.010.40.035.010.40.035.010.40.0
DEEPSETS[MAX, e, Σ∗, ρ]48.14.296.536.74.424.530.34.324.5
MALSETS38.46.70.038.46.70.038.46.70.0

On all non-monotone baselines, APG achieves an AUT-ASR of at least 95.7%, with the exception of RAMDA at 64.4%. For our DEEPSETS-based approaches, APG also evades (96.5-97.1%) only against the non-monotone models.

While all monotone models are unevaded, AL on attacked malware recovers evasion for some detectors across both Setting 3 | A and Setting 3 | B. While DREBIN still remains fully evaded, SEC-SVM’s evasion decreases by an average of 12.1 points. For tree-based detectors, only RANDOMFOREST and LIGHTGBM meaningfully decrease evasion by 23.9 and 18.2 points on average. AL has the largest improvement on DRMD, DEEPSETS[MAX, e, V, ρ], and DEEPSETS[MAX, e, Σ∗, ρ] as they similarly recover 74.5 points on average under Setting 3 | A. Notably, our DEEPSETS[MAX, e, V, ρ] model is the least evaded under both Setting 3 | A and Setting 3 | B.

All monotone models remain unevaded, and MALSETS retains the highest performance under both settings. DEEPSETS[MAX, e, V, glin] trails by 3.4 F1 points, and the monotone baselines follow by a wide margin. Here, MONOGBT trails by 14.5, and DREBIN+ by 14.8 F1 points, respectively. DEEPDREBIN+ ranks last with 13.1 F1 points.

Why MALSETS Pays Less

With DEEPSETS models, we match the architecture to the set-shaped structure of the Drebin feature space, achieving the highest performance of any detector in our benchmark (row 5). While MALSETS loses 20.2% of its F1 (row 11 versus row 5 of Table 2), it pays the smallest cost of security compared to the other monotone detectors, which lose 22.8% for DREBIN+, 37.2% for MONOGBT, and 64.9% for DEEPDREBIN+. Therefore, MALSETS remains 14.5 points F1 above the best monotone baseline.

The cost of security under clean AL

F1 (%) of each monotone detector against the non-monotone detector it constrains. Higher is better.

DREBIN30.5
DREBIN+23.6
LIGHTGBM38.1
MONOGBT23.9
DEEPDREBIN37.5
DEEPDREBIN+13.1
DEEPSETS[MAX, e, V, ρ]42.9
DEEPSETS[MAX, e, V, glin]35.0
DEEPSETS[MAX, e, Σ∗, ρ]48.1
MALSETS38.4
Table 3, Setting 1.

Monotonicity. Linear models and MLPs are only robust if all weights are constrained. For example, APG still fully evades DEEPDREBIN∗ with a monotone output layer (row 7 in Table 2), and DEEPDREBIN+ costs a 64.9% reduction in F1 to completely eliminate APG evasions (row 8 in Table 2). In contrast, MALSETS only requires the classifier ρ to be monotone, since adding features can only raise channels by construction.

Pooling Operator. Compared to MAX pooling, SUM pooling leads to feature accumulation, reducing F1 by 2.1 points while decreasing reliability by 1.92 (row 12, Table 2). A monotone head for MALSETS is not a performance bottleneck.

Open Vocabulary. Feature selection is an explicit design choice for MALSETS. If all malware-features of a malignant sample were transplanted to a benign application, monotone detectors would score this sample at least as high. This holds for 32% of malware under V, for 14% under V100k, and reduces to 3% under Σ∗.

In summary, DEEPSETS models match the architecture to the set-shaped problem, MALSETS constrains only the head, MAX pooling prevents features from accumulating, while feature selection becomes an optional design-choice.

Limitations

In our design and evaluation of MALSETS, we made a concerted effort to ablate every step of the process; however, there remain the following natural limitations to this work.

  • First, our experiments were conducted only on the Hypercube dataset; however, this choice was deliberate, as it constitutes the current standard for unbiased dataset construction with no comparable standards for other marketplaces.
  • Second, all our baselines share the same top-10,000 vocabulary, V, for consistency. Although this selection is in line with prior work, there have been other proposed approaches for the selection of Drebin features; however, as MALSETS uses Σ∗, it is independent of feature selection.
  • Third, we focus on additive benign attacks, as they are the predominant threat in the literature. Due to monotonicity, MALSETS is robust to the removal of benign features; whereas the removal of malware features in the problem-space, without breaking malicious functionality, remains an open problem.
  • Fourth, we focus on the threat model of an attacker aiming to evade a target system; however, monotonicity does not prevent data poisoning. Therefore, the addition of malicious features to benign samples could facilitate the poisoning of MALSETS, which we believe would be a natural direction for future work aiming to improve the resilience of MALSETS-based detectors.

Contributions

  • Problem Aligned Design through MIL. We cast static malware detection as MIL and operationalize it via DEEPSETS. A general text encoder embeds every feature string, which eliminates the out-of-vocabulary (OOV) problem by design. MAX pooling retains the malicious evidence of the sample, regardless of how many benign features an attacker adds.
  • Functional Monotonicity. We devise MALSETS by equipping MAX-pooled DEEPSETS models with a monotone head, over an open vocabulary representation. Since MAX pooling never decreases under benign addition, neither does the malware score. MALSETS thereby addresses the cost of security paid by prior monotone detectors, as it jointly maximizes both clean and attacked AL performance.
  • Adversarial Robustness. For MALSETS, more is never less as it is never evaded by any of the five attack families in our benchmark, ranging from black-box to white-box attacks. Under attack, MALSETS also retains the highest F1 of all detectors.

Altogether, these produce MALSETS, which pays the smallest relative cost of security for remaining completely unevaded by state-of-the-art black-box and white-box additive attacks.

Cite

@misc{herzog2026lessaffordablerobustnessadditive,
      title={More Is Never Less: Affordable Robustness to Additive Attacks via Monotone Multiple-Instance Learning},
      author={Alexander Herzog and Shae McFadden and Lorenzo Cavallaro},
      year={2026},
      eprint={2611.28825},
      archivePrefix={arXiv},
      primaryClass={cs.CR}
}