Transformers as Graph-to-Graph Models

James Henderson, Alireza Mohammadshahi, Andrei C. Coman, Lesly Miculicich
10/27/2023
cs.CLcs.AIcs.LG

Official code: idiap/g2g-transformer (62 stars, GPL-2.0, last commit 2021-03-23).

Abstract

We argue that Transformers are essentially graph-to-graph models, with sequences just being a special case. Attention weights are functionally equivalent to graph edges. Our Graph-to-Graph Transformer architecture makes this ability explicit, by inputting graph edges into the attention weight computations and predicting graph edges with attention-like functions, thereby integrating explicit graphs into the latent graphs learned by pretrained Transformers. Adding iterative graph refinement provides a joint embedding of input, output, and latent graphs, allowing non-autoregressive graph prediction to optimise the complete graph without any bespoke pipeline or decoding strategy. Empirical results show that this architecture achieves state-of-the-art accuracies for modelling a variety of linguistic structures, integrating very effectively with the latent linguistic representations learned by pretraining.

View on arXivView PDF

Code Implementations(1)

GPL-2.0

Pytorch implementation of “Recursive Non-Autoregressive Graph-to-Graph Transformer for Dependency Parsing with Iterative Refinement”

629Shell, PythonOct 22, 20205 years agoGPL-2.0

Similar Papers

Cite this paper

@article{henderson2023transformers,
  title  = {Transformers as Graph-to-Graph Models},
  author = {James Henderson and Alireza Mohammadshahi and Andrei C. Coman and Lesly Miculicich},
  year   = {2023},
  eprint = {2310.17936},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.17936v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.17936.svg)](https://codeofpaper.com/paper/2310.17936)

Discussion