Adversarial training with restricted data manipulation

David Benfield, Stefano Coniglio, Phan Tu Vuong, Alain B. ZemkohoarXiv 2025 · DOI

Abstract

Adversarial machine learning typically models the interaction between a learner and an adversary as a pessimistic bilevel optimization game. However, unrestricted adversaries can generate unrealistic data that degrades model performance on meaningful threats. This paper introduces a constrained pessimistic bilevel optimization model that restricts adversaries to "realistic" manipulations using non-convex measures like cosine similarity. By employing a nonsmooth Levenberg-Marquardt algorithm to navigate complex mathematical landscapes, the authors develop classifiers that are more resilient and consistent than traditional models.

Introduction: The Problem of Unrestricted Adversaries

In the ongoing arms race of adversarial machine learning, the standard approach is to assume an adversary will maximize loss at any cost. While mathematically sound, this "pessimistic" view often fails in practice because it ignores the adversary's need to maintain the utility or "realism" of their data.

Examples of legitimate and spam email messages used in the study.

Consider spam filtering: an unrestricted adversary might transform a spam email into a string of random gibberish to evade detection. While this technically "wins" the game against the classifier, it fails to deliver the intended message to the recipient. Training models to defend against such "nonsense" attacks often leads to a "distracted" classifier that performs poorly on actual, meaningful adversarial data. Existing solutions often rely on simple $l_2$ distance penalties, but these require the problem to be strongly convex, limiting their applicability to modern text embeddings where cosine similarity is the preferred metric.

Proposed Methodology: Constrained Bilevel Optimization

The authors propose a framework where the Learner (Leader) minimizes loss while the Adversary (Follower) maximizes it, subject to an explicit constraint: the manipulated data must maintain a minimum similarity ($\delta$) to the original input.

A visualization of the non-convex mathematical landscape and constraint regions handled by the proposed solver.

For text-based tasks, the researchers utilize cosine similarity. Because this measure is non-convex, it breaks traditional bilevel solvers that require unique, convex lower-level solutions. To overcome this, the authors implement a nonsmooth Levenberg-Marquardt algorithm. They transform the Karush-Kuhn-Tucker (KKT) optimality conditions into a system of equations using the Fischer-Burmeister function, allowing the solver to find stationary points even in "messy" non-convex landscapes.

Experimental Evaluation

The model was evaluated using two large-scale text datasets converted into 512-dimensional vectors via Google’s BERT embeddings:

  1. TREC: Approximately 68,000 emails (spam and legitimate) from 1993–2006.
  2. Amazon: Over 3 million cell phone reviews (fake and legitimate) from 1998–2014.

The data was processed chronologically to simulate real-world scenarios where classifiers must adapt to evolving adversarial tactics over time.

Key Results and Insights

Using the $P_4$ metric—a symmetric measure ideal for imbalanced datasets—the "BL-Constrained" model was compared against standard logistic regression, unconstrained bilevel models, and $l_2$-regularized models.

  • Superior Resilience: The constrained model consistently outperformed baselines across nearly all test years in both datasets.
  • Metric Importance: On the Amazon dataset, Euclidean ($l_2$) regularization performed poorly, confirming that cosine similarity is a far more effective constraint for high-dimensional text data.
  • Robustness and Efficiency: A significant finding was the model's consistency. The constrained approach is less sensitive to initial conditions and requires fewer trials to reach peak performance compared to unconstrained versions.

Conclusion

By embracing non-convex constraints that reflect real-world adversarial limitations, this research provides a more practical path for adversarial training. While computationally intensive, the move toward "realistic" adversarial modeling ensures that classifiers remain focused on the most dangerous threats without being distracted by mathematical edge cases. Future work will look toward applying these methods to other domains, such as computer vision, where different non-convex similarity measures may be more appropriate.

Summary updated

BibTeX
@misc{benfield2025adversarial,
  author = {David Benfield and Stefano Coniglio and Phan Tu Vuong and Alain B. Zemkoho},
  title = {{Adversarial training with restricted data manipulation}},
  year = {2025},
  eprint = {2510.03254},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.03254},
}
Figure