|
The KL Divergence Is Never Negative, Except in PyTorch
Researchers discovered widespread numerical errors in PyTorch's KL divergence calculations, where over 85% of values have at least 1% relative error near small divergences and approximately 30% incorrectly produce negative values despite KL divergence being mathematically non-negative. These errors propagate through machine learning applications including model distillation, parameter fitting, and LLM quantization, affecting up to 97% of results in some cases, but the authors demonstrate that stable algorithms and compensated arithmetic can eliminate over 97% of these errors.
Read Full Article →
← Back to latest