Skip to content

[AAAI 2026] The Curious Case of Analogies: Investigating Analogical Reasoning in Large Language Models

Notifications You must be signed in to change notification settings

dmis-lab/analogical-reasoning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Curious Case of Analogies: Investigating Analogical Reasoning in Large Language Models

This is the official repository for the paper "The Curious Case of Analogies: Investigating Analogical Reasoning in Large Language Models".

Setup

We recommend using the following versions for compatibility.

  • PyTorch 2.3.1
  • Cuda 12.4
conda env create -f environment.yml --name analogical_reasoning

Experiments

Section 4

  • evaluate_knowledge.py is used to obtain correct / incorrect test samples for each model.
  • knockout_attention.py is used to block specific attention edges to identify critical positions for answer resolution.
  • entity_description.py is used to obtain natural language descriptions of hidden states using Patchscopes.

Section 5

  • evaluate_knowledge_swap_pair.py is used in the first intervention experiment, where we replace the first entity pair with that of a correct analogy.
  • patch.py is used in the second error analysis experiment, where we patch the representations of e2 to the link.

Section 6

  • run_dual_probe.py is used to run probing experiments that can test whether and where models encode analogical structure in their internal representations.
  • evaluate_story_analogy.py is used to evaluate model performance on story analogies, as well as to obtain layer-wise token representations that can be used to calculate the Mutual Alignment Score (MAS).

Analysis

  • Follow the steps in inspect_section{4_a,4_b,5,6}.ipynb to analyze and reproduce experimental results.

About

[AAAI 2026] The Curious Case of Analogies: Investigating Analogical Reasoning in Large Language Models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published