Saved in:
Bibliographic Details
Main Authors: Cheng, Xiang, Carin, Lawrence, Sra, Suvrit
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2410.16699
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913713949245440
author Cheng, Xiang
Carin, Lawrence
Sra, Suvrit
author_facet Cheng, Xiang
Carin, Lawrence
Sra, Suvrit
contents We show theoretically and empirically that the linear Transformer, when applied to graph data, can implement algorithms that solve canonical problems such as electric flow and eigenvector decomposition. The Transformer has access to information on the input graph only via the graph's incidence matrix. We present explicit weight configurations for implementing each algorithm, and we bound the constructed Transformers' errors by the errors of the underlying algorithms. Our theoretical findings are corroborated by experiments on synthetic data. Additionally, on a real-world molecular regression task, we observe that the linear Transformer is capable of learning a more effective positional encoding than the default one based on Laplacian eigenvectors. Our work is an initial step towards elucidating the inner-workings of the Transformer for graph data. Code is available at https://github.com/chengxiang/LinearGraphTransformer
format Preprint
id arxiv_https___arxiv_org_abs_2410_16699
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Graph Transformers Dream of Electric Flow
Cheng, Xiang
Carin, Lawrence
Sra, Suvrit
Machine Learning
Artificial Intelligence
We show theoretically and empirically that the linear Transformer, when applied to graph data, can implement algorithms that solve canonical problems such as electric flow and eigenvector decomposition. The Transformer has access to information on the input graph only via the graph's incidence matrix. We present explicit weight configurations for implementing each algorithm, and we bound the constructed Transformers' errors by the errors of the underlying algorithms. Our theoretical findings are corroborated by experiments on synthetic data. Additionally, on a real-world molecular regression task, we observe that the linear Transformer is capable of learning a more effective positional encoding than the default one based on Laplacian eigenvectors. Our work is an initial step towards elucidating the inner-workings of the Transformer for graph data. Code is available at https://github.com/chengxiang/LinearGraphTransformer
title Graph Transformers Dream of Electric Flow
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2410.16699