LogUp-GKR

This note is about LogUp-GKR, and is the culmination of many notes that built up to this. Make sure to take a look at the book for links to all other articles. Namely, the previous article deep dove into the original GKR. Also make sure to familiarize yourself with our math conventions.

Recall the LogUp equation from the LogUp note:

i=0n2j=0k1maij(αaij)=i=0n2j=0k1mbij(αbij)

LogUp-GKR is a technique for a prover to prove the correct evaluation of this equation to a verifier using a modified version of GKR. We're going to be specifically interested in the case where the

maij,
mbij
,
aij
and
bij
are values derived from a STARK trace. As discussed in the LogUp note, we know how to prove this relationship using AIR constraints directly. This note is interested in how to offload this task to GKR instead.

Conventions

Recall from the note on the multilinear extension that

h~i stands for the MLE of some
h:{0,1}kF
. In the case of LogUp-GKR, we view the trace columns as functions
fi:{0,1}logn
, where
n
is the length of the trace. We use the bit decomposition of the row index as input to the function. For example, row index
6
would be accessed as
110
. Further, say that we number these bits as
b2b1b0
, such that
b2=1
,
b1=1
, and
b0=0
. Then we would write
hi(b0,b1,b2)=hi(0,1,1)
, such that the least significant bit comes first, and the most significant bit comes last.

Additionally, throughout the note,

fi:{0,1}lognF will refer to the
i
th trace column. As usual,
f~i
will refer to the multilinear extension of
fi
. Also, it will also be convenient to define
ω~(x)=(f~0(x),,f~m1(x))
. Lastly, we will say that the trace has
m
columns.

The circuit

Next, we will describe the circuit that LogUp-GKR operates on. However, before we discuss the circuit, let's first rearrange the above equation by bringing all the terms on the left-hand side:

i=0n2j=0k1maij(αaij)mbij(αbij)=0

Notice that the above is a sum of fractions. To simplify the presentation of the circuit, let's assume that we only have 4 fractions:

ab+cd+ef+gh=0

The first layer of the circuit will represent these 4 fractions. Then, the second layer will reduce the number of fractions by 2 by merging pairs of fractions as follows:

ad+cbbd+eh+gffh=0

And finally, the final layer in this example would halve the number of fractions down to a single one in a similar manner:

fh(ad+cb)+bd(eh+gf)bdfh

Note that the circuit never performs any actual division; all it does is merge fractions together over and over with each new layer, down until there is only a single one remaining.

Hence, a fraction will be represented as a pair of field elements

(a,b). Additionally, we will define an addition operation that mimics how fractions are added:

(a,b)+(c,d)=(ad+cb,bd)

We will follow the paper's terminology and call this

(F2,+) the projective representation. Nodes in the circuit are going to be in projective representation. That is, every node will represent 2 field elements, and nodes are summed as described above.

Below is an example circuit, where the initial fractions (encoded in projective representation) lie in the input layer:

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

In drawing this circuit, we made the assumption that

k=1 and
n=4
. We omitted the
j=0
index in the circuit, such that, for example,
mai
stands for
mai0
. Additionally, note that the circuit ends with 2 fractions in the final layer instead of 1; we will explain why when we get to GKR.

The

(pi,qi) pairs on the left hand-side of the circuit represent the 2 polynomials that will be interpolated per layer; we will discuss these in-depth in the next sections.

Recall from the multiset check note that the terms

maij,
mbij
,
aij
and
bij
are assumed to be polynomials over the trace row
i
and
i+1
. However, in this circuit and in the rest of this note, we make the simplifying assumption that the terms are polynomials solely over the trace row
i
.

GKR

We will now discuss the modifications to the GKR protocol that are made to prove the evaluation of this circuit. The point to address is how we handle the fact that we have 2 field elements per node compared to a single one in the original GKR. We will also define the layer polynomial differently (exploiting the additional structure in the circuit) to make the layer sum-check more efficient.

We will first discuss GKR over all layers other than the input layer, and end with the treatment of the input layer.

All inner layers (excluding the input layer)

We begin the discussion about all layers except the input layer. At layer

i, let
pi:{0,1}kiF
and
qi:{0,1}kiF
be functions that encode all the left element of each node, and all the right element of each node, respectively. For example, referring to our example circuit at layer 2,

