OneTrainer icon indicating copy to clipboard operation
OneTrainer copied to clipboard

Clipped OFT Norm for Long-term Stability

Open Koratahiu opened this issue 6 months ago • 0 comments

Issue

In OFT, the Neumann series only converges if the matrix norm $Q < 1$. If the norm of $Q$ hits or exceeds 1 (e.g., 1.01), the sequence diverges (the terms start getting larger instead of smaller). This results in "garbage" gradients and updates.

Solution

This PR introduces a simple safeguard fix: if the $Q$ norm exceeds 1, it is clipped back to 1.0 to guarantee convergence and ensure long-term training stability.

Koratahiu avatar May 31 '26 20:05 Koratahiu