Saved in:
Bibliographic Details
Main Author: Boué, Laurent
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2512.23329
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915698085724160
author Boué, Laurent
author_facet Boué, Laurent
contents This document is a follow-up to our previous paper dedicated to a vectorized derivation of backpropagation in CNNs. Following the same principles and notations already put in place there, we now focus on transformer-based next-token-prediction architectures. To this end, we apply our lightweight index-free methodology to new types of layers such as embedding, multi-headed self-attention and layer normalization. In addition, we also provide gradient expressions for LoRA layers to illustrate parameter-efficient fine-tuning. Why bother doing manual backpropagation when there are so many tools that do this automatically? Any gap in understanding of how values propagate forward will become evident when attempting to differentiate the loss function. By working through the backward pass manually, we gain a deeper intuition for how each operation influences the final output. A complete PyTorch implementation of a minimalistic GPT-like network is also provided along with analytical expressions for of all of its gradient updates.
format Preprint
id arxiv_https___arxiv_org_abs_2512_23329
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Deep learning for pedestrians: backpropagation in Transformers
Boué, Laurent
Machine Learning
This document is a follow-up to our previous paper dedicated to a vectorized derivation of backpropagation in CNNs. Following the same principles and notations already put in place there, we now focus on transformer-based next-token-prediction architectures. To this end, we apply our lightweight index-free methodology to new types of layers such as embedding, multi-headed self-attention and layer normalization. In addition, we also provide gradient expressions for LoRA layers to illustrate parameter-efficient fine-tuning. Why bother doing manual backpropagation when there are so many tools that do this automatically? Any gap in understanding of how values propagate forward will become evident when attempting to differentiate the loss function. By working through the backward pass manually, we gain a deeper intuition for how each operation influences the final output. A complete PyTorch implementation of a minimalistic GPT-like network is also provided along with analytical expressions for of all of its gradient updates.
title Deep learning for pedestrians: backpropagation in Transformers
topic Machine Learning
url https://arxiv.org/abs/2512.23329