p2(0,0,0)=ma0q2(0,0,0)=αa0p2(1,0,0)=mb0q2(1,0,0)=αb0

Additionally, we can describe the circuit structure as

pi(x)=pi+1(0,x)qi+1(1,x)+pi+1(1,x)qi+1(0,x)qi(x)=qi+1(0,x)qi+1(1,x)

This follows from how the nodes are laid out, the fact that we index nodes in bit representation from least to most significant bit, and from the definition of addition for the projective representation.

Next, we need to give a definition of

p~i and
q~i
which can be proved using sum-check. We will use the following definitions:

p~i(x^)=x{0,1}kieq(x,x^)(p~i+1(0,x)q~i+1(1,x)+p~i+1(1,x)q~i+1(0,x))q~i(x^)=x{0,1}kieq(x,x^)q~i+1(0,x)q~i+1(1,x)

Remember that the MLE of a function

f is unique, and hence all expressions which are multilinear and interpolate
f
are equivalent definitions of the same polynomial
f~
. You can verify that the 2 properties hold for the above definitions. This concept is further discussed in this note from Justin Thaler.

Notice that unlike the original GKR protocol, both sum-checks are defined over

x of the current layer
i
as opposed to over some
y,z{0,1}ki+1
of the next layer
i+1
. Concretely, we are summing over
ki
variables instead of
2ki+1
, which is radically more efficient. We are able to do this by exploiting the additional structure in the circuit where a node with index
(x0,,xki)
in layer
i
will be the result of adding the nodes in layer
i+1
with index
(0,x0,,xki)
and
(1,x0,,xki)
. Additionally, since there are no multiplications in the circuit, we omit them completely.

Recall that the core idea of the GKR protocol is to reduce a claim about the layer polynomial(s) at layer

i to a claim about the layer polynomial(s) at layer
i+1
. Assume that the claims at layer
i
are
p~i(ρi)
and
q~i(ρi)
, for some random
ρiRFki
. Here, we could execute 2 sum-check protocols to reduce the 2 claims
p~i(ρi)
and
q~i(ρi)
to 2 claims
p~i+1(ρi+1)
and
q~i+1(ρi+1)
, for some random
ρi+1RFki+1
. However, we will instead reduce the 2 sum-check problems to a single one by taking a random linear combination of both claims. Specifically, given a randomly sampled
λiF
,

p~i(x^)+λiq~i(x^)=x{0,1}kieq(x,x^)[p~i+1(0,x)q~i+1(1,x)+p~i+1(1,x)q~i+1(0,x)+λiq~i+1(0,x)q~i+1(1,x)]

The core property of a random linear combination of

n claims is that it reduces the
n
claims to a single claim. In other words, if the reduced claim is proven to be true, then with high probability, the
n
original claims are proven true as well.

Hence, with this trick, we are back to having a single sum-check protocol per layer.

Finally, we are left with showing how to reduce a claim

p~i(ρi)+λq~i(ρi), for some random
ρiRFki
, to a claim
p~i+1(ρi+1)+λi+1q~i+1(ρi+1)
, for some random
ρi+1RF
and
λi+1F
.

Hence, starting from the claim

p~i(ρi)+λiq~i(ρi), we run the
ki
rounds of sum-check until the last evaluation check:

p~i(ρi)+λiq~i(ρi)=x{0,1}kieq(x,ρi)[p~i+1(0,x)q~i+1(1,x)+p~i+1(1,x)q~i+1(0,x)+λiq~i+1(0,x)q~i+1(1,x)]

In the last step of the sum-check, let

γRFki be the randomness sampled during the
ki
rounds. Hence, the verifier is left with evaluating
p~i+1(0,γ)
,
p~i+1(1,γ)
,
q~i+1(0,γ)
, and
q~i+1(1,γ)
. Just as in the original GKR, the prover will send these evaluations as claims. Also, just as in GKR, we need to reduce the 2 claims about
p~i+1
to a single claim, and the 2 claims about
q~i+1
to a single claim.

Recall from GKR that to reduce 2 claims about

W~i to a single claim about
W~i+1
, the prover had to send a univariate polynomial
qi=W~i+1li+1
of degree
ki+1
. In LogUp-GKR, we can do better by exploiting the additional structure of the circuit.

