Kronecker-factored Approximate Curvature (KFAC) From Scratch

Felix Dangel, Bálint Mucsányi, Tobias Weber, Runa Eschenhagen
7/1/2025
cs.LG

No confident code implementation found for this paper.

Abstract

Kronecker-factored approximate curvature (KFAC) is arguably one of the most prominent curvature approximations in deep learning. Its applications range from optimization to Bayesian deep learning, training data attribution with influence functions, and model compression or merging. While the intuition behind KFAC is easy to understand, its implementation is tedious: It comes in many flavours, has common pitfalls when translating the math to code, and is challenging to test, which complicates ensuring a properly functioning implementation. Some of the authors themselves have dealt with these challenges and experienced the discomfort of not being able to fully test their code. Thanks to recent advances in understanding KFAC, we are now able to provide test cases and a recipe for a reliable KFAC implementation. This tutorial is meant as a ground-up introduction to KFAC. In contrast to the existing work, our focus lies on providing both math and code side-by-side and providing test cases based on the latest insights into KFAC that are scattered throughout the literature. We hope this tutorial provides a contemporary view of KFAC that allows beginners to gain a deeper understanding of this curvature approximation while lowering the barrier to its implementation, extension, and usage in practice.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{dangel2025kroneckerfactored,
  title  = {Kronecker-factored Approximate Curvature (KFAC) From Scratch},
  author = {Felix Dangel and Bálint Mucsányi and Tobias Weber and Runa Eschenhagen},
  year   = {2025},
  eprint = {2507.05127},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.05127v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.05127.svg)](https://codeofpaper.com/paper/2507.05127)

Discussion