Length Generalization via Auxiliary Tasks

Pranjal Awasthi, Anupam Gupta, Ravi Kumar
1/1/2025

No confident code implementation found for this paper.

Abstract

Length generalization , the ability of sequence models to generalize to sequences longer than those encountered during training, remains a key challenge for trans-formers, especially in tasks requiring algorithmic reasoning. Existing theoretical understanding of length generalization is limited, often providing only asymptotic results or focusing on specific problem classes or architectural variants, while empirical approaches frequently rely on ad hoc and often fragile techniques.

Show full abstract

In this work we introduce a novel framework for analyzing and proving length generalization bounds under specified, verifiable assumptions. A key outcome of the theory is the identification of a natural set of auxiliary tasks, intricately related to the primary task structure, such that strong performance on these auxiliary tasks, alongside the primary task, provably guarantees length generalization within the framework. This motivates a multi-task training procedure that explicitly optimizes performance on both the primary and the identified auxiliary tasks. Empirical evaluations on a variety of synthetic benchmarks known to be challenging for length generalization, including sequence sorting, and reversal, demonstrate that our proposed method yields significant improvements in generalization to substantially longer sequences.

DOISemantic Scholar

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{awasthi2025length,
  title  = {Length Generalization via Auxiliary Tasks},
  author = {Pranjal Awasthi and Anupam Gupta and Ravi Kumar},
  year   = {2025},
  doi    = {10.52202/085713-2973},
  url    = {https://doi.org/10.52202/085713-2973},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/9c13ea0eff795eb09e7302688c8df67c081c5407.svg)](https://codeofpaper.com/paper/9c13ea0eff795eb09e7302688c8df67c081c5407)

Discussion