Composition, Attention, or Both?

Ryo Yoshida, Yohei Oseki
10/24/2022
cs.CL
transformer-attention

Official code: osekilab/CAG (4 stars, Python, MIT, last commit 2024-08-21).

Abstract

In this paper, we propose a novel architecture called Composition Attention Grammars (CAGs) that recursively compose subtrees into a single vector representation with a composition function, and selectively attend to previous structural information with a self-attention mechanism. We investigate whether these components -- the composition function and the self-attention mechanism -- can both induce human-like syntactic generalization.

Show full abstract

Specifically, we train language models (LMs) with and without these two components with the model sizes carefully controlled, and evaluate their syntactic generalization performance against six test circuits on the SyntaxGym benchmark. The results demonstrated that the composition function and the self-attention mechanism both play an important role to make LMs more human-like, and closer inspection of linguistic phenomenon implied that the composition function allowed syntactic features, but not semantic features, to percolate into subtree representations.

View on arXivView PDF

Code Implementations(1)

osekilab/CAGOfficial100%
MIT
41Python, ShellOct 19, 20222 years agoMIT

Similar Papers

Cite this paper

@article{yoshida2022composition,
  title  = {Composition, Attention, or Both?},
  author = {Ryo Yoshida and Yohei Oseki},
  year   = {2022},
  eprint = {2210.12958},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.12958}
}

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

Discussion