The RNN Homunculus: Learning to Gate Long-Term Memory

Zeyu Fan, Alexandru-Dragos Manolache, Jan van Gemert
10/9/2026
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

Learning long-range dependencies with recurrent neural networks (RNNs) is difficult because of the vanishing gradient problem. Gated recurrent neural networks like GRUs and LSTMs address this problem and are commonly explained by their ability to create additive copy paths through time.

Show full abstract

This explanation is correct, but incomplete: useful RNN gate values must themselves be learned, which is typically done with another RNN. We study this gate-learning problem through carefully controlled sequence classification tasks. Our analysis shows that gated architectures struggle when all training samples require long-range memory and thus equally suffer from the vanishing gradient problem. We intervene by adding short-dependency samples which let gated models learn solutions that capture long-dependency samples, but also generalize across different class labels. When properly learned, gated RNNs match or even exceed the test accuracy of modern architectures like Mamba and xLSTM. Overall, our results highlight gate learning as a central part of learning long-range memory and show how training data can support this process by exposing the same task over shorter dependencies.

View on arXivView PDF

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{fan2026homunculus,
  title  = {The RNN Homunculus: Learning to Gate Long-Term Memory},
  author = {Zeyu Fan and Alexandru-Dragos Manolache and Jan van Gemert},
  year   = {2026},
  eprint = {2610.14279},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.14279v1}
}

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/2610.14279.svg)](https://codeofpaper.com/paper/2610.14279)

Discussion