OPML: Innovative Applications of Optimistic Machine Learning on Blockchain

robot
Abstract generation in progress

OPML: Optimistic Approach-Based Machine Learning Techniques

OPML(Optimistic Machine Learning) is an emerging technology that utilizes optimistic approaches for AI model inference and training/fine-tuning on blockchain systems. Compared to ZKML, OPML can provide lower cost and higher efficiency ML services. One of the major advantages of OPML is its low barrier to entry - currently, a regular PC can run OPML containing large language models ( such as the 7B-LLaMA) of 26GB size without requiring a GPU.

OPML adopts a verification game mechanism to ensure the decentralization and verifiable consensus of ML services. Its workflow is as follows:

  1. The requester initiates the ML service task.
  2. The server completes the task and submits the results to the chain.
  3. The validator verifies the results.
  4. In case of disputes, accurately locate the erroneous steps through the bifurcation agreement.
  5. Arbitrating a single step on the smart contract

OPML: Machine Learning Using Optimistic Rollup System

Single-Stage Verification Game

The core of the single-stage verification game is the precise positioning protocol, which works similarly to the computation delegation (RDoC). The main features include:

  • Build a virtual machine (VM) for off-chain execution and on-chain arbitration.
  • Implement a lightweight DNN library to improve AI model inference efficiency
  • Use cross-compilation technology to compile AI model inference code into VM instructions
  • Use Merkle trees to manage VM images, uploading only the Merkle root to the chain.

In performance testing, a basic AI model ( MNIST classification DNN model ) can complete inference in 2 seconds on a VM on a PC, and the entire challenge process can be completed in under 2 minutes in a local Ethereum testing environment.

OPML: Machine Learning Using Optimistic Rollup System

Multi-Stage Verification Game

To overcome the limitations of single-stage verification games, we propose multi-stage verification games:

  • Calculation is only performed in the VM during the final stage.
  • Other stages can be flexibly executed in the local environment, making full use of hardware resources such as CPU, GPU, and TPU.
  • Significantly improve OPML execution performance, approaching local environment level.

Taking the two-stage (k=2) verification game as an example:

  1. Stage Two: Similar to the single-stage validation game, pinpointing the controversial steps on the "big instruction."
  2. Phase One: Positioning the Controversial Steps on VM Microinstructions

Ensure the integrity and security of transitions between phases through Merkle trees.

OPML: Machine Learning Using Optimistic Rollup System

Multi-Stage OPML Example: LLaMA Model

The LLaMA model adopts a two-stage OPML method:

  1. Represent the computation process of the deep neural network (DNN) as a computation graph G.
  2. Conduct the second phase verification game on the computation graph using multi-threaded CPU or GPU.
  3. The first stage converts single node computation into VM instructions.

For more complex calculations, a multi-stage OPML method with more than two stages can be introduced.

OPML: Machine Learning Using Optimistic Rollup System

Performance Improvement Analysis

Assuming the computation graph has n nodes, each node requires m VM micro-instructions, and the acceleration ratio of GPU or parallel computing is α:

  1. Two-stage OPML is α times faster than single-stage OPML.
  2. The size of the Merkle tree for the two-stage OPML is O(m+n), which is significantly smaller than the O(mn) of the single-stage OPML.

Consistency and Determinism Guarantees

To ensure the consistency of ML results, OPML adopts:

  1. Fixed-point Algorithm ( Quantization Technology ): Using fixed precision instead of floating-point numbers
  2. Software-based floating point library: Ensure cross-platform consistency

These methods effectively address the challenges posed by floating-point variables and platform differences, enhancing the reliability of OPML calculations.

OPML: Machine Learning Using Optimistic Rollup System

B-1.75%
ETH-3.28%
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 4
  • Share
Comment
0/400
MaticHoleFillervip
· 07-23 00:37
There are both models and consensus, but what is missing is implementation.
View OriginalReply0
DegenWhisperervip
· 07-22 06:53
Ah, I didn't understand it, just remember bull and that's it!
View OriginalReply0
SignatureCollectorvip
· 07-20 06:29
What kind of black technology is this? I'm a bit confused.
View OriginalReply0
Token_Sherpavip
· 07-20 06:29
just another ponzi wearing an AI suit... same old tokenomics trap tbh
Reply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)