From Sequence to Structure: Uncovering Substructure Reasoning in Transformers

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Dai, Xinnan, Yang, Kai, Revolinsky, Jay, Guo, Kai, Wang, Aoran, Zhang, Bohang, Tang, Jiliang
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917025758052352
author Dai, Xinnan
Yang, Kai
Revolinsky, Jay
Guo, Kai
Wang, Aoran
Zhang, Bohang
Tang, Jiliang
author_facet Dai, Xinnan
Yang, Kai
Revolinsky, Jay
Guo, Kai
Wang, Aoran
Zhang, Bohang
Tang, Jiliang
contents Recent studies suggest that large language models (LLMs) possess the capability to solve graph reasoning tasks. Notably, even when graph structures are embedded within textual descriptions, LLMs can still effectively answer related questions. This raises a fundamental question: How can a decoder-only Transformer architecture understand underlying graph structures? To address this, we start with the substructure extraction task, interpreting the inner mechanisms inside the transformers and analyzing the impact of the input queries. Specifically, through both empirical results and theoretical analysis, we present Induced Substructure Filtration (ISF), a perspective that captures the substructure identification in the multi-layer transformers. We further validate the ISF process in LLMs, revealing consistent internal dynamics across layers. Building on these insights, we explore the broader capabilities of Transformers in handling diverse graph types. Specifically, we introduce the concept of thinking in substructures to efficiently extract complex composite patterns, and demonstrate that decoder-only Transformers can successfully extract substructures from attributed graphs, such as molecular graphs. Together, our findings offer a new insight on how sequence-based Transformers perform the substructure extraction task over graph data.
format Preprint
id arxiv_https___arxiv_org_abs_2507_10435
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle From Sequence to Structure: Uncovering Substructure Reasoning in Transformers
Dai, Xinnan
Yang, Kai
Revolinsky, Jay
Guo, Kai
Wang, Aoran
Zhang, Bohang
Tang, Jiliang
Computation and Language
Artificial Intelligence
Recent studies suggest that large language models (LLMs) possess the capability to solve graph reasoning tasks. Notably, even when graph structures are embedded within textual descriptions, LLMs can still effectively answer related questions. This raises a fundamental question: How can a decoder-only Transformer architecture understand underlying graph structures? To address this, we start with the substructure extraction task, interpreting the inner mechanisms inside the transformers and analyzing the impact of the input queries. Specifically, through both empirical results and theoretical analysis, we present Induced Substructure Filtration (ISF), a perspective that captures the substructure identification in the multi-layer transformers. We further validate the ISF process in LLMs, revealing consistent internal dynamics across layers. Building on these insights, we explore the broader capabilities of Transformers in handling diverse graph types. Specifically, we introduce the concept of thinking in substructures to efficiently extract complex composite patterns, and demonstrate that decoder-only Transformers can successfully extract substructures from attributed graphs, such as molecular graphs. Together, our findings offer a new insight on how sequence-based Transformers perform the substructure extraction task over graph data.
title From Sequence to Structure: Uncovering Substructure Reasoning in Transformers
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2507.10435