0% found this document useful (0 votes)
35 views16 pages

Large Language Model Federated Learning With Blockchain and Unlearning For Cross-Organizational Collaboration

Uploaded by

qwi25946
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views16 pages

Large Language Model Federated Learning With Blockchain and Unlearning For Cross-Organizational Collaboration

Uploaded by

qwi25946
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

JOURNAL OF LATEX CLASS FILES, VOL. 14, NO.

8, AUGUST 2015 1

Large Language Model Federated Learning with


Blockchain and Unlearning for
Cross-Organizational Collaboration
Xuhan Zuo, Minghao Wang, Tianqing Zhu∗ , Shui Yu, Fellow, IEEE, Wanlei Zhou, Fellow, IEEE

Abstract—Large language models (LLMs) have transformed Moreover, LLMs needs to consume a huge amount of data,
arXiv:2412.13551v1 [cs.CR] 18 Dec 2024

the way computers understand and process human language, the public data may consumed up while private data from
but using them effectively across different organizations remains organizations are highly needed. This need for collaboration
still difficult. When organizations work together to improve
LLMs, they face several main challenges. First, organizations is particularly evident in specialized domains where valuable
hesitate to share their valuable data with others. Second, com- data is distributed across multiple organizations. For exam-
petition between organizations creates trust problems during ple, hospitals possess rich repositories of medical narratives
collaboration. Third, new privacy laws require organizations and clinical documentation that could significantly enhance
to be able to delete specific data when requested, which is medical language models. However, direct data sharing may
especially difficult when multiple organizations are learning from
shared data. Traditional federated learning approaches do not face substantial regulatory barriers and privacy concerns from
address these interconnected challenges, particularly in scenarios organizations.
where participants cannot fully trust each other or the central While federated learning has emerged as a promising so-
aggregator. To overcome these limitations, we propose a hybrid lution for collaborative model training [2], allowing orga-
blockchain-based federated learning framework that uniquely
combines public and private blockchain architectures with multi-
nizations to develop models without sharing raw data. As
agent reinforcement learning. Our framework enables trans- highlighted by [3], each organization trains the model locally
parent sharing of model update through the public blockchain and shares only model updates with a central server for
while protecting sensitive computations in private chains. Each aggregation into a global model. However, our analysis reveals
organization operates as an intelligent agent, using Q-learning to that the intersection of trust, privacy, and regulatory compli-
optimize its participation strategy and resource allocation, thus
aligning individual incentives with collective goals. Notably, we
ance represents a critical bottleneck in this approach. The
introduce an efficient unlearning mechanism based on Low-Rank issue of trust among participating organizations emerges as
Adaptation (LoRA) that enables selective removal of specific a fundamental concern [4], [5]. Traditional federated learning
data contributions without compromising the model’s overall approaches often make optimistic assumptions about partici-
performance. Through extensive experimentation on real-world pant honesty and aggregator trustworthiness. However, in real-
datasets, we demonstrate that our framework effectively balances
privacy protection, trust establishment, and regulatory compli-
world scenarios, organizations can have competing interests
ance while maintaining high model performance. Case studies and varying levels of commitment to the collaborative process,
in healthcare and education sectors validate our approach’s which can lead to data poisoning or model manipulation [6].
practical applicability in sensitive domains where data privacy Therefore, if we would like to propose a large language
and trust are paramount.
model based federated learning, some key challenges should
Index Terms—LLM, Federated Learning, Machine Unlearning, be considered.
Blockchain, Privacy Preservation, Multi-agent.
• 1. Privacy concerns of organizations. Beyond trust con-
I. I NTRODUCTION cerns, organizations must also navigate the complex
landscape of data privacy regulations, particularly regard-
In recent years, we have witnessed an unprecedented trans- ing data removal requests. The ”right to be forgotten”
formation in natural language processing, driven largely by the enshrined in GDPR [7] presents a unique challenge in
emergency of Large Language Models (LLMs). These models collaborative model training.
have revolutionized our ability to process and generate human • 2. The trustworthiness and transparency of the collabora-
language [1]. However, the scale of data and computational tion between organizations. Organizations face dual chal-
resources required for training these models often exceeds lenges in cross-organizational collaboration: they need
what any single organization can provide, making multi- to ensure transparent verification of model updates and
organizational collaboration not just beneficial, but necessary. transactions while protecting sensitive model updates
∗ Tianqing Zhu is the corresponding author with Faculty of Data Science, from exposure. A single blockchain architecture can-
City University of Macau, Macao (E-mail: [email protected]) not address the requirements effectively because public
Xuhan Zuo and Shui Yu are with School of Computer Science, Univer-
sity of Technology Sydney, Ultimo 2007, Australia (E-mail: Xuhan.Zuo-
blockchains offer transparency but lack privacy protec-
[email protected]; [email protected]) tion, while private blockchains provide privacy but limit
Minghao Wang, and Wanlei Zhou are with the Faculty of Data Sci- cross-organizational verification.
ence, City University of Macau, Macao (E-mail: [email protected];
[email protected]) For the first challenge, we applied machine unlearning to
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 2

allow all organizations to withdraw any data they have pro- aggregation and learning speed adjustment, alongside a flexi-
vided. But we have observed that when multiple organizations ble storage strategy that selectively manages sensitive model
contribute to a model’s development through numerous itera- layers. While their approach effectively balances client perfor-
tions, ensuring the complete removal of specific individual’s mance and resource efficiency, it doesn’t address the broader
data becomes technically challenging and computationally challenges of cross-organizational trust and transparent verifi-
expensive. Therefore, a key innovation in our framework is the cation that our hybrid blockchain framework provides.
integration of an efficient unlearning mechanism based on the Wu et al [12]. introduce FedBiOT, focusing on resource-
Low-Rank Adaptation (LoRA) technique [8]. This mechanism efficient LLM fine-tuning in federated settings. Their novel
addresses one of the most pressing challenges in collaborative bi-level optimization approach involves server-side model
AI development: the ability to selectively remove specific data compression and client-side adapter fine-tuning, effectively
contributions without compromising the entire model. Our addressing the challenge of limited client resources. While this
implementation not only ensures regulatory compliance but method significantly reduces resource consumption without
also significantly reduces the computational cost traditionally compromising performance, it doesn’t incorporate the compre-
associated with model unlearning. hensive privacy protection and data removal capabilities that
For the second challenge, we propose a novel hy- our LoRA-based unlearning mechanism offers.
brid blockchain-based federated learning framework designed Kuang et al [13]. highlight the fundamental challenges
specifically for LLM development in cross-organizational set- in federated LLM fine-tuning, particularly emphasizing the
tings. Our approach uniquely combines public and private need for frameworks that can optimize resource consumption
blockchain architectures to establish a secure and transparent while meeting diverse information protection demands. Their
collaboration environment. The public blockchain serves as an work identifies critical gaps in existing frameworks regarding
immutable record of model updates and transactions, while communication efficiency, task-specific data preparation, and
private blockchain networks enable organizations to share privacy protection. Our work directly addresses these gaps
sensitive model updates within controlled groups [9], [10]. through a combination of blockchain-based verification and
The practical impact of our framework extends beyond efficient unlearning capabilities.
theoretical contributions. Through extensive experimentation Ye et al [14]. present OpenFedLLM, a comprehensive
and real-world case studies in education and healthcare sectors, framework for collaborative LLM training that addresses
we demonstrate how our approach effectively balances the the impending scarcity of high-quality public data. Their
competing demands of collaboration efficiency, data privacy, framework encompasses federated instruction tuning, value
and regulatory compliance. Our results suggest that this alignment, and supports diverse domain applications with
framework could serve as a foundation for future large-scale extensive evaluation metrics. Their results demonstrate the
collaborative AI development projects, particularly in sensitive superior performance of federated approaches over local train-
domains where data privacy and trust are paramount concerns. ing, particularly in specialized domains. However, their focus
The main contributions of this paper are: primarily remains on performance optimization rather than
• An efficient unlearning mechanism based on LoRA for addressing the complex trust dynamics and privacy concerns in
selective data removal, ensuring compliance with data cross-organizational collaboration that our work emphasizes.
privacy regulations and maintaining user trust. In summary, while existing research has made significant
• A novel hybrid blockchain-based federated learning progress in addressing various aspects of federated LLM
framework with multi-agent interactions and unlearning training, our framework uniquely combines blockchain-based
capabilities for secure, transparent, and efficient collabo- trust mechanisms with efficient unlearning capabilities to
rative LLM training in cross-organizational settings. create a more comprehensive solution for cross-organizational
• Extensive experimental evaluations and case studies collaboration. This approach not only ensures data privacy
demonstrating the effectiveness and practical applicability and model security but also provides the transparency and
of our framework in real-world scenarios. verification mechanisms essential for sustainable collaborative
AI development.
II. R ELATED W ORK
A. Federated Learning with LLM B. Unlearning with LLM
The integration of federated learning with large language The challenge of unlearning specific information from large
models has emerged as a crucial research direction, particu- language models (LLMs) has garnered significant attention,
larly as organizations face increasing challenges in accessing especially as the need to remove sensitive or harmful informa-
high-quality public data while possessing valuable private tion becomes increasingly important. Several approaches have
datasets. This intersection presents unique challenges related been proposed to tackle this issue, each with its strengths and
to computational resources, communication efficiency, and limitations.
privacy protection. Liu et al. [15] introduce Selective Knowledge Negation
Zhao et al [11]. propose PPLR (Privacy-Preserving LLM- Unlearning (SKU), a novel unlearning framework designed
based Recommendation), addressing two critical challenges to eliminate harmful knowledge while preserving the utility
in LLM-based federated recommendation: performance imbal- of LLMs on normal prompts. The SKU framework involves a
ance across clients and high resource demands. Their frame- two-stage process: a harmful knowledge acquisition stage fol-
work introduces a dynamic balance strategy for parameter lowed by a knowledge negation stage. The study demonstrates
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 3

