|
| 1 | +# Towards Learning High-Precision Least Squares Algorithms with Sequence Models |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +This repository contains code for the following paper: |
| 6 | + |
| 7 | +> **Towards Learning High-Precision Least Squares Algorithms with Sequence Models.** |
| 8 | +> |
| 9 | +> Jerry Liu, Jessica Grogan, Owen Dugan, Ashish Rao, Simran Arora, Atri Rudra, Chris Ré. |
| 10 | +> ICLR 2025. |
| 11 | +
|
| 12 | +## Dependencies |
| 13 | +Install dependencies with |
| 14 | +``` |
| 15 | +conda create -n "precision-ls" python=3.10 |
| 16 | +conda activate precision-ls |
| 17 | +pip install -r requirements.txt |
| 18 | +``` |
| 19 | + |
| 20 | +## Code structure |
| 21 | +The code is organized as follows: |
| 22 | +- `notebooks/`: contains notebooks for the experiments |
| 23 | +- `replication_scripts/`: contains scripts for running the experiments |
| 24 | +- `src/datagen/`: contains code for data generation (tasks and samplers) |
| 25 | +- `src/models/`: contains code for the models, including different sequence mixers |
| 26 | +- `src/schedulers/`: contains code for the learning rate schedulers, including the adaptive one used in the paper |
| 27 | + |
| 28 | +## Running experiments |
| 29 | +To test the data generation, run |
| 30 | +``` |
| 31 | +bash src/datagen/test.sh |
| 32 | +``` |
| 33 | + |
| 34 | +To run the least squares experiments, run |
| 35 | +``` |
| 36 | +bash replication_scripts/least_squares.sh |
| 37 | +``` |
| 38 | + |
| 39 | +To run the experiments and ablations with linear algebra primitives, run |
| 40 | +``` |
| 41 | +bash replication_scripts/primitives.sh |
| 42 | +``` |
| 43 | + |
| 44 | +To run the experiments and ablations with the explicit gradient and k-iterate gradient descent tasks, run |
| 45 | +``` |
| 46 | +bash replication_scripts/explicit_gradient.sh |
| 47 | +``` |
| 48 | + |
| 49 | +To run the experiments with in-context ODEs, run |
| 50 | +``` |
| 51 | +bash replication_scripts/odes.sh |
| 52 | +``` |
| 53 | + |
| 54 | +## Citation |
| 55 | +If you find this work useful, please cite it as follows: |
| 56 | +``` |
| 57 | +@article{TODO, |
| 58 | + title={TODO}, |
| 59 | + author={TODO}, |
| 60 | + journal={TODO}, |
| 61 | + year={TODO}, |
| 62 | +} |
| 63 | +``` |
0 commit comments