The Swarm Approach: How Parallax Achieves 3x Faster AI Inference

Valerie NwajeiValerie Nwajei
12 min read

Introduction: The Scaling Crisis in AI

For years, the strategy for improving AI has simply been to make the models larger and train them on more data. Models are being trained on data scraped from the web, public data sets, and even synthetic data when real-world data is insufficient or unavailable.

While this has shown progress, it has simultaneously created an insatiable demand for compute resources. The CPUs are being pushed to their absolute engineering limits with multiple cores and deeper pipelines, yet they still hit a wall when it comes to the specific demands of AI.

Gordon Moore, the founder of Intel, predicted that the number of transistors in a microchip doubles every two years, but AI’s capabilities are on an exponential curve that is steeper than what traditional semi-conductor scaling alone can explain.

Simply relying on faster chips isn’t enough anymore.

The challenge now is to sustain this rapid progress while addressing other demands for computing. Case in point, CPUs have attempted to achieve parallel processing but cannot do this fully because of their general purpose nature. Even if you have an infinite number of processors, the program will only run as fast as its slowest sequential part.

The best it can do is very fast sequential processing, with few powerful cores optimized for executing instructions one after the other.

For years, Dennard scaling worked hand in hand with Moore’s prediction. Dennard predicted that new generation transistors would consume proportionally less power, allowing for higher clock speeds and more transistors to be packed onto a chip without increasing overall power consumption. But as transistors reached nanoscale, becoming incredibly small, leakage current became a problem. This eventually slowed down the development of more powerful CPUs, leading to a compute famine that majorly affected the advancement and training of models.

Understanding Modern AI Inference: How LLMs Actually Work

Like the human brain, AI reasons, but with numbers. Their fundamental operation involves breaking down words into tokens, assigning numerical IDs to these tokens and converting them to vectors which are then fed to the core of the AI model and used to calculate the most probable next value based on the preceding values. Eventually converting these calculated predictions back into tokens brings about results.

This is basically how AI inference works.

Large Language Models(LLMs) carry out this process at a hugely amplified scale, having trillions of parameters in weights and biases. For this, inference needs to be extremely fast; but the time it takes for an LLM to process input and generate output has been a significant bottleneck for complex queries or long sequences.

In addition, LLMs have a ‘context window’ which refers to the maximum number of tokens that the model can process in one input, directly impacting the LLMs ability to understand and generate text based on the given context.

Attempts to work around this limitation brought about methods such as removing parts of the input text when it exceeds the model’s context window, dividing large texts into smaller segments called chunks and reducing large input texts into more concise versions. These methods aren’t ideal because asides introducing computational overhead in management, it can lead to significant information loss and reduced coherence.

The core challenge with larger context windows is that the computational memory requirements grow rapidly as context length increases. Longer context windows means more tokens and each token requires memory to store its representation and computations.

The Challenges Of Large Language Models And Centralized Inference

Shifting to GPUs , TPUs and ASIC designed specifically for parallel processing optimized these operations, with GPUs having thousands of smaller, efficient cores that can run multiple tasks in parallel.

They also have significantly higher memory bandwidth, allowing data to be fed to processing units much faster, making them highly effective for the larger operations that are fundamental to LLMs. .

Despite this optimization, pretrained LLMs are still difficult to use due to the sheer size in terms of parameters, requiring over 350GB accelerator memory for inference and even more for fine-tuning. As a result, even basic inference for these LLMs requires multiple high end GPUs or multi-node clusters.

A sudden increase in the number of inference requests to a cloud-hosted LLM can deplete GPU memory. Bursts in inference requests have been attempted to be managed by queueing, i.e. scheduling a batch of prompts for inference and queuing the remaining until free GPU memory is available. But queueing leads to unresponsiveness, exhausting the LLMs KV cache capacity and causing a spike in time-to-first-token(a measure of how quickly the model starts responding).

Basically, the server itself becomes a bottleneck.

KV(key-value) cache is a memory structure used to store key-value output during inference. Its primary purpose is to speed up the generation of text by avoiding redundant computations. When a new token is generated during inference, the model needs to consider the entire sequence of tokens generated so far, this involves calculating “key” and “value” matrices for each token. Without caching, the model would need to recompute the matrices each time, which is computationally expensive and slow.

While these technical restrictions are in play, centralized inference introduces a deeper concern about user data. With traditional inference, it is almost impossible to achieve full control over personal AI systems as all your data is sent to a single data center for an LLM to process. The development and deployment of advanced AI are controlled by few major technology corporations which have the models operating as black boxes, making it difficult for individuals to understand how their data is being used or how decisions are reached.

