Evaluating Transformer's Ability to Learn Mildly Context-Sensitive Languages

Shunjie Wang, Shane Steinert-Threlkeld
9/2/2023
cs.CL

No confident code implementation found for this paper.

Abstract

Despite the fact that Transformers perform well in NLP tasks, recent studies suggest that self-attention is theoretically limited in learning even some regular and context-free languages. These findings motivated us to think about their implications in modeling natural language, which is hypothesized to be mildly context-sensitive. We test the Transformer's ability to learn mildly context-sensitive languages of varying complexities, and find that they generalize well to unseen in-distribution data, but their ability to extrapolate to longer strings is worse than that of LSTMs. Our analyses show that the learned self-attention patterns and representations modeled dependency relations and demonstrated counting behavior, which may have helped the models solve the languages.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2023evaluating,
  title  = {Evaluating Transformer's Ability to Learn Mildly Context-Sensitive Languages},
  author = {Shunjie Wang and Shane Steinert-Threlkeld},
  year   = {2023},
  eprint = {2309.00857},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2309.00857v2}
}

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

Discussion