that SKU effectively balances the trade-off between unlearning The integration of blockchain with LLMs has emerged as a
harmful content and maintaining model performance on non- promising approach to mitigate risks such as data leakage,
harmful prompts. Compared to this approach, our work ex- inference attacks, and other adversarial threats.
tends the idea of selective unlearning by incorporating a more Luo et al. [20] presents a comprehensive survey on the in-
granular control mechanism, allowing for the targeted removal tegration of blockchain with LLMs, exploring how blockchain
of specific data points with minimal impact on overall model technology can enhance the trustworthiness of LLMs by en-
utility. suring data provenance, integrity, and transparency. Their work
Chen et al. [16] propose an effective unlearning framework categorizes blockchain’s role in addressing key vulnerabilities
with an unlearning layer specifically designed for both clas- of LLMs, such as prompt injection and data poisoning attacks.
sification and generation tasks. Their approach focuses on While their survey provides a broad overview, our work goes
the efficient removal of unwanted knowledge from LLMs, a step further by proposing a hybrid blockchain framework
emphasizing the importance of computational efficiency and specifically designed for cross-organizational LLM federated
scalability in the unlearning process. While their method is learning. This framework not only addresses the security con-
robust in terms of task versatility, our framework offers a cerns highlighted by Luo et al. but also introduces innovative
more specialized solution tailored to the unique challenges solutions like the LoRA-based data forgetting mechanism,
of LLMs used in federated learning environments, ensuring which enhances data privacy and model adaptability in dy-
that unlearning is both precise and minimally disruptive to the namic environments.
model’s overall functionality. Gong [21] proposes the concept of Dynamic Large Lan-
Yao et al. [17] pioneer the concept of large language guage Models (DLLMs) on blockchain, which evolve post-
model unlearning, defining the goal of unlearning in LLMs as training by continuous learning during their usage. This ap-
the ability to produce non-harmful outputs when faced with proach leverages the decentralized nature of blockchain to cre-
harmful prompts. They employ a Gradient Ascent (GA) based ate tamper-resistant datasets that can be audited for accuracy.
method to remove harmful content, though this often results While Gong’s work focuses on the dynamic updating of LLMs,
in degraded performance on normal prompts. In contrast, our our approach extends the security benefits by integrating
work introduces a more balanced approach, leveraging the both public and private blockchains to balance transparency
LoRA-based forgetting mechanism to ensure that the removal and privacy, particularly in cross-organizational collaborations
of harmful information does not compromise the model’s where data sensitivity varies.
ability to respond accurately to benign queries. Lin et al. [22] introduce a blockchain-based trusted feder-
Maini et al. [18] present a new benchmark for evaluating un- ated offloading framework, which utilizes Chameleon Hash
learning methods in LLMs, specifically focusing on fictitious (CH) technology to streamline model updates and reduce
unlearning, where the model is tested on its ability to forget computational and consensus costs associated with offloading
contrived or synthetic information. This benchmark provides a tasks. This framework ensures the integrity and traceability
useful tool for assessing unlearning efficacy, but it is limited to of model updates while incorporating privacy-preserving re-
specific types of data. Our work, however, addresses a broader sults. Compared to their approach, our work further enhances
range of real-world unlearning scenarios, particularly in cross- privacy and adaptability through the use of LoRA-based data
organizational contexts where different organizations may have forgetting mechanisms, which allow for selective data removal
varying privacy and security requirements. without compromising overall model performance.
Eldan et al. [19] introduce an innovative network designed Mbula et al. [23] explore the potential of blockchain to
to unlearn copyrighted information embedded within LLMs, provide auditability and traceability in LLMs, particularly
highlighting the importance of intellectual property protection in defending against prompt injection attacks. Their work
in the AI space. Their approach is highly relevant in legal highlights the transparency and immutability of blockchain as
contexts, but our work focuses on a wider application, ensuring critical factors in securing LLM interactions. In contrast, our
that LLMs used in collaborative environments can unlearn proposed framework not only incorporates these features but
a variety of sensitive information while maintaining model also introduces a multi-agent system that optimizes decision-
performance across diverse tasks. making processes across organizations, further enhancing the
In summary, while existing research has made significant security and efficiency of LLM deployment in federated learn-
strides in developing methods for unlearning in LLMs, our ing scenarios.
work offers a comprehensive and flexible solution that is Malhotra et al. [24] propose a blockchain-based proof-of-
particularly suited for federated learning scenarios. Our ap- authenticity framework for explainable AI (XAI), utilizing
proach not only ensures that sensitive information can be Ethereum smart contracts to ensure secure and auditable
effectively unlearned but also maintains the model’s utility and transactions. Their framework emphasizes the importance of
adaptability in dynamic, cross-organizational environments. transparency and traceability in AI systems. Our work builds
on these principles by applying them specifically to the LLM
domain, where the hybrid blockchain architecture we propose
C. Blockchain with LLM ensures that both public and private data are securely managed
In recent years, there has been a growing interest in lever- and that all model updates are transparently recorded, provid-
aging blockchain technology to address various vulnerabilities ing a robust foundation for cross-organizational collaboration.
and enhance the security of large language models (LLMs). In summary, while existing research has explored var-
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 4

ious aspects of integrating blockchain with LLMs, our C. Blockchain Technology


work distinguishes itself by offering a comprehensive hy- Blockchain is a decentralized and distributed ledger technol-
brid blockchain framework designed for federated learning ogy that enables secure, transparent, and tamper-proof record-
in cross-organizational settings. This framework not only keeping [26], [27]. In our framework, we utilize a permis-
addresses common security concerns but also introduces novel sioned blockchain platform designed for enterprise use, which
mechanisms like LoRA-based data forgetting, enhancing both allows for a more flexible and scalable architecture suitable
the privacy and adaptability of LLMs in real-world applica- for cross-organizational collaborations. The key components
tions. of our blockchain system include:
• Peers: Nodes that maintain the ledger and execute smart

III. P RELIMINARIES contracts.


• Orderers: Nodes responsible for the consensus process
A. Large Language Models (LLMs) and creating new blocks.
• Channels: Private subnets of communication between
Large Language Models (LLMs) are neural network-based
models designed to understand, generate, and manipulate specific network members.
human language. The core of most LLMs is the Transformer The ledger in our blockchain system consists of two distinct
architecture, which uses self-attention mechanisms to process components:
sequential data. The self-attention mechanism can be formu- L = W, S (4)
lated as: where L is the ledger, W is the world state (current state of the
QK T ledger), and S is the blockchain (transaction log). Transactions
Attention(Q, K, V ) = sof tmax( √ )V (1) in our blockchain follow a specific lifecycle:
dk
T = P roposal, Endorsement, Ordering, V alidation (5)
where Q, K, and V are query, key, and value matrices
respectively, and dk is the dimension of the key vectors. LLMs The endorsement policy, which specifies the conditions for
are typically trained to minimize the negative log-likelihood transaction validation, can be represented as:
of the training data:
E = f (S1 , S2 , ..., Sn ) (6)
N
X where E is the endorsement result, f is the policy function,
L(θ) = − log p(xi |θ) (2)
and S1 , S2 , ..., Sn are the signatures of the endorsing peers. In
i=1
our hybrid blockchain architecture, we leverage the channel
where θ represents the model parameters, and xi are the feature to create private data collections for secure data sharing
training examples. In cross-organizational settings, LLMs can within organizations:
be collaboratively trained and utilized, opening up new pos-
P DC = data, collectiondef inition , endorsementpolicy (7)
sibilities for applications such as personalized education and
medical decision support. where P DC represents a Private Data Collection. This ar-
chitecture allows us to maintain the privacy of sensitive
data within organizations while still enabling secure cross-
B. Federated Learning organizational collaboration. The public blockchain serves as
Federated learning is a distributed machine learning a transparent and immutable ledger for recording global model
paradigm that enables multiple parties to collaboratively train updates, while private channels enable secure sharing of pro-
a model without the need for direct data sharing [25]. In a prietary data and model updates within respective consortia.
federated learning setting, each participating entity (i.e., agent)
maintains its own local dataset and performs model training D. Multi-Agent Systems and Q-Learning
locally. The locally trained models are then aggregated to Multi-agent systems (MAS) are a subfield of artificial intel-
update a global model, which is shared among all agents. This ligence that focuses on the study of intelligent agents and their
process is repeated iteratively until the global model converges interactions in complex environments [28]. In an MAS, each
or a desired level of performance is achieved. agent is an autonomous entity with its own goals, beliefs, and
Formally, the goal of federated learning is to minimize decision-making capabilities. Agents can interact with each
a global objective function F (θ), which is defined as the other and with their environment to achieve their objectives,
weighted average of the local objective functions Fi (θ) of N often through cooperation, coordination, and negotiation.
agents: Q-learning is a popular reinforcement learning algorithm
XN that has been widely used in multi-agent settings [29]. In
F (θ) = wi Fi (θ) (3) multi-agent Q-learning, each agent maintains a Q-table that
i=1 stores the expected cumulative rewards (Q-values) for taking
a particular action in a given state. The Q-values are updated
where θ denotes the model parameters, and wi represents using the following equation:
the weight of the i-th agent, which is typically proportional to
the size of its local dataset. Q(s, a) ← Q(s, a) + α[r + γ max

Q(s′ , a′ ) − Q(s, a)] (8)
a
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 5

