Transformer from Scratch

Full Transformer implementation with encoder–decoder attention and positional encodings.

This project implements a Transformer architecture from scratch, including:

  • Encoder–decoder multi-head attention
  • Positional encodings
  • Training loop and inference for sequence-to-sequence tasks

It’s designed as a learning project to deeply understand how Transformers work under the hood, beyond using off-the-shelf libraries.

View the repository