Abstract
Retrieval-Augmented Generation (RAG) significantly enhances Large Language Models (LLMs) by providing access to external knowledge, yet its deployment on edge devices remains challenging due to high computational costs and the "frozen" nature of model knowledge. We present EACO-RAG, a distributed framework that optimizes RAG for the edge through a collaborative gating mechanism and adaptive knowledge updates. By networking local edge nodes and dynamically routing queries between local, neighbor, and cloud resources, EACO-RAG reduces operational costs by up to 84% while maintaining the accuracy of massive cloud-based models.
Introduction
Large Language Models (LLMs) are powerful but computationally intensive and limited by static training data. While RAG addresses the knowledge gap, existing centralized solutions are often too heavy for edge environments. Conversely, Small Language Models (SLMs) suitable for edge devices suffer from limited internal knowledge and hallucinations.
EACO-RAG bridges this gap by introducing a distributed, tiered architecture where knowledge is spread across multiple edge nodes. This allows the system to balance latency, cost, and accuracy by intelligently deciding where to retrieve information and where to generate responses, effectively turning edge nodes into a collaborative network.
Methodology
The EACO-RAG framework is built upon three core innovations designed to bring high-performance RAG to resource-constrained environments:
- Distributed Tiered Architecture: Knowledge is decentralized across edge nodes, each maintaining a dynamic local dataset tailored to regional or temporal interests. This avoids the latency of centralized databases.
- Adaptive Knowledge Updates: Local caches are kept fresh using a FIFO (First-In-First-Out) policy. The system periodically pulls semantically coherent "chunks" from a cloud-based GraphRAG based on local query trends, ensuring the edge nodes stay relevant to user interests.
- Hierarchical Collaborative Gating: The system employs a Safe Online Bayesian Optimization (SafeOBO) algorithm to route queries. It evaluates whether to use local, neighbor (edge-assisted), or cloud retrieval, and whether to employ a local SLM (e.g., Qwen2.5-3B) or a cloud LLM (e.g., Qwen2.5-72B).
This "Safe" optimization ensures that cost reduction does not come at the expense of Quality of Service (QoS) constraints, such as minimum accuracy or maximum allowable delay.
Evaluation and Results
The framework was evaluated using the Wiki QA (general domain) and Harry Potter QA (specialized domain) datasets to test its robustness across different knowledge requirements.
Performance and Cost Efficiency
EACO-RAG demonstrated significant efficiency gains over traditional cloud-only RAG approaches:
- Cost Reduction: In cost-efficient modes, the system reduced total operational costs by 84.6% on Wiki QA while matching the accuracy of a 72B cloud-based GraphRAG. Even under strict 1-second latency constraints, it achieved a 65.3% cost reduction.
- Accuracy Parity: On Wiki QA, EACO-RAG achieved 94.92% accuracy, slightly outperforming the standalone 72B cloud model (94.39%) through superior context selection enabled by the gating mechanism.
As shown in the evaluation, the edge-assisted approach consistently outperforms local-only retrieval across various data chunk sizes. This validates the "Power of Neighbors" concept, where edge nodes share data to avoid expensive cloud calls.
Discussion and Conclusion
EACO-RAG treats intelligence as a scalable utility. By escalating only complex queries to the cloud and leveraging neighboring edge nodes for intermediate tasks, it avoids the silos of traditional edge computing. The integration of cloud-based GraphRAG as a "teacher" to distill data for edge nodes further enhances SLM performance, allowing small models to punch above their weight.
While the current prototype focuses on a limited set of retrieval/inference strategies, future work will expand the decision space and incorporate more dataset-specific features into the gating logic to support complex, multi-hop reasoning at the edge without constant cloud reliance.
Summary updated