where s and a denote the current state and action, respec- Fourth is the organizational autonomy and incentive chal-
tively; s′ represents the next state; r is the immediate reward; lenge: Each organization Oi operates with utility function
α is the learning rate; and γ is the discount factor that balances Ui (ri , ci ), where ri represents the resources contributed and
the importance of immediate and future rewards. ci represents the benefits received from participation. With-
In our proposed framework, we adopt a multi-agent Q- out proper incentive mechanisms, organizations might adopt
learning approach to model the decision-making processes of strategic behaviors that benefit themselves at the expense of
participating organizations in the federated learning setting. global model performance. The system must ensure that honest
Each organization is treated as an agent that aims to maximize participation and high-quality contributions form the dominant
its own utility while contributing to the collaborative learning strategy for all participants.
process. The Q-learning algorithm enables agents to learn the These challenges are fundamentally interconnected. For
optimal strategies for participating in the federated learning instance, implementing robust verification mechanisms might
process, such as determining the amount of resources to increase computational overhead, potentially affecting organi-
contribute and the level of data sharing, based on the rewards zation’s willingness to participate. Similarly, enabling flexible
they receive. data removal could make it more difficult to maintain model
By incorporating multi-agent Q-learning into our hybrid performance and verify contribution quality.
blockchain-based framework, we can capture the complex
dynamics and interactions among participating organizations
B. System Model
and design effective incentive mechanisms to encourage honest
participation and fair resource contribution. This integration of Our system model combines blockchain technology, multi-
Q-learning with federated learning and blockchain technology agent interactions, and unlearning mechanisms to facilitate
provides a powerful and adaptive approach for enabling secure, secure, efficient cross-organizational collaboration in LLM
transparent, and incentive-aligned collaborative learning with training. The architecture integrates multiple components to
LLMs in cross-organizational settings. address the challenges outlined in our problem definition.
At its foundation lies the agent architecture, where partic-
IV. P ROBLEM D EFINITION AND S YSTEM M ODEL ipating organizations register on the public blockchain and
establish their identities through secure JW T tokens. The
A. Problem Definition registration process validates each organization’s credentials
The integration of Large Language Models (LLMs) with and assigns unique identifiers, enabling them to participate in
federated learning in cross-organizational collaborations intro- the collaborative training process. Organizations with substan-
duces several critical challenges that require novel solutions: tial data volumes establish private blockchain environments to
First is the secure cross-organizational collaboration challenge: enhance training efficiency and protect sensitive information.
For N organizations O = O1 , O2 , ..., ON , each with private The hybrid blockchain structure serves as the backbone of
dataset Di, organizations need to collaboratively train an LLM our system, with the public chain maintaining an immutable
while ensuring Di never leaves Oi. For example, healthcare ledger L comprising world state W and transaction log S.
providers have patient records that could improve medical This ledger records all model updates and cross-organizational
language understanding, but direct data sharing is restricted by transactions. The private blockchains, defined by P DC =
privacy regulations. Traditional federated learning approaches {data, collection def inition, endorsement policy},
fail to provide sufficient security guarantees when organiza- enable organizations to process sensitive data and conduct
tions have competing interests or when the central aggregator preliminary computations within protected environments.
cannot be fully trusted. Model updates flow through a care-
Second is the model update verification challenge: For fully designed transaction lifecycle T =
model updates U = U1 , U2 , ..., UN from N organizations, we {P roposal, Endorsement, Ordering, V alidation}. When
need to verify the authenticity and quality of each Ui without an organization proposes a model update, it must first
accessing the original training data Di. Unlike conventional receive endorsement from peers according to policy
federated learning settings where participants are typically E = f (S1 , S2 , ..., Sn ). The endorsed update then undergoes
trusted, our cross-organizational scenario faces potential risks ordering and final validation before integration into the global
of malicious updates or model tampering. Organizations may model. This process ensures the authenticity and quality of
intentionally contribute low-quality updates or manipulate the all contributions while maintaining transparency.
training process for their benefit. In the training phase, organizations utilize Q-learning strate-
Third is the dynamic data management challenge: When an gies to optimize their participation. The learning process
organization Oi requests to remove a subset of data Df ⊂ Di guides decisions about resource allocation and model contribu-
from the trained model LLMg , the system needs to efficiently tion timing. When the private chain reaches its specified epoch
transform the model to LLMu while maintaining performance Nprivate epoch , the locally trained model LLMp undergoes
on the remaining data D \ Df . This is particularly complex aggregation within the private chain before secure transmission
in federated learning settings because the data’s influence to the public chain.
is distributed across model updates from multiple training Our system incorporates an efficient unlearning mechanism
iterations. Traditional approaches requiring complete model based on LoRA adaptation. When an organization requests
retraining are impractical in our cross-organizational setting. data removal, the process transforms the global model LLMg
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 6

using carefully tuned parameters λ over Eu epochs. This


mechanism ensures thorough data removal while preserving
model utility on remaining data.
The interaction between these components creates a dy-
namic environment where organizations can collaboratively
enhance the global model while maintaining control over their
sensitive data. The public blockchain ensures transparency
and accountability, while private chains protect organizational
interests and enable efficient local computations.

V. A H YBRID B LOCKCHAIN - BASED F EDERATED


L EARNING F RAMEWORK
A. Overview
Our proposed framework introduces a novel hybrid
blockchain architecture that seamlessly integrates public and
private blockchains to facilitate secure and efficient cross-
organizational collaboration using Large Language Models.
The framework ensures transparency, traceability, and data
privacy protection while enabling the effective sharing and
utilization of data across multiple organizations. The key
components of our framework include client registration,
global model upload, private blockchain establishment, feder-
ated learning training process, private blockchain aggregation,
unlearning process using LoRA for forgetting, unlearning
verification and submitting unlearning results, and public
blockchain aggregation.
In our framework, we introduce a multi-agent system where
each participating organization is represented by an agent.
These agents are responsible for managing the local training Fig. 1. Overview and process of our proposed system. (1) Client register. (2)
process, contributing to the global model, and interacting with Global model upload. (3) Private blockchain establish. (4) Federated learning
training process. (5) Private blockchain aggregation. (6) Unlearning process
the blockchain network. The agents employ Q-learning, a using LoRA. (7) Unlearning verification and submitting. (8) Public blockchain
reinforcement learning technique, to make optimal decisions aggregation.
based on the current state of the system and the rewards
received for their actions.
Figure 1 illustrates the procedure of our proposed fed- B. Client and Agent Register
erated learning system with public and private blockchains The client and agent registration process is the initial step in
and multi-agent interactions. Initially, all clients must register our framework. Each participating organization must register
on the public blockchain. During registration, clients specify as a client to join the collaborative network, while agents
their affiliated organization or company. Once registration is are responsible for managing the local training process and
complete, the agent uploads the global model to the public interacting with the blockchain network. During registration,
chain. Companies with a large number of clients then establish both clients and agents provide their unique identifiers and
their private chains to enhance the federated learning training establish secure communication channels using cryptographic
process efficiency. The federated learning training epoch is set techniques such as public-key cryptography. This step ensures
within the smart contract. that only authorized organizations and agents can participate in
When the private chain’s training process reaches the speci- the federated learning process and access the shared resources.
fied epoch, model aggregation commences in the private chain.
The private model, LLMp , is then sent to the public chain The algorithm begins by checking if the entity’s unique
for further aggregation. If an organization requests to remove identifier (Ename ) is already present in the entity pool (Epool ).
their data or model updates, the unlearning process is triggered If the identifier exists, the registration halts, indicating that
using LoRA for forgetting. The unlearning results are verified the entity already exists. The algorithm also verifies the
and submitted to the public chain. Upon completion of the organization (Org) associated with the entity.
model aggregation and unlearning verification processes, the If the entity is new, the algorithm proceeds to generate
smart contract updates the final global model, LLMf , which a public-secret key pair using the keyGen() function. With
the agent can then obtain. The following sections provide these keys, it then creates a JSON Web Token (JWT) for the
a detailed explanation of each component in our proposed entity. This JWT, along with the entity ID, is securely stored,
framework. effectively registering the entity.
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 7

