paper-with-me

홈 › Papers

Hessian of Perplexity for Large Language Models by PyTorch autograd (Open Source)

2025-04-06 · Ivan Ilin

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.

📄 PDF Abstract BibTeX arXiv:2504.04520

Code (1)

vectozavr/llm-hessian 공식 구현 pytorch

Tasks

Language ModelingLanguage ModellingLarge Language Model

Similar Papers 제목 키워드 기반

torch-sla: Differentiable Sparse Linear Algebra with Adjoint Solvers and Sparse Tensor Parallelism for PyTorch

2026-01-20 · Mingyuan Chi, Shizheng Wen arxiv

Differentiable sparse linear algebra is foundational for scientific machine learning, yet PyTorch lacks a unified library for it: torch.sparse provides only low-level kernels and a non-differentiable, CPU-only spsolve, a…

Automatic Differentiation in PyTorch

2017-10-28 · NIPS 2017 2017 10 · Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan 외

In this article, we describe an automatic differentiation module of PyTorch — a library designed to enable rapid research on machine learning models. It builds upon a few projects, most notably Lua Torch, Chainer, and HI…

ClusteringCPUDimensionality ReductionGeneral Classification+1

MinBackProp -- Backpropagating through Minimal Solvers

2024-04-27 · Diana Sungatullina, Tomas Pajdla

We present an approach to backpropagating through minimal problem solvers in end-to-end neural network training. Traditional methods relying on manually constructed formulas, finite differences, and autograd are laboriou…

Vectorized Adjoint Sensitivity Method for Graph Convolutional Neural Ordinary Differential Equations

2022-09-14 · Jack Cai

This document, as the title stated, is meant to provide a vectorized implementation of adjoint dynamics calculation for Graph Convolutional Neural Ordinary Differential Equations (GCDE). The adjoint sensitivity method is…

Edge-computingSensitivity

Autograding Mathematical Induction Proofs with Natural Language Processing

2024-06-11 · Chenyan Zhao, Mariana Silva, Seth Poulsen

In mathematical proof education, there remains a need for interventions that help students learn to write mathematical proofs. Research has shown that timely feedback can be very helpful to students learning new skills. …

Mathematical InductionMathematical Proofs