AIVM Architecture and Design

The Artificial Intelligence Virtual Machine (AIVM) serves as the bedrock of our decentralized AI platform, providing a standardized and secure execution environment analogous to the Ethereum Virtual Machine’s (EVM) role in Ethereum. However, unlike the EVM, which is geared towards general-purpose smart contract execution, the AIVM is specifically optimized for the complexities and nuances of AI model inference, both large and small.

At its core, the AIVM is designed to execute AI models uniformly, ensuring that regardless of the underlying hardware or software of the individual nodes, the output remains consistent. This is critical to achieving consensus within the network, as even minute discrepancies in model execution can lead to divergent results, thereby undermining the veracity and reliability of the entire system, and wasting time, resources, and gas fees in the process.

Each AI model in the AIVM ecosystem comprises four integral components:

  • Model Parameters are the weights and biases that define the AI model. They are the product of the training process and dictate the model’s behavior and capabilities.

  • AIVM Configuration File functions similar to a Docker file but specific to the AIVM, this file contains the specifications for the virtual environment in which the AI model will execute. It details the dependencies, libraries, and runtime needed to run the model, ensuring that every node sets up an execution environment with identical configurations.

  • Inference Code is the code that runs the AI model. This includes the logic for processing inputs and generating predictions or outputs. The inference code also comes with necessary compilation information to ensure it can be seamlessly executed within the AIVM.

  • Aggregation Code is a piece of scripting code that determines how the decentralized VM will aggregate and reach consensus from results returned from different nodes.

These components together form what we call the AIVM kernel. The kernel encapsulates all of the necessary building blocks for a node to download and correctly execute an AI model. To facilitate transparency and repeatability, the AIVM kernel is stored on the blockchain, providing an immutable and verifiable record of the model’s execution environment and logic.

In addition to the kernel, a fully operational AIVM also contains various protocols that support decentralization and security. These protocols will be discussed in later chapters. The full architecture is depicted in the image below.

The AIVM is architected with a highly simplified user interface intended to abstract away the complexities of the AI execution process. Nodes operating within the network can easily download and run an AIVM kernel locally.

The interface is designed to accept user inputs, such as prompts for language models or data for predictive analytics, and then carry out the inference task, returning the results to the user or writing them back to the blockchain, as required by the application.

Key design features of the AIVM include:

  • Isolation. The AIVM ensures that the execution of AI models is isolated from the host environment of the node, preventing any external factors from affecting the inference process.

  • Reproducibility. The comprehensive specification of the AIVM’s environment ensures that models can be executed reliably and with the same results across different nodes.

  • Security. The AIVM is powered by a proprietary hybrid cryptographic security protocol built by Nesa to be detailed in later sections, that minimizes the risk of malicious code execution and safeguards the integrity of inference tasks.

  • Agility. While the AIVM aims to provide a full-fledged execution environment, it is designed to be lightweight and lean so as not to impose significant overhead on the node’s resources.

The AIVM architecture lays the foundation for a network where diverse participants can collaborate and contribute to AI tasks with confidence in the consistency and reliability of the results.

With the AIVM, we ensure that our platform remains open, secure, and accessible, fostering a thriving ecosystem of shared AI capabilities.

Last updated