arXiv:2610.33298cs.LGOct 2026

Manuscript Offprint

arXiv:2610.33298

All-in-One: A Composable Attack on LLM Transformations

Xiaohua Zhan, Kazuki Egashira, Robin Staab, Mark Vero, Martin Vechev

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Quantization, pruning, and model merging are popular transformations applied to deployment-ready LLMs to improve efficiency and downstream performance. Recent work has shown that these transformations can introduce a security threat: an adversary can train a model that passes safety checks in its pre-transformed state, only turning malicious once it is transformed for deployment. However, prior attacks target one specific transformation (e.g., quantization) and generally rely on transformation-specific techniques, making them difficult to combine in practice. In this work, we introduce a simple, composable attack framework that targets multiple transformations simultaneously and triggers when any one of them is applied by a user. Our key insight is that the effect of each transformation can be approximated as a perturbation to the model weights, allowing us to jointly train the model with a benign loss on the original model and a malicious loss on each simulated transformed model. These perturbations are simple enough to simulate at every training iteration across diverse transformations, making them practically combinable within a single training objective, enabling a unified attack. Through extensive experiments across attack scenarios, model families, and a wide range of deployment-time model transformations, we show that our attack achieves high success rates. This demonstrates that model transformations may be utilized to trigger significantly different behavior from the original model and reinforces the associated security concerns by demonstrating that a single attack can jointly target diverse transformations.

1 INTRODUCTION

Large language models (LLMs) consist of billions of parameters, making the compute required to serve or adapt them unattainable for most practitioners. To address this, various deployment-time model transformations have been proposed to reduce inference costs or enhance model capabilities without the need for extra training. Prominent examples of such transformations include quantization and pruning for improving inference efficiency, and model merging for lightweight model adaptation.

Exploiting Deployment-Time Model Transformations. Previous works have shown that certain deployment-time model transformations may be utilized to trigger security issues. Specifically, an attacker can construct a model such that it appears benign and passes pre-deployment safety inspection, yet exhibits malicious behavior after a specific transformation is applied. This type of attack has been demonstrated for quantization (Hong et al., 2021; Pan et al., 2021; Tian et al., 2021; Ma et al., 2023a; Dong et al., 2025; Egashira et al., 2024; 2025b; Song et al., 2026; Zhan et al., 2026) and pruning (Tian et al., 2021; Egashira et al., 2025a). Importantly, these attacks are designed to target a particular transformation, typically based on an insight that applies only to one type of transformation. As such, the applicability of these attacks beyond those tested, or whether they can be composed to target multiple transformations at once, remains unclear.

This Work: Attacking Deployment-Time Model Transformations All at Once. In this work, we introduce the first attack that triggers across a wide range of model transformation families, including quantization, pruning, and model merging. We show an overview of our attack in Figure 1. Our key observation is that the effect of various model transformations on the model weights can be

Figure

Figure 1: Overview of our any-transformation-activated attack. The adversary jointly optimizes a benign loss and malicious losses with a target behavior. The malicious losses are calculated on inexpensive surrogates simulating deployment-time transformations. The released model behaves benignly prior to any transformation. However, any of the deployment-time weight transformations targeted by the training-time surrogates activates the hidden malicious behavior.

approximated by constructing simple surrogate perturbations randomly sampled from a distribution in each training step (Section 3). For example, we find that Gaussian noise with carefully calibrated variance provides a sufficient approximation for the quantization error. Similarly, stochastic weight masking and random layer dropping (for unstructured and structured pruning, respectively), and linear rescaling of the task vector (for model merging) can be used to approximate the effect of these transformations on the model weights. We then train the model by incorporating a benign loss on the original model and malicious losses on the perturbed models. Importantly, the perturbations are simple and cheap to compute so they can be combined within a single training objective, allowing easy integration of multiple transformations into a single attack. This way, the adversary can train a model that behaves benignly under the original weights but exhibits malicious behavior when any of the transformations considered by the adversary are applied.

Through extensive evaluation with 156 transformation configurations across four LLMs, three attack scenarios, and 13 deployment-time transformations, we observe in 137 setups that the post-transformed model exhibits the targeted malicious behavior, with an attack success rate (ASR) of at least 20%. Interestingly, the malicious behavior of our attacked model also transfers to a range of transformations that are not explicitly targeted, including several SVD-based compression methods. Our results show that several distinct deployment-time transformations can be exploited at once, broadening the security risks posed by transformation-triggered attacks beyond any individual transformation. We urge the community to recognize this risk and the importance of evaluating models in the form in which they will be deployed.