← Latest papers
💬 NLP

Transformers Can Learn Connectivity in Some Graphs but Not Others

This study reveals that while transformer models can effectively learn and generalize transitive connectivity on low-dimensional grid-like graphs through scaling, they struggle to do so on complex graphs with many disconnected components or high-dimensional structures.

Original authors: Amit Roy, Abulhair Saparov

Published 2026-04-23
📖 4 min read☕ Coffee break read

Original authors: Amit Roy, Abulhair Saparov

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

Imagine you are teaching a very smart, but literal-minded robot (a Transformer model) how to understand how things are connected. You want it to learn a simple rule: If A leads to B, and B leads to C, then A must lead to C.

This is the same logic used in real life: "If it rains, the ground gets wet. If the ground gets wet, the grass grows. Therefore, if it rains, the grass grows." In the world of computer science, this is called transitive reasoning, and it's basically about figuring out if there is a path between two points on a map.

The paper you shared asks a big question: Can these AI robots learn this rule just by studying examples, and does making the robot "bigger" (more powerful) help it get better at it?

Here is what the researchers discovered, explained through some everyday analogies:

1. The "Neat City" vs. The "Messy Jungle"

The researchers tested the AI on two very different types of maps (graphs).

  • The Neat City (Grid Graphs): Imagine a city laid out in a perfect grid, like Manhattan. Every street runs straight North-South or East-West. If you know where you are and which way you are facing, you can easily guess where you'll end up.

    • The Result: The AI loved this! It learned the rules very quickly. Because the city is so organized, the AI could find a simple "mental shortcut" (a low-dimensional embedding) to understand the connections. It's like the AI realized, "Oh, I just need to count the blocks North and East to know the path."
    • The Catch: The more complex the city (e.g., a 3D city with skyscrapers and underground tunnels vs. a flat 2D city), the harder it was for the AI. But as long as the city was "grid-like," the AI could figure it out.
  • The Messy Jungle (Disconnected Components): Now, imagine a map that isn't a city at all. It's a bunch of isolated islands. Some islands have paths, but many are just floating alone with no bridges to anything else.

    • The Result: The AI got completely lost. When the map was full of disconnected pieces, the AI couldn't find a pattern. It's like trying to teach someone the rules of a game where the board changes randomly every turn. No matter how many examples you show them, they can't guess the next move because there is no consistent logic to follow.

2. Does Bigger Mean Better?

The researchers also asked: "If we make the AI brain bigger and give it more computing power, does it get smarter?"

  • On the Neat City: Yes! The bigger the AI, the better it got at predicting paths. It was like giving a student a bigger library; the more resources they had, the better they could generalize the rules to new, unseen parts of the city.
  • On the Messy Jungle: No. Even a giant, super-powerful AI struggled here. If the underlying logic of the problem is broken (too many disconnected islands), making the AI smarter doesn't help. You can't teach a robot to find a path that doesn't exist.

The Big Takeaway

This paper tells us that AI isn't magic; it's pattern recognition.

  • If the world you are trying to understand is organized and logical (like a grid), AI can learn to navigate it perfectly, and bigger models will do even better.
  • If the world is chaotic and broken (full of dead ends and isolated islands), even the smartest AI will struggle to make sense of it.

So, before we expect AI to solve complex real-world problems (like predicting cause-and-effect in medicine or economics), we need to make sure the data we feed it has a clear, logical structure. If the data is a "messy jungle," the AI might just be guessing in the dark.

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 →