Neuro-Symbolic Contrastive Learning for Cross-domain Inference
Mingyue Liu, Ryo Ueda, Zhen Wan, Katsumi Inoue, Chris G. Willcocks
TL;DR
This work tackles the issue that pretrained language models struggle with genuine logical inference by combining inductive logic programming with neural networks through a neuro-symbolic contrastive learning framework. The method uses ILP-derived meta-rules to generate hard positive and hard negative pairs, mapping data between logical forms and natural language via LoLA and Grammatical Framework, and optimizes a contrastive loss $\mathcal{L}_{cl}$ to carve a logical structure into the neural embedding space. Empirical results on ILP-inspired NLI datasets show improved cross-domain and cross-form transfer, with logic-form representations sometimes outperforming NL forms in reasoning tasks. The approach advances interpretable, generalizable reasoning for NLP by leveraging symbolic rules to guide differentiable learning and data augmentation.
Abstract
Pre-trained language models (PLMs) have made significant advances in natural language inference (NLI) tasks, however their sensitivity to textual perturbations and dependence on large datasets indicate an over-reliance on shallow heuristics. In contrast, inductive logic programming (ILP) excels at inferring logical relationships across diverse, sparse and limited datasets, but its discrete nature requires the inputs to be precisely specified, which limits their application. This paper proposes a bridge between the two approaches: neuro-symbolic contrastive learning. This allows for smooth and differentiable optimisation that improves logical accuracy across an otherwise discrete, noisy, and sparse topological space of logical functions. We show that abstract logical relationships can be effectively embedded within a neuro-symbolic paradigm, by representing data as logic programs and sets of logic rules. The embedding space captures highly varied textual information with similar semantic logical relations, but can also separate similar textual relations that have dissimilar logical relations. Experimental results demonstrate that our approach significantly improves the inference capabilities of the models in terms of generalisation and reasoning.
