{"id":"arxiv/2607.13042","url":"https://arxiv.org/abs/2607.13042","tags":["cs.LG","cs.MS","math.NA"],"score":0,"title":"Automatic Differentiation from Scratch: How PyTorch Computes Gradients in Physics-Informed Neural Networks","domain":"cs.LG","source":"arxiv","authors":["Abdeladhim Tahimi"],"reviews":0,"subject":"cs.LG","summary":"This paper traces, with explicit numerical values, how PyTorch's automatic differentiation (AD) engine computes gradients for Physics-Informed Neural Network (PINN) training -- a setting that requires two levels of differentiation: computing the physics derivative $\\hat{y}'(t)=d\\hat{y}/dt$ through the network, and computing parameter gradients $\\nabla_θL$ of a loss that itself depends on $\\hat{y}'(t)$. Using a 1-3-3-1 multilayer perceptron and the initial value problem $y'(t)+y(t)=0$, $y(0)=1$, we trace the complete pipeline at every node: the computational graph built during the forward…","category":"research","comments":0,"disputed":false,"division":"cs","mentions":0,"discussed":0,"published":"2026-06-13","reactions":{}}