OPML: Optimistic Machine Learning Brings a New Efficient and Low-Cost Paradigm to Blockchain AI

robot
Abstract generation in progress

OPML: A New Paradigm of Machine Learning Based on Optimistic Approaches

OPML(Optimistic Machine Learning) is an emerging technology aimed at applying optimistic approaches to AI model inference and training/fine-tuning within blockchain systems. Compared to ZKML, OPML has the advantages of low cost and high efficiency, capable of running large language models on a regular PC, such as the 7B-LLaMA( model which is approximately 26GB) in size.

OPML adopts a verification game mechanism to ensure the decentralization and verifiability of ML services. Its basic process 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, and if there are objections, the verification game is initiated.
  4. Step-by-step arbitration through smart contracts

OPML: Machine Learning Using Optimistic Rollup System

Single-Stage Verification Game

The core elements of a single-stage OPML include:

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

Locate the disputed steps through the binary agreement and send them to the on-chain arbitration contract. Preliminary tests indicate that basic AI model inference can be completed in under 2 seconds on a regular PC, and the entire challenge process takes about 2 minutes.

OPML: Machine Learning Using Optimistic Rollup System

Multi-Stage Verification Game

To overcome the limitations of the single-stage approach, OPML introduces a multi-stage verification game:

  • Only calculate in the VM during the final stage, other stages can be executed in the local environment.
  • Utilize hardware acceleration capabilities such as CPU, GPU, TPU.
  • Significantly improve execution performance by reducing reliance on VMs.

The core idea of multi-stage OPML is to represent the DNN computation process as a computational graph and validate it at different stages. This approach can fully leverage hardware acceleration and improve overall efficiency.

OPML: Using Optimistic Rollup System for Machine Learning

Performance Improvements

Multi-stage OPML has significant advantages over single-stage methods:

  • Speed calculation improved by α times ( α is the GPU or parallel computing acceleration ratio )
  • The size of the Merkle tree decreases from O(mn) to O(m+n), where m is the number of VM micro-instructions and n is the number of computation graph nodes.

These improvements significantly enhance the efficiency and scalability of the system.

OPML: Machine Learning Using Optimistic Rollup System

Consistency and Determinism

To ensure the consistency of ML results, OPML adopts the following strategies:

  1. Use fixed-point algorithm ( quantization technology ) to reduce floating-point error impact.
  2. Use a software-based floating-point library to ensure cross-platform consistency.

These methods effectively address the differences in floating-point calculations across different hardware platforms and enhance the reliability of OPML calculations.

OPML: Machine Learning Using Optimistic Rollup System

Overall, OPML provides an efficient and low-cost solution for AI model inference and training in blockchain systems. While it currently focuses mainly on model inference, the framework also supports the training process and is expected to become a universal solution for various machine learning tasks.

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
  • 3
  • Share
Comment
0/400
StakeOrRegretvip
· 07-13 11:26
Blockchain optimization still depends on the Algorithm.
View OriginalReply0
StableGeniusDegenvip
· 07-13 09:13
Reduce costs and increase efficiency bull wow
View OriginalReply0
MEVEyevip
· 07-12 12:33
Cost-effective and efficient, low operating costs without lag is just amazing.
View OriginalReply0
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)