This project is a part of the course project for CSCI 567: Machine Learning at USC for Fall '23. In this project, we explore the interpretability of transformer models and try to understand the phenomenon of grokking in transformer models on algorithmic tasks.
- Mann Patel
- Che Wei Wu
- Huy Nguyen
- Luis Gil
- Te Li
All the code is present in the notebooks folder. All the notebooks are self-explanatory and can be run on Google Colab.
The repository is structured as follows:
└───mech-interp
├───fig
└───notebooks
├───gcd
├───general-modular-addition
├───primality
└───sorting
For each task, we have a separate folder in the notebooks folder. For each notebook, the dependencies are pip
installed in the first few cells.
Regardless of that, we have also provided a requirements.txt
file in the root directory of the repository. To install all the dependencies, run the following command in the root directory of the repository:
pip install -r requirements.txt
It is highly recommended to run the notebooks on Google Colab!