Gradient introduced Parallax as a solution to these problems. They believe the introduction of decentralized inference is key to lifting the technical limitations hindering AI development. Parallax leverages the computational power of existing devices, making machine learning more accessible with the aim to provide cheaper and faster query responses by optimizing the placement of models across the network.

The Shift To Decentralized Inference: Introduction to Parallax

Decentralized inference allows localization of sensitive information on individual devices, reducing the risk of data breaches as a single point of failure is eliminated. If one device goes offline, the rest of the network continues to operate so that the system is much harder to shut down or disrupt. This also solves the problem of scalability by distributing the computational workload across numerous devices, avoiding overwhelming a single server.

Rather than sending data to central servers which introduces a level of latency unacceptable for applications requiring immediate responses, the system automatically handles the connection without admins defining where to connect or find others. The decentralized network processes data closer to its source, improving overall efficiency and reducing bandwidth consumption.

Despite its benefits, decentralised inference is extremely challenging to set up and manage.

Because the requests aren’t sent to a central server but to another device or group of devices on the network that can perform the task, establishing computation across this distributed network requires complicated protocols and mechanisms to ensure consistent model performance and output quality across diverse nodes.

Parallax is designed to ensure that inference doesn’t require specific software environments such as a particular brand of chip or a specific amount of RAM. By enabling individuals to run state-of-the-art models on their own devices, the need for constant reliance on cloud services is eliminated.

To coordinate this distributed network effectively, Parallax integrates with Solana as its foundational coordination layer, providing trustless verification of computational results, and implements a token-based incentive mechanism that rewards network participants for contributing their computing resources. This blockchain integration ensures that despite the distributed nature of the system, all computations maintain integrity.

Parallax: Architecture and Innovation

The system, designed for efficient running of LLMs in a distributed environment, consists of three layers: Runtime, Communication and Worker.

The Runtime layer, being responsible for the overall management of LLM serving across the network, directs the execution of tasks in communication with the other two layers.

This MLX-based layer utilizes NVIDIA GPUs, known for their immense parallel processing power in training and deploying most large-scale AI models, and Apple Silicon, which integrates CPU, GPU and Neural Engine onto a single chip with unified memory architecture.

On receiving an inference request, Runtime determines how to distribute the task across available workers considering the capabilities of the devices on the network. It then uses the communication layer to send these tasks and model data to the appropriate workers while monitoring the progress of tasks and handling retries or reassignments in case of failures.

To handle the large number of requests, it is composed of an Executor which is the core operational unit, taking incoming requests and driving their execution through the inference process. It acts as a control loop, continuously fetching, batching and sending requests to the model for processing and managing the generation of tokens.

Because LLMs are often too large to fit into the memory of a single GPU, the runtime layer uses model sharding to split the model’s weights across multiple GPUs/devices and uses a Model Shard Holder for each GPU to hold its assigned portion of the LLM.

A Request manager serves as the entry point for all incoming LLM inference requests from users or other services, maintaining a queue of pending requests. Each new request is added to this queue, where they are validated and prioritized by the Scheduler based on factors like urgency or user tier.

A Paged KV Cache Manager is used to break the cache into fixed-size blocks, handling the KV Cache bottleneck mentioned earlier. This component is responsible for allocating, reallocating and managing the KV cache blocks across GPU memory instead of wastefully allocating memory continuously for the entire KV cache of a sequence with unpredictable output length.

The actual transmission of LLM model data alongside intermediate results between different worker nodes is handled by the communication layer. This layer ensures continuous operation of inference despite node failures by using gRPC to provide a reliable communication protocol that identifies and signals failures. Additionally, tensor streaming between peers allows for dynamic routing, enabling the system to reconfigure data paths to bypass failed nodes or links.

The Worker layer carries out the inference computations and then relies on the communication layer to send the results back where they are needed.

These layers are the fundamental components of the Parallax architecture called The Swarm which is a network of nodes that collectively serve the language model. Each node within the Swarm is responsible for processing a specific segment of the model, executing a defined portion of the inference process.

Parallax: Performance And Impact

