Introduction
While modern language models are excellent at capturing linguistic nuances, they often struggle with basic logic, such as negation, symmetry, and implication. Most previous attempts to address this focused on "hard" rules—logical absolutes. However, real-world knowledge is rarely absolute; most common-sense rules are "soft" (e.g., "If two people live together, they are likely married"). RuleBERT addresses the challenge of teaching models to weigh these approximate rules and reason over them to reach probabilistic conclusions.
Methodology
The RuleBERT framework treats reasoning as a classification task: given a set of facts and soft rules, is a specific hypothesis true? To achieve this, the authors employed three key components:
- Probabilistic Logic Grounding: Using a formal reasoner ($LP^{MLN}$) to calculate the exact mathematical probability of a hypothesis given a set of soft Horn rules.
- Weighted Binary Cross-Entropy (wBCE) Loss: A novel loss function that treats training examples as weighted combinations of positive and negative labels, forcing the model to output specific probabilities (e.g., 0.7) rather than just binary 0 or 1.
- Model Architecture: RoBERTa-Large was used as the base model, receiving facts and rules via natural language templates.
Datasets
The researchers introduced the RuleBERT dataset, containing 3.2 million examples derived from 161 soft rules mined from DBpedia. The dataset covers single-rule reasoning, overlapping (conflicting) rules, and rule chaining up to a depth of 5.
Key Results
RuleBERT achieved high "Confidence Accuracy" (CA@k), meaning its predicted probabilities closely matched the mathematically correct values from the formal reasoner. Notably, the model generalized well to unseen rules, suggesting it learned the underlying mechanics of logic rather than just memorizing facts.
On external benchmarks, RuleBERT showed significant transferability. It achieved 85.2% accuracy on the Negated LAMA dataset (vs. 68.4% for standard RoBERTa) and reached 86.3% accuracy on the bAbI deductive reasoning task in just two epochs.
Limitations and Future Work
Despite its success, RuleBERT faces challenges such as "catastrophic forgetting" when fine-tuned on unrelated tasks. Additionally, the current training relies on structured natural language templates rather than messy, real-world human speech. Future work aims to explore non-entailment scenarios and improve model explainability by providing explicit proof traces for reached conclusions.
Summary updated