Matrix Multiplication Layer
A GKR "matrix multiplication" layer is one which takes as input two MLEs and outputs a single MLE whose evaluations are the flattened matrix multiplication of the evaluations of and .
Canonic matrix multiplication is defined as the following, given matrices resulting in :
where the above holds for , . We instead consider the multilinear extensions of the above matrices, such that
where . Then for all and we have
(Note that the above is also necessarily true for general , as multilinear extensions are uniquely defined by their evaluations over the boolean hypercube.) We wish to prove this relationship to the verifier using sumcheck. We can do this using Schwarz-Zippel against as follows: rather than checking the above relationship for all , the verifier can sample challenges and instead check the following relationship:
This is a sumcheck over just variables, and yields two claims (assume that is bound to during sumcheck) –
Costs
The prover cost for sumcheck over matrix multiplication is as follows:
- The prover must first compute the evaluations of and for . It already has the evaluations of and , and thus this preprocessing step takes .
- Next, the prover must compute sumcheck messages for the above relationship. The degree of each sumcheck message is , and thus the prover sends evaluations per round of sumcheck. Since we are sumchecking over , there are rounds of sumcheck and thus the prover cost is for the 'th round of sumcheck. The total prover sumcheck cost is thus
- The prover's total cost (preprocessing + sumcheck) is . Letting be a constant and allowing square matrices with , the prover's total cost is , which is asymptotically optimal for matrix multiplication.
The proof size for sumcheck over matrix multiplication is as follows:
- There are total sumcheck rounds, each with the prover sending over evaluations for a quadratic polynomial. The proof size is thus field elements, plus extra for the final claims on and .
The verifier cost for sumcheck over matrix multiplication is as follows:
- The verifier receives sumcheck messages with evaluations each, and each round it must evaluate those quadratic polynomials at a random point. Its runtime is thus with very small constants.