In LogUp-GKR, to reduce the 2 claims about

p~i+1, the prover only needs to send the 2 claims
p~i+1(0,γ)
and
p~i+1(1,γ)
. The verifier samples
γ0RF
, and computes the new claim
p~i+1(γ0,γ)=(1γ0)p~i+1(0,γ)+γ0p~i+1(1,γ)
. Similarly for
q~i+1
, the prover also sends the claims
q~i+1(0,γ)
and
q~i+1(1,γ)
, which are reduced to
q~i+1(γ0,γ)=(1γ0)q~i+1(0,γ)+γ0q~i+1(1,γ)
. Finally, the verifier samples
λi+1RF
, yielding the next layer claim
p~i+1(γ0,γ)+λi+1q~i+1(γ0,γ)
.

The above makes use of a property of multilinear polynomials, which was explored in this note.

Recall that our goal was to reduce the initial claim

p~i(ρi)+λiq~i(ρi) to a single claim
p~i+1(ρi+1)+λi+1q~i+1(ρi+1)
for some
ρi+1RFki+1
. We just achieved this with
ρi+1=(γ0,γ)
.

Hence, by exploiting the graph structure, in LogUp-GKR we are able to have the prover send 2 field elements per polynomial (

p~i+1(0,γ),
p~i+1(1,γ)
,
q~i+1(0,γ)
and
q~i+1(1,γ)
) instead of the
ki+1
field elements that represent the
q
polynomial in the original GKR.

The input layer

Recall that we are interested in the use of LogUp-GKR where the values

maij,
mbij
,
aij
and
bij
that sit in the input layer are derived from a STARK trace. In order to prove that this is indeed the case, we design the circuit to reduce the evaluation of the circuit to claims about the main trace columns
f~0(ρ)
,
,
f~m1(ρ)
, given a randomly sampled
ρFlogn
. Then, in the next article, we will show how to prove these claims with Air constraints.

Therefore, this additional constraint means that we need to reduce the claim about the 2nd layer (

p1(ρ1)+λ1q1(ρ1) in our example circuit) differently from all other layers. Concretely, again referring to our example circuit, applying the same algorithm as all other circuit layers would reduce the 2nd layer claim to a claim
p2(ρ2)+λ2q2(ρ2)
, for some random
ρ2RFk2
. This is not quite what we need.

Recall that the input layer holds the values

maij,
mbij
,
aij
and
bij
, for
0i<n
and
0j<k
. That is,
i
selects the trace row, and
j
selects the fraction generated at row
i
.

Let

zFlogk be the bit decomposition of
j
. For example, if
j=4
, then
z=(0,0,1)
, following our previously discussed convention that the least significant bit comes first.

Next, we will introduce

g[z](ω~(x)), which captures all numerators of a given row, and
h[z](ω~(x))
to capture the denominators. In our example circuit, using a slight abuse of notation, we would have

g0(ω~(x))=max0g1(ω~(x))=mbx0h0(ω~(x))=αax0h1(ω~(x))=αbx0

We abuse notation since

x is the bit decomposition of the index
i
, which we use directly into, for example,
max0
.

Then, let

p~d2(ρd2)+λd2q~d2(ρd2) be the claim from the 2nd layer. We will rewrite the claim as

p~d2(ρz,ρx)+λd2q~d2(ρz,ρx)

where

ρzRFlog(k)1 and
ρxRFlogn
.

Then, the reduction to the input layer can written as

p~d2(ρz,ρx)+λd2q~d2(ρz,ρx)=x{0,1}lognz{0,1}log(k)1eq(z,ρz)eq(x,ρx)[g[(0,z)](ω~(x))h[(1,z)](ω~(x))+g[(1,z)](ω~(x))h[(0,z)](ω~(x))]

We only run the sum-check protocol over the

x variable. Then, after the last round of sum-check, let
x^RFlogn
be the randomness generated during sum-check. The prover sends the claims
ω~(x^)=(f~0(x^),,f~m1(x^))
, which the verifier uses to complete the final evaluation of sum-check.

And We're done! We are left with claims

(f~0(x^),,f~m1(x^)) to prove, which we will be proved in Air. We will discuss this in the next article.