Hessian of Perplexity for Large Language Models by PyTorch autograd (Open Source)
Not on the map. Why?
Abstract (arXiv)
Computing the full Hessian matrix -- the matrix of second-order derivatives for an entire Large Language Model (LLM) is infeasible due to its sheer size. In this technical report, we aim to provide a comprehensive guide on how to accurately compute at least a small portion of the Hessian for LLMs using PyTorch autograd library. We also demonstrate how to compute the full diagonal of the Hessian matrix using multiple samples of vector-Hessian Products (HVPs). We hope that both this guide and the accompanying GitHub code will be valuable resources for practitioners and researchers interested in better understanding the behavior and structure of the Hessian in LLMs.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 7 of its 16 references that are in the map. First posted on arXiv 6 Apr 2025.
Builds on
7 of 16 references.
References · 7
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
- 2016Pointer Sentinel Mixture Modelscited by 2,992
- 2020An Improved Analysis of Stochastic Gradient Descent with Momentumcited by 117
- 2024Pushing the Limits of Large Language Model Quantization via the Linearity Theoremcited by 20
Built on by
Citing papers per year: 2026: 2.
2 papers.