Introduction
Transformer models have revolutionized artificial intelligence, yet their deployment on resource-constrained edge devices remains a significant challenge. Large-scale models like GPT-2 or Swin Transformer often exceed the memory and computational limits of individual edge nodes such as the NVIDIA Jetson Nano.
Existing deployment strategies typically rely on either aggressive model compression, which often sacrifices accuracy, or sequential collaborative inference (pipelining). As illustrated below, pipelining splits a model layer-by-layer across multiple devices.
However, this approach frequently results in high latency because devices remain idle while waiting for data from preceding stages, creating a performance-efficiency gap that prevents the effective utilization of collective edge resources.
The CoFormer Framework
To overcome these limitations, we introduce CoFormer, a collaborative inference framework designed for heterogeneous edge environments. CoFormer shifts from sequential processing to an Aggregate-Edge architecture. The core innovation lies in decomposing a large "teacher" Transformer into multiple smaller "student" sub-models that execute concurrently across different devices. Their intermediate results are then aggregated at a central node to produce the final output.
Decomposition and Boosting (DeBo)
The framework utilizes the DeBo algorithm, consisting of two primary components:
- Bayesian Decomposition: This module optimizes the sub-model architectures (layers, embedding dimensions, and attention heads) to match the specific hardware constraints of each available edge device.
- Progressive Boosting Distillation: To mitigate the accuracy loss inherent in decomposition, this process "teaches" sub-models to mimic the original teacher model, ensuring the aggregated result remains highly accurate.
A dedicated Latency Predictor—a multi-layer perceptron—is employed to rapidly estimate inference times during the optimization phase, bypassing the need for exhaustive hardware measurements.
Key Results and Discussion
CoFormer was evaluated across image classification (ImageNet-1K), object detection (MS COCO), and language understanding (GLUE). The framework demonstrated exceptional scalability across diverse hardware, including various NVIDIA Jetson modules and Raspberry Pi devices.
As shown in the performance analysis, CoFormer accelerated the Swin-L model by 3.1× with only a 1.7% drop in accuracy on ImageNet-1K. Furthermore, it enabled the deployment of the 1.6 billion parameter GPT2-XL on edge devices by reducing memory requirements by 76.3%. Energy consumption was also significantly reduced, with savings ranging from 40% to 53% across various tasks.
Conclusion
CoFormer provides a scalable solution for running massive Transformers on the edge by leveraging device heterogeneity and parallel execution. By parallelizing sub-models, the framework effectively "harvests" compute cycles that would otherwise be wasted in a pipelined setup. While communication overhead remains a factor as the number of devices grows, the framework's single-round aggregation significantly reduces the network bottlenecks typical of distributed edge solutions.
Summary updated