Eigen Memory Trees

Mark Rucker, Jordan T. Ash, John Langford, Paul Mineiro, Ida Momennejad

TL;DR

The Eigen Memory Tree (EMT) is a scalable episodic memory model for sequential learning that organizes past experiences in a binary tree split along principal components. When hybridized with standard parametric linear models via simple feature stacking, it yields substantial sample-efficiency gains across hundreds of contextual bandit benchmarks with virtually no downside—even under strict memory budgets.

What Problem Does This Paper Address?

In sequential decision-making settings like contextual bandits, agents must learn effective policies under partial feedback: they only observe rewards for chosen actions, never for the counterfactuals. Parametric models (acting like semantic memory) generalize well over time but often adapt slowly to new patterns because they discard specific past experiences.

Episodic memory offers an attractive complement by retrieving exact or similar past events for instant recall. However, existing episodic memory architectures often face fundamental trade-offs:

  1. Scalability: Exact nearest-neighbor searches scale linearly with memory size, while differentiable neural memories are computationally heavy.
  2. Self-consistency: If an agent encounters a previously seen context, it should consistently retrieve that exact memory. Prior tree-based architectures like the Contextual Memory Tree (CMT) continually update their routing mechanisms, meaning previously stored experiences can drift out of reach.

Methods

EMT organizes past interaction pairs $(x, y)$ within the leaves of an incrementally grown binary tree:

  • Eigen-Router Leaf Splitting: When a leaf exceeds capacity $c$, it splits into two children. The routing decision is determined by computing the first principal component of the leaf's stored context vectors via Oja’s streaming PCA algorithm. Stored samples are projected onto this top eigenvector, and the split threshold is set at their median. Routing queries from root to leaf takes $O(\log N)$ time and keeps the tree well-balanced.
  • Self-Consistent Dissimilarity Scorer: Within a leaf, a linear scoring function ranks candidate memories by evaluating coordinate-wise absolute differences, $z = |x_1 - x_2|$, clipped at zero: $\max(0, \langle w, z \rangle)$. Because identical vectors yield $z = \mathbf{0}$, identical matches always receive a perfect dissimilarity score of 0. The weight vector $w$ is updated online using an $L_2$ ranking loss comparing the currently retrieved memory against the best alternative memory in that leaf.
  • Hybrid PEMT Architecture: Rather than relying solely on EMT for action selection, the authors introduce PEMT-CB. At each step, EMT's predicted reward for each candidate action is passed as an extra input feature into a standard parametric linear regressor (trained via SGD using Vowpal Wabbit).
Query x ──► Route down tree using ──► Identify best memory ──► EMT Reward ──► Feed as feature to
             Top Eigenvectors          in leaf via Scorer        Prediction     Parametric Learner

Datasets

The authors evaluated models across 206 classification datasets from the OpenML repository converted into contextual bandit tasks via a supervised-to-bandit transformation (where choosing the correct class gives a reward of 1, and 0 otherwise). For large datasets, 4,000 interactions were sampled; for long-horizon memory-budget experiments, 116 datasets with at least 32,000 examples were evaluated over 32,000 interactions.

Key Insights and Ideas

  • Hard-constraining self-consistency is vital: Enforcing that identical context pairs evaluate to a dissimilarity of zero provided immediate performance gains over unconstrained metric approaches across 180 out of 206 datasets.
  • Fixed routing beats continual router training in trees: By freezing the eigenvector-based routers once a leaf splits (unlike CMT, which incrementally updates routers), EMT guarantees that past memories remain reachable at their original coordinates.
  • When memory beats parametric learning: A meta-analysis revealed that standalone EMT outperforms purely parametric models primarily on datasets with high mutual information between features and labels and where the first principal component explains a large fraction of feature variance.
  • Stacking removes the "No Free Lunch" penalty: Standalone episodic memory doesn't win on every dataset, but passing memory predictions as a feature into a parametric model lets SGD naturally weight the memory when helpful and ignore it when noisy.

Key Results

  • EMT vs. Prior Memory Models: On contextual bandit benchmarks, EMT soundly outperformed CMT (177 wins vs. 11 wins, with 18 ties).
  • Hybrid PEMT vs. Purely Parametric:
  • Pure EMT beat the baseline parametric model in only 44 of 206 datasets.
  • The hybridized PEMT-CB beat the parametric baseline on 110 datasets, tied on 88, and lost on only 8 (where losses were by negligible margins).
  • Robustness to Bounded Memory: Using a simple Least-Recently-Used (LRU) cache eviction strategy, PEMT retained almost full performance. Restricting memory to 1,000 samples over 32,000 steps (a 3.1% memory footprint) resulted in an average reward drop of just 0.0075, while still outperforming the parametric baseline on 61 datasets.

Limitations and Future Work

  • Non-Stationary Environments: Because leaf split vectors are static and memory eviction relies on an LRU queue, the current architecture may struggle to adapt when the underlying data distribution drifts significantly over time.
  • Exploration Strategies: The current formulation relies on simple $\epsilon$-greedy exploration; incorporating uncertainty-aware exploration (e.g., LinUCB or Thompson sampling style bonuses) based on memory density remains unexplored.

Summary updated

BibTeX
@inproceedings{rucker2023eigen,
  author = {Mark Rucker and Jordan T. Ash and John Langford and Paul Mineiro and Ida Momennejad},
  title = {{Eigen Memory Trees}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=1DOS0kifqeP},
}
Figure