Batch Inverse
Reduction of the number of field inverse operations when computing batch operations.
Last updated
Reduction of the number of field inverse operations when computing batch operations.
Last updated
Batch Inverse is a technique used to efficiently compute the inverses of multiple values at once. Normally, calculating each inverse separately requires (inverse operations), but with Batch Inversion, you can compute all the inverses using just a single inverse operation.
As inverse operations are significantly more expensive than multiplications, this method is especially useful in performance-sensitive contexts—such as in ZK provers.
Let’s walk through an example of computing the inverses of four values:
Multiply the values one by one, keeping track of intermediate results:
So we get:
Compute the inverse of the final product:
This is the only inverse operation required.
Now, traverse the values in reverse to compute individual inverses:
This phase involves only multiplication operations.
Total:
, then update
, then update
, then update
If the vector has length , the total computational cost is:
Prefix Product Computation:
One Inverse Operation:
Reverse Traversal:
Written by of