🤖 AI Summary
Recent findings have highlighted a critical flaw in PyTorch related to Kullback-Leibler (KL) divergence calculations, which, despite being mathematically defined as always non-negative, have been reported to yield negative values in practical applications. This issue stems from inaccuracies in the standard KL divergence formulas, particularly when evaluating distributions close to each other. In extensive tests involving 8.5 million inputs, researchers discovered that over 85% of the floating-point (FP32) values exhibited at least 1% relative error near KL values of 10^(-7), and roughly 30% resulted in negative divergences. Higher precision was found to be ineffective at resolving the errors, emphasizing a more fundamental problem within the computations.
This revelation is significant for the AI/ML community, as it impacts various machine-learning tasks, including parameter fitting, Bayesian decision-making, and layer ranking in quantized LLMs, potentially leading to severe discrepancies—up to 97% in some distillation processes. The researchers propose new techniques involving stable closed-form decompositions and compensated arithmetic that drastically reduce significant errors. With these reforms, errors in 7.2 million closed-form samples were nearly eliminated, reinforcing the importance of accurate KL divergence calculations for robust and reliable machine learning applications.
Loading comments...
login to comment
loading comments...
no comments yet