Sources:
- Multivariate lookups based on logarithmic derivatives
- Improving logarithmic derivative lookups using GKR
- Understanding LogUp: A Royal Road (Ben’s Blog post)
- cq - Cached quotients for fast lookups
Background: Lookup argument via product check
Analogously to the the Permutation Check via Product Check, for multi-set and set , we have if there exist values such that the following two polynomials are equal:
The values are the multiplicities, i.e., denotes the number of times appears in .
The problem with this approach is that computing the exponentiation requires a bit-decomposition of , which adds logarithmic overhead.
Logarithmic Derivative
Applying the logarithm to and the taking the derivative of and , we can transform the product check into a sum check over fractions:
LogUp based on fractional sum check
(Multivariate lookups based on logarithmic derivatives)
The paper describes the protocol in the multivariate setting, but this can be adopted to the univariate setting by using the Univariate Sum-Check Protocol and Univariate Zero-Check Protocol instead of the multivariate variants.
Example: Looking up one column, no batching
Let be the two multilinear polynomials that map each element of the boolean hypercube to an element in , , and the multiplicity respectively.
To show that the equality above holds, the verifier first samples a random . Then, the prover needs to show that:
The problem is that the expression we’re summing over is not a polynomial, so the sum-check protocol is not directly applicable!
To get around this, prover interpolates and commits to a polynomial such that:
or, equivalently:
So, we:
- Apply the Multivariate Sum-Check Protocol to show that
- Apply the Multivariate Zero Check Protocol to prove the identity above
The two protocols can be run in one go, as a single sum-check applied to:
where is a verifier challenge and is the unique multilinear extension of the equality function on the Boolean hypercube.
Batching
In principle, this technique can be generalized to looking up many columns, by defining such that:
The problem with this is that the degree of the zero-check expression grows linearly with each column. The paper describes a way to split into such that . This decreases the degree, but requires the prover to commit to more polynomials. The ideal value for depends on the polynomial commitment scheme being used.
Fractional sum-check via GKR
(Improving logarithmic derivative lookups using GKR)
With this approach, we get rid of the need to commit to the “helper polynomials” .
Let be the concatenations of the table values and multiplicities ( for each column on the LHS of the lookup, otherwise the combined multiplicity). We essentially want to show that:
Adding to rational numbers and can be achieved by mapping and to . So, we can compute the sum as a layered arithmetic circuit of depth by explicitly keeping track of the numerators and denominators and summing them up pair-wise in each layer!
The execution of the circuit can then be proven using the GKR protocol.
cq (cached quotients)
cq is essentially an instantiation of LogUp (in its original variant) in the univariate setting, using KZG commitments.
The main achievement is that the prover time is independent of the table size: We can prove a subset relation for a multi-set of size into a table of size in time (and pre-processing time ).
In a nutshell:
- The prover commits to polynomials , , and
- The verifier sends a random challenge
- Now, the prover computes and commits to and such that:
Note that:
- The degree of and is ; the degree of and is
- However, because is -sparse, its commitment can be computed in time, by adding pre-computed commitments to the Lagrange polynomials
- The main issue is that the Univariate Zero-Check Protocol requires computing a commitment to an -degree quotient polynomial such that
The key insight is that the quotient is also -sparse (but in a different basis) and can be computed in time!
First, note that the we’re computing is the same quotient that we get from dividing by with remainder:
(where it happens that )
Second, because is just a linear combination of Lagrange polynomials, we can write as the same linear combination of polynomials where:
Note that the quotients are independent of ! Therefore, we can pre-compute their commitments once and use them to compute the commitment to in time.