A Blockchain-based Platform for Reliable Inference and Training of Large-Scale Models

Sanghyeon Park, Junmo Lee, Soo-Mook MoonarXiv 2023

Abstract

As artificial intelligence (AI) continues to permeate various domains, concerns surrounding trust and transparency in AI-driven inference and training processes have emerged, particularly with respect to potential biases and traceability challenges. Decentralized solutions such as blockchain have been proposed to tackle these issues, but they often struggle when dealing with large-scale models, leading to time-consuming inference and inefficient training verification. To overcome these limitations, we introduce BRAIN, a Blockchain-based Reliable AI Network, a novel platform specifically designed to ensure reliable inference and training of large models. BRAIN harnesses a unique two-phase transaction mechanism, allowing real-time processing via pipelining by separating request and response transactions. Each randomly-selected inference committee commits and reveals the inference results, and upon reaching an agreement through a smart contract, then the requested operation is executed using the consensus result. Additionally, BRAIN carries out training by employing a randomly-selected training committee. They submit commit and reveal transactions along with their respective scores, enabling local model aggregation based on the median value of the scores. Experimental results demonstrate that BRAIN delivers considerably higher inference throughput at reasonable gas fees. In particular, BRAIN's tasks-per-second performance is 454.4293 times greater than that of a naive single-phase implementation.

The Challenge: AI Transparency vs. Blockchain Scalability

As AI models become central to critical decision-making, we face a "black box" problem: verifying that an AI’s output hasn't been manipulated or that its training wasn't biased. While blockchain offers a transparent, decentralized ledger, it faces a massive scalability hurdle when applied to large-scale models. Standard blockchains are too slow to wait for a 6-billion-parameter model to run an inference, and storing massive model weights on-chain is prohibitively expensive.

Previous attempts at decentralized AI often fell short, either supporting only "toy" models or failing to provide cryptographic proof of work. As shown in the comparison below, BRAIN is designed to address these gaps, supporting large models and training/inference engines without requiring a hardfork of the underlying blockchain.

Comparison of BRAIN with existing decentralized AI platforms across key features.

The BRAIN Architecture: Two-Phase Pipelining

To make decentralized inference practical for large-scale models like GPT-J, BRAIN introduces four key architectural innovations:

  1. Two-Phase Transaction Pipelining: Instead of a single transaction that blocks until a result is returned, BRAIN splits the process. Phase 1 pushes a request into a priority queue, while Phase 2 handles the response. This allows the blockchain to continue processing blocks while AI nodes perform heavy lifting in the background.
  2. Cryptographic Sortition (VRF): To avoid the bottleneck of every node verifying every task, BRAIN uses Verifiable Random Functions (VRFs) to randomly select a small "committee" of nodes for each task. This ensures security as the committee members remain unknown until they submit results.
  3. Commit-and-Reveal: To prevent "free-riders" (nodes that simply copy the first person’s answer), committee members must first submit a hash of their result (Commit) and then later reveal the actual data (Reveal).
  4. Aggregator-Free Federated Learning: For training, BRAIN eliminates central server dependencies. Nodes evaluate model updates and submit scores to a smart contract, which uses the median value to aggregate the model locally on each node, providing resistance against poisoning attacks.
The sequence of the two-phase mechanism, showing how nodes interact through Request, Commit, Reveal, and Execute phases.

Experimental Evaluation and Results

The researchers evaluated BRAIN using GPT-J-6B, a 6-billion parameter large language model, and the SAMSum Dataset for inference testing. The system was deployed and tested against real-world gas costs and block times on the Ethereum and Polygon networks.

  • Massive Throughput Gains: By decoupling the request from the response, BRAIN achieved an inference throughput 454.4293 times higher than a naive, single-phase implementation. This pipelining allows the network to handle multiple AI tasks simultaneously.
  • Practical Latency: On Ethereum, the average time to receive a verified AI response was approximately 86.4 seconds. While not instantaneous, this is highly practical for asynchronous tasks like legal analysis, medical auditing, or content moderation.
  • Cost Efficiency: By utilizing optimized "precompiled" contracts for VRF verification, costs on Ethereum dropped from ~$32.50 to just $2.98. On the Polygon network, these costs were negligible, often fractions of a cent.

Conclusion and Future Work

BRAIN demonstrates that trust in AI does not require on-chain execution of the model itself. Instead, the blockchain serves as a reliable "referee" that coordinates off-chain verification. By moving the heavy lifting off-chain while keeping the coordination logic on-chain, BRAIN achieves the best of both worlds: transparency and performance.

Currently, BRAIN focuses on reliability and traceability. A primary limitation is privacy, as prompts and outputs are visible to the committee nodes. Future work aims to integrate privacy-preserving features, such as Zero-Knowledge Proofs (ZKPs) or Trusted Execution Environments (TEEs), to ensure users can receive verified results without exposing sensitive data to the network.

Summary updated

BibTeX
@misc{park2023blockchain,
  author = {Sanghyeon Park and Junmo Lee and Soo-Mook Moon},
  title = {{A Blockchain-based Platform for Reliable Inference and Training of Large-Scale Models}},
  year = {2023},
  eprint = {2305.04062},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.04062},
}
Figure