Transformer-Based Models Are Not Yet Perfect At Learning to Emulate Structural Recursion

Shizhuo Dylan Zhang, Curt Tigges, Zory Zhang, Stella Biderman, Maxim Raginsky, Talia Ringer

Research output: Contribution to journalArticlepeer-review

Abstract

This paper investigates the ability of transformer-based models to learn structural recursion from examples. Recursion is a universal concept in both natural and formal languages. Structural recursion is central to the programming language and formal mathematics tasks where symbolic tools currently excel beyond neural models, such as inferring semantic re-lations between datatypes and emulating program behavior. We introduce a general conceptual framework that nicely connects the abstract concepts of structural recursion in the programming language domain to concrete sequence modeling problems and learned mod-els’ behavior. The framework includes a representation that captures the general syntax of structural recursion, coupled with two different frameworks for understanding their se-mantics—one that is more natural from a programming languages perspective and one that helps bridge that perspective with a mechanistic understanding of the underlying transformer architecture. With our framework as a powerful conceptual tool, we identify different issues under vari-ous set-ups. The models trained to emulate recursive computations cannot fully capture the recursion yet instead fit short-cut algorithms and thus cannot solve certain edge cases that are under-represented in the training distribution. In addition, it is difficult for state-of-the-art large language models (LLMs) to mine recursive rules from in-context demonstrations. Meanwhile, these LLMs fail in interesting ways when emulating reduction (step-wise com-putation) of the recursive function.

Original languageEnglish (US)
JournalTransactions on Machine Learning Research
Volume2024
StatePublished - 2024

ASJC Scopus subject areas

  • Artificial Intelligence
  • Computer Vision and Pattern Recognition

Fingerprint

Dive into the research topics of 'Transformer-Based Models Are Not Yet Perfect At Learning to Emulate Structural Recursion'. Together they form a unique fingerprint.

Cite this