harvardnlp/annotated-transformer
An annotated Jupyter notebook implementation of the Transformer architecture from the seminal "Attention Is All You Need" paper.

This repository provides a line-by-line annotated implementation of the Transformer model architecture in Python using Jupyter notebooks. It serves as an educational resource explaining how self-attention mechanisms, encoder-decoder structures, and transformer components work in practice. The material is maintained using jupytext to sync a Python script with the notebook format for version control, and can be run locally or via Google Colab.