Abstract
Recent advancements in natural language processing have led to the development of "Soft Theorem Provers" (STPs)—neural models capable of performing deductive reasoning over natural language facts and rules. While these models achieve high accuracy on benchmarks, their true reasoning capabilities remain under scrutiny. This paper introduces LAVA (Logically consistent AdVersarial Attacker), a framework designed to probe the limits of STPs by generating adversarial examples that are guaranteed to be logically sound. By integrating a symbolic solver into the attack loop, LAVA reveals that even high-performing models often rely on shallow heuristics rather than robust logical deduction.
Introduction
Soft Theorem Provers, typically based on Transformer architectures, are trained to determine if a specific natural language query is entailed by a provided context of facts and rules. Despite near-perfect scores on datasets like RuleTakers, it is unclear whether these models are truly simulating logical inference or merely exploiting statistical shortcuts. Standard adversarial attacks, which perturb text to induce model failure, are often unsuitable for testing logical reasoning. In a formal logic context, changing a single word can flip the ground-truth label, leading to the "logical inconsistency problem." If an attacker changes a premise such that the answer changes from "True" to "False" but still expects the model to predict "True," the attack is invalid. LAVA addresses this by ensuring every perturbation is verified against a symbolic logic engine.
The LAVA Framework
LAVA is a black-box generative adversarial framework consisting of a Transformer-based Attacker and a Victim STP. The core innovation of LAVA is the integration of ProbLog, a symbolic solver, to maintain logical integrity throughout the perturbation process.
Perturbation Strategies
The attacker utilizes three primary template-based strategies to modify the input:
- Question Flipping (QuesFlip): The query is negated to see if the model can handle the inverse logic.
- Sentence Elimination (SentElim): Specific facts are removed from the context to test if the model's conclusion changes appropriately.
- Equivalence Substitution (EquivSub): A fact is replaced with a logically equivalent rule (e.g., replacing fact "A" with the rule "If B, then A," where "B" is an existing fact).
Label Verification and Optimization
Unlike standard attackers that assume the label remains constant, LAVA passes every perturbed program to the symbolic solver. The solver computes a new, logically consistent ground-truth label. The attacker is then trained via reinforcement learning (REINFORCE) to maximize the victim's loss against this verified label, ensuring the model is penalized for genuine reasoning errors rather than label mismatches.
Experimental Setup and Datasets
The framework was evaluated using the RuleTakers dataset, a benchmark designed for logical reasoning in natural language. RuleTakers contains facts and rules (e.g., "If someone is smart, they are happy") and categorizes samples by "proof depth"—the number of deductive steps required to reach a conclusion (ranging from 0 to 5+).
Key Results and Insights
The Consistency Gap
Research revealed a significant "Consistency Gap" in prior methods. Standard attacks like HotFlip were found to produce inconsistent labels up to 80% of the time. When these attacks were corrected by a symbolic solver, their success rates dropped drastically, suggesting that previous adversarial successes were largely due to presenting models with logically impossible tasks.
Reasoning vs. Heuristic Matching
LAVA's attacks highlighted that STPs often rely on "word matching." Models are frequently fooled if a query's text appears within a rule's body, even if that rule is not supported by the available facts. This suggests the models prioritize lexical overlap over logical flow.
Brittleness with Depth
As the complexity of the required logic increases, model performance degrades. LAVA's Attack Success Rate (ASR) rose from approximately 19% for 1-step proofs to over 47% for proofs requiring three or more steps. Furthermore, models struggled with variable binding in quantified rules (e.g., "If someone is happy, they like John"), often failing to correctly associate predicates with specific entities.
Performance and Hardening
LAVA achieved a 28.6% ASR against a robust RoBERTa-large model, significantly higher than consistency-adjusted baselines like TextFooler (10.1%). Additionally, LAVA-generated attacks showed high transferability between different models (up to 84%), indicating shared logical vulnerabilities across architectures. Finally, using LAVA for adversarial training improved the accuracy of weaker models like DistilRoBERTa by as much as 17.5% on adversarial sets.
Conclusion
LAVA provides a rigorous method for evaluating the reasoning limits of Soft Theorem Provers. By enforcing logical consistency, the framework demonstrates that current models are susceptible to shallow heuristics and struggle as deductive complexity increases. However, the success of adversarial training using LAVA suggests that these models can be "hardened," moving them closer to true logical robustness. Future work will focus on expanding the diversity of attacks beyond template-based substitutions and applying the framework to more complex logical structures.
Summary updated