# Towards a Decentralized Collaborative Framework for Scalable Edge AI
## 5 The Proposed Architecture
```
1 FunctionRequestModel(r)
2 if\(r\in Search(Knowledge\_Vaults)\)then
3 //Retrieve the model from the matching knowledge vault;
4\(M_{knowledge}=Knowledge\_Vaults(r)\);
5
6 else
7 //Search for a matching model in global population;
8 if\(r\in Search(Global\_Learners)\)then
9 \(M_{knowledge}=Global\_Learners(r)\);
10
11 //Perform Knowledge Distillation;
12\(M_{new}=Distill(M_{knowledge},M_{learner})\);
13
14 FunctionStoreModel(M)
15\(r=Extract\_representation(M)\);
16\(V=Find\_fault(r)\);
17\(Store\_vault(V,r,M)\);
```  
**Algorithm 1**Model Discovery and Distillation (MDD)  
Therefore, the key innovation in this architecture is the introduction of discovery service design based on distributed architecture. This distributed service will act as the arbiter of clients' requests, leveraging decentralized edge servers for the discovery process. In particular, we envision the MDD service as a distributed service leveraging cloud resources or serverless computing to handle client requests [4]. The computing service that handles the knowledge discovery would rely on a distributed ledger (e.g., name or directory service) to keep track of the knowledge produced in the network. The MDD  
Figure 2: The proposed architectural design involves decentralized learning parties, secure model vaults to store the models hosted by edge servers and discovery service for model exchange hosted in the cloud. service relies on the unused resources of the edge servers to aid with knowledge distillation for updating clients' models [5]. However, achieving scalable and efficient discovery requires investigating novel discovery algorithms and protocols to search the network for the models that fulfill the requirements of clients' requests (the exploration of scalable discovery algorithms is part of our future work). The discovery service works by employing a service similar to Named Data Networking (NDN) [39] used for finding content in content-distribution networks (CDN) or Information-Centric Networks [40]. Similar to NDN, the models are treated as content that requires retrieval, and they are addressed using their key features, such as the task they solve, the dataset they were trained on, etc. Moreover, other performance metrics are collected about the model. Then, this information is stored in the distributed ledger (or directory service) and used to forward client requests to the destination (i.e., the model owner). Moreover, optimal routing algorithms can handle the dynamic and mobile IoT environments [41]. Upon completion of discovery, the requester either obtains a copy of the model and applies knowledge transfer technique (e.g., model distillation) [10; 32] to integrate the knowledge of the discovered model(s) into its model and enhance the model quality (e.g., classification accuracy for class D), or the client can share its model with an Edge or Cloud server to allow for the knowledge distillation to occur on the server. In our design, we envision that the clients can seek full or partial assistance from edge server(s) to conduct the knowledge transfer operations to integrate the knowledge into their own models. This can be proven useful, especially in IoT use cases where the clients are typically limited in computational resources. In the following, we conduct experiments aiming at showcasing (1) the heterogeneity's detrimental impact on the collaboratively produced models, and (2) the effectiveness of the new system in improving model performances via model discovery and distillation.