Efficient LLM Distillation for Bangladesh Legal Context: A Smartphone-Compatible Retrieval-Augmented Generation Model
作者: MD. Nafis Kamal, Mahadi Hasan Fahim, Talha Ridwan, Nadifa Zaman, Fariha Roushon Florin, Farig Yousuf Sadeque, Saadat Rafid Ahmed
分类: cs.CL
发布日期: 2026-09-21
备注: 10 pages, 6 figures, 8 tables
💡 一句话要点
提出高效法律语言模型蒸馏方法以解决孟加拉国法律信息获取难题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 法律信息获取 知识蒸馏 移动设备 孟加拉国法律 自然语言处理
📋 核心要点
- 现有法律信息获取方法在孟加拉国面临语言障碍和网络不稳定等挑战,导致法律文本难以被普通公民理解。
- 论文提出通过两阶段的知识蒸馏,将大型法律语言模型压缩为适合手机使用的小型模型,以提高法律信息的可获取性。
- 实验结果显示,蒸馏模型在ROUGE-L和BERTScore等指标上分别提升了103%和143%,证明了其有效性和实用性。
📝 摘要(中文)
孟加拉国的法律信息对大多数公民而言难以获取,法律文本仅以英语呈现,受训律师主要集中在城市,而依赖云计算的人工智能在移动网络不稳定的环境中无法有效工作,导致虚假法律文本的出现可能造成直接伤害。本文通过两阶段的渐进知识蒸馏,将一个拥有90亿参数的Gemma-2教师模型压缩为一个20亿参数的学生模型,旨在填补法律获取的空白。实验结果表明,蒸馏后的模型在多个评估指标上显著优于未蒸馏的基线,展示了其在孟加拉国法定法律领域的有效性。
🔬 方法详解
问题定义:本文旨在解决孟加拉国法律信息获取的困难,现有方法在语言和网络条件下存在显著不足,导致法律文本的可用性降低。
核心思路:通过两阶段的渐进知识蒸馏,将一个大型法律语言模型压缩为适合移动设备的小型模型,以便在网络不稳定的环境中提供可靠的法律信息。
技术框架:整体架构包括两个主要阶段:第一阶段对9,429个质量筛选的法律问答对进行监督微调,第二阶段通过最小化稀疏Kullback-Leibler散度来优化模型输出。
关键创新:最重要的创新在于采用了QLoRA技术进行模型蒸馏,结合了4位量化和LoRA适配器,显著降低了模型的存储需求和计算复杂度。
关键设计:模型在第二阶段使用了温度参数tau = 4.0,并通过混合检索方法结合了密集语义搜索和BM25算法,确保每个响应都基于36,029个法定文本片段。实验中,模型的适配器量化至1.6 GB,能够在Pixel 6上以每秒4-8个标记的速度运行。
🖼️ 关键图片
📊 实验亮点
实验结果显示,蒸馏后的模型在50个查询的英语基准测试中达到了ROUGE-L 0.4715和BERTScore F1 0.5679,分别比未蒸馏基线提升了103%和143%。在50个孟加拉语查询的跨语言评估中,模型也表现出色,ROUGE-L达到0.4083,BERTScore为0.8133,证明了其有效的检索能力。
🎯 应用场景
该研究的潜在应用领域包括法律咨询、法律教育和公共法律服务等。通过提供易于访问的法律信息,能够帮助普通公民更好地理解法律条款,促进法律知识的普及和公平获取。未来,该模型还可以扩展到其他国家的法律系统,提升全球法律信息的可获取性。
📄 摘要(原文)
Legal information in Bangladesh is inaccessible to most citizens. Statutory text is English-only, trained lawyers are concentrated in urban centres, and cloud-dependent AI fails where mobile connectivity is unreliable, a setting in which hallucinated legal text causes direct harm. The system addresses statutory interpretation only; queries that require judicial precedent or case-law reasoning fall outside its scope. We target the statutory access gap by compressing a 9-billion-parameter Gemma-2 teacher into a 2-billion-parameter student through two-phase progressive knowledge distillation. Phase 1 performs supervised fine-tuning on 9,429 quality-gated legal question-answer pairs (65% acceptance from 14,514 generated queries); Phase 2 minimises sparse Kullback-Leibler divergence against the teacher's top-50 per-token logits at temperature tau = 4.0, implemented via QLoRA (4-bit NF4, rank-32 LoRA adapters). Prior legal language models target general legal English; this system specialises in Bangladeshi statutory law. Every response is grounded through hybrid retrieval combining dense semantic search (60%) and BM25 (40%) across 36,029 statutory passages from the Bangladesh Constitution and national legislation. On a 50-query English benchmark, the distilled model reaches ROUGE-L 0.4715 and BERTScore F1 0.5679, a 103% ROUGE-L and 143% BERTScore gain over the retrieval-augmented undistilled baseline (ROUGE-L 0.2323, BERTScore 0.2340). The adapter quantises to 1.6 GB (GGUF Q4_K_M) and runs at 4-8 tokens per second on a Pixel 6 with no network access. Cross-lingual evaluation on 50 Bangla queries yields ROUGE-L 0.4083 and BERTScore 0.8133, showing effective retrieval from Bangla input against an English-only corpus. In a single-evaluator pilot, a practising lawyer rated 50 responses at a weighted mean of 4.16/5 (90% rated 4 or 5), supporting utility beyond text-overlap metrics.