RNNs are not Transformers (Yet): The Key Bottleneck on In-context Retrieval

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Wen, Kaiyue, Dang, Xingyu, Lyu, Kaifeng
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866912147458490368
author Wen, Kaiyue
Dang, Xingyu
Lyu, Kaifeng
author_facet Wen, Kaiyue
Dang, Xingyu
Lyu, Kaifeng
contents This paper investigates the gap in representation powers of Recurrent Neural Networks (RNNs) and Transformers in the context of solving algorithmic problems. We focus on understanding whether RNNs, known for their memory efficiency in handling long sequences, can match the performance of Transformers, particularly when enhanced with Chain-of-Thought (CoT) prompting. Our theoretical analysis reveals that CoT improves RNNs but is insufficient to close the gap with Transformers. A key bottleneck lies in the inability of RNNs to perfectly retrieve information from the context, even with CoT: for several tasks that explicitly or implicitly require this capability, such as associative recall and determining if a graph is a tree, we prove that RNNs are not expressive enough to solve the tasks while Transformers can solve them with ease. Conversely, we prove that adopting techniques to enhance the in-context retrieval capability of RNNs, including Retrieval-Augmented Generation (RAG) and adding a single Transformer layer, can elevate RNNs to be capable of solving all polynomial-time solvable problems with CoT, hence closing the representation gap with Transformers.
format Preprint
id arxiv_https___arxiv_org_abs_2402_18510
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle RNNs are not Transformers (Yet): The Key Bottleneck on In-context Retrieval
Wen, Kaiyue
Dang, Xingyu
Lyu, Kaifeng
Machine Learning
Computation and Language
This paper investigates the gap in representation powers of Recurrent Neural Networks (RNNs) and Transformers in the context of solving algorithmic problems. We focus on understanding whether RNNs, known for their memory efficiency in handling long sequences, can match the performance of Transformers, particularly when enhanced with Chain-of-Thought (CoT) prompting. Our theoretical analysis reveals that CoT improves RNNs but is insufficient to close the gap with Transformers. A key bottleneck lies in the inability of RNNs to perfectly retrieve information from the context, even with CoT: for several tasks that explicitly or implicitly require this capability, such as associative recall and determining if a graph is a tree, we prove that RNNs are not expressive enough to solve the tasks while Transformers can solve them with ease. Conversely, we prove that adopting techniques to enhance the in-context retrieval capability of RNNs, including Retrieval-Augmented Generation (RAG) and adding a single Transformer layer, can elevate RNNs to be capable of solving all polynomial-time solvable problems with CoT, hence closing the representation gap with Transformers.
title RNNs are not Transformers (Yet): The Key Bottleneck on In-context Retrieval
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2402.18510