Skip to content

Compress the intermediate variable size #209

Description

@niconiconi

Description

In our current GKR-based ZK proof system implementation, we represent data using field elements that occupy 32 bits each. However, in many practical applications, the underlying data is binary in nature—each element effectively represents only 1 bit of meaningful information. This creates an opportunity to optimize memory usage.

Proposed Improvement

We should implement a mechanism similar to LLM quantization where we:

  • Store data in a compressed format using 1 bit per element.
  • Process computations in 32-bit field elements when necessary.

This approach can substantially reduce the memory footprint for intermediate variables without affecting the computational correctness of our ZK proofs.

Benefits

  • Memory Efficiency: Significant reduction in storage requirements.
  • Potential Speedup: Smaller data size may lead to faster data transfer and processing.
  • Scalability: Improved performance for applications dealing with large binary datasets.

Next Steps

  1. Prototype the conversion logic between compressed and full-width representations.
  2. Benchmark memory usage and performance improvements.
  3. Integrate the solution with existing components and perform end-to-end testing.
  4. Review and iterate based on the findings.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions