Overview
Large Language Models (LLMs) are conventionally characterized as autoregressive generators. This work presents an alternative perspective, viewing LLMs as high-dimensional Dense Associative Memories. Within this framework, complex reasoning patterns are considered to be stored as latent attractors. The research investigates the energy landscape associated with mathematical reasoning. It proposes that accurate reasoning chains correspond to deep, wide attractor basins, termed 'flat minima,' within the model's output distribution. Conversely, hallucinations are posited to correspond to sharp, unstable local minima.
Approach
To leverage the identified geometry of the energy landscape, a retrieval mechanism was developed. This mechanism is based on a Gibbs measure of the trajectory's spectral entropy. The methodology involves sampling multiple reasoning paths. These paths are then weighted by their inverse energy, expressed as $P \propto e^{-\beta E}$. This weighting process approximates the equilibrium distribution of the associative memory, facilitating the system's relaxation into a robust solution.
Findings
The application of this physics-inspired mechanism resulted in empirical improvements. Specifically, Microsoft Phi-3.5's performance on the GSM8K benchmark increased by 5.38%. This improvement moved the performance from 84.7% to 90.1%. These findings suggest that the inference process in LLMs can be more effectively modeled as a dynamic settling into an attractor basin, rather than solely as a greedy next-token prediction.
Research Context
The study reframes the understanding of LLM operation from that of a sequential generator to a collective computation system operating as a high-dimensional Dense Associative Memory. This conceptual shift provides a framework for analyzing reasoning within LLMs through the lens of attractor dynamics and energy landscapes. The identification of 'flat minima' for correct reasoning and 'sharp, unstable local minima' for hallucinations provides a geometric interpretation of model accuracy and failure modes.