Algorithm 1 Client and Agent Register This part of the framework ensures that the global model
Require: Ename , Role, Org is securely uploaded to the public chain by an authorized
Ensure: RegSuccess, jwt agent, making it accessible to all participating organizations
1: RegSuccess = False; for collaborative training. The process is straightforward and
2: Check Org; includes the necessary security checks to maintain the integrity
3: if Ename ∈ Epool then of the system.
4: return Ename already existed.
5: end if D. Private Blockchain Establish
6: Pk , Sk ← keyGen();
After the global model is successfully uploaded to the public
7: jwt ← Pk , Sk ;
chain, organizations with a large number of clients establish
8: Ename ← jwt;
their private blockchains. The private blockchain serves as a
9: if Role is Client then
secure and tamper-proof ledger for storing and managing the
10: P oolc ← Epool ∪ IDci ;
organization’s sensitive data and model updates. Ensure data
11: else if Role is Agent then
privacy by restricting access to authorized parties within the
12: P oola ← Epool ∪ IDai ;
organization.
13: end if
14: RegSuccess = True; Algorithm 3 Private Blockchain Establish
15: return RegSuccess, jwt
Require: jwt, LLMg
Ensure: EstablishSuccess, LLMp
1: EstablishSuccess = False;
The algorithm then checks the role of the entity. If the role 2: if jwt is invalid then
is Client, the client pool (P oolc ) is updated to include the 3: return jwt expired
new client ID. If the role is Agent, the agent pool (P oola ) is 4: end if
updated to include the new agent ID. 5: LLMp ← LLMg ;
Finally, the RegSuccess indicator is set to true, and both 6: EstablishSuccess = True;
RegSuccess and the generated jwt are returned, signifying 7: return EstablishSuccess, LLMp
the entity’s successful registration and their secure token for
future communications.
The algorithm verifies the validity of the organization’s
By incorporating both client and agent registration into this
JWT. If the token is invalid or has expired, the process is
process, the algorithm ensures that all participating entities
terminated, and an error message is returned. Upon successful
are properly authenticated and authorized to participate in the
authentication, the global model LLMg is uploaded to the
federated learning process while maintaining the security and
private chain as LLMp . The EstablishSuccess indicator
integrity of the system.
is set to true, and both EstablishSuccess and LLMp are
returned.
C. Global Model Upload This part of the framework ensures that organizations with a
After successful registration, the agent can upload the global large number of clients can establish their private blockchains
model to the public chain. The global model upload process to securely store and manage their sensitive data and model
ensures that all participating organizations have access to the updates. The process includes necessary security checks to
initial model for collaborative training. maintain the privacy and integrity of the organization’s data
while allowing them to participate in the federated learning
Algorithm 2 Global Model Upload process.
Require: jwt, LLMg
Ensure: U ploadSuccess, LLM E. Multi-Agent Federated Learning Process on Private Chain
1: U ploadSuccess = False; The multi-agent federated learning process on the private
2: if jwt is invalid then chain enables organizations with a large number of clients to
3: return jwt expired collaboratively train the LLM without directly sharing their
4: end if sensitive data. Each agent within the organization participates
5: LLM ← LLMg ; in the training process by leveraging its local data and compu-
6: U ploadSuccess = True; tational resources. The agents train the model locally and share
7: return U ploadSuccess, LLM only the model updates with the organization’s private chain.
This approach ensures data privacy while benefiting from the
The algorithm starts by verifying the validity of the agent’s collective knowledge of all agents within the organization.
JWT. If the token is invalid or has expired, the process is The algorithm begins by setting the T rainSuccess indi-
terminated, and an error message is returned. Upon successful cator to false. It then iterates for the specified number of
authentication, the global model LLMg is uploaded to the P rivateepoch . Within each epoch, the algorithm loops through
public chain as LLM . The U ploadSuccess indicator is set to each agent Ai in the organization. Each agent receives the
true, and both U ploadSuccess and LLM are returned. current LLMp from the private chain, trains the model using
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 8

Algorithm 4 Multi-Agent Federated Learning Process on Algorithm 5 Private Blockchain Aggregation


Private Chain Require: jwt, P rivateepoch , LLMp , Aggp
Require: P rivateepoch , LLMp Ensure: AggSuccess
Ensure: T rainSuccess 1: Aggp = False;
1: T rainSuccess = False; 2: SC realizes that the private chain has reached
2: for epoch = 1 to P rivateepoch do P rivateepoch ;
3: for each agent Ai in the organization do 3: if Np reaches P rivateepoch then
4: Ai receives LLMp from the private chain 4: SC aggregates LLMp from all agents;
5: Ai trains LLMp using local data and Q-learning 5: LLM ← LLMp ;
strategy 6: if jwt is invalid then
6: Ai sends updated model LLMp,i to the private chain 7: return jwt expired
7: end for 8: end if
8: Aggregate LLMp,i from all agents to update LLMp on 9: end if
the private chain 10: SC sends LLM to P ublicChain;
9: end for 11: Aggp = True;
10: T rainSuccess = True; 12: return Aggp , LLM
11: return T rainSuccess

G. Unlearning Process Using LoRA to withdraw data contri-


its local data and Q-learning strategy, and sends the updated bution
model LLMp,i back to the private chain. The Q-learning
strategy enables agents to make optimal decisions based on The unlearning process enables the selective removal of spe-
the current state of the system and the rewards received for cific data or model contributions from the federated learning
their actions, such as contributing high-quality data or model model. When an organization requests to remove their data or
updates. model updates, the unlearning process is triggered. We employ
Low-Rank Adaptation (LoRA) technology to efficiently forget
After all agents have completed their training for the current
the specified data without compromising the overall model
epoch, the algorithm aggregates the updated models LLMp,i
performance. The unlearning process ensures data privacy and
from all agents to update the LLMp on the private chain. Once
compliance with regulatory requirements.
all epochs are completed, the T rainSuccess indicator is set
to true, and T rainSuccess is returned.
Algorithm 6 Unlearning Process using LoRA for Forgetting
This modified version of the Federated Learning Training
Require: LLMg , Df orget , Learning rate η, Unlearning
Process emphasizes the multi-agent approach, where each
epochs Eu , LoRA parameters λ
agent within the organization contributes to the collaborative
Ensure: params
learning process using Q-learning strategies. The training
1: Unlearning Request due to data sensitivity or correction
occurs on the private chain, allowing organizations with a large
needs;
number of clients to maintain data privacy and security while
2: Initialize unlearning model LLMlocal with LLMg ;
benefiting from the collective knowledge of their agents.
3: Adapter A constructed for LLMlocal targeting forgetting
process;
4: for epoch = 1 to Eu do
F. Private Blockchain Aggregation 5: Forward pass with Df orget through LLMlocal to iden-
During the federated learning process on the private chain, tify features to forget;
each agent’s model updates are securely stored and aggre- 6: Compute gradients for LLMlocal emphasizing data
gated within their respective organization’s private blockchain. points in Df orget to be forgotten;
The private blockchain aggregation mechanism ensures the 7: Apply LoRA to adjust gradients of adapter A using
integrity and traceability of the model updates. It allows each parameters λ, focusing on unlearning;
organization to maintain a transparent record of their agents’ 8: Update LLMlocal ’s parameters using the adjusted gra-
contributions to the collaborative model while preserving the dients and learning rate η, facilitating forgetting;
confidentiality of their sensitive data. 9: end for
10: Calculate the updating params indicative of the forgetting
As federated learning progresses on the private chain and
the number of epochs Np reaches the P rivateepoch setting, process between LLMlocal and LLMg ;
11: return params
the smart contract (SC) aggregates the model updates from
all agents on the private chain to obtain LLMp . Additionally,
the JWT is verified when the aggregated model is ready to The process begins by initializing a local version of the
be sent to the public chain. The SC then sends the model LLM, denoted as LLMlocal , with the parameters of LLMg .
to the public chain for further aggregation. The private chain An adapter, A, is constructed within LLMlocal specifically
aggregation indicator, Aggp , is set to true, and both Aggp and designed to target and facilitate the forgetting of the specified
the model LLM are returned. dataset, Df orget .
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 9

