LogiCoT: Logical Chain-of-Thought Instruction Tuning

Hanmeng Liu, Zhiyang Teng, Leyang Cui, Chaoli Zhang, Qiji Zhou, Yue Zhang

Abstract

While large-scale language models like GPT-4 exhibit sophisticated "Chain-of-Thought" (CoT) reasoning, smaller open-source models frequently struggle with formal logic and multi-step deductions. This paper introduces LogiCoT, a specialized dataset of 70,000 instruction-tuning pairs designed to distill complex logical reasoning capabilities into smaller models. By fine-tuning a LLaMA-7b model on high-quality reasoning chains generated by GPT-4, we developed LLaMA-7b-logicot. This compact model significantly outperforms much larger counterparts, such as Falcon-40b, and rivals proprietary models like ChatGPT on several logical benchmarks, demonstrating that specialized logical tuning can bridge the performance gap between small and large models.

Introduction

The rapid advancement of Large Language Models (LLMs) has led to impressive conversational abilities. However, a "reasoning gap" persists: while models can paraphrase or write creatively, they often fail when faced with symbolic logic, multi-step deductions, or identifying flaws in complex arguments. Most existing instruction-tuning datasets, such as Alpaca, focus on general conversational proficiency rather than the rigorous, step-by-step reasoning required for formal logic.

LogiCoT addresses this by providing high-quality data on how to reason. The approach focuses on "Inference Chains"—the connective tissue between premises—rather than just factual knowledge.

Methodology

The researchers developed a multi-stage pipeline to distill logical reasoning from GPT-4 into a smaller 7B parameter model. The process began with selecting seed data from established logic datasets like FOLIO and ReClor.

Rationale Generation

A critical component of the pipeline is the generation of detailed, step-by-step reasoning chains (rationales). GPT-4 was prompted to generate these rationales, guided by known correct answers to ensure accuracy. This process transforms standard multiple-choice or logic problems into rich instructional data.

Figure 2: Example of a step-by-step reasoning rationale generated by GPT-4 for a logic problem.

Instruction Diversity and Fine-Tuning

The instructions were categorized into two main types:

  1. General Inference: Tasks involving translating natural language to logic, performing one-step deductions, and constructing full inference chains.
  2. Reading Comprehension: Tasks focused on identifying necessary claims, strengthening or weakening arguments, and spotting logical fallacies.

The final LLaMA-7b-logicot model was trained on this 70,000-instance dataset.

Dataset Construction

The LogiCoT training set leverages several seminal datasets:

  • LOGICINFERENCE & FOLIO: Used for symbolic and first-order logic.
  • EntailmentBank: Provides multi-step reasoning trees.
  • ReClor & LogiQA: Features "real-world" verbal reasoning from standardized tests like the LSAT and GMAT.

For evaluation, the authors introduced LogiEval, a suite of eight benchmarks including AR-LSAT and TaxiNLI, alongside the standard MMLU benchmark to test general intelligence.

Results and Analysis

The fine-tuned LLaMA-7b-logicot model demonstrated striking performance improvements across all benchmarks.

Performance on LogiEval

LLaMA-7b-logicot achieved an overall average score of 40.69%, more than doubling the performance of the base LLaMA-7b model (20.22%). Notably, it outperformed models significantly larger than itself, including LLaMA-30b-supercot and Falcon-40b-instruct.

Figure 4: Comparative performance of LLaMA-7b-logicot against base models and larger instruction-tuned models across various logic datasets.

Generalization and Specialized Tasks

Beyond pure logic puzzles, the model showed an 11.5% absolute improvement in average accuracy on the MMLU benchmark. This suggests that logical tuning enhances general problem-solving capabilities across diverse subjects like law, STEM, and the humanities. On specific datasets like ReClor and TaxiNLI, the 7B model even slightly outperformed ChatGPT, highlighting the efficacy of specialized distillation.

Discussion and Limitations

While LogiCoT represents a significant step forward, several challenges remain. The model's reasoning skills do not perfectly transfer across languages; for instance, performance on the Chinese version of LogiQA was lower than on the English version. Additionally, the model occasionally suffers from "complex hallucinations," where it may invent constraints or fail to exhaustively evaluate all options in highly intricate analytical questions. Performance also tends to degrade as passage length increases, making it harder for the model to track multiple entities.

Future research will explore integrating LogiCoT with dialogue-oriented tuning to create models that are both helpful conversationalists and rigorous logical thinkers.

Summary updated

BibTeX
@inproceedings{liu2023logicot,
  author = {Hanmeng Liu and Zhiyang Teng and Leyang Cui and Chaoli Zhang and Qiji Zhou and Yue Zhang},
  title = {{LogiCoT: Logical Chain-of-Thought Instruction Tuning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.191},
}
Figure