Parallax is the first of its kind as an MLX-based decentralized inference engine with a framework purpose-built to take maximum advantage of its optimized features. Testing the performance of Parallax against baseline distributed inference systems like Petals proved its significant performance advantage and efficiency under varying input loads. Metrics shown included:

  1. Improved Time-To-First-Token by 2.9x: Time-to-first-token (TTFT) refers to how much time is required for the very first piece of the AI's response to appear after a request. Delivering this 2.9x faster gives the user immediate feedback that the system is working and reduces the wait time, making the application highly responsive from the outset.

  2. 3.1x Lower on End-To-End Latency: In delivering the full output of a request, Parallax ran 3.1 times faster, translating to a much more responsive application which is useful for interactive or real-time scenarios

  3. 5.3x Lower on Inter-Token Latency: Parallax generates each next token 5.3 times faster than the baseline model, meaning AIs built on Parallax would stream more smoothly and continuously, rather than having noticeable pause between words.

  4. Improved Input and Output Throughput by 3.1x: Input throughput measures how many input tokens (or requests) the system can process per unit of time. Parallax can handle 3.1 times more input data or simultaneous requests while generating 3.1 times more output data per second than the baseline model. This indicates higher capacity and higher efficiency for the system by serving more users concurrently and completing tasks at a much faster rate.

While many LLM inference systems struggle with increasing input length, experiencing a disproportionate increase in latency, Parallax maintains stable performance with consistent inter-token latency and high output throughput across input lengths up to 16K tokens, making it crucial for applications dealing with complex and lengthy prompts.

Additionally, the engine demonstrated its ability to handle batching very efficiently, with its total output token increasing significantly with increased batch size. As more requests are grouped and processed together, the system becomes even more productive because Parallax can effectively leverage more computational resources like additional GPUs or nodes, providing high performance at scale.

The Broader Ecosystem: Open Source Future and Blockchain Integration

According to Gradient HQ, Parallax is going open-source once it is production-ready, inviting global collaboration especially contributions from AI researchers and developers integrating it into new applications, accelerating the pace of innovation in decentralized AI. Open-sourcing this engine can help address concerns about AI bias by allowing scrutiny of the underlying inference mechanism. As more participants join the network with their compute resources, the overall capacity for AI inference grows, enabling the deployment of even larger and more complex AI models globally.

Building Parallax, especially on Solana, directly contributes to the DePIN sector, showing real-world utility for the blockchain beyond DeFi. The rapid interactions and high data throughput required for inference directly aligns with the Solana ethos as a fast, low fee and robust blockchain making it uniquely suited to handle the demands. As Parallax grows, its compute capacity can easily be expanded by horizontal scaling on Solana without sacrificing performance. The chain’s ability to handle rapid state changes ensures that the resources within the Parallax swarm can be managed effectively and in near real-time. This would further demonstrate technical superiority in handling transaction volumes and real-time operations, making it more attractive to AI developers and startups.

Solana is solidifying its reputation as the leading blockchain for AI and DePIN.

References

  1. https://gradient.network/blog/parallax-world-inference-engine

  2. https://levelup.gitconnected.com/ai-overdrive-building-a-production-grade-inference-engine-that-powers-next-gen-applications-1ce8b944d83c

  3. Parshin Shojaee, Iman Mirzadeh, Maxwell Horton et al. Apple: The Illusion Of Thinking - Understanding The Strengths And Limitations Of Reasoning Models Via The Lens Of Problem Complexity

  4. How Large Language Models Learn, Connect and Respond https://www.bland.ai/blogs/llm-customer-interaction-guide

  5. Tao Shen, Didi Zhu,, Ziyu Zhao, et al. Will LLMs Scaling Hit The Wall? Breaking Barriers via Distributed Resources on Massive Edge Devices https://arxiv.org/html/2503.08223v1#bib.bib142

  6. Liyuan Liu, Jianfeng Gao. LLM Profiling Guides KV Cache Optimization, Microsoft(2024)

  7. https://research.ibm.com/blog/larger-context-window

  8. Abhishek Vijaya Kumar. Network-Accelerated Memory Offloading for LLMs in Scale-Up GPU Domains(2025)

  9. Alexander Borzunov. Distributed Inference And Fine-Tuning Of Large Language Models Over The Internet

  10. Hesham G. Moussa, Arashmid Akhavain, S. Maryam Hosseini, Bill McCormick. Distributed Learning and Inference Systems: A Networking Perspective

  11. Andrea Dal Mas. Decentralized Inference: The intersection Of Blockchain And AI. https://www.linkedin.com/pulse/decentralized-inference-intersection-blockchain-ai-andrea-dal-mas-evkof/

  12. Adam Jones. What Risks Does AI Pose? https://bluedot.org/blog/ai-risks

  13. Mastering LLM Techniques: Inference Optimization https://developer.nvidia.com/blog/mastering-llm-techniques-inference-optimization/

  14. The Building Blocks of LLMs:Vectors, Tokens and Embeddings https://thenewstack.io/the-building-blocks-of-llms-vectors-tokens-and-embeddings/

0
Subscribe to my newsletter

Read articles from Valerie Nwajei directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Valerie Nwajei
Valerie Nwajei