Reproduce “Pre-trained Large Language Models Use Fourier Features to Compute Addition” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Tianyi Zhou, Deqing Fu, Vatsal Sharan, Robin Jia
Researchers at the University of Southern California discovered that pre-trained large language models compute integer addition by leveraging Fourier features, which are embedded in their token embeddings and processed complementarily by MLP and attention layers. This mechanism allows for progressive computation, achieving high accuracy (e.g., 99.74% for fine-tuned GPT-2-XL) unlike models trained from scratch.
Key insights
- Pre-trained LLMs perform addition through a progressive computation process, refining approximate answers in early layers to precise solutions in later layers, rather than simply memorizing results.
- Fourier features, characterized by sparse components in the frequency domain at periods like 2, 5, and 10, are the underlying mechanism for numerical representation and computation, with MLP and attention layers exhibiting complementary roles.
- Pre-training is crucial for the emergence of these Fourier features, as they are embedded as an inductive bias within token representations, enabling efficient and accurate arithmetic, a capability absent in scratch-trained models.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.