The core of the unlearning process involves several training successful verification, the SC initializes an updated version
epochs, defined by the parameter Eu . In each epoch, a forward of the LLM (LLMupdated ) with the new parameters. The SC
pass of Df orget through LLMlocal is performed to identify employs a validation dataset (Dval ) to assess the efficacy of
the characteristics associated with the data points that must be the unlearning process by calculating the loss and precision of
forgotten. Gradients are computed for LLMlocal with an em- training.
phasis on the data to be unlearned. The LoRA technique is ap- If the unlearning results satisfy the predefined verification
plied to the adapter A’s gradients using parameters λ to focus criteria, the SC submits the updated parameters params to the
the unlearning process. With adjusted gradients, LLMlocal ’s blockchain network. Agents download these parameters from
parameters are updated using the specified learning rate η. the blockchain for weight integration into the global model.
This iterative process gradually leads to the forgetting of the The SC ensures that the updated weights are recorded on the
specified data points from Df orget . blockchain, providing transparency and traceability. Addition-
Upon completion of the unlearning epochs, the algorithm ally, the SC logs a Transaction ID (Tid ), serving as proof
calculates the parameters params that indicate the changes of submission and an integration request. The process ends
made to LLMlocal compared to LLMg . These parameters with the return of the transaction ID, indicating the successful
represent the outcome of the forgetting process, effectively verification and submission of the unlearning results.
capturing the essence of what has been unlearned. The algo-
rithm concludes by returning these updated parameters. I. Public Blockchain Aggregation
The public blockchain aggregation component facilitates the
H. Unlearning Verification and Submitting Unlearning Results secure and transparent aggregation of the model updates from
The unlearning verification and submission process ensures all participating organizations. The central server collects the
the integrity and transparency of the unlearning results in model updates from each organization’s private blockchain
the federated learning model. The process involves the agent and aggregates them using secure aggregation techniques.
sending the updated parameters, resulting from the unlearning The aggregated model updates are then stored on the public
process, to the smart contract (SC). The SC validates the blockchain, ensuring transparency and traceability. The public
agent’s credentials and evaluates the unlearning results using blockchain serves as an immutable record of the collaborative
a validation dataset. If the unlearning results satisfy the veri- learning process, enhancing trust among the participating
fication criteria, the SC submits the updated parameters to the organizations.
blockchain network.
Algorithm 8 Public Blockchain Aggregation
Algorithm 7 Unlearning Verification and Submitting Unlearn- Require: LLM , jwt, Aggg
ing Results Ensure: epoch, Aggp
Require: params, Validation dataset Dval , Agent 1: Aggg = False;
Ensure: Tid 2: if Ng reaches epoch then
1: Agent sends params to SC; 3: SC aggregates LLM from all organizations;
2: if Agent’s jwt is invalid then 4: LLMg ← LLM ;
3: return Agent identity check failed 5: if jwt is invalid then
4: end if 6: return jwt expired
5: SC instantiates updated LLM LLMupdated with received 7: end if
params; 8: end if
6: SC uses Dval to evaluate LLMupdated . Calculates training 9: Aggg = True;
loss and accuracy to measure unlearning impact. 10: return Aggg , LLMg
7: if Verification criteria are met then
8: SC sends params to blockchain network; The algorithm begins by setting the public chain aggregation
9: Agents download params from blockchain for weight indicator (Aggg ) to false. When the global epoch Ng reaches
integration; the previously set epoch, the smart contract (SC) commences
10: SC ensures updated weights are recorded on blockchain model aggregation from all organizations. A JWT must be
for transparency and traceability; validated to upload the model. If the token is invalid, an error
11: SC records Transaction ID Tid as proof of submission message is returned. Ultimately, the indicator Aggg is set to
and integration request; true and returned alongside LLMg .
12: end if
Following model aggregation on the public chain, a global
13: Continue for future federated learning process;
model update process is initiated, wherein the LLMf is
14: return Tid
updated using LLMp and LLMg .
This completes the detailed explanation of our proposed
The algorithm starts with the agent sending the updated framework, which leverages a hybrid blockchain architecture
parameters params to the SC. The agent’s credentials are to facilitate secure and efficient cross-organizational collabo-
validated through their JWT. If the token is invalid, the process ration using Large Language Models (LLMs) while ensuring
halts, indicating a failure in agent identity verification. Upon data privacy, transparency, and traceability.
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 10

J. Case Studies c) Challenges and Solutions: One major challenge in


To demonstrate the practical applicability and versatility of implementing the education university alliance case study is
our proposed framework, we present two case studies that coordinating data sharing and model updates among the dif-
highlight its potential in real-world scenarios. These case ferent universities. Each university may have varying data for-
studies illustrate how our blockchain-based federated learn- mats, privacy requirements, and technical infrastructures. To
ing framework with unlearning capabilities and multi-agent address this challenge, our framework provides a standardized
interactions can be leveraged to address the unique challenges interface for data sharing and model aggregation, streamlining
faced by different industries, such as education and healthcare, the collaboration process across different institutions.
when collaborating on LLM development. Another challenge is ensuring that the unlearning process
1) Case Study 1: Education University Alliance: In the first complies with each university’s data retention policies and
case study, we consider an alliance of universities collaborat- regulatory requirements. Our framework offers a flexible and
ing to develop an LLM for educational purposes. The LLM verifiable approach to manage diverse data retention needs by
aims to assist students, faculty, and researchers by providing using LoRA for fine-grained data removal and verifying the
personalized learning experiences, intelligent tutoring, and unlearning results on the blockchain.
advanced research assistance. Each university possesses a d) Discussion: The education university alliance case
wealth of educational data, including course materials, student study demonstrates the potential application of our blockchain-
interactions, and research publications. However, sharing this based federated learning framework with multi-agent interac-
data directly among the universities raises concerns about data tions in the education domain. By allowing universities to col-
privacy, intellectual property rights, and the potential misuse laborate while protecting data privacy and intellectual property
of sensitive information. rights, our framework paves the way for developing LLMs
a) Implementation of the System: To realize the educa- for personalized learning, intelligent tutoring, and advanced
tion university alliance case study, we adopt our proposed research. The multi-agent approach enables universities to
blockchain-based federated learning framework with multi- make optimal decisions based on their local data and learning
agent interactions. First, each participating university registers strategies, while the unlearning mechanism provided by the
as a client in the system, as shown in Algorithm 1. Then, framework enables universities to manage their data retention
one university is selected as the agent to upload the initial policies while ensuring compliance and transparency.
global LLM model to the public blockchain, as demonstrated 2) Case Study 2: Cross-Hospital Collaboration in Health-
in Algorithm 2. Universities with large amounts of data care: The second case study focuses on the collaboration
establish their own private blockchains to ensure the privacy among different hospitals within a healthcare system to de-
and security of their sensitive data (Algorithm 3). velop an LLM for medical decision support and patient care.
On the private blockchain, each university is represented The LLM aims to assist healthcare professionals by providing
by an agent that trains the LLM using its local data and evidence-based recommendations, analyzing patient data, and
Q-learning strategies to make optimal decisions (Algorithm facilitating knowledge sharing among hospitals. Each hospital
5). After multiple rounds of training, the aggregated LLM is has a vast repository of medical records, including patient
shared on the private blockchain and then sent to the public histories, diagnostic images, and treatment outcomes. How-
blockchain for global aggregation (Algorithm 6). ever, the sensitive nature of this data and the strict regulations
If a university needs to remove specific data points or model governing healthcare information pose significant challenges
contributions, the unlearning process is triggered (Algorithm for collaboration.
4). The LoRA technique is used to selectively remove data a) Implementation of the System: To realize the cross-
without significantly affecting the overall performance of the hospital collaboration case study, we adopt a similar approach
LLM. The unlearning results are verified and submitted to the to the education university alliance case study. Each hospital
public blockchain (Algorithm 5), ensuring the integrity and registers as a client in the system, while one hospital is
transparency of the removal process. selected as the agent to upload the initial global LLM to the
b) Analysis: By utilizing our framework, the education public blockchain. Hospitals with large amounts of patient data
university alliance can leverage the collective knowledge and establish their own private blockchains to ensure data privacy
expertise of multiple institutions while preserving data privacy and security.
and intellectual property rights. The resulting educational On the private blockchain, each hospital is represented by
LLM can offer advanced learning experiences and research an agent that trains the LLM using its local patient data and
support to students, faculty, and researchers across the par- Q-learning strategies to make optimal decisions. The agents
ticipating universities. The private blockchain ensures that collaborate to improve the LLM while maintaining data pri-
each university’s sensitive data remains protected, while the vacy. The aggregated LLM is shared on the private blockchain
public blockchain facilitates secure collaboration among the and then sent to the public blockchain for global aggregation.
different institutions. The multi-agent approach allows each If specific patient data or model contributions need to be
university to make optimal decisions based on its local data removed, hospitals can trigger the unlearning process, using
and Q-learning strategies, enhancing the overall performance LoRA to selectively remove data without affecting the overall
of the LLM. The LoRA-driven unlearning mechanism allows performance of the LLM. The unlearning results are verified
universities to effectively remove specific data as needed while on the public blockchain, ensuring the integrity of the removal
maintaining the overall performance of the LLM. process.
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 11

