Looped Transformers for Length Generalization
<|reference_start|>Looped Transformers for Length Generalization: Recent work has shown that Transformers trained from scratch can successfully solve various arithmetic and algorithmic tasks, such as adding numbers and computing parity. While these Transformers generalize well on unseen inputs of the same length, they struggle with length generalization, i.e., handling inputs of unseen lengths. In this work, we demonstrate that looped Transformers with an adaptive number of steps significantly improve length generalization. We focus on tasks with a known iterative solution, involving multiple iterations of a RASP-L operation - a length-generalizable operation that can be expressed by a finite-sized Transformer. We train looped Transformers using our proposed learning algorithm and observe that they learn highly length-generalizable solutions for various tasks.<|reference_end|>
@article{fan2024looped,
    title={Looped Transformers for Length Generalization},
    author={Ying Fan, Yilun Du, Kannan Ramchandran, Kangwook Lee},
    journal={arXiv preprint arXiv:2409.15647},
    year={2024},
    archivePrefix={arXiv},
    eprint={2409.15647},
    primaryClass={cs.LG}
}