# Tree-Transformer: A Transformer-Based Method for Correction of Tree-Structured Data

arXiv: https://arxiv.org/abs/1908.00449 · HTML: https://mlsanity.com/paper/1908.00449/

## Key facts

- Cited by 20 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 1 Aug 2019.

## Built on by (most cited first, 20 of 20)

- [Unified Pre-training for Program Understanding and Generation](https://mlsanity.com/paper/2103.06333/) (2021)
- [Retrieval Augmented Code Generation and Summarization](https://mlsanity.com/paper/2108.11601/) (2021)
- [Integrating Visuospatial, Linguistic and Commonsense Structure into Story Visualization](https://mlsanity.com/paper/2110.10834/) (2021)
- [CodeQA: A Question Answering Dataset for Source Code Comprehension](https://mlsanity.com/paper/2109.08365/) (2021)
- [API2Com: On the Improvement of Automatically Generated Code Comments Using API Documentations](https://mlsanity.com/paper/2103.10668/) (2021)
- [Structured Context and High-Coverage Grammar for Conversational Question Answering over Knowledge Graphs](https://mlsanity.com/paper/2109.00269/) (2021)
- [Graph-Induced Syntactic-Semantic Spaces in Transformer-Based Variational AutoEncoders](https://mlsanity.com/paper/2311.08579/) (2023)
- [DeepCPCFG: Deep Learning and Context Free Grammars for End-to-End Information Extraction](https://mlsanity.com/paper/2103.05908/) (2021)
- [Transformer with Tree-order Encoding for Neural Program Generation](https://mlsanity.com/paper/2206.13354/) (2022)
- [Forming Trees with Treeformers](https://mlsanity.com/paper/2207.06960/) (2022)
- [SURGE: On the Potential of Large Language Models as General-Purpose Surrogate Code Executors](https://mlsanity.com/paper/2502.11167/) (2025)
- [ImmunoLingo: Linguistics-based formalization of the antibody language](https://mlsanity.com/paper/2209.12635/) (2022)
- [APIContext2Com: Code Comment Generation by Incorporating Pre-Defined API Documentation](https://mlsanity.com/paper/2303.01645/) (2023)
- [Enhancing the Transformer Decoder with Transition-based Syntax](https://mlsanity.com/paper/2101.12640/) (2021)
- [G-MATT: Single-step Retrosynthesis Prediction using Molecular Grammar Tree Transformer](https://mlsanity.com/paper/2305.03153/) (2023)
- [Representation Learning of Geometric Trees](https://mlsanity.com/paper/2408.08799/) (2024)
- [Trees in transformers: a theoretical analysis of the Transformer's ability to represent trees](https://mlsanity.com/paper/2112.11913/) (2021)
- [What AI can do for horse-racing ?](https://mlsanity.com/paper/2207.04981/) (2022)
- [Spatial Attention and Syntax Rule Enhanced Tree Decoder for Offine Handwritten Mathematical Expression Recognition](https://mlsanity.com/paper/2303.07077/) (2023)
- [Tree Meets Transformer: A Hybrid Architecture for Scalable Power Allocation in Cell-Free Networks](https://mlsanity.com/paper/2512.22639/) (2025)

## Abstract (arXiv)

Many common sequential data sources, such as source code and natural language, have a natural tree-structured representation. These trees can be generated by fitting a sequence to a grammar, yielding a hierarchical ordering of the tokens in the sequence. This structure encodes a high degree of syntactic information, making it ideal for problems such as grammar correction. However, little work has been done to develop neural networks that can operate on and exploit tree-structured data. In this paper we present the Tree-Transformer textemdash a novel neural network architecture designed to translate between arbitrary input and output trees. We applied this architecture to correction tasks in both the source code and natural language domains. On source code, our model achieved an improvement of 25% F0.5 over the best sequential method. On natural language, we achieved comparable results to the most complex state of the art systems, obtaining a 10% improvement in recall on the CoNLL 2014 benchmark and the highest to date F0.5 score on the AESW benchmark of 50.43.
