SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.18510 · 2024

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

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 3 functions out of this paper's own repositories and ran 2 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
dangxingyu/rnn-icrag canonical 2 of 3
FunctionStatusWhere it lives
evaluate Ran dangxingyu/rnn-icrag/rnn/val.py
pointer only (licence: NONE) · get_code("fd7451e108a22a91")
evaluate_through_generation Ran dangxingyu/rnn-icrag/rnn/val.py
pointer only (licence: NONE) · get_code("10571dc20b61fd10")
generate Not yet run dangxingyu/rnn-icrag/rnn/val.py
pointer only (licence: NONE) · get_code("fe384f6380199cb6")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2402.18510")
get_code_for_paper("2402.18510")
have("2402.18510")

Connect an agent — have() is free.