atlas

Research map / Graph learning / Graph algorithms and clustering

Simulation of Graph Algorithms with Looped Transformers

ICML 2024 · Graph learning › Graph algorithms and clustering · approach: Neural combinatorial optimization on graphs · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows by construction that a looped transformer with graph-adjacency attention heads and constant width can simulate Dijkstra, BFS, DFS, Kosaraju SCC, a multitask model, and SUBLEQ (Turing complete), with empirical validation on CLRS.

Problem

Whether transformers can simulate graph algorithms on graphs of arbitrary size, since standard architectures store the graph in the input and their width/depth scale with graph size.

Approach

A looped transformer with extra attention heads that multiply attention by the (padded) adjacency matrix (and its transpose) lets the graph be accessed as architecture rather than input, so parameter count and width stay constant across graph sizes; positional encodings on a circle enumerate nodes.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use the looped-transformer simulation for BFS, DFS, Dijkstra, and SCCLooped transformer · CLRS Train, Validation, and Testaccuracy: 100%Helped
Increase Ω beyond 50 in the if-else constructionIf-else construction · if-else functioncondition number: above 50 -> above 10^{16}Hurt
Increase ΩIf-else construction · if-else functionsimulation qualityHelped
Decrease εLess-than construction · less-than functionsimulation qualityHelped

Surprising findings

Limitations

Experimental setup

Datasets: CLRS Algorithmic Reasoning Benchmark

Benchmarks: CLRS Algorithmic Reasoning Benchmark

Metrics: accuracy

Builds on: CLRS Algorithmic Reasoning Benchmark Looped transformer Universal Transformers

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy