# Large Language Models as Graph Computational Solvers via Topology-aware Residual Attention

*Wei Zhuo, Siqiang Luo*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/149081) · [OpenReview](https://openreview.net/forum?id=t1V4p1bOen) · [Open on the map](../papers.html#p149081)

Category: [LLM Reasoning, Memory & RAG](../pcat/19.md) › [Diffusion Language Models](../pgroup/210.md) · Type: new method · Keywords: graph neural solvers, topology-aware attention, process-reward RL, permutation-invariant encoding, algorithmic reasoning

Areas: [LLM Reasoning](../areas/reasoning.md) › Language Model Reasoning › Knowledge Conflict and Hallucination; [Model Architectures & Sequence Modeling](../areas/architectures.md) › Language Model Architectures › Algorithmic Transformers; [Graph Learning](../areas/graph-learning.md) › Graph Reasoning and Representation › Graph-Language Models

## Summary
TRACER is a post-training framework that equips LLMs to act as native graph computational solvers by adding permutation-invariant graph encoding, topology-aware residual attention, and process-reward reinforcement learning.

## Explained to a 5-year-old
Big computer programs called language models can think like people, but they get confused when solving puzzles that involve shapes and connections. Graph puzzles are like drawing lines between points, and the order of drawing doesn't matter. The researchers noticed that the computers look at nearby words instead of the shape of the puzzle. They added three tricks to help the computers understand the puzzle better: a way to ignore the drawing order, a way to pay attention to the shape, and a way to follow the steps carefully. After the tricks, the computers solve many kinds of puzzles much better.

## Explained to a 5-year-old, longer
Language models are computer programs that can talk and reason a little like people. They are used to answer questions and write text, but they sometimes make mistakes on puzzles. Graph puzzles are like drawing dots and lines where the order of drawing doesn't change the answer. The researchers found that the models get confused because they focus on the order of words instead of the shape. They also noticed that the models pay attention to nearby words rather than the connections in the puzzle. Additionally, the models don't always follow the steps of solving a puzzle correctly. To fix these problems, the researchers added three helpful ideas: a way to ignore the drawing order, a way to look at the puzzle's shape, and a way to stick to the solving steps. After applying these ideas, the models solved many different kinds of puzzles much better than before.

## For a technical reader
The paper identifies three shortcomings in standard Transformers when applied to graph problems: token order breaks symmetry, attention is biased toward textual proximity, and autoregressive decoding does not enforce algorithmic correctness. It then proposes a post-training pipeline that adds permutation-invariant graph encoding, a topology-aware residual attention mechanism, and process-reward reinforcement learning to guide algorithmic traces. Experiments on linear-time, polynomial-time, and NP-complete tasks show significant performance gains over baseline LLMs.

## Problem
Large language models are unreliable on graph computation tasks because their internal Transformer computation does not respect graph symmetries, topology, or algorithmic constraints.

## Method
The approach adds three components: a permutation-invariant graph encoding to preserve symmetries, a topology-aware residual attention mechanism to inject graph signals into self-attention, and process-reward reinforcement learning to enforce faithful algorithmic traces.

## Results
The approach achieves substantial improvements over baseline methods on linear-time, polynomial-time, and NP-complete graph tasks.

## Contributions
It identifies the root causes of graph computation failures in Transformers and proposes a unified framework to address them, enabling LLMs to reliably solve a wide range of graph algorithmic problems.

## Practical relevance
It provides a practical path for using LLMs as reliable neural solvers for structured algorithmic reasoning in real-world applications.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/149081)
