Introduction
In modern artificial intelligence, developers rely on high-level frameworks like PyTorch and TensorFlow to abstract away complex hardware details. Under the hood, these frameworks depend on Basic Linear Algebra Subprograms (BLAS) libraries—such as Intel MKL, Nvidia CUDA, and Apple Accelerate—to handle the heavy lifting of matrix multiplications and convolutions.
While the industry generally assumes these backends are perfectly interchangeable, this paper reveals a subtle vulnerability: "mathematically equivalent" linear algebra libraries produce slightly different results due to the non-associative nature of floating-point arithmetic. Exploiting this, the authors introduce Chimera examples—adversarial inputs specifically engineered to trigger these discrepancies, causing a single model to produce conflicting predictions depending solely on which hardware backend executes the computation.
The Fragility of Floating-Point Math
Because computers must round numbers to fit into fixed bit-widths (like 32-bit floats), the order of mathematical operations matters. In floating-point arithmetic, $(a + b) + c$ does not always strictly equal $a + (b + c)$. BLAS specifications allow libraries to reorder operations to maximize speed on specific CPUs or GPUs.
Normally, the resulting differences are microscopic (around $10^{-10}$). However, this paper asks a critical security question: Can an attacker selectively amplify these tiny errors to flip a model's classification?
Introducing Chimera Examples
To answer this, the authors propose a novel white-box attack to generate Chimera examples. These are inputs that look identical to a human but force the neural network into a state of disagreement across different backends.
Unlike standard adversarial attacks that push an input toward a single "wrong" class, this method targets multiple backends simultaneously.
Methodology
The attack relies on a few key mechanisms:
- Tug-of-War Optimization: The method assigns a different target label to each backend and computes an aggregated gradient. This creates a "tug-of-war" effect, pulling the input toward a precise region in the high-dimensional space where the backends' decision boundaries diverge.
- Discrete Input Constraints: Most adversarial attacks assume infinite precision. Because real-world images are often 8-bit integers, the authors incorporate a quantization function into their search loop. This ensures the resulting Chimera example remains a valid, representable input (e.g., a standard JPEG-compatible image) rather than a theoretical mathematical construct.
Key Findings and the "GPU Gap"
The researchers evaluated their attack across three standard benchmarks: FashionMNIST, CIFAR-10, and ImageNet (using a pre-trained EfficientNetV2-S model).
- The "GPU Gap": The most successful attacks occurred when comparing CPU-based backends (like OpenBLAS or Intel MKL) against Nvidia's cuBLAS (GPU). GPUs use fundamentally different algorithms for convolutions to leverage parallel processing, leading to much larger numerical "pockets" of disagreement. On ImageNet, the attack achieved a 100% success rate in creating inputs that elicit different predictions between CPU backends and Nvidia GPUs.
- CPU-to-CPU Vulnerability: The vulnerability is not strictly a hardware issue; it lies in the software implementation of the math. Even between different CPU libraries running on the exact same architecture (e.g., Intel MKL vs. OpenBLAS), the attack succeeded 16% to 44% of the time.
- Pockets of Inconsistency: Chimera examples are not isolated mathematical glitches. The authors found that these inputs are surrounded by "pockets" of other conflicting vectors, sometimes spanning up to 100,000 Units in the Last Place (ULPs).
Defending Against the Threat
To counter this vulnerability, the authors propose a Keyed Noise Defense. By adding a small amount of deterministic noise to the input—generated using a pseudorandom number generator initialized with a secret key and the input itself—the defense effectively "blurs" the tiny pockets of imprecision that the attacker relies on.
This defense proved highly effective, reducing the attack success rate to near 0% in most scenarios without degrading the model's overall test accuracy.
Limitations and Future Work
While groundbreaking, the current attack model has limitations. It requires a "white-box" setting, meaning the adversary must have full access to the model weights and know the specific backends being used. The feasibility of "black-box" Chimera attacks remains an open question. Furthermore, the proposed defense relies on a secret key; if an attacker steals this key, they could incorporate the noise into their gradient calculations and potentially bypass the defense.
Future work could explore other common operations like LayerNorm or specialized activation functions, which might harbor similar numerical instabilities, expanding our understanding of backend-induced vulnerabilities.
Summary updated