Skip to main content

This post is a translation of the Spanish original.

Eigenvectors against forgetting: when linear algebra acts as memory

A paper uses the eigenvectors of a transition matrix as a basis so an agent doesn't forget when the task changes. Finally I see chapter 4 of linear algebra doing something useful.

3 min read

Eigenvectors against forgetting: when linear algebra acts as memory

When I had to compute eigenvectors by hand at UNED, my question was the usual one: fine, but what is this for outside the exam? This week I found a rather elegant answer on arXiv, and it comes from a place I didn't expect: neuroscience.

The paper is called "Grid Cells as Spectral Successor Features" and it's by Élodie Côté-Gauthier, Doina Precup and Isabeau Prémont-Schwarz. The idea fits in one line: if you build an agent's representation out of eigenvectors, learning a new task becomes almost trivial.

The property that explains everything

In reinforcement learning there is the successor representation, which roughly says "from this state, where will I go in the future, discounting what's far away?". Mathematically it's an infinite sum of powers of the transition matrix P, weighted by a factor γ. Learning it usually requires a separately trained neural network.

Here's the trick. If φ is an eigenvector of P with eigenvalue λ, applying P over and over only multiplies it by λ. The infinite sum collapses into a geometric series and you get this:

terminal
SR · φ = φ / (1 − γλ)

In other words, the successor feature of an eigenvector is the eigenvector itself scaled by a constant. There's nothing to learn. The authors take the eigenvectors of a fixed reference policy (a uniform random walk) and, in that case, the basis reduces to the low-frequency eigenvectors of the state graph's Laplacian. When the task changes, you only need to fit some linear weights on the reward: no successor-feature network and no replay buffer.

Why they talk about grid cells

The title isn't decoration. Since the work by Stachenfeld and colleagues (2014 and 2017) there has been a hypothesis in neuroscience: the grid cells in the entorhinal cortex, the ones that help us find our way around, look a lot like the eigenvectors of the successor representation. This paper uses that as a design principle. It even has a variant that learns those "cells" directly from pixels with an objective called ALLO, freezes the encoder and lets the agent learn only the reward weights.

The experiments are modest, and that's worth saying: a 12×12 grid with 84 free cells and four actions, 336 nodes in total. The paper is accepted at NeurIPS 2026 workshops, not the main conference. Some summaries say the agent keeps its performance after each goal switch while DQN collapses, but I haven't been able to check that against the results section, so I'm keeping it in quarantine.

My take

I like this paper for something that has nothing to do with beating benchmarks. It shows that catastrophic forgetting, one of the heaviest problems in continual learning, can be tackled by choosing the right basis instead of adding more parameters. It's the same intuition as Fourier or PCA: if you represent the data in the right basis, the hard part becomes linear.

The best counterargument is obvious. A small grid with a random walk is a very friendly world. In large environments, computing or approximating those eigenvectors is expensive, and if the real dynamics drift far from the reference policy, the basis may stop being useful. Even so, I'd rather have a clean idea that scales badly than a black box that works without anyone knowing why.

For anyone studying AI, the message is more practical than it looks. Maths courses aren't a toll you pay before the interesting stuff: quite often they are the interesting stuff.

The question I'm left with is whether we'll see this outside toy grids, or whether eigenvectors will remain that beautiful tool that only shines in 84-cell environments.

Sources

David González Lombraña

Apuntes, laboratorio y proyectos de IA, Linux y redes.