stat.MLMar 16, 2026

Learning to Recall with Transformers Beyond Orthogonal Embeddings

Authors: Nuri Mert Vural, Alberto Bietti, Mahdi Soltanolkotabi, Denny Wu

Organizations: University of Toronto and Vector Institute · Flatiron Institute · University of Southern California · New York University and Flatiron Institute

Abstract

Modern large language models (LLMs) excel at tasks that require storing and retrieving knowledge, such as factual recall and question answering. Transformers are central to this capability because they can encode information during training and retrieve it at inference. Existing theoretical analyses typically study transformers under idealized assumptions such as infinite data or orthogonal embeddings. In realistic settings, however, models are trained on finite datasets with non-orthogonal (random) embeddings. We address this gap by analyzing a single-layer transformer with random embeddings trained with (empirical) gradient descent on a simple token-retrieval task, where the model must identify an informative token within a length-LL sequence and learn a one-to-one mapping from tokens to labels. Our analysis tracks the ``early phase'' of gradient descent and yields explicit formulas for the model's storage capacity -- revealing a multiplicative dependence between sample size NN, embedding dimension dd, and sequence length LL. We validate these scalings numerically and further complement them with a lower bound for the underlying statistical problem, demonstrating that this multiplicative scaling is intrinsic under non-orthogonal embeddings.

Figures & tables

Explore similar work

CardsList
  1. Geometric Factual Recall in Transformers

    May 12, 2026Shauli Ravfogel, Gilad Yehudai, Joan Bruna +1Neural Representation GeometryMemorization in Language Models

  2. MLPs are Hebbians: Constructing Efficient Fact-Storing MLPs for Transformers

    Jul 10, 2026Roberto Garcia, Jerry Liu, Ronny Junkins +3TransformerMemorization in Language Models

  3. Mixture of Chapters: Scaling Learnt Memory in Transformers

    Mar 22, 2026Tasmay Pankaj Tibrewal, Pritish Saha, Ankit Meda +2Memory-Augmented Language ModelsPersistent Memory for Language Models