So, deep learning models are great at learning complex, non-linear patterns and seem to handle noise just fine. But under the hood, they rely on IEEE754 floating-point numbers, which can lose precision (e.g., rounding errors). Meanwhile, cryptography, like elliptic curve crypto, also deals with theoretically smooth, non-linear curves. But instead of floating-point, crypto uses modular arithmetic (finite fields) to keep everything exact and robust.
Here’s the thing: crypto folks turn continuous math into discrete, finite fields to avoid floating-point messiness. But deep learning avoids modular arithmetic because it hates abrupt jumps—like how uint8
wraps 255 → 0
. That discontinuity wrecks gradients during training.
What if we reimagined uint8
as a cyclic space, like a gear with 256 teeth? For example, the distance between 254 and 1 isn’t 253 (linear subtraction) but just 3 steps if you "rotate" through 255 → 0 → 1
. It’s like choosing to rotate clockwise instead of counterclockwise. Could gradients work this way? Instead of "add/subtract," maybe gradients tell us how much to "rotate" the weights in this cyclic space. So, the direction of gradient is not about negative or positive. Instead, it's counter clockwise or clockwise.
I’m not talking about security here, or deep learning is supposed to be secure (even though it's better). Just the engineering. Why stick to floating-point when modular arithmetic avoids precision loss? Couldn’t cyclic gradients sidestep exploding/vanishing issues? Or is there a deeper reason deep learning avoids this?
Example: If a gradient says rotate 3 steps clockwise instead of subtract 3, wouldn’t that handle modular wraps more gracefully? Or does this break how neural networks update weights?
So, actual number that we have already known must be encoded into cyclic space, and that literal value in cyclic space is not really represents absolute value in cyclic space.
For example, if we have continuous feature like temperature in celcius, it supposed to be encoded into uint8
space and think this as hidden representation of temperature in celcius.