OPML: Build an efficient on-chain AI framework that transcends ZKML with innovative solutions

robot
Abstract generation in progress

OPML: A Machine Learning Framework Based on Optimistic Methods

We have proposed a new framework called OPML(Optimistic Machine Learning ), which can efficiently execute AI model inference and training on blockchain systems. Compared to ZKML, OPML has lower costs and higher efficiency. OPML's hardware requirements are very low, and a regular PC can run OPML tasks that include large language models such as 7B-LLaMA without a GPU.

OPML uses a verification game mechanism to ensure the decentralization and verifiability of ML services. The process is as follows:

  1. The user initiates an ML service request
  2. The server completes the task and submits the results to the chain.
  3. Validators check the results; if there are objections, the verification game is initiated.
  4. Locate specific error steps through the binary protocol
  5. Finally, arbitration is carried out step by step by the smart contract.

OPML: Using Optimistic Rollup System for Machine Learning

Single-Stage Verification Game

The key points 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 inference efficiency
  • Use cross-compilation technology to compile AI inference code into VM instructions
  • Use a Merkle tree to manage VM images, only upload the root hash to the chain.

In basic testing, we can complete DNN inference within 2 seconds, and the entire challenge process can be completed within 2 minutes.

OPML: Machine Learning Using Optimistic Rollup System

Multi-Stage Verification Game

To overcome the limitations of a single-stage solution, we propose a multi-stage verification game:

  • Only calculate in the VM during the final stage, other stages can be executed flexibly.
  • Make full use of GPU/TPU acceleration and parallel processing
  • Significantly improve execution performance, approaching local environment levels.
  • Use Merkle trees to ensure the integrity and security of transitions between stages.

Taking the LLaMA model as an example, we adopt a two-stage OPML method:

  • The second stage involves verification games on the computation graph, which can be accelerated using GPUs.
  • The first stage converts single node computation into VM instructions.

The multi-stage method can achieve α times computational acceleration compared to the single-stage method, while significantly reducing the size of the Merkle tree.

OPML: Machine Learning Using Optimistic Rollup System

OPML: Machine Learning Using Optimistic Rollup System

Consistency and Determinism

To ensure the consistency of ML results, we have taken the following measures:

  1. Use fixed-point algorithm ( quantization technology ) to reduce the impact of floating-point errors.
  2. Use a consistent software floating-point library across platforms.

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

OPML is still under continuous development. We welcome individuals interested in this project to join and contribute to the development of OPML.

OPML: Machine Learning using Optimistic Rollup System

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
  • 6
  • Repost
  • Share
Comment
0/400
DeadTrades_Walkingvip
· 10h ago
The verification game is just a hide-and-seek game on the server.
View OriginalReply0
AirdropHunter007vip
· 10h ago
Eh, isn't this the spring for GPU miners?
View OriginalReply0
FundingMartyrvip
· 10h ago
Low price running LLama? Bull!
View OriginalReply0
ImpermanentPhilosophervip
· 10h ago
On-chain AI is really coming.
View OriginalReply0
OnChainDetectivevip
· 10h ago
Another "Decentralization" black box... Who will monitor the validators' dark operations? The transfer of 0.618 funds is suspicious.
View OriginalReply0
PretendingToReadDocsvip
· 10h ago
Everyone says they can't keep up with the times, and the hardware isn't working either. When can we get a GPU?
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)