Logical reasoning is central to complex human activities, such as thinking, debating, and planning; it is also a central component of many AI systems as well. In this paper, we investigate the extent to which encoder-only transformer language models (LMs) can reason according to logical rules. We ask whether those LMs can deduce theorems in propositional calculus and first-order logic; if their relative success in these problems reflects general logical capabilities; and which layers contribute the most to the task. First, we show for several encoder-only LMs that they can be trained, to a reasonable degree, to determine logical validity on various datasets. Next, by cross-probing fine-tuned models on these datasets, we show that LMs have difficulty in transferring their putative logical reasoning ability, which suggests that they may have learned dataset-specific features, instead of a general capability. Finally, we conduct a layerwise probing experiment, which shows that the hypothesis classification task is mostly solved through higher layers.
翻译:逻辑推理是人类复杂活动(如思考、辩论和规划)的核心,也是许多人工智能系统的关键组成部分。本文研究了仅编码器Transformer语言模型(LMs)依据逻辑规则进行推理的能力程度。我们探讨了这些模型能否推导命题演算和一阶逻辑中的定理;它们在这些问题上的相对成功是否反映了普遍的逻辑能力;以及哪些层对任务贡献最大。首先,我们证明多个仅编码器语言模型可以在合理程度上被训练以判断不同数据集上的逻辑有效性。其次,通过在这些数据集上对微调模型进行交叉测试,我们发现语言模型难以迁移其假定的逻辑推理能力,这表明它们可能学习了数据集特定的特征,而非通用能力。最后,我们进行了分层探测实验,结果显示假设分类任务主要通过高层网络层完成。