b) Analysis: By adopting our framework, the cross- designed to address the critical privacy challenges associated
hospital collaboration in healthcare can leverage the collective with collaborative learning in cross-organizational settings. By
knowledge and expertise of multiple institutions to develop synergistically integrating the inherent privacy-preserving fea-
a powerful medical LLM. The resulting LLM can assist tures of federated learning, the immutability and transparency
healthcare professionals in making informed decisions, im- of blockchain technology, and the efficient data removal mech-
proving patient outcomes, and advancing medical research anisms of unlearning, our approach offers a holistic solution
while maintaining the highest standards of data privacy and for secure and privacy-centric LLM training.
regulatory compliance. The private blockchain ensures that At its core, federated learning enables the distributed train-
each hospital’s sensitive patient data remains protected, while ing of LLMs across multiple participants without necessitating
the public blockchain facilitates secure collaboration among the direct exchange of sensitive data [30]. This decentralized
the hospitals. The multi-agent approach allows hospitals to paradigm ensures that each participant maintains control over
make optimal decisions based on their local data and Q- their proprietary data, significantly mitigating the risks of data
learning strategies, enhancing the overall performance of the breaches and unauthorized access. Mathematically, federated
medical LLM. The LoRA-driven unlearning mechanism al- learning can be formulated as an optimization problem that
lows hospitals to effectively remove specific data as needed seeks to minimize the global objective function while keeping
while preserving the integrity of the medical LLM. the data localized:
c) Challenges and Solutions: One major challenge in N
implementing the cross-hospital collaboration case study is
X ni
min L(θ) = Li (θ) (9)
ensuring compliance with strict healthcare regulations, such θ
i=1
n
as HIPAA. Our framework addresses this challenge by using
private blockchains to isolate sensitive patient data and lever- where θ represents the model parameters, L(θ) denotes the
aging secure aggregation protocols to share model updates global objective function, Li (θ) is the local objective function
among hospitals. The blockchain technology also provides an of the i-th participant, ni is the number of data samples
immutable audit trail of data access and sharing activities, held by the i-th participant, n is the total number of data
ensuring compliance. samples across all participants, and N is the total number of
Another challenge is managing the different data retention participants.
policies and patient consent requirements across hospitals. Our By optimizing the global objective function in this manner,
framework offers a flexible and verifiable approach to handle federated learning facilitates the collaborative enhancement of
these variations by using LoRA for fine-grained data removal the LLM without exposing raw data, effectively leveraging the
and verifying the unlearning results on the blockchain. This distributed data across participants while safeguarding privacy
allows hospitals to customize the unlearning process based on and boosting model performance.
their specific data management requirements. The introduction of multi-agent interactions and Q-learning
d) Discussion: The cross-hospital collaboration case strategies in our framework further enhances privacy protec-
study in healthcare demonstrates the potential application tion by enabling participating organizations to make intelligent
of our blockchain-based federated learning framework with decisions about data sharing and model contributions based
multi-agent interactions in the medical domain. By allowing on their individual privacy constraints and objectives. Each
hospitals to collaborate while maintaining patient privacy and agent autonomously learns the optimal strategies for engaging
regulatory compliance, our framework paves the way for de- in the federated learning process, considering factors such
veloping LLMs for medical decision support, patient care, and as data sensitivity, regulatory compliance, and the potential
medical research. The multi-agent approach enables hospitals benefits and risks of collaboration. This decentralized decision-
to make optimal decisions based on their local data and making approach empowers organizations to maintain granular
learning strategies, while the unlearning mechanism provided control over their data and reduces the reliance on centralized
by the framework enables hospitals to manage their data re- control mechanisms that may introduce additional privacy
tention policies while ensuring compliance and accountability. vulnerabilities.
These two case studies showcase the wide-ranging applica- Moreover, the integration of blockchain technology in our
bility of our blockchain-based federated learning framework framework provides an immutable and transparent ledger of
with multi-agent interactions in real-world scenarios. By ad- all interactions and transactions within the federated learning
dressing the unique challenges faced by different industries, process, ensuring the integrity and accountability of the col-
our framework provides a viable path for the responsible laborative learning process. The utilization of smart contracts
development and deployment of LLMs in critical domains automates the enforcement of predefined privacy policies
such as healthcare and education. and conditions, guaranteeing that all participants adhere to
mutually agreed-upon privacy standards. This automation min-
VI. P RIVACY AND S ECURITY A NALYSIS imizes the potential for human error and mitigates the risk of
unauthorized data access or manipulation.
A. Privacy Analysis The unlearning mechanism embedded within our frame-
The proposed hybrid blockchain-based federated learning work empowers participants to selectively remove specific
framework with multi-agent interactions and unlearning capa- data points or model updates, granting them fine-grained
bilities for Large Language Models (LLMs) is meticulously control over their data lifecycle and facilitating compliance
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 12

with evolving privacy regulations. Theoretically, the unlearn- enables the system to remain robust and responsive even in
ing process can be modeled as a constrained optimization the presence of sophisticated adversaries.
problem, wherein the objective is to minimize the impact of Our framework also leverages advanced cryptographic prim-
the removed data on the model’s performance while satisfying itives, such as threshold signatures and zero-knowledge proofs,
the unlearning constraints: to ensure the integrity and confidentiality of all transactions.
N
Threshold signatures allow for the distributed generation and
X ni verification of signatures, eliminating single points of failure
min L(θ) = Li (θ) s.t. θ ∈ Θu (10)
θ
i=1
n and enhancing the resilience of the system against attacks.
Zero-knowledge proofs enable participants to validate the
where Θu represents the feasible set of model parameters correctness of computations without revealing the underlying
after unlearning. The goal is to identify the optimal model data [33], preserving privacy while maintaining trust in the
parameters that minimize the impact of the removed data federated learning process. By combining these cryptographic
on the model’s performance while adhering to the unlearn- techniques with the security features of blockchain and multi-
ing constraints. By incorporating this unlearning mechanism, agent interactions, our framework establishes a secure and
our framework provides participants with a powerful tool to trustworthy environment for collaborative LLM development.
manage their data lifecycle and maintain model performance. The utilization of smart contracts further strengthens the se-
curity of the system by automating the execution of predefined
rules and conditions, minimizing the potential for unauthorized
B. Security Analysis
access or manipulation. In our framework, smart contracts
The integration of blockchain technology and multi-agent govern the federated learning process, enforcing participant
interactions in our federated learning framework significantly adherence to agreed-upon security protocols and facilitating
enhances the security of the collaborative learning process. the secure aggregation of model updates. This automated
The immutable nature of blockchain ensures that all model enforcement reduces the risk of human error and malicious
updates and transactions are tamper-proof and easily verifiable, behavior, bolstering the overall security of the system.
providing a robust defense against malicious actors attempting The decentralized architecture of our framework, enabled by
to manipulate the learning process [31]. the hybrid blockchain design, eliminates single points of fail-
From a theoretical perspective, the security of a blockchain ure and distributes risk across multiple nodes. This distributed
network can be analyzed through the lens of game theory approach significantly increases the difficulty for attackers to
and consensus mechanisms. In a proof-of-stake (PoS) based compromise the entire system, as they would need to control a
blockchain, network security is maintained by requiring partic- substantial portion of the participating nodes simultaneously.
ipants to stake a portion of their assets as collateral [32]. This The probability of a successful attack decreases exponentially
staking mechanism incentivizes participants to act honestly, with the number of honest nodes in the network, making
as any malicious behavior would result in the loss of their it practically infeasible in a large-scale, cross-organizational
staked assets. The security of the network can be modeled as a federated learning setting.
game between honest and malicious participants, where honest In conclusion, our hybrid blockchain-based federated learn-
participants aim to maximize their rewards by following the ing framework with multi-agent interactions and unlearning
protocol, while malicious participants seek to maximize their capabilities offers a comprehensive solution for addressing
gains by deviating from the protocol. The Nash equilibrium of security concerns in cross-organizational LLM training. By
this game represents a state in which no participant can benefit harnessing the inherent security features of blockchain tech-
by unilaterally altering their strategy, ensuring the stability and nology, multi-agent interactions, and advanced cryptographic
security of the blockchain network. techniques, our approach creates a resilient and secure en-
The multi-agent approach introduced in our framework adds vironment for collaborative LLM development. The adaptive
an extra layer of security by enabling participating organiza- security measures enabled by Q-learning strategies and the
tions to independently assess the credibility and trustworthi- decentralized trust mechanism further fortify the system’s de-
ness of other agents based on their past behavior and contri- fenses against evolving security threats, ensuring the integrity
butions. Agents can learn to identify and isolate malicious or and reliability of the federated learning process in complex,
free-riding participants, minimizing their impact on the collab- multi-stakeholder settings.
orative learning process. This decentralized trust mechanism
complements the security features of the blockchain, creating a VII. P ERFORMANCE E VALUATION
more resilient and adaptive system that can effectively respond
A. Experimental Setup
to evolving security threats.
Furthermore, the Q-learning strategies employed by the Datasets: For our experiments, we utilized two distinct
agents allow them to dynamically adapt their behavior based datasets: the IMDB dataset for sentiment analysis and a dataset
on the observed security state of the system. Agents can learn of tweets from Twitter. These datasets were selected based on
to take proactive measures, such as increasing the frequency several important criteria:
of model validations or adjusting the staking requirements, • Relevance to LLM Applications: The IMDB dataset is
to maintain the integrity of the federated learning process in a standard benchmark for sentiment analysis, making it
the face of potential attacks. This adaptive security approach ideal for evaluating the performance of our framework in
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 13

