Loading…

Arithmetic Transformers Can Length-Generalize in Both Operand Length and Count

Transformers often struggle with length generalization, meaning they fail to generalize to sequences longer than those encountered during training. While arithmetic tasks are commonly used to study length generalization, certain tasks are considered notoriously difficult, e.g., multi-operand additio...

Full description

Saved in:
Bibliographic Details
Published in:arXiv.org 2024-10
Main Authors: Cho, Hanseul, Cha, Jaeyoung, Bhojanapalli, Srinadh, Yun, Chulhee
Format: Article
Language:English
Subjects:
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
cited_by
cites
container_end_page
container_issue
container_start_page
container_title arXiv.org
container_volume
creator Cho, Hanseul
Cha, Jaeyoung
Bhojanapalli, Srinadh
Yun, Chulhee
description Transformers often struggle with length generalization, meaning they fail to generalize to sequences longer than those encountered during training. While arithmetic tasks are commonly used to study length generalization, certain tasks are considered notoriously difficult, e.g., multi-operand addition (requiring generalization over both the number of operands and their lengths) and multiplication (requiring generalization over both operand lengths). In this work, we achieve approximately 2-3x length generalization on both tasks, which is the first such achievement in arithmetic Transformers. We design task-specific scratchpads enabling the model to focus on a fixed number of tokens per each next-token prediction step, and apply multi-level versions of Position Coupling (Cho et al., 2024; McLeish et al., 2024) to let Transformers know the right position to attend to. On the theory side, we prove that a 1-layer Transformer using our method can solve multi-operand addition, up to operand length and operand count that are exponential in embedding dimension.
format article
fullrecord <record><control><sourceid>proquest</sourceid><recordid>TN_cdi_proquest_journals_3119327782</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>3119327782</sourcerecordid><originalsourceid>FETCH-proquest_journals_31193277823</originalsourceid><addsrcrecordid>eNqNis0KgkAURocgSMp3GGgt6J1MW9bQzyJq416GuuaI3rGZcdPTZ-ADtDof5zszFoAQSZRvABYsdK6J4xi2GaSpCNhtb7WvO_T6wQuryFXGdmgdl4r4Fenl6-iMhFa1-oNcEz8YX_N7Pxp6TgX_TWkG8is2r1TrMJy4ZOvTsZCXqLfmPaDzZWMGS-NViiTZCciyHMR_1RevpD3L</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype><pqid>3119327782</pqid></control><display><type>article</type><title>Arithmetic Transformers Can Length-Generalize in Both Operand Length and Count</title><source>Publicly Available Content Database</source><creator>Cho, Hanseul ; Cha, Jaeyoung ; Bhojanapalli, Srinadh ; Yun, Chulhee</creator><creatorcontrib>Cho, Hanseul ; Cha, Jaeyoung ; Bhojanapalli, Srinadh ; Yun, Chulhee</creatorcontrib><description>Transformers often struggle with length generalization, meaning they fail to generalize to sequences longer than those encountered during training. While arithmetic tasks are commonly used to study length generalization, certain tasks are considered notoriously difficult, e.g., multi-operand addition (requiring generalization over both the number of operands and their lengths) and multiplication (requiring generalization over both operand lengths). In this work, we achieve approximately 2-3x length generalization on both tasks, which is the first such achievement in arithmetic Transformers. We design task-specific scratchpads enabling the model to focus on a fixed number of tokens per each next-token prediction step, and apply multi-level versions of Position Coupling (Cho et al., 2024; McLeish et al., 2024) to let Transformers know the right position to attend to. On the theory side, we prove that a 1-layer Transformer using our method can solve multi-operand addition, up to operand length and operand count that are exponential in embedding dimension.</description><identifier>EISSN: 2331-8422</identifier><language>eng</language><publisher>Ithaca: Cornell University Library, arXiv.org</publisher><subject>Arithmetic ; Multiplication ; Sequences</subject><ispartof>arXiv.org, 2024-10</ispartof><rights>2024. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.</rights><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><linktohtml>$$Uhttps://www.proquest.com/docview/3119327782?pq-origsite=primo$$EHTML$$P50$$Gproquest$$Hfree_for_read</linktohtml><link.rule.ids>780,784,25753,37012,44590</link.rule.ids></links><search><creatorcontrib>Cho, Hanseul</creatorcontrib><creatorcontrib>Cha, Jaeyoung</creatorcontrib><creatorcontrib>Bhojanapalli, Srinadh</creatorcontrib><creatorcontrib>Yun, Chulhee</creatorcontrib><title>Arithmetic Transformers Can Length-Generalize in Both Operand Length and Count</title><title>arXiv.org</title><description>Transformers often struggle with length generalization, meaning they fail to generalize to sequences longer than those encountered during training. While arithmetic tasks are commonly used to study length generalization, certain tasks are considered notoriously difficult, e.g., multi-operand addition (requiring generalization over both the number of operands and their lengths) and multiplication (requiring generalization over both operand lengths). In this work, we achieve approximately 2-3x length generalization on both tasks, which is the first such achievement in arithmetic Transformers. We design task-specific scratchpads enabling the model to focus on a fixed number of tokens per each next-token prediction step, and apply multi-level versions of Position Coupling (Cho et al., 2024; McLeish et al., 2024) to let Transformers know the right position to attend to. On the theory side, we prove that a 1-layer Transformer using our method can solve multi-operand addition, up to operand length and operand count that are exponential in embedding dimension.</description><subject>Arithmetic</subject><subject>Multiplication</subject><subject>Sequences</subject><issn>2331-8422</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2024</creationdate><recordtype>article</recordtype><sourceid>PIMPY</sourceid><recordid>eNqNis0KgkAURocgSMp3GGgt6J1MW9bQzyJq416GuuaI3rGZcdPTZ-ADtDof5zszFoAQSZRvABYsdK6J4xi2GaSpCNhtb7WvO_T6wQuryFXGdmgdl4r4Fenl6-iMhFa1-oNcEz8YX_N7Pxp6TgX_TWkG8is2r1TrMJy4ZOvTsZCXqLfmPaDzZWMGS-NViiTZCciyHMR_1RevpD3L</recordid><startdate>20241021</startdate><enddate>20241021</enddate><creator>Cho, Hanseul</creator><creator>Cha, Jaeyoung</creator><creator>Bhojanapalli, Srinadh</creator><creator>Yun, Chulhee</creator><general>Cornell University Library, arXiv.org</general><scope>8FE</scope><scope>8FG</scope><scope>ABJCF</scope><scope>ABUWG</scope><scope>AFKRA</scope><scope>AZQEC</scope><scope>BENPR</scope><scope>BGLVJ</scope><scope>CCPQU</scope><scope>DWQXO</scope><scope>HCIFZ</scope><scope>L6V</scope><scope>M7S</scope><scope>PIMPY</scope><scope>PQEST</scope><scope>PQQKQ</scope><scope>PQUKI</scope><scope>PRINS</scope><scope>PTHSS</scope></search><sort><creationdate>20241021</creationdate><title>Arithmetic Transformers Can Length-Generalize in Both Operand Length and Count</title><author>Cho, Hanseul ; Cha, Jaeyoung ; Bhojanapalli, Srinadh ; Yun, Chulhee</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-proquest_journals_31193277823</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2024</creationdate><topic>Arithmetic</topic><topic>Multiplication</topic><topic>Sequences</topic><toplevel>online_resources</toplevel><creatorcontrib>Cho, Hanseul</creatorcontrib><creatorcontrib>Cha, Jaeyoung</creatorcontrib><creatorcontrib>Bhojanapalli, Srinadh</creatorcontrib><creatorcontrib>Yun, Chulhee</creatorcontrib><collection>ProQuest SciTech Collection</collection><collection>ProQuest Technology Collection</collection><collection>Materials Science &amp; Engineering Collection</collection><collection>ProQuest Central (Alumni Edition)</collection><collection>ProQuest Central UK/Ireland</collection><collection>ProQuest Central Essentials</collection><collection>ProQuest Central</collection><collection>Technology Collection</collection><collection>ProQuest One Community College</collection><collection>ProQuest Central Korea</collection><collection>SciTech Premium Collection</collection><collection>ProQuest Engineering Collection</collection><collection>Engineering Database</collection><collection>Publicly Available Content Database</collection><collection>ProQuest One Academic Eastern Edition (DO NOT USE)</collection><collection>ProQuest One Academic</collection><collection>ProQuest One Academic UKI Edition</collection><collection>ProQuest Central China</collection><collection>Engineering Collection</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>Cho, Hanseul</au><au>Cha, Jaeyoung</au><au>Bhojanapalli, Srinadh</au><au>Yun, Chulhee</au><format>book</format><genre>document</genre><ristype>GEN</ristype><atitle>Arithmetic Transformers Can Length-Generalize in Both Operand Length and Count</atitle><jtitle>arXiv.org</jtitle><date>2024-10-21</date><risdate>2024</risdate><eissn>2331-8422</eissn><abstract>Transformers often struggle with length generalization, meaning they fail to generalize to sequences longer than those encountered during training. While arithmetic tasks are commonly used to study length generalization, certain tasks are considered notoriously difficult, e.g., multi-operand addition (requiring generalization over both the number of operands and their lengths) and multiplication (requiring generalization over both operand lengths). In this work, we achieve approximately 2-3x length generalization on both tasks, which is the first such achievement in arithmetic Transformers. We design task-specific scratchpads enabling the model to focus on a fixed number of tokens per each next-token prediction step, and apply multi-level versions of Position Coupling (Cho et al., 2024; McLeish et al., 2024) to let Transformers know the right position to attend to. On the theory side, we prove that a 1-layer Transformer using our method can solve multi-operand addition, up to operand length and operand count that are exponential in embedding dimension.</abstract><cop>Ithaca</cop><pub>Cornell University Library, arXiv.org</pub><oa>free_for_read</oa></addata></record>
fulltext fulltext
identifier EISSN: 2331-8422
ispartof arXiv.org, 2024-10
issn 2331-8422
language eng
recordid cdi_proquest_journals_3119327782
source Publicly Available Content Database
subjects Arithmetic
Multiplication
Sequences
title Arithmetic Transformers Can Length-Generalize in Both Operand Length and Count
url http://sfxeu10.hosted.exlibrisgroup.com/loughborough?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2024-12-28T03%3A37%3A49IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-proquest&rft_val_fmt=info:ofi/fmt:kev:mtx:book&rft.genre=document&rft.atitle=Arithmetic%20Transformers%20Can%20Length-Generalize%20in%20Both%20Operand%20Length%20and%20Count&rft.jtitle=arXiv.org&rft.au=Cho,%20Hanseul&rft.date=2024-10-21&rft.eissn=2331-8422&rft_id=info:doi/&rft_dat=%3Cproquest%3E3119327782%3C/proquest%3E%3Cgrp_id%3Ecdi_FETCH-proquest_journals_31193277823%3C/grp_id%3E%3Coa%3E%3C/oa%3E%3Curl%3E%3C/url%3E&rft_id=info:oai/&rft_pqid=3119327782&rft_id=info:pmid/&rfr_iscdi=true