Thomas Coratger
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Optimizing the Sumcheck Protocol ## What is the Sumcheck Protocol? The Sumcheck protocol is an interactive proof system where a **Prover** \(P\) convinces a **Verifier** (V) of a specific claim without the Verifier re-doing all the work. * **The Claim**: The Prover asserts that the sum of a known multivariate polynomial $g(X_1, \dots, X_\ell)$ over every point in the Boolean hypercube $\{0,1\}^\ell$ equals a certain value $H$. $$ H = \sum_{x \in \{0,1\}^\ell} g(x) $$ * **The Goal**: The Verifier needs to check this claim efficiently. A naive check would require $2^\ell$ evaluations of $g$, which is computationally infeasible for the Verifier. * **The Trick**: The sumcheck protocol reduces the Verifier's work to just **one single evaluation** of the polynomial $g$ at a random point, plus some very cheap consistency checks. ## The Prover's Bottleneck & Optimization Landscape While the Verifier's job is easy, the Prover must compute a new polynomial in each round, which can be computationally intensive. The optimizations we'll discuss are particularly relevant for a common scenario in modern multilinear SNARKs like the one we have in the leanVM prover. ### The Setting 1. **Polynomial Structure**: The polynomial $g$ is often a product of $d$ simpler, multilinear polynomials (degree at most 1 in each variable). $$ g(X) = \prod_{k=1}^{d} p_k(X) $$ 2. **Base and Extension Field**: The actual computations involve "small" values (e.g., from a base field $\mathbb{F}_p$), but for security, the protocol's challenges are drawn from a much larger extension field $\mathbb{F}_{p^k}$. This creates a significant performance gap between different types of multiplication: * `ss` (small-small): Base field $\times$ Base field. **Very fast.** * `sl` (small-large): Base field $\times$ Extension field. **Fast.** * `ll` (large-large): Extension field $\times$ Extension field. **Very slow.** Since the Verifier's random challenges $r_i$ are in the large field, the Prover's work from round 2 onwards is dominated by slow `ll` multiplications. The key to optimization is to rearrange the computation to minimize these `ll` operations, often by doing more work upfront in the cheaper base field. ## Optimization 1: Small-Value Sumcheck via Interpolation This technique, based on work by Bagad, Dao, Domb, and Thaler, decouples the Prover's work into offline and online phases. > LambdaClass has hands-on experience implementing this, so their insights will be highly valuable here! This section will focus on the core concepts, with the deeper dive happening during our discussion. > Just putting a bunch of equations here for the discussion. ### The Core Idea: Decouple and Pre-compute We split the prover's work into two phases: * **Offline (Preprocessing)**: Perform as much work as possible using only "small" values before interacting with the Verifier. * **Online**: Perform the remaining work that requires the "large" random challenges from the Verifier. The main tool for this is Lagrange Interpolation. Any polynomial $F(Y)$ can be expressed as a weighted sum of basis polynomials. Instead of evaluating $F(r)$ directly at a random challenge $r$, we can write: $$F(r) = \sum_{j} \underbrace{F(v_j)}_{\text{small coefficient}} \cdot \underbrace{L_j(r)}_{\text{basis eval}}$$ Here, the $v_j$ are pre-chosen "small" points. The terms $F(v_j)$ can be pre-computed offline. ### Applying it to Sumcheck In round $i$, the Prover needs to compute $s_i(u) = \sum_{x'} \prod_{k=1}^{d} p_k(r_1, \dots, r_{i-1}, u, x')$. Using interpolation and swapping the order of summations, we get: $$s_i(u) = \sum_{v \in G_d} \left( \sum_{x'} \prod_{k=1}^{d} p_k(v, u, x') \right) \cdot L_v(r_1, \dots, r_{i-1})$$ The term in the parentheses is what we call an accumulator: $$A_i(v, u) = \sum_{x' \in \{0,1\}^{\ell-i}} \prod_{k=1}^{d} p_k(v, u, x')$$ These accumulators depend only on small, fixed points and can be entirely pre-computed offline using fast `ss` multiplications. The online work is then reduced to a single linear combination involving the `ll` heavy evaluations of $L_v(r_1, \dots, r_{i-1})$. ### The Hybrid Strategy This method is most effective for the first few rounds. The optimal strategy is **hybrid**: 1. Use the accumulator method for the first $\ell_0$ rounds. 2. Switch back to the standard prover algorithm for the remaining rounds. This approach dramatically reduces the total number of expensive `ll` multiplications. ### Open Questions for Discussion * What is the optimal switch-over point $\ell_0$ in practice? * Is this technique equally beneficial for the PCS side (like WHIR) and the PIOP, or is it better suited for one over the other? ## Optimization 2: Univariate Skip The univariate skip is another technique for the initial rounds of sumcheck, designed to maximize work in the cheap base field. ### The Motivation Can we do even more work in the base field to reduce the number of expensive extension-field rounds? Instead of eliminating one variable at a time, can we eliminate $k$ variables in a single, super-sized first round? A naive attempt to create a *multivariate* polynomial is too expensive, as it requires $(d+1)^k$ evaluations to define. ### The Solution: Reorganize the Domain The key is to avoid creating a multivariate polynomial by changing the evaluation domain's structure. 1. **Restructure**: Replace the first $k$ Boolean variables (domain $\{0,1\}^k$) with a single variable that ranges over a multiplicative subgroup $D$ of the base field, where $|D| = 2^k$. 2. **Reinterpret**: The polynomial to be summed, $g(X_0, \dots, X_{\ell-1})$, is reinterpreted as a function $g'(X, x_k, \dots, x_{\ell-1})$, where $X \in D$. 3. **Compute**: The prover computes a single univariate polynomial $v(X)$ by summing over the remaining $\ell-k$ Boolean variables. $$ v(X) = \sum_{x_k, \dots, x_{\ell-1} \in \{0,1\}} g'(X, x_k, \dots, x_{\ell-1}) $$ Because $v(X)$ is univariate, it can be defined by a manageable number of evaluations (linear in $2^k$, not exponential). The prover sends $v(X)$ to the verifier, effectively completing $k$ rounds of Sumcheck in one go, all within the fast base field. This is often implemented using Low-Degree Extensions (LDEs) via FFTs. ### Open Questions for Discussion * WHIR: The univariate skip modifies the challenger state and has downstream effects on the entire proof system, including STIR query management and verifier logic in WHIR. How can we best manage this complexity? * Initial benchmarks suggest this might be slower than the traditional approach (for WHIR but much better results for the PIOP), possibly due to overhead from handling a large `eq` polynomial table. What are the bottlenecks and how can they be addressed? ## Broader Implementation Questions Let's brainstorm some higher-level implementation challenges and goals. * How can we design a single, generic Sumcheck implementation that is efficient for both WHIR and SuperSpartan-like PIOPs? * How to integrate packing strategies in the Sumcheck of WHIR? * What would an ideal, unified implementation for both Sumcheck and Zerocheck look like, potentially for upstreaming into a library like Plonky3? * How to implem the univariate skip properly ?

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully