-
Notifications
You must be signed in to change notification settings - Fork 705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accuracy along the output vector with CKKS #52
Comments
Resurfacing this issue. We are seeing the same problem on multiple experiments with different numbers (but the same parameters): the first 3 locations of the output vector are less numerically accurate than the others. |
Looking into it. |
Previously I was suffering with the same problem and I figure out that this is from moduls switching process. When this process do "flooring" (n |
@HanKyoohyung Thanks, Kay. We also have narrowed it down to "flooring". I still can't be sure why this happens. |
When I change from floor to round, this problem was solved. It is quite hard to explain the reason in text, but following is brief explaination. The decode is evalute roots in complex field. In case of the first slot, decode evaluate w = exp(2pi / M) for M = 2 × degree. When the polynomial is f(x) = Sum f_i x^i, f(w) is Sum f_i w^i. Here we only use w^i for i < degree, so all imag part is w^i is positive. This means that 1st slot can be larger than other when f_i > 0 for all i. |
In addition, raising the root of unity to its 3rd power those not help to solve the problem. Always decode will use exp(2pi/M) in some place. |
@HanKyoohyung I have also switched to rounding. The error is vastly improved rather than eliminated. Rounding still introduces a very little bias: [0, (p-1)/2] are rounded to 0, [(p+1)/2, p-1] are rounded to 1. The set rounded to 1 has one less element. I guess this is the best we can do now. Thank you for the help! @lae3C069 @yaronf Internally the error is fixed. We will run more tests and release the fix soon in 3.3.2. This does not affect security, which is a relief. Thank you very much for the "scrutiny". It is extremely valuable. I'll close the issue now. |
Regarding the use of CKKS without batching, I was wondering why I observe different accuracy along the output vector. I noticed on multiple examples that the first 3 or 4 values of the vector have less accuracy compared to the following ones.
Here is one example showing this behavior, I have as input 98.123456789, and I simply encrypt then decrypt it.
This is the output I get:
The text was updated successfully, but these errors were encountered: