ANALOGYKB: Unlocking Analogical Reasoning of Language Models with A Million-scale Knowledge Base

Siyu Yuan, Jiangjie Chen, Changzhi Sun, Jiaqing Liang, Yanghua Xiao, Deqing Yang · DOI

Abstract

Analogical reasoning is a fundamental component of human cognition, enabling the mapping of familiar relational structures to novel domains. Despite the success of Large Language Models (LLMs), they often struggle with formal analogical tasks due to a lack of large-scale, high-quality training data. We introduce ANALOGYKB, the first million-scale knowledge base specifically designed for analogical reasoning. By mining Wikidata and ConceptNet and employing an LLM-based filtering pipeline, we demonstrate significant performance gains in both small and large language models across multiple benchmarks.

Introduction

Analogical reasoning—the ability to recognize that "a heart is to a pump as a brain is to a computer"—allows humans to solve complex problems by leveraging structural similarities between disparate concepts. While LLMs exhibit impressive capabilities, their performance on formal analogy tasks is often hampered by a "data drought." Existing datasets typically contain only a few thousand samples, which is insufficient for teaching models the abstract relational structures necessary for high-level reasoning. ANALOGYKB addresses this bottleneck by providing over one million concept pairs across nearly a thousand relations.

Methodology: Mining Analogies from Knowledge Graphs

The construction of ANALOGYKB involves mining two primary "seed" Knowledge Graphs (KGs): Wikidata and ConceptNet. The researchers identified two distinct types of analogies:

  1. Analogies of the Same Relation: These are formed by pairing concept tuples that share the same relation (e.g., Lion:Animal :: Apple:Fruit).
  2. Analogies of Analogous Relations: This core innovation involves identifying different relations that share a higher-order "meta-relation." For instance, the relationship between a CEO and a Company is structurally analogous to that between a Head of State and a Country.
Comparison of Same Relation and Analogous Relation structures in ANALOGYKB.

To identify these complex pairs, the authors utilized an LLM-in-the-loop pipeline. Candidate relations were selected based on embedding similarity, followed by LLM-based prediction to determine if the relations were truly analogous. To ensure quality, the pipeline enforced symmetry (if R1 is analogous to R2, then R2 must be analogous to R1) and required the LLM to summarize the meta-relation connecting the pairs.

Dataset Characteristics

The resulting ANALOGYKB contains over 1 million concept pairs spanning 943 relations, including 103 pairs of "analogous relations." The dataset covers a wide variety of domains, from biological species and geographical regions to organizational roles and historical events. Evaluation was conducted on six established benchmarks: E-KAR, BATS, UNIT 2, UNIT 4, Google, and SAT, as well as the SCAN dataset for out-of-domain scientific analogies.

Results and Analysis

The integration of ANALOGYKB led to consistent improvements across various model architectures and sizes.

Performance Gains in Small and Large Models

For smaller models like RoBERTa and DeBERTa, fine-tuning on ANALOGYKB increased mean accuracy on recognition tasks from approximately 60% to over 77%. In the case of large-scale models like GPT-3.5, using ANALOGYKB for in-context learning (few-shot prompting) yielded dramatic results. On the SCAN benchmark, InstructGPT's accuracy improved from a zero-shot baseline of 3.32% to 15.30%.

Performance improvements across multiple benchmarks after fine-tuning on ANALOGYKB.

Structural Logic vs. Semantic Similarity

A key insight from the study is that relational structure is more critical than simple semantic similarity. Models trained on "analogous relations" outperformed those trained only on "same relation" pairs, suggesting that abstract logic is better learned when the model is forced to map across different relational types. Furthermore, training on "pseudo-analogies" (randomly paired concepts) resulted in performance degradation, confirming that the specific relational logic captured in ANALOGYKB is the primary driver of improvement.

Discussion and Limitations

While ANALOGYKB represents a significant advancement, several challenges remain. The current knowledge base primarily utilizes the standard "A:B :: C:D" format, which may not fully capture the complexity of real-world analogies involving multi-entity systems (e.g., comparing the entire structure of a camera to a human eye). Additionally, while the general-purpose KGs provide broad coverage, they may lack the depth required for highly specialized technical domains. Future research will focus on bridging the gap between structured knowledge tuples and the fluid, metaphorical nature of natural language.

Summary updated

BibTeX
@inproceedings{yuan2024analogykb,
  author = {Siyu Yuan and Jiangjie Chen and Changzhi Sun and Jiaqing Liang and Yanghua Xiao and Deqing Yang},
  title = {{ANALOGYKB: Unlocking Analogical Reasoning of Language Models with A Million-scale Knowledge Base}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.68},
}
Figure