I Transformer Possono Rappresentare Modelli Linguistici n-gram
Transformers Can Represent n-gram Language Models
April 23, 2024
Autori: Anej Svete, Ryan Cotterell
cs.AI
Abstract
Molti lavori esistenti hanno analizzato le capacità dell'architettura transformer descrivendone la capacità rappresentativa attraverso modelli formali di calcolo. Tuttavia, finora l'attenzione si è concentrata sull'analisi dell'architettura in termini di accettazione del linguaggio. Sosteniamo che questo sia un problema poco adatto nello studio dei modelli linguistici (LM), che per definizione sono distribuzioni di probabilità su stringhe. In questo articolo, ci concentriamo sulla relazione tra i transformer LM e i modelli linguistici n-gram, una classe semplice e storicamente rilevante di modelli linguistici. Dimostriamo che i transformer LM che utilizzano meccanismi di attenzione hard o sparsa possono rappresentare esattamente qualsiasi modello linguistico n-gram, fornendoci un limite inferiore concreto sulla loro capacità rappresentativa probabilistica. Questo rappresenta un primo passo verso la comprensione dei meccanismi che i transformer LM possono utilizzare per rappresentare distribuzioni di probabilità su stringhe.
English
Plenty of existing work has analyzed the abilities of the transformer
architecture by describing its representational capacity with formal models of
computation. However, the focus so far has been on analyzing the architecture
in terms of language acceptance. We contend that this is an ill-suited
problem in the study of language models (LMs), which are definitionally
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.