Simulation of Graph Algorithms with Looped Transformers

AmazUtah_NLP at SemEval-2024 Task 9: A MultiChoice Question Answering System for Commonsense Defying Reasoning


View a PDF of the paper titled Simulation of Graph Algorithms with Looped Transformers, by Artur Back de Luca and Kimon Fountoulakis

View PDF
HTML (experimental)

Abstract:The execution of graph algorithms using neural networks has recently attracted significant interest due to promising empirical progress. This motivates further understanding of how neural networks can replicate reasoning steps with relational data. In this work, we study the ability of transformer networks to simulate algorithms on graphs from a theoretical perspective. The architecture we use is a looped transformer with extra attention heads that interact with the graph. We prove by construction that this architecture can simulate individual algorithms such as Dijkstra’s shortest path, Breadth- and Depth-First Search, and Kosaraju’s strongly connected components, as well as multiple algorithms simultaneously. The number of parameters in the networks does not increase with the input graph size, which implies that the networks can simulate the above algorithms for any graph. Despite this property, we show a limit to simulation in our solution due to finite precision. Finally, we show a Turing Completeness result with constant width when the extra attention heads are utilized.

Submission history

From: Artur Back de Luca [view email]
[v1]
Fri, 2 Feb 2024 02:48:03 UTC (267 KB)
[v2]
Wed, 29 May 2024 22:41:12 UTC (433 KB)
[v3]
Tue, 1 Oct 2024 20:30:37 UTC (290 KB)



Source link
lol

By stp2y

Leave a Reply

Your email address will not be published. Required fields are marked *

No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.