newton-kepler

Code for a research paper studying what physics or algorithms transformers learn internally when trained to predict planetary motion. Used to explore how learned world models relate to Kepler and Newton style laws.

Share on XNo license declared

Overview

This repository holds the code for a research paper titled From Kepler to Newton: Inductive Biases Guide Learned World Models in Transformers. It studies what a transformer learns internally when trained to predict planetary motion, and whether it behaves like a Keplerian or a Newtonian world model. The experiments use 1D sine waves and 2D Kepler orbits, with training scripts and analysis notebooks that reproduce the paper figures.

Key features

  • Training scripts for classification and regression transformers
  • Experiments on 1D sine waves and 2D Kepler orbits
  • Notebooks that reproduce figures and analyze training dynamics
  • Compares full-context attention with local attention

Best for

Researchers studying learned world models or interpretability who want to reproduce and extend the paper's experiments.

Upstream
KindXiaoming/newton-kepler
Fork on GitHub
Guo-astro/newton-kepler
Upstream stars
50
Category
Finance, data and research
License
No license declaredWithout a license, the author keeps all rights. Ask the upstream owner before reusing the code.
Forked
2026-02-09
Sync status
In syncLast synced 2026-09-29