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)在多大程度上能够按照逻辑规则进行推理。我们探究了这些LM是否能推导出命题演算和一阶逻辑中的定理;它们在这些问题上的相对成功是否反映了通用的逻辑能力;以及哪些层面对该任务贡献最大。首先,我们展示了多个仅编码器LM能够在合理程度上通过训练来确定各种数据集的逻辑有效性。接着,通过对这些数据集上的微调模型进行交叉探测,我们发现LM在迁移其假定的逻辑推理能力方面存在困难,这表明它们可能学习的是数据集特定的特征,而非通用能力。最后,我们进行了逐层探测实验,结果显示假设分类任务主要通过较高层解决。