a well-known context. The Twitter dataset, on the other TABLE I


hand, provides real-world text data applicable to various R ESULTS ON IMDB DATASET
NLP tasks such as sentiment analysis, topic modeling, LoRA Config Initial Accuracy Final Accuracy
and text classification. r=32, alpha=2, dropout=0.1 97.10% 0.95%
• Size and Complexity: The IMDB dataset consists of r=16, alpha=8, dropout=0.1 95.95% 1.00%
r=16, alpha=4, dropout=0.5 98.00% 1.10%
50,000 movie reviews, offering a substantial but man- r=16, alpha=4, dropout=0.2 98.70% 1.20%
ageable volume for federated learning experiments. The r=2, alpha=16, dropout=0.1 84.41% 1.25%
Twitter dataset includes a large number of tweets, which
helps assess the scalability and efficiency of our frame-
Twitter Dataset Results: Similarly, we conducted exper-
work.
iments on the Twitter dataset to assess our method’s perfor-
• Diversity of Content: The IMDB dataset contains struc-
mance. Table II shows the results of these experiments.
tured, domain-specific reviews, while the Twitter dataset
includes a wide range of topics, opinions, and writing
TABLE II
styles. This diversity allows us to test the robustness and R ESULTS ON T WITTER DATASET
adaptability of our framework.
LoRA Config Initial Accuracy Final Accuracy
• Sensitive Information: Tweets often contain personal
r=16, alpha=8, dropout=0.2 83.98% 7.93%
or sensitive information that users might wish to erase. r=16, alpha=1, dropout=0.1 84.68% 8.33%
This makes the Twitter dataset particularly suitable for r=2, alpha=1, dropout=0.3 74.42% 8.41%
evaluating our unlearning mechanism’s effectiveness in r=16, alpha=2, dropout=0.4 81.33% 8.42%
r=8, alpha=1, dropout=0.1 91.00% 9.04%
removing specific data points while preserving overall
model performance. 1) Impact of Rank on Unlearning: Figures 2 and 3 illustrate
Evaluation Metrics: Accuracy was chosen as the primary how different ranks (r) affect accuracy reduction for the
metric for evaluating our experiments. It provides a straight- Twitter and IMDB datasets, respectively. Higher ranks, such
forward measure of the proportion of correctly classified as r = 16 and r = 32, generally result in more significant ac-
reviews post-unlearning. By comparing accuracy before and curacy reductions post-unlearning, indicating better unlearning
after unlearning, we can gauge the framework’s effectiveness performance.
in forgetting specific data points while retaining overall model 2) Impact of Alpha on Unlearning: Figures 4 and 5 show
performance. the effects of different alpha values on accuracy reduction for
Experimental Comparisons: Given the unique combina- the Twitter and IMDB datasets. Lower alpha values generally
tion of federated learning, blockchain technology, and un- lead to more effective unlearning, as evidenced by greater
learning capabilities in our approach, there are no direct accuracy reductions.
counterparts in the current literature for comparison. Our 3) Impact of Dropout on Unlearning: Figures 6 and 7 de-
framework is pioneering in addressing selective unlearning pict how different dropout values influence accuracy reduction.
within a federated learning setup for LLMs, enhanced with Higher dropout rates (0.4 and 0.5) tend to enhance unlearning
blockchain to ensure privacy and security. performance by introducing more noise during training, thus
For comprehensive evaluation, we varied LoRA hyperpa- facilitating better forgetting of specific data.
rameters such as rank and scaling factor to identify the 4) Performance Influencing Factors: Analyzing the impact
configurations that best balance unlearning effectiveness and of alpha, dropout, and r values reveals important insights into
model accuracy. The multi-agent system configuration in our the performance of our unlearning method. Both datasets show
experiments involved each agent (representing an organiza- that lower alpha values and higher dropout rates contribute
tion) training locally on its data and collaboratively updating significantly to improved unlearning by reducing the model’s
the global model via blockchain to ensure transparency and capacity to retain information.
accountability. Moreover, higher r values allow the model to capture
more diverse information, facilitating better unlearning. These
Hardware and Software Environment: The experiments
findings underscore the need to carefully tune hyperparam-
were run on a system with an Intel Xeon 6238R processor,
eters in our LoRA-based unlearning approach to maximize
64GB RAM, and an NVIDIA A6000 GPU, using software
effectiveness.
environments like Ubuntu 20.04, Visual Studio Code, Hyper-
5) Comparison with Retrain from Scratch: Table III com-
ledger Fabric, FATE, and machine learning frameworks such
pares our method with the Retrain from Scratch technique for
as PyTorch and TensorFlow.
both datasets. Our approach achieves similar final accuracies,
demonstrating effective unlearning while being computation-
ally more efficient.
B. Results and Discussion
6) Blockchain Integration and Performance: Our study
IMDB Dataset Results: We experimented with various also evaluates the performance implications of integrating a
LoRA settings on the IMDB dataset. The Retrain from Scratch hybrid blockchain structure, combining public and private
method served as a benchmark to evaluate our unlearning blockchains, into our federated learning framework with un-
approach. Table I presents the initial and final accuracies for learning capabilities. We focused on scalability, transaction
different LoRA configurations. throughput, and latency.
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 14

Fig. 2. Impact of Different r Values on Accuracy Fig. 3. Impact of Different r Values on Accuracy Fig. 4. Impact of Different Alpha Values on
(Twitter) (IMDB) Accuracy (Twitter)

Fig. 5. Impact of Different Alpha Values on Fig. 6. Impact of Different Dropout Values on Fig. 7. Impact of Different Dropout Values on
Accuracy (IMDB) Accuracy (Twitter) Accuracy (IMDB)

TABLE III TABLE IV


F INAL ACCURACY C OMPARISON T IME C OST A NALYSIS FOR LLM F EDERATED L EARNING WITH AND
WITHOUT B LOCKCHAIN I NTEGRATION
Method Initial Accuracy Final Accuracy
Twitter & Our Method 83.98% 7.93% Method t=0 t=9 t = 99 t = 999
Twitter & Retrain from Scratch 87.53% 7.84% Normal Federated Learning 30s 300s 3000s 30000s
IMDB & Our Method 97.10% 0.95% for LLMs
IMDB & Retrain from Scratch 95.60% 0.85% Public Blockchain- 79s 367s 3277s 32277s
Enhanced Method for
LLMs
Hybrid Blockchain- 84s 378s 3384s 33384s
• Setup Time: Initial setup of the hybrid blockchain net- Enhanced Method for
work took approximately 48 seconds. This is slightly LLMs
higher than using only a public blockchain but acceptable
considering the long-term benefits in security and privacy.
• Consensus Overhead: The consensus process added public blockchain. This approach balances the need for trans-
around 6 seconds due to the additional coordination parency and accountability with privacy requirements.
required between public and private blockchains. This Overall, our results demonstrate that integrating a hybrid
increase is manageable within the federated learning blockchain into our federated learning framework introduces
context. minimal overhead while ensuring robust and scalable per-
• Transaction Processing: Average transaction processing formance. This makes our system a promising solution for
time, including model updates and data sharing, was secure, transparent, and privacy-preserving federated learning
4 seconds, demonstrating the hybrid blockchain’s effi- with unlearning capabilities for LLMs.
ciency. 7) Discussion: Our experiments on the IMDB and Twitter
• Per-Epoch Duration: Training duration per epoch re- datasets confirm that our method achieves performance levels
mained consistent at 30-32 seconds, even with additional comparable to the Retrain from Scratch technique in terms of
unlearning activities and blockchain coordination, high- accuracy reduction. The success of our LoRA-based unlearn-
lighting the system’s robustness. ing approach is due to carefully selected and tuned parameters
Table IV compares time costs across different federated and specific implementation techniques. Our method offers a
learning cycles, showing that while the hybrid blockchain computationally viable alternative to retraining from scratch,
method has a slightly higher initial time cost, it normalizes which can be resource-intensive and time-consuming.
over iterations, indicating scalability. Additionally, we evaluated the impact of incorporating
The hybrid blockchain architecture provides additional data blockchain technology into our federated learning framework.
privacy benefits by using private blockchains for sensitive The results show that the added blockchain components in-
information sharing while maintaining transparency on the troduce negligible overhead in terms of setup, consensus,
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 15

