Introduction
Large Language Models (LLMs) possess vast encyclopedic knowledge but often struggle to "connect the dots." While they can retrieve individual facts, they frequently fail at knowledge reasoning—the ability to derive new information by combining existing knowledge. This paper introduces Chain-of-Knowledge (CoK), a framework designed to teach LLMs multi-hop reasoning by leveraging Knowledge Graphs (KGs) through a novel "trial-and-error" training mechanism.
The Challenge of Knowledge Reasoning
The authors identify two primary hurdles in LLM reasoning. First, Knowledge Gaps: if a model lacks one prerequisite fact in its internal weights, the entire reasoning chain collapses. Second, Rule Overfitting: during standard fine-tuning, models often learn to follow reasoning templates blindly (e.g., "If X works for Y and Y is in Z, then X lives in Z") without verifying if the underlying facts are present in their memory, leading to confident hallucinations.
Methodology
The CoK framework is built upon two main pillars: structured dataset construction and a specialized learning process.
1. Dataset Construction (KNOWREASON)
To train models effectively, the researchers developed the KNOWREASON dataset by mining Knowledge Graphs like Wikidata5m. The process involves:
- Rule Mining: Extracting logical rules (2-hop to 4-hop) using breadth-first search.
- Knowledge Selection: Ensuring the model is actually reasoning rather than memorizing. This is achieved through an anonymized setting (using random strings for entities) and a regular setting (probing the model to confirm it knows the premises but not the conclusion).
- Sample Generation: Utilizing GPT-3.5 to translate logical triples into natural language questions and coherent reasoning chains.
2. Chain-of-Knowledge Learning
The core innovation is the Trial-and-Error (T&E) mechanism. Unlike standard Behavior Cloning, which only shows correct paths, T&E trains the model to simulate human-like exploration. If a model attempts a reasoning path but finds it lacks a supporting fact, it is trained to backtrace and attempt an alternative logical rule. This teaches the model to discern when a rule is applicable based on its internal state, significantly reducing hallucinations.
Key Insights and Results
Experiments conducted on Llama3-8B and Mistral-7B yielded several critical findings:
- The Hallucination of Logic: Standard training ("Vanilla CoK") can actually increase hallucinations because models become "addicted" to reasoning patterns regardless of factual accuracy. The T&E mechanism acts as a vital regularizer.
- Superior OOD Performance: In anonymized settings, CoK (T&E) significantly outperformed Vanilla Chain-of-Thought (CoT). For Llama3-8B, accuracy on out-of-domain tasks rose from 6.97% to 19.24%.
- Generalization: Training on KG-style reasoning improved performance on general benchmarks like CommonsenseQA (CSQA) and the AI2 Reasoning Challenge (ARC), demonstrating that the logical skills learned are transferable.
- Anonymization as a Pure Test: By using random entity strings, the researchers confirmed that performance gains stemmed from improved logical processing rather than simple fact memorization.
Conclusion and Future Work
Chain-of-Knowledge represents a significant step toward grounding LLM reasoning in factual consistency. While the KNOWREASON dataset provides a robust foundation, future work may involve increasing dataset diversity, exploring more complex non-linear reasoning structures, or integrating external KGs during inference to bridge remaining knowledge gaps.
Summary updated