HuRef: HUman-REadable Fingerprint for Large Language Models
作者: Boyi Zeng, Lizheng Wang, Yuncong Hu, Yi Xu, Chenghu Zhou, Xinbing Wang, Yu Yu, Zhouhan Lin
分类: cs.CL, cs.AI
发布日期: 2023-12-08 (更新: 2025-01-07)
备注: NeurIPS 2024
🔗 代码/项目: GITHUB
💡 一句话要点
提出HuRef:一种大型语言模型的人类可读指纹,用于版权保护和模型溯源。
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 版权保护 模型溯源 指纹识别 不变性特征 零知识证明 Transformer StyleGAN2
📋 核心要点
- 大型语言模型版权保护面临挑战,现有方法难以在参数修改后有效识别原始模型。
- HuRef通过提取模型参数方向的稳定不变性特征,生成人类可读的指纹图像,实现模型溯源。
- 实验表明,HuRef能够在黑盒场景下有效识别各种LLM,并采用零知识证明确保指纹的真实性。
📝 摘要(中文)
由于大型语言模型(LLM)训练成本高昂且伴随着精心设计的许可协议,保护其版权至关重要。然而,由于潜在的参数更改,识别LLM的原始基础模型具有挑战性。本研究提出了HuRef,一种LLM的人类可读指纹,它能唯一地识别基础模型,且不干扰训练,也不会向公众暴露模型参数。我们首先观察到,LLM参数的向量方向在模型预训练收敛后保持稳定,在后续的训练步骤(包括持续预训练、监督微调和RLHF)中扰动可忽略不计,这使其成为识别基础模型的充分条件。通过使用额外的项继续训练LLM以驱离模型参数的方向来验证必要性,并且模型变得损坏。然而,这种方向容易受到简单的攻击,如维度置换或矩阵旋转,这些攻击会显着改变它而不影响性能。为了解决这个问题,利用Transformer结构,我们系统地分析了潜在的攻击,并定义了三个不变项来识别LLM的基础模型。由于存在信息泄露的潜在风险,我们无法直接发布不变项。相反,我们使用编码器将它们映射到高斯向量,然后使用StyleGAN2将其转换为自然图像,最后发布该图像。在我们的黑盒设置中,所有指纹识别步骤均由LLM所有者在内部进行。为了确保发布的指纹是诚实生成的,我们引入了零知识证明(ZKP)。跨各种LLM的实验结果证明了我们方法的有效性。代码可在https://github.com/LUMIA-Group/HuRef获取。
🔬 方法详解
问题定义:大型语言模型的版权保护日益重要,但模型经过持续预训练、微调等修改后,难以准确识别其原始基础模型。现有方法容易受到参数扰动和攻击的影响,无法可靠地进行模型溯源。
核心思路:论文的核心在于观察到LLM参数的向量方向在预训练收敛后具有稳定性,即使经过后续训练步骤,其扰动也很小。因此,可以利用这一特性来识别基础模型。为了应对潜在的攻击,论文进一步提取了Transformer结构中的不变性特征。
技术框架:HuRef方法主要包含以下几个阶段:1) 提取LLM参数的向量方向;2) 分析Transformer结构,定义不变性特征;3) 使用编码器将不变性特征映射到高斯向量;4) 利用StyleGAN2将高斯向量转换为人类可读的自然图像;5) 使用零知识证明(ZKP)确保指纹的真实性。整个过程在黑盒环境中进行,模型所有者在内部完成所有步骤。
关键创新:HuRef的关键创新在于:1) 利用LLM参数向量方向的稳定性进行模型溯源;2) 提取Transformer结构中的不变性特征,增强指纹的鲁棒性;3) 将指纹转换为人类可读的图像,方便传播和验证;4) 引入零知识证明,确保指纹的真实性,防止恶意篡改。
关键设计:论文的关键设计包括:1) 仔细选择和提取Transformer结构中的不变性特征,以抵抗各种攻击;2) 使用StyleGAN2生成高质量的自然图像,提高指纹的可读性和美观性;3) 设计零知识证明协议,确保指纹生成过程的诚实性,防止伪造指纹。
📊 实验亮点
论文在多个LLM上进行了实验,验证了HuRef的有效性。实验结果表明,HuRef能够在黑盒场景下准确识别基础模型,并且对各种攻击具有较强的鲁棒性。此外,零知识证明的引入进一步增强了指纹的安全性,确保了指纹的真实性。
🎯 应用场景
HuRef可应用于大型语言模型的版权保护、模型溯源和安全审计。通过发布模型的指纹图像,可以方便地验证模型的来源,防止未经授权的复制和使用。此外,该方法还可以用于检测恶意模型篡改和后门攻击,提高LLM的安全性。
📄 摘要(原文)
Protecting the copyright of large language models (LLMs) has become crucial due to their resource-intensive training and accompanying carefully designed licenses. However, identifying the original base model of an LLM is challenging due to potential parameter alterations. In this study, we introduce HuRef, a human-readable fingerprint for LLMs that uniquely identifies the base model without interfering with training or exposing model parameters to the public. We first observe that the vector direction of LLM parameters remains stable after the model has converged during pretraining, with negligible perturbations through subsequent training steps, including continued pretraining, supervised fine-tuning, and RLHF, which makes it a sufficient condition to identify the base model. The necessity is validated by continuing to train an LLM with an extra term to drive away the model parameters' direction and the model becomes damaged. However, this direction is vulnerable to simple attacks like dimension permutation or matrix rotation, which significantly change it without affecting performance. To address this, leveraging the Transformer structure, we systematically analyze potential attacks and define three invariant terms that identify an LLM's base model. Due to the potential risk of information leakage, we cannot publish invariant terms directly. Instead, we map them to a Gaussian vector using an encoder, then convert it into a natural image using StyleGAN2, and finally publish the image. In our black-box setting, all fingerprinting steps are internally conducted by the LLMs owners. To ensure the published fingerprints are honestly generated, we introduced Zero-Knowledge Proof (ZKP). Experimental results across various LLMs demonstrate the effectiveness of our method. The code is available at https://github.com/LUMIA-Group/HuRef.