transaction processing, and per-epoch time costs. The system’s [9] Y. Qu, M. P. Uddin, C. Gan, Y. Xiang, L. Gao, and J. Yearwood,
consistent performance, despite additional unlearning activi- “Blockchain-enabled federated learning: A survey,” ACM Comput.
Surv., vol. 55, no. 4, Nov. 2022. [Online]. Available: https:
ties, highlights its resilience and scalability. //doi.org/10.1145/3524104
By balancing performance, privacy, and computational effi- [10] Y. Qu, L. Gao, Y. Xiang, S. Shen, and S. Yu, “Fedtwin: Blockchain-
ciency, our multi-agent blockchain-integrated federated learn- enabled adaptive asynchronous federated learning for digital twin net-
works,” IEEE Network, vol. 36, no. 6, pp. 183–190, 2022.
ing framework with unlearning capabilities presents a robust [11] J. Zhao, W. Wang, C. Xu, Z. Ren, S.-K. Ng, and T.-S. Chua, “Llm-based
solution for secure and effective LLM training in diverse federated recommendation,” arXiv preprint arXiv:2402.09959, 2024.
applications. [12] F. Wu, Z. Li, Y. Li, B. Ding, and J. Gao, “Fedbiot: Llm local fine-tuning
in federated learning without full model,” in Proceedings of the 30th
ACM SIGKDD Conference on Knowledge Discovery and Data Mining,
VIII. C ONCLUSION 2024, pp. 3345–3355.
This paper introduces an innovative hybrid blockchain- [13] W. Kuang, B. Qian, Z. Li, D. Chen, D. Gao, X. Pan, Y. Xie, Y. Li,
B. Ding, and J. Zhou, “Federatedscope-llm: A comprehensive package
based multi-agent federated learning framework for training for fine-tuning large language models in federated learning,” in Proceed-
Large Language Models (LLMs) in cross-organizational col- ings of the 30th ACM SIGKDD Conference on Knowledge Discovery and
laborations, with data unlearning capabilities. Our framework Data Mining, 2024, pp. 5260–5271.
[14] R. Ye, W. Wang, J. Chai, D. Li, Z. Li, Y. Xu, Y. Du, Y. Wang, and
leverages the strengths of both public and private blockchains S. Chen, “Openfedllm: Training large language models on decentralized
to create a secure, transparent, and efficient collaborative private data via federated learning,” in Proceedings of the 30th ACM
environment while incorporating multi-agent interactions and SIGKDD Conference on Knowledge Discovery and Data Mining, 2024,
pp. 6137–6147.
efficient data unlearning mechanisms. Through extensive ex- [15] Z. Liu, G. Dou, Z. Tan, Y. Tian, and M. Jiang, “Towards safer
periments on IMDB and Twitter datasets, we demonstrate large language models through machine unlearning,” arXiv preprint
the superior performance of our framework in terms of data arXiv:2402.10058, 2024.
[16] J. Chen and D. Yang, “Unlearn what you want to forget: Efficient
privacy protection, collaboration efficiency improvement, and unlearning for llms,” arXiv preprint arXiv:2310.20150, 2023.
targeted data forgetting. The carefully tuned LoRA hyperpa- [17] Y. Yao, X. Xu, and Y. Liu, “Large language model unlearning,” arXiv
rameters enable our approach to efficiently remove target data preprint arXiv:2310.10683, 2023.
[18] P. Maini, Z. Feng, A. Schwarzschild, Z. C. Lipton, and J. Z.
while maintaining the model’s performance on the remaining Kolter, “Tofu: A task of fictitious unlearning for llms,” arXiv preprint
data. The multi-agent system enhances collaboration efficiency arXiv:2401.06121, 2024.
through interactions and knowledge sharing among agents. [19] R. Eldan and M. Russinovich, “Who’s harry potter? approximate un-
Furthermore, the hybrid blockchain architecture introduces learning in llms,” arXiv preprint arXiv:2310.02238, 2023.
[20] H. Luo, J. Luo, and A. V. Vasilakos, “Bc4llm: Trusted artificial intel-
minimal computational overhead and time cost, highlighting ligence when blockchain meets large language models,” arXiv preprint
the scalability and robustness of our system. Compared to arXiv:2310.06278, 2023.
existing methods, our framework exhibits significant advan- [21] Y. Gong, “Dynamic large language models on blockchains,” arXiv
preprint arXiv:2307.10549, 2023.
tages in terms of computational efficiency, versatility, and [22] Y. Lin, Z. Gao, H. Du, J. Ren, Z. Xie, and D. Niyato,
adaptability. It provides a secure, transparent, and efficient “Blockchain-enabled trustworthy federated unlearning,” arXiv preprint
solution for federated learning of LLMs in cross-organizational arXiv:2401.15917, 2024.
[23] J. G. M. Mboma, O. T. Tshipata, W. V. Kambale, and K. Kyamakya,
settings. Our framework has the potential to drive innovative “Assessing how large language models can be integrated with or used for
applications, particularly in scenarios where data privacy and blockchain technology: Overview and illustrative case study,” in 2023
selective data forgetting are of paramount importance. 27th International Conference on Circuits, Systems, Communications
and Computers (CSCC). IEEE, 2023, pp. 59–70.
[24] D. Malhotra, P. Saini, and A. K. Singh, “Blockchain-based proof-
R EFERENCES of-authenticity frameworks for explainable ai,” Multimedia Tools and
[1] M. U. Hadi, R. Qureshi, A. Shah, M. Irfan, A. Zafar, M. B. Shaikh, Applications, vol. 83, no. 13, pp. 37 889–37 911, 2024.
N. Akhtar, J. Wu, S. Mirjalili et al., “Large language models: a [25] M. Zhang, S. Chen, J. Shen, and W. Susilo, “Privacyeafl: Privacy-
comprehensive survey of its applications, challenges, limitations, and enhanced aggregation for federated learning in mobile crowdsensing,”
future prospects,” Authorea Preprints, 2023. IEEE Transactions on Information Forensics and Security, 2023.
[2] L. Zhang, T. Zhu, H. Zhang, P. Xiong, and W. Zhou, “Fedrecovery: [26] J. Zong, C. Wang, J. Shen, C. Su, and W. Wang, “Relac: Revocable
Differentially private machine unlearning for federated learning frame- and lightweight access control with blockchain for smart consumer
works,” IEEE Transactions on Information Forensics and Security, 2023. electronics,” IEEE Transactions on Consumer Electronics, vol. 70, no. 1,
[3] Y. Zhao, Y. Qu, Y. Xiang, M. P. Uddin, D. Peng, and L. Gao, “A pp. 3994–4004, 2023.
comprehensive survey on edge data integrity verification: Fundamentals [27] Y. Li, J. Shen, S. Ji, and Y.-H. Lai, “Blockchain-based data integrity
and future trends,” ACM Comput. Surv., vol. 57, no. 1, Oct. 2024. verification scheme in aiot cloud–edge computing environment,” IEEE
[Online]. Available: https://doi.org/10.1145/3680277 Transactions on Engineering Management, 2023.
[4] P. M. S. Sánchez, A. H. Celdrán, N. Xie, G. Bovet, G. M. Pérez, and [28] M. Wooldridge, An introduction to multiagent systems. John Wiley &
B. Stiller, “Federatedtrust: A solution for trustworthy federated learning,” Sons, 2009.
Future Generation Computer Systems, vol. 152, pp. 83–98, 2024. [29] C. J. Watkins and P. Dayan, “Q-learning,” Machine learning, vol. 8, no.
[5] J. Zhang, L. Pan, Q.-L. Han, C. Chen, S. Wen, and Y. Xiang, “Deep 3-4, pp. 279–292, 1992.
learning based attack detection for cyber-physical system cybersecurity: [30] F. Yin, Z. Lin, Q. Kong, Y. Xu, D. Li, S. Theodoridis, and S. R.
A survey,” IEEE/CAA Journal of Automatica Sinica, vol. 9, no. 3, pp. Cui, “Fedloc: Federated learning framework for data-driven cooperative
377–391, 2021. localization and location data processing,” IEEE Open Journal of Signal
[6] W. Zhou, X. Zhu, Q.-L. Han, L. Li, X. Chen, S. Wen, and Y. Xiang, Processing, vol. 1, pp. 187–215, 2020.
“The security of using large language models - a survey with emphasis [31] E. Politou, F. Casino, E. Alepis, and C. Patsakis, “Blockchain mutability:
on chatgpt,” IEEE/CAA Journal of Automatica Sinica, 2025. Challenges and proposed solutions,” IEEE Transactions on Emerging
[7] G. D. P. Regulation, “General data protection regulation (gdpr),” Intersoft Topics in Computing, vol. 9, no. 4, pp. 1972–1986, 2019.
Consulting, Accessed in October, vol. 24, no. 1, 2018. [32] N. A. Akbar, A. Muneer, N. ElHakim, and S. M. Fati, “Distributed
[8] E. J. Hu, Y. Shen, P. Wallis, Z. Allen-Zhu, Y. Li, S. Wang, L. Wang, hybrid double-spending attack prevention mechanism for proof-of-work
and W. Chen, “Lora: Low-rank adaptation of large language models,” and proof-of-stake blockchain consensuses,” Future Internet, vol. 13,
arXiv preprint arXiv:2106.09685, 2021. no. 11, p. 285, 2021.
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 16

[33] Z. Wan, Y. Zhou, and K. Ren, “zk-authfeed: Protecting data feed to smart
contracts with authenticated zero knowledge proof,” IEEE Transactions
on Dependable and Secure Computing, vol. 20, no. 2, pp. 1335–1347,
2022.

You might also like