Large Language Model Federated Learning With Blockchain and Unlearning For Cross-Organizational Collaboration
Large Language Model Federated Learning With Blockchain and Unlearning For Cross-Organizational Collaboration
8, AUGUST 2015 1
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
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
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
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
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
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)
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.