Skip to content

Add ONNX example: PLA Sigmoid (replace lookup with piecewise linear)#1021

Draft
changshenhan wants to merge 1 commit into
zkonduit:mainfrom
changshenhan:examples/onnx/pla_sigmoid
Draft

Add ONNX example: PLA Sigmoid (replace lookup with piecewise linear)#1021
changshenhan wants to merge 1 commit into
zkonduit:mainfrom
changshenhan:examples/onnx/pla_sigmoid

Conversation

@changshenhan
Copy link
Copy Markdown

This adds an ONNX example under examples/onnx/pla_sigmoid that replaces Sigmoid lookup with a piecewise linear approximation (PLA). The circuit uses only mul/add/compare (copy and arithmetic constraints), no lookup.

  • Keeps accuracy ≥ 99.5% vs true sigmoid.
  • Allows lighter ezkl settings (num_inner_cols=1, minimal lookup_range).
  • Useful as a reference for reducing proof cost when handling nonlinear ops.

Author: @changshenhan

@changshenhan
Copy link
Copy Markdown
Author

Hi @jasonmorton and @zkonduit-team,

I've submitted this PR to implement the Piecewise Linear Approximation (PLA) for Sigmoid, which significantly optimizes the proof generation time.

It's been a few days and the CI workflows are still awaiting approval. Could you please help to run the workflows so I can ensure everything passes on your side?

I've already verified the logic locally with a precision of 99.5%. Thanks for your time!

@changshenhan changshenhan marked this pull request as draft March 13, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant