paper-with-me

Papers

Transformers Can Represent $n$-gram Language Models

2024-04-23 · Anej Svete, Ryan Cotterell

Existing work has analyzed the representational capacity of the transformer architecture by means of formal models of computation. However, the focus so far has been on analyzing the architecture in terms of language \emph{acceptance}. We contend that this is an ill-suited problem in the study of \emph{language models} (LMs), which are definitionally \emph{probability distributions} over strings. In this paper, we focus on the relationship between transformer LMs and $n$-gram LMs, a simple and historically relevant class of language models. We show that transformer LMs using the hard or sparse attention mechanisms can exactly represent any $n$-gram LM, giving us a concrete lower bound on their probabilistic representational capacity. This provides a first step towards understanding the mechanisms that transformer LMs can use to represent probability distributions over strings.

📄 PDF Abstract BibTeX arXiv:2404.14994

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

Focus 설명 없음

Similar Papers 제목 키워드 기반

Can Transformers Learn $n$-gram Language Models?

2024-10-03 · Anej Svete, Nadav Borenstein, Mike Zhou, Isabelle Augenstein 외

Much theoretical work has described the ability of transformers to represent formal languages. However, linking theoretical results to empirical performance is not straightforward due to the complex interplay between the…

Discovering Interpretable Algorithms by Decompiling Transformers to RASP

2026-02-09 · Xinting Huang, Aleksandra Bakalova, Satwik Bhattamishra, William Merrill 외 arxiv

Recent work has shown that the computations of Transformers can be simulated in the RASP family of programming languages. These findings have enabled improved understanding of the expressive capacity and generalization a…

An expressivity analysis of hierarchical modelling in deep transformers via bounded-depth grammars

2026-06-16 · Vinoth Nandakumar, Qiang Qu, Pramod Thebe, Sakshi Khachariya 외 arxiv

Deep neural networks are widely believed to derive their expressive power from their ability to form \textbf{hierarchical representations}, capturing progressively more abstract and compositional features across layers. …

Transformers are Efficient Compilers, Provably

2024-10-07 · Xiyu Zhai, Runlong Zhou, Liao Zhang, Simon Shaolei Du

Transformer-based large language models (LLMs) have demonstrated surprisingly robust performance across a wide range of language-related tasks, including programming language understanding and generation. In this paper, …

ALTA: Compiler-Based Analysis of Transformers

2024-10-23 · Peter Shaw, James Cohan, Jacob Eisenstein, Kenton Lee 외

We propose a new programming language called ALTA and a compiler that can map ALTA programs to Transformer weights. ALTA is inspired by RASP, a language proposed by Weiss et al. (2021), and Tracr (Lindner et al., 2023), …