Contextual Counting: A Mechanistic Study of Transformers on a Quantitative Task

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Golkar, Siavash, Bietti, Alberto, Pettee, Mariel, Eickenberg, Michael, Cranmer, Miles, Hirashima, Keiya, Krawezik, Geraud, Lourie, Nicholas, McCabe, Michael, Morel, Rudy, Ohana, Ruben, Parker, Liam Holden, Blancard, Bruno Régaldo-Saint, Cho, Kyunghyun, Ho, Shirley
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909217079689216
author Golkar, Siavash
Bietti, Alberto
Pettee, Mariel
Eickenberg, Michael
Cranmer, Miles
Hirashima, Keiya
Krawezik, Geraud
Lourie, Nicholas
McCabe, Michael
Morel, Rudy
Ohana, Ruben
Parker, Liam Holden
Blancard, Bruno Régaldo-Saint
Cho, Kyunghyun
Ho, Shirley
author_facet Golkar, Siavash
Bietti, Alberto
Pettee, Mariel
Eickenberg, Michael
Cranmer, Miles
Hirashima, Keiya
Krawezik, Geraud
Lourie, Nicholas
McCabe, Michael
Morel, Rudy
Ohana, Ruben
Parker, Liam Holden
Blancard, Bruno Régaldo-Saint
Cho, Kyunghyun
Ho, Shirley
contents Transformers have revolutionized machine learning across diverse domains, yet understanding their behavior remains crucial, particularly in high-stakes applications. This paper introduces the contextual counting task, a novel toy problem aimed at enhancing our understanding of Transformers in quantitative and scientific contexts. This task requires precise localization and computation within datasets, akin to object detection or region-based scientific analysis. We present theoretical and empirical analysis using both causal and non-causal Transformer architectures, investigating the influence of various positional encodings on performance and interpretability. In particular, we find that causal attention is much better suited for the task, and that no positional embeddings lead to the best accuracy, though rotary embeddings are competitive and easier to train. We also show that out of distribution performance is tightly linked to which tokens it uses as a bias term.
format Preprint
id arxiv_https___arxiv_org_abs_2406_02585
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Contextual Counting: A Mechanistic Study of Transformers on a Quantitative Task
Golkar, Siavash
Bietti, Alberto
Pettee, Mariel
Eickenberg, Michael
Cranmer, Miles
Hirashima, Keiya
Krawezik, Geraud
Lourie, Nicholas
McCabe, Michael
Morel, Rudy
Ohana, Ruben
Parker, Liam Holden
Blancard, Bruno Régaldo-Saint
Cho, Kyunghyun
Ho, Shirley
Machine Learning
Artificial Intelligence
Transformers have revolutionized machine learning across diverse domains, yet understanding their behavior remains crucial, particularly in high-stakes applications. This paper introduces the contextual counting task, a novel toy problem aimed at enhancing our understanding of Transformers in quantitative and scientific contexts. This task requires precise localization and computation within datasets, akin to object detection or region-based scientific analysis. We present theoretical and empirical analysis using both causal and non-causal Transformer architectures, investigating the influence of various positional encodings on performance and interpretability. In particular, we find that causal attention is much better suited for the task, and that no positional embeddings lead to the best accuracy, though rotary embeddings are competitive and easier to train. We also show that out of distribution performance is tightly linked to which tokens it uses as a bias term.
title Contextual Counting: A Mechanistic Study of Transformers on a Quantitative Task
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2406.02585