Skip to main content
QUICK REVIEW

[论文解读] FedJudge: Federated Legal Large Language Model

Linan Yue, Qi Liu|arXiv (Cornell University)|Sep 15, 2023
Artificial Intelligence in Law被引用 4
一句话总结

FedJudge 是首个用于训练法律大语言模型(LLMs)的联邦学习框架,解决了数据隐私、计算开销和数据分布偏移问题。它采用参数高效的 LoRA 微调与持续学习技术,保留全局知识,在保持原始数据本地化的同时,实现了法律任务上的最先进性能。

ABSTRACT

Large Language Models (LLMs) have gained prominence in the field of Legal Intelligence, offering potential applications in assisting legal professionals and laymen. However, the centralized training of these Legal LLMs raises data privacy concerns, as legal data is distributed among various institutions containing sensitive individual information. This paper addresses this challenge by exploring the integration of Legal LLMs with Federated Learning (FL) methodologies. By employing FL, Legal LLMs can be fine-tuned locally on devices or clients, and their parameters are aggregated and distributed on a central server, ensuring data privacy without directly sharing raw data. However, computation and communication overheads hinder the full fine-tuning of LLMs under the FL setting. Moreover, the distribution shift of legal data reduces the effectiveness of FL methods. To this end, in this paper, we propose the first Federated Legal Large Language Model (FedJudge) framework, which fine-tunes Legal LLMs efficiently and effectively. Specifically, FedJudge utilizes parameter-efficient fine-tuning methods to update only a few additional parameters during the FL training. Besides, we explore the continual learning methods to preserve the global model's important parameters when training local clients to mitigate the problem of data shifts. Extensive experimental results on three real-world datasets clearly validate the effectiveness of FedJudge. Code is released at https://github.com/yuelinan/FedJudge.

研究动机与目标

  • 通过避免法院和法律事务所等机构之间共享原始数据,解决训练法律 LLM 时的数据隐私问题。
  • 在联邦学习设置下,降低微调大语言模型时的计算与通信开销。
  • 缓解异构法律客户端(如法院与法律咨询机构)之间数据分布偏移导致的性能下降问题。
  • 开发一种可扩展、隐私保护的框架,利用参数高效与持续学习技术,训练高质量的法律 LLM。

提出的方法

  • 采用 LoRA(低秩适应)实现参数高效的微调,仅更新可学习的秩矩阵,同时冻结基础 LLM 的权重。
  • 在客户端与服务器之间仅传输 LoRA 参数,相比完整模型参数交换,显著降低了通信开销。
  • 应用持续学习并引入正则化损失(公式 3),防止本地模型在训练过程中遗忘重要全局知识。
  • 使用 FedAvg 风格的聚合方法,仅基于客户端聚合的 LoRA 参数更新全局模型。
  • 引入个性化客户端模型(如 CL-Client),在适应本地数据分布的同时保持全局知识。
  • 采用双阶段训练策略:通过联邦聚合训练全局模型,同时在本地对模型进行微调,并施加知识保留约束。
Fig. 1 : (a) An example in the court client. (b) An example in the legal consultation client.
Fig. 1 : (a) An example in the court client. (b) An example in the legal consultation client.

实验结果

研究问题

  • RQ1联邦学习能否在保护数据隐私的前提下,有效应用于法律任务的大语言模型微调?
  • RQ2在联邦设置下微调法律 LLM 时,如何最小化通信与计算开销?
  • RQ3法律机构之间(如法院与咨询机构)的数据分布偏移在多大程度上会降低联邦法律 LLM 的性能?
  • RQ4持续学习技术能否在异构数据分布下提升联邦法律 LLM 的泛化能力与知识保留能力?

主要发现

  • FedJudge-CL 在大多数指标上优于全局模型(FedJudge-Base)与个性化基线模型(Base-Client),证明了持续学习在缓解分布偏移方面的有效性。
  • 个性化模型 CL-Client3 在法律推理任务中表现最佳,能够正确推理并回答复杂案例,而 Baichuan-7B 与 Center 则给出了错误或不相关的回答。
  • Center-Client1 在其自身数据上表现优于 Center(BertScore 提高 4.87 分),但在其他客户端数据上表现不佳(如在 Client1 上 BLEU-N 仅为 4.47),凸显了集中式训练在异构数据下的局限性。
  • 尽管未访问原始全局数据,FedJudge-CL 的性能仍与集中式模型(Center)相当,证明了联邦学习在法律 LLM 中的可行性。
  • LoRA 的使用显著降低了通信与计算成本,使资源受限客户端也能实现高效微调。
  • 持续学习约束(公式 3)有效减少了本地模型与全局模型之间的权重偏差,保留了全局知识,提升了全局模型质量。
Fig. 2 : An overview of FedJudge, where represents trainable weights and denotes frozen LLMs.
Fig. 2 : An overview of FedJudge, where represents trainable weights and denotes frozen LLMs.

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。