Augmenting transformers with recursively composed multi-grained representations

Xiang Hu, Qingyang Zhu, Kewei Tu, Wei Wu
9/1/2023

No official code found. Best implementation: ant-research/StructuredLM_RTDT (80 stars, Apache-2.0, last commit 2024-08-12).

Abstract

We present ReCAT, a recursive composition augmented Transformer that is able to explicitly model hierarchical syntactic structures of raw texts without relying on gold trees during both learning and inference. Existing research along this line restricts data to follow a hierarchical tree structure and thus lacks inter-span communications. To overcome the problem, we propose a novel contextual inside-outside (CIO) layer that learns contextualized representations of spans through bottom-up and top-down passes, where a bottom-up pass forms representations of high-level spans by composing low-level spans, while a top-down pass combines information inside and outside a span. By stacking several CIO layers between the embedding layer and the attention layers in Transformer, the ReCAT model can perform both deep intra-span and deep inter-span interactions, and thus generate multi-grained representations fully contextualized with other spans. Moreover, the CIO layers can be jointly pre-trained with Transformers, making ReCAT enjoy scaling ability, strong performance, and interpretability at the same time. We conduct experiments on various sentence-level and span-level tasks. Evaluation results indicate that ReCAT can significantly outperform vanilla Transformer models on all span-level tasks and baselines that combine recursive networks with Transformers on natural language inference tasks. More interestingly, the hierarchical structures induced by ReCAT exhibit strong consistency with human-annotated syntactic trees, indicating good interpretability brought by the CIO layers.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

A library for building hierarchical text representation and corresponding downstream applications.

8015C++, ShellMay 20, 20212 years agoApache-2.0

Similar Papers

Cite this paper

@article{hu2023augmenting,
  title  = {Augmenting transformers with recursively composed multi-grained representations},
  author = {Xiang Hu and Qingyang Zhu and Kewei Tu and Wei Wu},
  year   = {2023},
  eprint = {2309.16319},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.16319},
  journal = {ICLR 2023 2023}
}

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/2309.16319.svg)](https://codeofpaper.com/paper/2309.16319)

Discussion