Adversarial attacks—tiny, often invisible perturbations to input data—can cause deep learning models to fail spectacularly. While researchers have developed "certified robustness" methods to provide mathematical guarantees against these attacks, these purely data-driven approaches have hit a performance ceiling.
In a paper presented at NeurIPS 2022, researchers propose a paradigm shift: integrating statistical machine learning with logical reasoning. By wrapping neural networks in a layer of domain knowledge using Markov Logic Networks (MLNs), they demonstrate that we can significantly push the boundaries of how much noise a model can safely tolerate.
The Bottleneck in Current Defenses
Most current defenses against adversarial attacks are empirical—they work until a cleverer attacker finds a new loophole. Certified robustness aims to solve this by providing a "safety radius": a mathematical guarantee that the model's prediction will not change for any perturbation within a certain limit.
However, existing certified methods (like randomized smoothing) rely solely on the data the model was trained on. They ignore "exogenous" information—the common-sense rules humans use to stay robust. For example, a human knows a "Stop" sign must be octagonal. If an attacker modifies the sign to look like a "Yield" sign but leaves it octagonal, a human's reasoning would catch the inconsistency. This paper brings that reasoning capability to ML models to break the current robustness bottleneck.
The Sensing-Reasoning Pipeline
To incorporate human-like logic, the authors introduce a two-stage Sensing-Reasoning Pipeline:
- Sensing Component: A set of standard deep neural networks (sensors) that output probabilities for various attributes (e.g., "Is this a stop sign?", "Is this an octagon?").
- Reasoning Component: A Markov Logic Network (MLN) that takes these probabilities and applies first-order logic rules to produce a final, consistent prediction.
In this setup, logic acts as a powerful regularizer. Even if an attacker successfully "fools" the primary sensor, they must also fool all related attribute sensors in a way that remains logically consistent, which is significantly harder to achieve.
The Challenge of Certification
Certifying this pipeline is non-trivial. The authors prove that checking the robustness of an MLN is #P-hard, meaning it is at least as difficult as the most complex counting problems in computer science. This establishes that certifying reasoning is fundamentally as difficult as the reasoning itself.
To bypass this computational wall, they developed a novel certification algorithm. By using Lagrangian multipliers, they decouple the complex probability distributions of the MLN into manageable sub-problems.
The critical insight is that exact solutions to the #P-hard problem are not required to generate a valid certificate. The "exponential family" nature of MLNs provides helpful mathematical properties—specifically monotonicity and convexity within the MLN's factor graph. These properties allow the algorithm to efficiently search for reliable upper and lower bounds on the model's output, even when exact calculation is impossible.
Empirical Results
The researchers evaluated their approach on five diverse datasets, including vision tasks (GTSRB, Word50, PrimateNet, MNIST, CIFAR10) and natural language processing (HighTech). The sensing-reasoning pipeline consistently outperformed state-of-the-art "pure" ML models:
- Road Sign Safety: On the GTSRB dataset, at a large perturbation radius ($L_2$ radius of 1.0), the vanilla smoothed model achieved 61.7% certified accuracy. The sensing-reasoning pipeline improved this to 62.5%.
- Preventing Total Failure: In scenarios where vanilla methods dropped to 0% certified accuracy due to the looseness of standard statistical bounds, the reasoning-enabled pipeline often maintained robustness levels above 70%.
- NLP Robustness: On the HighTech text dataset, the pipeline improved certified accuracy from 38.4% to 58.8% under high-uncertainty conditions.
Limitations and Future Work
While promising, the framework has areas for future refinement:
- The Oracle Assumption: The current algorithm assumes access to an "inference oracle" for the MLN. For extremely large or dense logic graphs, exact inference becomes a computational bottleneck.
- Rule Engineering: The system currently relies on human-provided or pre-existing logical rules. Future work could explore automatically "learning" these rules from data while maintaining the ability to certify them.
- Search Efficiency: The search for optimal Lagrangian multipliers currently uses grid search or random sampling. More sophisticated gradient-based optimization could lead to even tighter, and thus better, robustness certificates.
By bridging the gap between statistical learning and logical reasoning, this work provides a compelling new direction for building AI systems that are not just accurate, but provably safe.
Summary updated