← Latest papers
💬 NLP

Detecting Differences Is Not Understanding Structure: Large Language Models Fail at Graph Isomorphism

This paper reveals that large language models' apparent success in detecting graph isomorphism is illusory, as they fail to recognize identical graphs with permuted node labels, indicating they rely on superficial patterns rather than genuine structural reasoning.

Original authors: Kumar Thushalika, Sukumar Kishanthan, Asela Hevapathige

Published 2026-06-09
📖 4 min read☕ Coffee break read

Original authors: Kumar Thushalika, Sukumar Kishanthan, Asela Hevapathige

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Idea: "Recognizing a Face vs. Recognizing a Name"

Imagine you have a friend, let's call him Bob. You know Bob perfectly well. You know his face, his voice, and how he walks.

Now, imagine someone hands you a photo of Bob, but they've digitally changed his name tag from "Bob" to "Charlie."

  • A smart observer looks at the photo, sees the face, and says, "That's still Bob, just with a new name tag."
  • A pattern-matching robot looks at the photo, sees the name tag says "Charlie," and panics. It thinks, "This isn't Bob! The name is different, so the person must be different!"

This paper is about testing Large Language Models (LLMs) to see if they are the "smart observer" or the "pattern-matching robot" when it comes to understanding shapes and connections (graphs).

The Test: The "Graph Isomorphism" Puzzle

In math, there is a puzzle called Graph Isomorphism. It asks: "Are these two shapes actually the same, even if they look different on paper?"

Think of a graph like a map of a subway system.

  • Graph A lists stations as "Stop 1, Stop 2, Stop 3."
  • Graph B lists the exact same stations as "Station Alpha, Station Beta, Station Gamma."

If the connections between the stops are identical, the maps are the same (isomorphic). A true understanding of the map means you know the structure is the same, regardless of what you call the stops.

What the Researchers Did

The researchers gave three popular AI models (GPT-4o, Gemini, and Llama) a series of tests with two parts:

Part 1: The "Easy" Test (Spotting Differences)
They showed the AI pairs of maps. Some were clearly different (like a subway with 5 stops vs. one with 10).

  • The Result: The AI models were amazing. They got almost 100% correct. They could easily tell when two maps were totally different.

Part 2: The "Tricky" Test (The Name Change)
This is where the real test happened. They took a map, kept the structure exactly the same, but scrambled the names of the stops (e.g., changing "Stop 1" to "Stop 5").

  • The Question: "Are these two maps the same?"
  • The Expectation: Since the structure didn't change, the answer should be "Yes."
  • The Reality: The AI models failed miserably.
    • When the names were scrambled, the models said, "No, these are different!"
    • They were fooled by the change in labels. They didn't see the underlying shape; they only saw that the text labels were different.

The Analogy: The "Recipe" vs. The "Ingredients List"

Imagine you are baking a cake.

  • The Structure: The recipe (mix flour, then eggs, then bake).
  • The Labels: The names of the ingredients (e.g., "Flour" vs. "Wheat Powder").

If you write a recipe using "Wheat Powder" instead of "Flour," but the steps are identical, the cake is the same.

  • True Understanding: You know the process makes the cake, not the specific words used.
  • The AI's Failure: The AI acts like a chef who thinks, "If the ingredient list says 'Wheat Powder' instead of 'Flour', this is a completely different recipe!" It gets confused by the words, not the logic.

The Conclusion: "Detecting Differences is Not Understanding Structure"

The paper's main title says it all: "Detecting Differences Is Not Understanding Structure."

The AI models are very good at spotting surface-level differences (like different numbers of nodes or different labels). But they are not actually reasoning about the abstract shape or structure of the graph. They are just matching patterns in the text.

  • If you rename the nodes: The AI thinks the graph has changed.
  • If you keep the structure but change the text: The AI fails to realize it's the same thing.

Why This Matters (According to the Paper)

The authors warn us not to be fooled by the high scores the AI gets on "easy" graph tests. Just because an AI can tell two different maps apart doesn't mean it truly understands how maps work.

If you rely on these AI models for tasks where the structure is critical (like analyzing complex networks or molecules), you might get the wrong answer just because someone changed the labels on the data. The paper suggests that before we trust AI with these tasks, we need to test if they can handle "scrambled names" without panicking. Currently, they cannot.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →