Hacker News AIT2·Open Source
78 pts
An audit of 8.5 million inputs across 18 closed-form KL families and F.kl_div finds widespread value and gradient errors in PyTorch on both CPU and GPU: over 85% of FP32 results carry at least 1% relative error near KL 1e-7, about 30% turn negative at smaller divergences, and higher precision does not fix it. The authors propose stable closed-form decompositions, compensated arithmetic and analytic gradients that remove over 97% of significant errors, with code and data open-sourced.