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

Taewhoo Lee, Minju Song, Chanwoong Yoon, Jungwoo Park, Jaewoo Kang

TL;DR

This paper investigates how Large Language Models (LLMs) handle analogical reasoning, revealing that while models successfully encode abstract relationships in their mid-to-upper layers, they often stumble when trying to apply those relationships to new contexts. By using mechanistic interpretability tools, the authors show that successful analogies depend on "structural alignment"—the model's ability to internally map corresponding elements between two different situations.

What Problem Does This Paper Address?

Analogical reasoning—the ability to see that "A is to B as C is to D"—is a cornerstone of human intelligence. It allows us to solve novel problems by drawing parallels to familiar ones. While LLMs have shown impressive pattern-matching abilities, it has remained unclear whether they are truly performing relational reasoning or just relying on surface-level statistical correlations.

The authors set out to determine:

  1. Do LLMs actually encode high-level relational concepts (like "author of" or "capital of")?
  2. Where and how is this information processed within the model's layers?
  3. Why do models fail even when they possess the underlying knowledge required for an analogy?

Methods

The researchers employed a suite of "mechanistic interpretability" techniques to peek under the hood of models like Llama-2, Gemma, and Qwen:

  • Attention Knockout: They selectively disabled attention pathways to identify which tokens and layers are critical for predicting the final answer.
  • Linear Probing: They trained simple classifiers on the models' internal hidden states to see if relational information is "linearly separable" (i.e., easily accessible) at specific depths.
  • Patchscopes: A novel technique used to "translate" a model's hidden representations into natural language. By injecting a hidden state into a specific prompt, they could see if the model "thought" a token represented a specific attribute or a relation.
  • Activation Patching: They manually "fixed" failing analogies by injecting hidden representations from successful cases into the layers of failing ones to see if the model could then reach the correct conclusion.
  • Mutual Alignment Score (MAS): The authors introduced this metric to quantify "structural alignment"—how well the model's internal representations of a source story "line up" with a target story, token by token.

Datasets

The study utilized two primary types of analogies:

  1. Proportional Analogies: Built using AnalogyKB, a million-scale knowledge base. The authors manually filtered this into a set of 50,000 analogies, ensuring the models actually had the prerequisite knowledge to solve them and weren't just using "shortcuts" (like direct associations between words).
  2. Story Analogies: Sourced from the StoryAnalogy dataset, which requires models to identify thematic parallels between two different narratives (e.g., two stories about "every cloud has a silver lining" despite having different characters and settings).

Key Insights and Ideas

  • The Mid-Layer "Reasoning Room": Relational information isn't present in the early layers. It emerges and peaks in the mid-to-upper layers. If a model fails an analogy, it's often because this relational signal is missing or degraded in these specific layers.
  • The Application Bottleneck: Interestingly, models often successfully encode the relation (e.g., they know the relationship is "author of") but fail to apply it to the new entity. The "link" token (the word "as" in "A is to B as C is to D") acts as a critical bottleneck for transferring this relational info.
  • Structural Alignment is Key: For complex story analogies, success is highly correlated with how well the model aligns the "structure" of the stories. In successful cases, the model's internal representation of "the warrior" in Story A aligns closely with "the patient" in Story B, because they play the same functional role in the narrative.
  • Human-Like but Limited: The way LLMs perform structural alignment mirrors aspects of human cognition (as described by Gentner’s Structure-Mapping Theory), but LLMs are far more vulnerable to "distractor" stories that share surface-level keywords but different underlying themes.

Key Results

  • Patching Works: By patching representations of the second entity ($e_2$) into the "link" token position, the researchers were able to rectify up to 38.1% of reasoning failures. This proves the information was there; the model just failed to move it to the right place.
  • High Probing Accuracy: Linear probes reached an average accuracy of 82.9% in middle layers (layers 20-30) when distinguishing between analogous and non-analogous stories, showing that the models develop a clear internal "map" of analogical structure.
  • Relational vs. Attributive: Patchscopes revealed that while "attributive" info (what an object is) persists throughout most layers, "relational" info (how objects connect) is much more fragile and is the primary point of failure in incorrect analogies.

Limitations and Future Work

The authors acknowledge several limitations:

  • Scope: The study focused on proportional and story analogies; other forms (like visual or metaphorical analogies) were not explored.
  • Language: The benchmarks are English-centric.
  • Application: While they identified the "application bottleneck," they haven't yet developed a training method to permanently fix it, relying instead on manual interventions (patching).

Future research could focus on using these insights to design better prompting strategies or fine-tuning objectives that specifically encourage stronger structural alignment and more robust relational transfer.

Summary updated

BibTeX
@inproceedings{lee2026curious,
  author = {Taewhoo Lee and Minju Song and Chanwoong Yoon and Jungwoo Park and Jaewoo Kang},
  title = {{The Curious Case of Analogies: Investigating Analogical Reasoning in Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i37.40414},
}
Figure