HackerPapers

arXiv:2210.02671cs.LG

A Logic for Expressing Log-Precision Transformers

William Merrill, Ashish Sabharwal

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

One way to interpret the reasoning power of transformer-based language models is to describe the types of logical rules they can resolve over some input text. Recently, Chiang et al. (2023) showed that finite-precision transformers can be equivalently expressed in a generalization of first-order logic. However, finite-precision transformers are a weak transformer variant because, as we show, a single head can only attend to a constant number of tokens and, in particular, cannot represent uniform attention. Since attending broadly is a core capability for transformers, we ask whether a minimally more expressive model that can attend universally can also be characterized in logic. To this end, we analyze transformers whose forward pass is computed in $\log n$ precision on contexts of length $n$. We prove that any log-precision transformer can be equivalently expressed as a first-order logic sentence that, in addition to standard universal and existential quantifiers, may also contain majority-vote quantifiers. This is the tightest known upper bound and first logical characterization of log-precision transformers.

arXiv comments
May 24, 2023: Restructured version of old preprint. Oct 12, 2023: To appear at NeurIPS. Sept 10, 2025: minor technical corrections
Journal reference
DOI
Subjects
cs.LGMachine Learning cs.CCComputational Complexity

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Apr 2023 to Apr 2023. Found in 1 HN submission from May 2023 to May 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments1 thread

    • See Merrill & Sabharwal (2023) [1]: A transformer N is a specific kind of a computation graph family over vectors of floating-point numbers with p precision. We work with fixed-precision transformers, i.e., we take p to be constant with respect to the input sequence length n. In…

      bmc7505View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.