Processing math: 6%
  • 中国精品科技期刊
  • CCF推荐A类中文期刊
  • 计算领域高质量科技期刊T1类
高级检索

面向大语言模型的越狱攻击综述

李南, 丁益东, 江浩宇, 牛佳飞, 易平

李南, 丁益东, 江浩宇, 牛佳飞, 易平. 面向大语言模型的越狱攻击综述[J]. 计算机研究与发展, 2024, 61(5): 1156-1181. DOI: 10.7544/issn1000-1239.202330962
引用本文: 李南, 丁益东, 江浩宇, 牛佳飞, 易平. 面向大语言模型的越狱攻击综述[J]. 计算机研究与发展, 2024, 61(5): 1156-1181. DOI: 10.7544/issn1000-1239.202330962
Li Nan, Ding Yidong, Jiang Haoyu, Niu Jiafei, Yi Ping. Jailbreak Attack for Large Language Models: A Survey[J]. Journal of Computer Research and Development, 2024, 61(5): 1156-1181. DOI: 10.7544/issn1000-1239.202330962
Citation: Li Nan, Ding Yidong, Jiang Haoyu, Niu Jiafei, Yi Ping. Jailbreak Attack for Large Language Models: A Survey[J]. Journal of Computer Research and Development, 2024, 61(5): 1156-1181. DOI: 10.7544/issn1000-1239.202330962
李南, 丁益东, 江浩宇, 牛佳飞, 易平. 面向大语言模型的越狱攻击综述[J]. 计算机研究与发展, 2024, 61(5): 1156-1181. CSTR: 32373.14.issn1000-1239.202330962
引用本文: 李南, 丁益东, 江浩宇, 牛佳飞, 易平. 面向大语言模型的越狱攻击综述[J]. 计算机研究与发展, 2024, 61(5): 1156-1181. CSTR: 32373.14.issn1000-1239.202330962
Li Nan, Ding Yidong, Jiang Haoyu, Niu Jiafei, Yi Ping. Jailbreak Attack for Large Language Models: A Survey[J]. Journal of Computer Research and Development, 2024, 61(5): 1156-1181. CSTR: 32373.14.issn1000-1239.202330962
Citation: Li Nan, Ding Yidong, Jiang Haoyu, Niu Jiafei, Yi Ping. Jailbreak Attack for Large Language Models: A Survey[J]. Journal of Computer Research and Development, 2024, 61(5): 1156-1181. CSTR: 32373.14.issn1000-1239.202330962

面向大语言模型的越狱攻击综述

基金项目: 国家自然科学基金项目(61831007);国家重点研发计划(2020YFB1807504)
详细信息
    作者简介:

    李南: 2002年生. 硕士研究生. 主要研究方向为人工智能后门攻击、大语言模型安全

    丁益东: 2001年生. 硕士研究生. 主要研究方向为人工智能后门攻击与防御、大语言模型

    江浩宇: 1999年生. 硕士研究生. 主要研究方向为人工智能后门攻击、图神经网络

    牛佳飞: 2001年生. 硕士研究生. 主要研究方向为人工智能后门、大语言模型安全

    易平: 1969年生. 博士,副教授. CCF高级会员. 主要研究方向为人工智能安全、系统安全

    通讯作者:

    易平(yiping@sjtu.edu.cn

  • 中图分类号: TP391.1;TP18

Jailbreak Attack for Large Language Models: A Survey

Funds: This work was supported by the National Natural Science Foundation of China (61831007), and the National Key Research and Development Program of China (2020YFB1807504).
More Information
    Author Bio:

    Li Nan: born in 2002. Master candidate. His main research interests include artificial intelligence backdoor attack and large language model security

    Ding Yidong: born in 2001. Master candidate. His main research interests include artificial intelligence backdoor attack and defense, and large language models

    Jiang Haoyu: born in 1999. Master candidate. His main research interests include artificial intelligence backdoor attack and graph neural network

    Niu Jiafei: born in 2001. Master candidate. His main research interests include artificial intelligence backdoors and large language model security

    Yi Ping: born in 1969. PhD, associate professor. Senior member of CCF. His main research interests include security for artificial intelligence and system security

  • 摘要:

    近年来,大语言模型(large language model,LLM)在一系列下游任务中得到了广泛应用,并在多个领域表现出了卓越的文本理解、生成与推理能力. 然而,越狱攻击正成为大语言模型的新兴威胁. 越狱攻击能够绕过大语言模型的安全机制,削弱价值观对齐的影响,诱使经过对齐的大语言模型产生有害输出. 越狱攻击带来的滥用、劫持、泄露等问题已对基于大语言模型的对话系统与应用程序造成了严重威胁. 对近年的越狱攻击研究进行了系统梳理,并基于攻击原理将其分为基于人工设计的攻击、基于模型生成的攻击与基于对抗性优化的攻击3类. 详细总结了相关研究的基本原理、实施方法与研究结论,全面回顾了大语言模型越狱攻击的发展历程,为后续的研究提供了有效参考. 对现有的安全措施进行了简略回顾,从内部防御与外部防御2个角度介绍了能够缓解越狱攻击并提高大语言模型生成内容安全性的相关技术,并对不同方法的利弊进行了罗列与比较. 在上述工作的基础上,对大语言模型越狱攻击领域的现存问题与前沿方向进行探讨,并结合多模态、模型编辑、多智能体等方向进行研究展望.

    Abstract:

    In recent years, large language models (LLMs) have been widely applied in a range of downstream tasks and have demonstrated remarkable text understanding, generation, and reasoning capabilities in various fields. However, jailbreak attacks are emerging as a new threat to LLMs. Jailbreak attacks can bypass the security mechanisms of LLMs, weaken the influence of safety alignment, and induce harmful outputs from aligned LLMs. Issues such as abuse, hijacking and leakage caused by jailbreak attacks have posed serious threats to both dialogue systems and applications based on LLMs. We present a systematic review of jailbreak attacks in recent years, categorize these attacks into three distinct types based on their underlying mechanism: manually designed attacks, LLM-generated attacks, and optimization-based attacks. We provide a comprehensive summary of the core principles, implementation methods, and research findings derived from relevant studies, thoroughly examine the evolutionary trajectory of jailbreak attacks on LLMs, offering a valuable reference for future research endeavors. Moreover, a concise overview of the existing security measures is offered. It introduces pertinent techniques from the perspectives of internal defense and external defense, which aim to mitigate jailbreak attacks and enhance the content security of LLM generation. Finally, we delve into the existing challenges and frontier directions in the field of jailbreak attacks on LLMs, examine the potential of multimodal approaches, model editing, and multi-agent methodologies in tackling jailbreak attacks, providing valuable insights and research prospects to further advance the field of LLM security.

  • 多模态机器学习旨在建立能够处理和关联来自多种模式信息的模型,近年来成为研究的热点. 多模态表示和多模态融合是多模态机器学习的2个关键任务[1]. 由于模态间的异构性,多模态表示学习一直是个难点问题. 目前,基于神经网络的联合表示学习模型把所有的模态数据映射到统一的特征空间,得到联合特征表示,容易实现端到端的学习,但需要大量的标注数据[2]. 在一些应用领域,多模态数据具有共享和特有的特征,例如在多模态情感识别任务中,说话人的动作、语音和语言具有共同的动机和目标,同时它们又分别具有特有的情感、语气和语义. 为了有效学习不同模态的共享特征和特有特征,Hazarika等人[3]提出了一种多模态协同表示模型MISA,将每个模态映射到2个不同的子空间中,分别学习共享特征和特有特征,但该模型只考虑了单个样本内的多模态协同,没有考虑样本间的多模态协同,导致不同类别样本的特征空间具有一定程度的重合,特征表示缺乏鲁棒性.

    多模态融合根据融合阶段的不同,可以分为早期融合、晚期融合和混合融合[4]. 早期融合是特征层的融合,在融合后的特征上训练分类器;晚期融合是决策层的融合,每个模态数据单独训练一个分类器,然后根据投票、加权和学习等方式对分类器的结果进行融合;混合融合联合了早期融合和晚期融合2种方式,试图同时利用2种融合方式的优点. 晚期融合允许不同的模态采用不用的预测模型,使得模型具有灵活性,但忽视了不同模态特征的交互. 早期融合使用单一模型进行训练,实现了不同模态特征的交互. 研究表明[5-6],在多模态语言分析任务中,文本特征占据了主要地位,语音和视频常为辅助特征,在某些情况下语音和视频可能包含噪声,对结果的判断起到干扰作用. 目前大部分多模态融合方法,把所有的模态特征同等对待,导致对噪声数据敏感.

    因此,针对多模态协同表示没有考虑样本间的协同和多模态特征融合对噪声数据敏感的问题,本文提出一种基于样本内外协同表示和自适应融合的多模态学习方法. 在多模态表示方面,构建模态特定和模态共用的2类编码器分别学习文本、视频和语音的特有特征和共享特征的表示,通过样本重构误差、样本内协同误差和样本间协同误差设计表示学习损失函数. 在多模态特征融合方面,设计一种基于注意力机制和门控神经网络的自适应的融合方法,利用注意力机制学习模态间的依赖关系,通过门控神经网络得出融合权重. 在多模态意图识别数据集MIntRec和多模态情感数据集CMU-MOSI,CMU-MOSEI上的实验结果表明,本文提出的多模态学习方法在多个指标上优于基线方法,证明了该方法的有效性.

    本文的主要贡献包括3个方面:

    1) 提出了一种基于样本内和样本间多模态协同的表示方法,充分学习模态内和模态间的交互,提升多模态特征表示的鲁棒性.

    2) 设计了一种基于注意力机制和门控神经网络的自适应的多模态特征融合方法,降低噪声数据对多模态融合过程的干扰.

    3) 在多模态意图识别数据集和情感数据集上对本文提出的方法进行了大量的实验分析,本文方法在多个指标上优于基线方法.

    特征表示一直是机器学习关注的重要问题. 随着深度学习的发展,单模态的特征表示学习取得了很多进展,但由于数据的异构性,多模态表示学习一直是个难点问题[7]. 目前,多模态表示学习主要分为联合表示(joint representations)和协同表示(coordinated representations). 联合表示通过神经网络将各模态数据映射到同一个特征空间中,得到统一的特征表示,使得多模态表示学习和多模态融合之间没有明显的界限. 例如,Pham等人[8]利用机器翻译的思想,通过Seq2Seq模型实现不同模态之间的来回转换,把Seq2Seq中间隐含层的输出作为多模态的联合表示;Wang等人[9]提出一种通过门控模态混合网络实现文本和非文本特征联合表示的方法. 协同表示分别映射每种模态的数据到各自的特征空间,但要保证每种模态的特征空间之间存在一定的约束. 例如,Mai等人[10]提出一种基于混合对比学习的多模态协同表示方法,首先通过Transformer提取语音和视觉特征,通过BERT提取文本特征,然后通过模态内对比学习、模态间对比学习和半对比学习对语音特征、视觉特征和文本特征的相似性进行约束;Hazarika等人[3]提出一种多模态协同表示方法MISA,将每种模态投射到2个不同的子空间,第1个子空间是模态不变的,通过相似性进行约束,第2个子空间是模态特有的,通过正交结构进行约束;Huang等人[11]在MISA方法的基础上,通过中心矩差异对模态的特征空间进行约束.MISA是一种有效的多模态协同表示方法,能够很好地学习不同模态的共享特征和特有特征. 然而,MISA仅考虑了样本内的多模态协同约束,未考虑样本间的多模态协同,导致特征表示缺乏鲁棒性,从而影响模型的泛化能力. 因此,在MISA的基础上,本文提出一种基于样本内和样本间多模态协同的表示方法,充分学习模态内和模态间的交互,提升多模态特征表示的鲁棒性.

    多模态融合关注于如何将多模态数据以一定的架构和方法进行融合,共同贡献于解决目标任务[12-13],多模态融合主要分为模型无关和基于模型2类方法[14]. 模型无关的方法主要分为特征层融合和决策层融合. 特征层融合实现了不同模态间的底层交互,常用的融合方式有拼接、相加和基于张量的方法[15-16];决策层融合可以视为考虑不同模态置信度的集成学习,其优点是能够很好地适应模态缺失的问题[17],但缺乏多模态数据的底层交互,常用的融合机制有加权、投票和学习等方式. 基于模型的融合方法主要有基于内核的方法、基于概率图模型的方法和基于神经网络的方法[18-20]. 目前,基于神经网络的多模态融合方法已经成为主流[21],例如:Liang等人[22]提出一种循环多级融合网络RMFN,将融合问题分解为多个阶段,每个阶段专注于多模态数据的一个子集;Tsai等人[23]提出一种多模态Transformer架构,通过跨模态注意力机制融合多模态信息;Mou等人[24]提出一种基于注意力的卷积神经网络(convolutional neural networks,CNN)和长短期记忆网络(long short-term memory,LSTM)联合的多模态融合方法;Rahman等人[25]为了在大规模预训练语言模型中融合其他模态信息,在BERT 和 XLNet网络中设计了一个多模态适应门,允许BERT和XLNet在微调期间接受多模态非语言数据. 通过研究发现,目前大部分多模态融合方法没有区分模态间可能存在的主次关系,并且没有考虑数据中可能存在的噪声,导致模型对噪声数据敏感. 因此,鉴于每种模态在不同时刻可能呈现不同作用类型和噪声级别的特性,本文设计一种基于注意力机制和门控神经网络的融合方法,以实现对多模态特征的自适应融合.

    本文方法主要面向于文本特征为主、语音和视觉特征为辅的多模态自然语言理解任务,例如多模态情感分类和多模态意图识别. 给定一个数据集D={s1,s2,,sn},其中包含n个样本. 每个样本si都包含一段视频v、语音a、文本t和标签y. 我们的任务是学习一个模型f(t,v,a)y,输入样本si的文本信息t、视频信息v和语音信息a,正确输出样本si的标签信息y. 本文提出的基于样本内外协同表示和自适应融合的多模态学习方法CoAdMu,其架构如图1所示,主要包括初始特征提取、多模态表示、多模态融合和结果预测4个部分.

    图  1  CoAdMu的架构
    Figure  1.  Architecture of CoAdMu

    预训练语言模型能够很好地提取文本语义特征,已经成为自然语言处理任务的标配模块. 预训练语言模型BERT 基于Transformer的双向Encoder结构,采用Self-attention提高了模型的学习能力和并行计算效率. 为了获取句子级别的语义特征,BERT联合了Masked LM(masked language model)和 NSP(next sentence prediction)这2类任务进行训练.BERT 相比于 Word2vec,一方面考虑了上下文语境,解决了一词多义的问题;另一方面,通过分层学习得到不同层次的语义特征,为下游任务提供了丰富的特征选择. 基于BERT预训练模型,下游任务可以进行微调,在少量训练样本的情况下就能实现不错的分类效果. 所以,本文利用BERT最后隐藏层的输出 {{\boldsymbol{z}}^t} \in {\mathbb{R}^{{l_t} \times {F_t}}} 作为文本初始特征表示,{l_t}为文本序列长度,{F_t}为特征维度.

    近年来,受大规模预训练语言模型在自然语言理解任务上大获成功的影响,语音预训练模型成为研究的热点,出现了许多经典的模型. 例如Wav2vec 2.0 [26],HuBERT [27] 和 WavLM[28]等,通过在上万小时的无标注语音数据上进行自监督学习,显著提升了自动语音识别(automatic speech recognition,ASR)、语音合成(text-to-speech,TTS)和语音转换(voice conversation,VC)等下游任务的性能.Wav2vec 2.0 是 Meta 在 2020 年发布的无监督语音预训练模型,核心思想是通过向量量化(vector quantization,VQ)构建自监督训练目标,对输入做大量掩码后利用对比学习损失函数进行训练,得到的表征可以代替传统的声学特征. 所以,本文利用预训练的Wav2vec 2.0模型提取语音初始特征,把模型最后隐藏层的输出{{\boldsymbol{z}}^a} \in {\mathbb{R}^{{l_a} \times {F_a}}}作为语音初始特征表示,{l_a}为语音序列长度,{F_a}为特征维度.

    在视频画面中,关键信息是说话人(识别对象)的表情和动作,如果直接从整个画面中抽取特征,可能会因为背景噪声影响效果. 所以本文借鉴文献[29]的思路,对说话人进行检测. 具体流程如图2所示.

    图  2  Speaker detection
    Figure  2.  说话人检测

    首先利用场景检测工具scenedetect 1区分不同的视觉场景,从而得到关键帧;然后,利用基于MS-COCO数据集预训练的Faster R-CNN模型检测每个关键帧中的人物,得到人物边界框;最后,考虑到画面中可能存在多个人物的情况,使用预训练的TalkNet[30]识别说话人,得到说话人边界框. 本文结合说话人边界框B和由Faster R-CNN提取的特征表示f,得到视频初始特征{{\boldsymbol{z}}^v} \in {\mathbb{R}^{{l_v} \times {F_v}}}{l_v} 为关键帧的序列长度,{F_v}为每帧的特征维度,{{\boldsymbol{z}}^v}计算为:

    {{\boldsymbol{z}}^v} = AvgPool(RoIAlign({\boldsymbol{f}},B))\text{,} (1)

    其中RoIAlign表示根据边界框B抽取固定大小的特征图,AvgPool用来固定长宽到统一的大小.

    大部分多模态数据存在互补性和一致性. 例如,人在表达情感或意图时,表情、语音和语言具有共同的动机和目标,说明模态间具有一致性的共享特征. 同时,表情、语音和语言又分别具备特有的情感、语气和语义,说明模态间具有互补性的特有特征. 所以,本文设计模态特定和模态共用的2类编码器,分别学习文本、语音、视频的特有特征和共享特征,为多模态学习提供一个全面的表征视图. 文本、语音和视频的初始特征{{\boldsymbol{z}}^t}{{\boldsymbol{z}}^a}{{\boldsymbol{z}}^v}输入编码器之前,先进行L2归一化,再通过不同的Transformer进行预处理,然后对Transformer的输出序列进行累加求平均,分别得到{{\boldsymbol{u}}^t} \in {\mathbb{R}^{{d_{\text{t}}}}}{{\boldsymbol{u}}^a} \in {\mathbb{R}^{{d_{\text{t}}}}}{{\boldsymbol{u}}^v} \in {\mathbb{R}^{{d_{\text{t}}}}}{d_{\text{t}}}为Transformer的最后一层前馈神经网络的输出维度.

    1)共享特征表示. 为了学习不同模态的共享特征表示,构建一个模态共用的编码器{E_{\text{c}}}({{\boldsymbol{u}}^{(t,v,a)}};{\theta _{\text{c}}}),把文本特征 {{\boldsymbol{u}}^t} 、视觉特征{{\boldsymbol{u}}^v}和语音特征{{\boldsymbol{u}}^a}映射到同一个特征空间,分别得到文本、视频和语音的共享特征{\boldsymbol{h}}_{\text{c}}^t \in {\mathbb{R}^{{d_{\text{c}}}}}{\boldsymbol{h}}_{\text{c}}^v \in {\mathbb{R}^{{d_{\text{c}}}}}{\boldsymbol{h}}_{\text{c}}^a \in {\mathbb{R}^{{d_{\text{c}}}}},如式(2)~(4)所示,其中{\theta _{\text{c}}} {d_{\text{c}}} 分别为共用编码器的参数和输出维度.

    {\boldsymbol{h}}_{\text{c}}^t = {E_{\text{c}}}({{\boldsymbol{u}}^t};{\theta _{\text{c}}})\text{,} (2)
    {\boldsymbol{h}}_{\text{c}}^v = {E_{\text{c}}}({{\boldsymbol{u}}^v};{\theta _{\text{c}}})\text{,} (3)
    {\boldsymbol{h}}_{\text{c}}^a = {E_{\text{c}}}({{\boldsymbol{u}}^a};{\theta _{\text{c}}}) . (4)

    2)特有特征表示. 为了学习不同模态的特有特征表示,分别为文本、语音、视频构建一个特定的编码器 {E_{\text{p}}}({{\boldsymbol{u}}^t};\theta _{\text{p}}^t) {E_{\text{p}}}({{\boldsymbol{u}}^a};\theta _{\text{p}}^a) {E_{\text{p}}}({{\boldsymbol{u}}^v};\theta _{\text{p}}^v) ,把文本特征 {{\boldsymbol{u}}^t} 、语音特征{{\boldsymbol{u}}^a}和视觉特征{{\boldsymbol{u}}^v}映射到不同的特征空间,分别得到文本、语音和视频的特有特征{\boldsymbol{h}}_{\text{p}}^t \in {\mathbb{R}^{{d_{\text{p}}}}}{\boldsymbol{h}}_{\text{p}}^a \in {\mathbb{R}^{{d_{\text{p}}}}}{\boldsymbol{h}}_{\text{p}}^v \in {\mathbb{R}^{{d_{\text{p}}}}},如式(5)~(7)所示,其中\theta _{\text{p}}^t\theta _{\text{p}}^a\theta _{\text{p}}^v为特定编码器的参数,{d_{\text{p}}}为特定编码器的输出维度,输出维度和共用编码器的一致.

    {\boldsymbol{h}}_{\text{p}}^t = {E_{\text{p}}}({{\boldsymbol{u}}^t};\theta _{\text{p}}^t)\text{,} (5)
    {\boldsymbol{h}}_{\text{p}}^a = {E_{\text{p}}}({{\boldsymbol{u}}^a};\theta _{\text{p}}^a)\text{,} (6)
    {\boldsymbol{h}}_{\text{p}}^v = {E_{\text{p}}}({{\boldsymbol{u}}^v};\theta _{\text{p}}^v). (7)

    1)样本内协同损失函数

    在同一个样本内,需要保证不同模态的共享特征具有相似性和特有特征具有差异性,同一模态的共享特征和特有特征具有差异性. 本文利用中心矩差异(central moment discrepancy,CMD)和正交性衡量特征之间的相似性和差异性. CMD通过匹配2个表示的顺序矩差来计算它们之间的差异,相比于KL散度包含了高阶矩信息,相比于最大平均差异(maximum mean discrepancy,MMD)则减少了计算量,因为不需要计算核矩阵. 令 \tilde X \tilde Y 为区间[a, b]N上分别具有概率分布 pq 的有界随机样本,中心矩差异正则化项CMDK被定义为CMD的经验估计,其计算如式(8)所示:

    \begin{split} CM{D}_{K}(\tilde X,\tilde Y)=&\frac{1}{\left|b-a\right|}{\Vert E(\tilde X)-E(\tilde Y)\Vert }_{2}+\\ &{\displaystyle \sum _{k=2}^{K}\frac{1}{{\left|b-a\right|}^{k}}{\Vert {C}_{k}(\tilde X)-{C}_{k}(\tilde Y)\Vert }_{2}}\text{,}\end{split} (8)

    其中E(\tilde X) = \dfrac{1}{{\left| \tilde X \right|}}\displaystyle\sum\limits_{x \in X} x 表示样本\tilde X 的经验期望向量, {C_k}(\tilde X) = E\left( {\prod\limits_{i = 1}^N {{{({x_i} - E(\tilde X))}^k}} } \right) 表示\tilde X k阶样本中心距向量. 直观上理解,如果样本\tilde X \tilde Y 的概率分布越相似,那么它们的每阶中心距也越相近,CMD值越小. 利用CMD构建共享特征相似度损失函数,如式(9)所示;利用正交性约束构建特有特征差异性损失函数,如式(10)所示;样本内多模态协同的总损失函数如式(11)所示.

    \begin{split} L_{{{\rm{intra}}}}^{{\rm{sim}}} = \dfrac{1}{3}\displaystyle\sum\limits_{\scriptstyle({m_1},{m_2}) \in \atop {\scriptstyle\{ (t,a),(t,v),\atop \scriptstyle(a,v)\} }} {CM{D_K}({\boldsymbol{h}}_{\rm{c}}^{{m_1}},{\boldsymbol{h}}_{\rm{c}}^{{m_2}})} \end{split} , (9)
    \begin{split} L_{{\rm{intra}}}^{{\rm{diff}}} = \frac{1}{6}\left(\sum\limits_{m \in \{ t,a,v\} } {\cos ({\boldsymbol{h}}_{\rm{p}}^m,{\boldsymbol{h}}_{\rm{c}}^m)} + \sum\limits_{\scriptstyle({m_1},{m_2}) \in \atop {\scriptstyle\{ (t,a),(t,v),\atop \scriptstyle(a,v)\} }} {\cos ({\boldsymbol{h}}_{\rm{p}}^{{m_1}},{\boldsymbol{h}}_{\rm{p}}^{{m_2}})} \right) \end{split}, (10)
    {L_{{\text{intra}}}} = L_{{\text{intra}}}^{{\text{sim}}} + L_{{\text{intra}}}^{{\text{diff}}} \text{,} (11)

    其中tav分别表示文本、语音和视频, {\boldsymbol{h}}_{\text{c}}^m {\boldsymbol{h}}_{\text{p}}^m 分别表示模态m的共享特征和特有特征. {\boldsymbol{h}}_{\text{c}}^{{m_1}} {\boldsymbol{h}}_{\text{c}}^{{m_2}} 越相似 L_{{{\rm{intra}}}}^{{\rm{sim}}} 值越小,{\boldsymbol{h}}_{\text{p}}^m{\boldsymbol{h}}_{\text{c}}^m{\boldsymbol{h}}_{\text{p}}^{{m_1}}{\boldsymbol{h}}_{\text{p}}^{{m_2}}相差越大 L_{{\text{intra}}}^{{\text{diff}}} 值越小.

    2)样本间协同损失函数

    在不同样本间,需要保证同类别样本的特征具有相似性和不同类别样本的特征具有差异性. 借鉴对比学习的思路,在一组样本中随机选择一个样本作为锚点样本s,与s类别相同的N个样本作为正样本pos,与s类别不同的M个样本作为负样本neg. 基于CMD,构建如式(12)所示的样本间多模态协同的损失函数:

    \begin{split}{L}_{\text{inter}}=&\frac{1}{6}{\displaystyle \sum _{n\in \{\text{c},\text{p}\}}{\displaystyle \sum _{m\in \{t,a,v\}}(\frac{1}{N}{\displaystyle \sum _{i=1}^{N}CM{D}_{K}(s({{\boldsymbol{h}}}_{n}^{m}),po{s}_{i}({{\boldsymbol{h}}}_{n}^{m}))}}} -\\ &\frac{1}{M}{\displaystyle \sum _{j=1}^{M}CM{D}_{K}(s({{\boldsymbol{h}}}_{n}^{m}),ne{g}_{j}({{\boldsymbol{h}}}_{n}^{m}))}),\end{split} (12)

    其中c和p分别为共享和特有特征的标识,tav分别表示文本、语音和视频, s({\boldsymbol{h}}_n^m) po{s_i}({\boldsymbol{h}}_n^m) ne{g_j}({\boldsymbol{h}}_n^m) 分别表示锚点样本s、正样本i、负样本jm(文本、语音和视频)模态的 n (共享、特有)特征的表示. 正样本i和锚点样本s越相似、负样本j和锚点样本s差异性越大,损失函数 {L_{{{\text{inter}}}}} 值越小.

    3)样本重构损失函数

    为了保证由编码器得到的共享特征和特有特征保留了初始特征空间的相关性质,设计一个解码器 D({\boldsymbol{h}}_{\text{c}}^m,{\boldsymbol{h}}_{\text{p}}^m;{\theta _{\text{d}}}) ,输入模态m的共享特征 {\boldsymbol{h}}_{\text{c}}^m 和特有特征 {\boldsymbol{h}}_{\text{p}}^m ,希望输出能够重构该模态的初始特征. 本文使用均方误差(mean squared error, MSE)衡量重构误差,计算如式(13)所示:

    {L}_{\text{recon}}=\frac{1}{3}{\displaystyle \sum _{m\in \{t,a,v\}}{\Vert {{\boldsymbol{u}}}^{m}-D({{\boldsymbol{h}}}_{\text{c}}^{m},{{\boldsymbol{h}}}_{\text{p}}^{m})\Vert }_{2}}+\frac{\lambda }{2}{\Vert {\theta }_{\text{d}}\Vert }_{2} \text{,} (13)

    其中{{\boldsymbol{u}}^m}表示模态m的初始特征表示, D({{\boldsymbol{h}}}_{\text{c}}^{m},{{\boldsymbol{h}}}_{\text{p}}^{m}) 为解码器的输出, {\theta _{\text{d}}} 为解码器的参数, \dfrac{\lambda }{2}{\left\| {{\theta _{\text{d}}}} \right\|_2} 为正则化项,用于防止过拟合.

    在多模态自然语言分析任务中,文本为主要特征,语音和视频为辅助特征,并且在某些时刻语音和视频包含噪声数据,对结果的判断起到干扰作用. 因此,本文设计一种基于注意力机制和门控神经网络的自适应融合方法.

    对每个模态的共享特征和特有特征进行拼接,输入Self-attention中,捕获共享特征和特有特征的相关性,得到单模态融合特征. Self-attention是Transformer的核心组件,相比 RNN 网络结构,其最大的优点是可以实现并行计算和长距离依赖. 其计算流程如图3所示.

    图  3  Self-attention计算流程图
    Figure  3.  Self-attention calculation process

    计算形式如式(14)所示:

    SA({\boldsymbol{X}}) = {softmax} \left(\frac{{({{\boldsymbol{W}}^{\text{q}}}{\boldsymbol{X}}){{({{\boldsymbol{W}}^{\text{k}}}{\boldsymbol{X}})}^{\text{T}}}}}{{\sqrt {{d_{\text{k}}}} }}\right)\left({{\boldsymbol{W}}^{\text{v}}}{\boldsymbol{X}}\right) \text{,} (14)

    其中 {\boldsymbol{Q}} = {{\boldsymbol{W}}^{\text{q}}}{\boldsymbol{X}} {\boldsymbol{K}} = {{\boldsymbol{W}}^{\text{k}}}{\boldsymbol{X}} {\boldsymbol{V}} = {{\boldsymbol{W}}^{\text{v}}}{\boldsymbol{X}} 分别为Query,Key,Value矩阵, {{\boldsymbol{W}}^{\text{q}}} {{\boldsymbol{W}}^{\text{k}}} {{\boldsymbol{W}}^{\text{v}}} 为需要学习的权重矩阵. {d_{\text{k}}} 为 Key的维度,除以 \sqrt {{d_{\text{k}}}} 的目的是在反向传播时梯度更加稳定.Self-attention的 Query,Key,Value来自于同一个输入序列X. 分别对文本、语音和视频的共享特征和特有特征进行拼接{\boldsymbol{X}} = Concat({\boldsymbol{h}}_{\text{c}}^m,{\boldsymbol{h}}_{\text{p}}^m),输入Self-attention中得到单模态融合特征 {{\boldsymbol{h}}^t} \in {\mathbb{R}^{{d_{\text{v}}}}} {{\boldsymbol{h}}^a} \in {\mathbb{R}^{{d_{\text{v}}}}} {{\boldsymbol{h}}^v} \in {\mathbb{R}^{{d_{\text{v}}}}} {d_{\text{v}}}为Value的维度.

    得到单模态的融合特征后,基于Cross-attention分别计算文本与视频的关联特征 CA(t,v) 和文本与语音的关联特征 CA(t,a) . 不同于Self-attention,Cross-attention的Query,Key,Value的输入来自于2个不同的序列XYX作为Query的输入,而Y作为Key和Value的输入.Cross-attention的计算流程如图4所示.

    图  4  Cross-attention计算流程图
    Figure  4.  Cross-attention calculation process

    计算形式如式(15)所示:

    CA({\boldsymbol{X}},{\boldsymbol{Y}}) = {softmax} \left(\frac{{({{\boldsymbol{W}}^{\text{q}}}{\boldsymbol{X}}){{({{\boldsymbol{W}}^{\text{k}}}{\boldsymbol{Y}})}^{\text{T}}}}}{{\sqrt {{d_{\text{k}}}} }}\right)({{\boldsymbol{W}}^{\text{v}}}{\boldsymbol{Y}}) . (15)

    然后,把 CA(t,v) CA(t,a) 分别输入视觉门控神经单元和语音门控神经单元,得到视觉特征融合权重 {w^v} 和语音特征融合权重 {w^a} . 最后,根据权重融合视觉特征{{\boldsymbol{h}}^v}、语音特征{{\boldsymbol{h}}^a}和文本特征{{\boldsymbol{h}}^t},得到最终的多模态融合特征h,如式(16)所示:

    {\boldsymbol{h}} = {{\boldsymbol{h}}^t} + {w^v}{{\boldsymbol{h}}^v} + {w^a}{{\boldsymbol{h}}^a}. (16)

    直观上理解, {w^v} {w^a} 根据模态间的深层关系得到,当视觉特征和语音特征能辅助文本特征做决策时,则增加融合权重,反之则减少. 这种融合方式,一方面体现了文本特征为主、语音和视觉特征为辅的先验;另一方面,实现了自适应的融合,有效降低了语音和视频中可能存在的噪声干扰.

    把多模态融合特征h输入多层全连接神经网络中进行分类或回归任务. 分类任务使用交叉熵损失,回归任务使用均方误差损失,如式(17)所示:

    {L}_{\text{task}}=\left\{\begin{aligned} &-\frac{1}{N}{\displaystyle \sum _{i=1}^{N}{y}_{i}\mathrm{ln}({\widehat{y}}_{i})}+\frac{\lambda }{2}{\Vert {\boldsymbol{W}}\Vert }_{2}\text{,}\quad 分类\text{,}\\ &-\frac{1}{N}{\displaystyle \sum _{i=1}^{N}{\Vert {y}_{i}-{\widehat{y}}_{i}\Vert }_{2}}+\frac{\lambda }{2}{\Vert {\boldsymbol{W}}\Vert }_{2}\text{,}\quad 回归\text{,}\end{aligned}\right. (17)

    其中N是训练样本数量,{y_i}{\widehat y_i}分别代表样本i的真实值和预测值,\dfrac{\lambda }{2}{\left\| {\boldsymbol{W}} \right\|_2}为L2正则化,以降低模型的过拟合程度. 为了实现多模态表示、融合和预测端到端的训练,本文对多模态表示学习损失 {L_{{\text{intra}}}} {L_{{\text{inter}}}} {L_{{\text{recon}}}}和预测结果损失{L_{{\text{task}}}}进行联合优化,最终优化目标如式(18)所示,其中\alpha \beta \gamma 是权重.

    L = {L_{{\text{task}}}} + \frac{1}{N}\sum\limits_{i = 1}^N {(\alpha L_{{\text{intra}}}^i + \beta L_{{\text{inter}}}^i + \gamma L_{{\text{recon}}}^i)} . (18)

    本文选取多模态意图识别数据集MIntRec 2和多模态情感数据集CMU-MOSI,CMU-MOSEI 3作为实验数据,这3个数据集都包含文本、语音和视频3种模态.MIntRec数据集由清华大学智能技术与系统国家重点实验室提供,原始数据来源于美剧“Superstore”,包含2 224条实例.MIntRec数据集包含“表达情绪或态度”和“实现目标”2个粗粒度类别. “表达情绪或态度”细分为11个意图类别:Complain,Praise,Apologize,Thank,Criticize,Care,Agree,Taunt,Flaunt,Oppose,Joke. “实现目标”细分为9个意图类别:Inform,Advise,Arrange,Introduce,Comfort,Leave,Prevent,Greet,Ask for help. CMU-MOSI和CMU-MOSEI数据集由卡梅隆大学提供,原始数据集来源于YouTube,包含强烈积极(+3)、积极(+2)、弱积极(+1)、中性(0)、弱消极(–1)、消极(–2)、强烈消极(–3)这7种情感类别. CMU-MOSI数据集收录了89位YouTube用户的2 199条视频片段,CMU-MOSEI数据集是CMU-MOSI的扩展版,收录了1 000位YouTube用户的3 228条视频,包括250个主题,共23 453个句子. 训练集、验证集和测试集的划分结果如表1所示.

    表  1  数据集划分结果
    Table  1.  Division Results of Datasets
    数据集训练集验证集测试集
    MIntRec1344455455
    CMU-MOSI1319440440
    CMU-MOSEI1626518694643
    下载: 导出CSV 
    | 显示表格

    在MIntRec数据集上执行20-class分类任务,利用准确率(accuracy,Acc)、宏平均精确度(macro precision,MP)、宏平均召回率(macro recall,MR)和宏平均F1-score(macro F1-score,MF1)作为算法性能评价指标. 在CMU-MOSI和CMU-MOSEI数据集上执行回归和分类任务,回归任务利用平均绝对误差(mean absolute error,MAE)和皮尔逊相关系数(Pearson correlation coefficient,PCC)作为评价指标,分类任务利用二分类准确率(Acc-2)、F1-score和七分类准确率(Acc-7)作为评价指标.Acc,MP,MR,MF1,PCC,F1-score值越大越好,MAE值越低越好. 在以往的研究中,CMU-MOSI和CMU-MOSEI数据集根据情感分数有(负,非负)和(负,正)2种二分类做法.

    在初始特征提取中,分别基于预训练的BERT-base-uncased,Wav2vec 2.0,Faster R-CNN分别提取文本、语音和视觉特征. 在多模态表示中,使用层数为1、多头个数为1的Transformer分别对文本、语音和视觉特征进行预处理,编码器{E_{\text{c}}}({{\boldsymbol{u}}^{(t,v,a)}};{\theta _{\text{c}}}) {E_{\text{p}}}({{\boldsymbol{u}}^t};\theta _{\text{p}}^t) {E_{\text{p}}}({{\boldsymbol{u}}^v};\theta _{\text{p}}^v) {E_{\text{p}}}({{\boldsymbol{u}}^a};\theta _{\text{p}}^a) 和解码器 D({\boldsymbol{h}}_{\text{c}}^m,{\boldsymbol{h}}_{\text{p}}^m;{\theta _{\text{d}}}) 都采用单层全连接神经网络. 在多模态融合中,Self-attention和Cross-attention采用的层数和多头个数都为1.在结果预测中,采用2层的全连接神经网络. 整体来说,考虑到实验数据集相对较小,没有采用较为深层的网络架构. 其他超参数如表2所示. 为了减少式(18)中超参数\alpha \beta \gamma 的搜索时间,本文采用了一种次优网格搜索方法,具体内容见3.2.1节.

    表  2  超参数设置
    Table  2.  Hyperparameters Setting
    参数类型 参数 参数值
    模型参数 文本的最大序列长度{l_t} 30
    语音的最大序列长度 {l_a} 230
    视频的最大序列长度{l_v} 480
    文本特征维度{F_t} 768
    语音特征维度{F_a} 256
    视觉特征维度{F_v} 768
    {L_{{\text{intra}}}}的权重α 0.7
    {L_{{\text{inter}}}}的权重β 0.7
    {L_{{\text{recon}}}}的权重γ 0.6
    中心矩差异CMDK 的阶数K 5
    全连接神经网络的隐藏层大小 256
    训练参数 学习率 3E–5
    正则化参数 1E–6
    最大训练轮次 20
    停止训练的等待次数 6
    批量训练的batch size 8
    Dropout比例 0.1
    优化器Optimizer Adam
    下载: 导出CSV 
    | 显示表格

    {L_{{\text{intra}}}} {L_{{\text{inter}}}} {L_{{\text{recon}}}}的权重值\alpha \beta \gamma 是重要的超参数. 我们设定这些参数的搜索空间为{0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}. 然而,我们没有对\alpha \beta \gamma 同时建立网格,而是先固定其中2个参数,只对其中1个参数进行搜索,虽然这种网格搜索方式可能得不到最佳的参数组合,但可以极大地减少搜索的时间消耗. 为了提升模型的泛化能力,我们并没有针对不同的数据集选择不同的参数组合. 相反,我们选择了在MIntRec,CMU-MOSI,CMU-MOSEI这3个数据上平均准确率最高的参数组合. 这样的做法旨在确保模型在不同数据集上都能取得较好的性能,而不仅仅局限于某个特定数据集. 实验结果如图5所示.

    图  5  超参数搜索
    Figure  5.  Hyperparameter search

    首先,我们将\beta \gamma 固定为0.5,\alpha =0.7时模型表现最佳;然后,我们将\alpha 固定为0.7,\gamma 固定为0.5,\beta =0.7时模型表现最佳;最后,我们将\alpha \beta 固定为0.7,\gamma =0.6时模型的性能最佳. 所以,最终选择\alpha =0.7,\beta =0.7,\gamma =0.6.从图5看出,模型对重构误差{L_{{\text{recon}}}}的权重\gamma 更加敏感.

    1)多模态情感分析任务的实验对比

    为了验证本文提出的CoAdMu方法的有效性,选择以下多模态学习方法作为基线,对比其在多模态情感分析任务中的性能.

    ①TFN[15]. 一种基于张量的多模态融合方法,对提取的语言特征、视觉特征和语音特征做外积,得到融合的向量.

    ②LMF[16]. 通过将张量和权重并行分解,利用模态特定的低阶因子来执行多模态融合,避免计算高维的张量.

    ③MFM[7]. 通过模态分解将多模态表征分解为多模态判别因子和特定模态生成因子,多模态判别因子在所有模态之间共享,特定模态生成因子对于每个模态都是唯一的.

    ④RMFN[22]. 一种基于循环多阶段融合网络的多模态融合方法,将融合分解成前后关联的多个阶段.

    ⑤CIA[31]. 采用自编码器学习模态之间的交互关系,并利用上下文感知注意力学习相邻话语间的关系.

    ⑥MCTN[8]. 通过Seq2Seq模型实现不同模态之间的来回转换,得到多模态间的联合表示.

    ⑦RAVEN[9]. 通过视觉特征和语音特征动态调整文本中词嵌入,实现文本和非文本特征的联合表示.

    ⑧MulT[23]. 利用跨模态 Transformer 将源模态转换为目标模态来学习多模态表示.

    ⑨ICCN[6]. 使用语音-文本和视频-文本的特征外积和深度典型相关分析来生成多模态特征表示.

    ⑩MISA[3]. 将每个模态投射到2个不同的子空间中,分别学习共享特征和特有特征,但该方法只考虑了单个样本内的多模态协同.

    ⑪MAG-BERT[25]. 通过多模态适应门,允许 BERT 在微调期间接受多模态非语言数据,使得语言模型BERT有效利用了语音和视觉模态的信息.

    ⑫QMF[32]. 利用量子理论中的叠加和纠缠来表述单模态和跨模态的相互作用,提高多模态融合的可解释性.

    ⑬HyCon[10]. 通过联合模态内对比学习、模态间对比学习和半对比学习实现多模态表示.

    ⑭EMFRM[11]. 在MISA方法的基础上,通过中心矩差异对模态的特征空间进行约束,但该方法也只考虑了单个样本内的多模态协同.

    表3表4分别是在多模态情感数据集CMU-MOSI和CMU-MOSEI上的对比结果. 大部分基于表示学习的多模态方法的性能优于基于张量融合的多模态方法,因为基于张量融合的方法计算维度呈指数级增长,导致计算效率差,需要大量的训练数据才能学到模态间的交互. 表示学习方法一般基于对多模态数据的先验知识,例如多模态数据的一致性和互补性,构建表示学习模型,降低了学习的复杂度. 在表示学习方法中,基于协同表示的多模态方法的性能优于大部分基于联合表示的方法,因为协同表示方法把多模态信息映射到不同的特征空间,相比于映射到同一个空间的联合表示更好地保留了模态的特有特征. 联合表示方法MAG-BERT能获得相对较好的性能,主要是因为其借助了预训练语言模型BERT强大的语义学习能力,巧妙地把语音和视觉信息集成到了BERT之中.QMF方法利用量子理论中的叠加和纠缠来表述单模态和跨模态的交互,虽然方法性能没有得到很大的提升,但提高了多模态融合的可解释性. 本文提出的CoAdMu方法在CMU-MOSI和CMU-MOSEI这2个数据集上,比最先进的基线方法在所有的评价指标都有一定程度的提升,证明了本文方法的有效性.

    表  3  在CMU-MOSI数据集上与基线的对比
    Table  3.  Comparison with Baselines on CMU-MOSI Dataset
    方法 MAE PCC Acc-2/% F1-score/% Acc-7/%
    TFN 0.970 0.633 73.9/– 73.4/– 32.1
    LMF 0.912 0.668 76.4/– 75.7/– 32.8
    MFM 0.951 0.662 78.1/– 78.1/– 36.2
    RMFN 0.922 0.681 78.4/– 78.0/– 38.3
    CIA 0.914 0.689 79.9/– 79.5/– 38.9
    MCTN 0.909 0.676 79.3/– 79.1/– 35.6
    RAVEN 0.915 0.691 78.0/– 76.6/– 33.2
    MulT 0.871 0.698 –/83.0 –/82.8 40.0
    ICCN 0.862 0.714 –/83.0 –/83.0 39.0
    MISA 0.783 0.761 81.8/83.4 81.7/83.6 42.3
    MAG-BERT 0.790 0.769 82.2/83.5 82.6/83.5 42.9
    QMF 0.915 0.696 –/79.7 –/79.6 33.5
    HyCon 0.713 0.790 –/85.2 –/85.1 46.6
    EMRFM 0.722 0.785 –/84.7 –/84.8 46.1
    CoAdMu(本文) 0.711 0.798 84.1/86.1 84.0/86.1 47.2
    SOTA ↓0.002 ↑0.008 ↑1.9/↑0.9 ↑1.4/↑1.0 ↑0.6
    注:SOTA表示本文方法和最先进的方法对比,↓表示下降,↑表示提升,–/–的左右侧分别代表(负,非负)和(负,正)的结果. 黑体数值表示最优值.
    下载: 导出CSV 
    | 显示表格
    表  4  在CMU-MOSEI数据集上与基线的对比
    Table  4.  Comparison with Baselines on CMU-MOSEI Dataset
    方法 MAE PCC Acc-2/% F1-score/% Acc-7/%
    TFN 0.610 0.671 79.4/– 79.7/– 49.8
    LMF 0.608 0.677 80.6/– 81.0/– 50.0
    MFM 0.602 0.692 81.1/– 81.6/– 50.7
    RMFN 0.604 0.685 80.9/– 81.2/– 50.5
    CIA 0.680 0.590 80.4/– 78.2/– 50.1
    MCTN 0.609 0.670 79.8/– 80.6/– 49.6
    RAVEN 0.614 0.662 79.1/– 79.5/– 50.0
    MulT 0.580 0.703 –/82.5 –/82.3 51.8
    ICCN 0.565 0.713 –/84.2 –/84.2 51.6
    MISA 0.555 0.756 83.6/85.5 83.8/85.3 52.2
    MAG-BERT 0.602 0.778 83.1/85.0 83.2/85.0 51.9
    QMF 0.640 0.658 –/80.7 –/79.8 47.9
    HyCon 0.601 0.776 –/85.4 –/85.6 52.8
    EMRFM 0.600 0.775 –/85.2 –/85.3 52.3
    CoAdMu(本文) 0.550 0.791 84.2/86.5 84.6/86.7 53.6
    SOTA ↓0.005 ↑0.013 ↑0.6/↑1.0 ↑0.8/↑1.1 ↑0.8
    注:SOTA表示本文方法和最先进的方法对比,↓表示下降,↑表示提升,–/–的左右侧分别代表(负,非负)和(负,正)的结果. 黑体数值表示最优值.
    下载: 导出CSV 
    | 显示表格

    2)多模态意图识别任务的实验对比

    为了验证CoAdMu方法在复杂多模态场景下的学习能力,本文在真实世界多模态意图识别的基准数据集MIntRec上,实施进一步的实验对比. 一方面,MIntRec原始数据来源于真实世界的影视片段,具有丰富的人物角色和故事情节,以及复杂的场景画面;另一方面,MIntRec包含了更为细粒度的20个意图类别,囊括了表达情绪和态度、实现目标. 本文挑选MulT,MISA,MAG-BERT,HyCon这4个先进的多模态学习方法作为基线. 整体实验结果对比如表5所示,每个类别的F1-score如表6表7所示.

    表  5  在MIntRec数据集上与基线的对比
    Table  5.  Comparison with Baselines on MIntRec Dataset %
    方法 Acc MP MR MF1
    MulT 71.24 67.53 68.15 67.58
    MISA 71.91 69.98 68.91 68.92
    MAG-BERT 71.01 68.15 65.83 66.09
    HyCon 71.33 68.93 65.21 66.37
    CoAdMu(本文) 73.26 72.45 71.26 71.14
    SOTA ↑1.35 ↑2.47 ↑2.35 ↑2.22
    注:SOTA表示本文方法和最先进的方法对比,↓表示下降,↑表示提升. 黑体数值表示最优值.
    下载: 导出CSV 
    | 显示表格
    表  6  “表达情绪或态度”中每个细粒度意图类别的F1-score
    Table  6.  F1-score for Each Fine-grained Intent Category in “Express Emotions and Attitudes” %
    方法 Complain Praise Apologize Thank Criticize Care Agree Taunt Flaunt Joke Oppose
    MulT 67.26 87.36 98.11 95.83 48.00 86.49 91.67 9.52 36.36 50.00 35.29
    MISA 62.14 86.67 98.11 98.04 47.06 81.82 100.00 25.00 50.00 37.50 27.27
    MAG-BERT 66.09 90.24 98.18 98.04 40.00 85.71 95.65 9.09 15.38 40.00 40.00
    HyCon 66.67 93.83 98.11 98.11 48.89 94.74 95.65 10.00 23.53 28.57 38.10
    CoAdMu(本文) 64.08 90.24 96.30 94.34 60.87 91.89 96.00 28.57 44.44 40.00 34.78
    注:黑体数值表示最优值.
    下载: 导出CSV 
    | 显示表格
    表  7  “实现目标”中每个细粒度意图类别的F1-score
    Table  7.  F1-score for Each Fine-grained Intent Category in “Achieve Goals” %
    方法 Comfort Inform Advise Arrange Introduce Leave Prevent Greet Ask for help
    MulT 68.57 69.72 72.00 64.00 60.00 70.27 80.00 91.67 69.57
    MISA 78.79 69.57 70.59 65.00 72.00 75.00 85.71 90.91 57.14
    MAG-BERT 70.00 70.23 60.47 62.22 61.90 75.00 80.00 90.91 72.73
    HyCon 74.29 65.67 72.73 62.50 59.46 68.97 69.23 85.71 72.73
    CoAdMu(本文) 83.33 69.64 77.19 57.78 71.79 83.87 82.76 85.71 70.59
    注:黑体数值表示最优值.
    下载: 导出CSV 
    | 显示表格

    表5中可以发现,CoAdMu方法在所有的评价指标上获得了最好的效果,比最先进的基线方法在Acc,MP,MR,MF1上分别提高了1.35个百分点、2.47个百分点、2.35个百分点、2.22个百分点,提升效果比在多模态情感分析任务上更加明显. 一方面,MIntRec数据集在真实场景下采集,可能存在不同级别的噪声;另一方面,MIntRec数据集中的每种模态在不同时刻可能表现出不同的作用类型. 例如,在表达Agree和Thank这2种意图时的文本具有相对固定的表达方式,语音和视觉特征的作用并不明显. 然而,在表达Taunt和Joke意图时,语音和视频中的语气和表情是很好的补充特征. 基线方法基本上都是“重表示,轻融合”,在表示学习上设计了复杂的方式,而在特征融合上采用简单的拼接方式,没有突出不同特征的作用大小,导致模型对噪声数据敏感.CoAdMu采用协同表示和自适应融合的方式,不仅很好地学习了多模态表示,而且可以根据不同的类别类型、作用大小自动调整特征的融合权重,有效降低了噪声数据的干扰,所以获得了相对较好的效果.

    表6表7发现,同一个方法在不同的意图分类上具有不同的性能,没有哪个方法能够在所有的类别上获得最好的性能.MulT在Complain,Joke,Greet这3个类别上获得了最高评分;MISA在Agree,Flaunt,Arrange,Introduce,Prevent这5个类别上获得了最高评分;MAG-BERT在Apologize,Oppose,Inform,Ask for help这4个类别上获得了最高评分;

    HyCon在Praise,Thank,Care,Advise这4个类别上获得了最高评分;CoAdMu在Criticize,Taunt,Comfort,Leave这4个类别上获得了最高评分. 虽然CoAdMu获得的最高评分总个数不是最多,但平均的F1-score值最大. 通过最高分的分布发现,HyCon擅长于情感表达类的意图识别,MISA擅长于表达态度和实现目标类的意图识别,MulT,MAG-BERT,CoAdMu在不同的任务上表现比较均衡. 所有方法在大部分意图类别上都能获得较好的分类效果,但在Taunt,Flaunt,Joke,Oppose这4个类别上的分类效果不佳,因为这些意图的识别需要结合语言、语气、表情、动作和情景等做深层次的推理,这也说明CoAdMu和基线方法在多模态深层推理任务上还存在不足.

    为了进一步分析不同模块对CoAdMu的贡献,我们设计了11组消融实验方法. 方法①~③是对不同模态的消融;方法④~⑥是对多模态表示模块中相关损失函数的消融;方法⑦去除多模态表示模块,直接把{{\boldsymbol{u}}^t}{{\boldsymbol{u}}^a}{{\boldsymbol{u}}^v}输入多模态融合层;方法⑧采用分段训练方式,首先根据损失函数L = {L_{{\text{intra}}}} + {L_{{\text{inter}}}} + {L_{{\text{recon}}}}对多模态表示模块进行预训练,然后,再根据损失函数{L_{{\text{task}}}}对多模态融合模块和结果预测模块进行训练;方法⑨⑩分别去除多模态特征融合中的视觉门控神经单元和语音门控神经单元;方法⑪去除整个多模态融合模块,采用简单相加的方式进行融合. 实验结果如表8所示.

    表  8  消融实验结果
    Table  8.  Ablation Experiment Results
    方法CMU-MOSICMU-MOSEIMIntRec
    MAEAcc-7/%MAEAcc-7/%Acc/%MF1/%
    CoAdMu(本文)0.71147.20.55053.673.371.1
    ①(–)Text1.37222.60.79024.629.922.8
    ②(–)Video0.78644.70.56150.971.567.4
    ③(–)Audio0.73046.10.55752.073.170.8
    ④(–)Lintra0.79143.90.56849.471.468.9
    ⑤(–)Linter0.73445.80.55951.672.670.5
    ⑥(–)Lrecon0.79843.20.57049.169.567.6
    ⑦(–)MultRe0.80342.60.57548.470.668.5
    ⑧(*)MultRe0.78444.90.56250.971.669.4
    ⑨(–)Gate_V0.80542.30.57248.769.666.7
    ⑩(–)Gate_A0.72846.60.55552.572.670.1
    ⑪(–)MultFu0.80742.00.57848.069.166.3
    下载: 导出CSV 
    | 显示表格

    通过方法①~③的实验结果发现,去除文本对模型性能的影响最大,一方面的原因是文本相比于语音和视频包含了更多的信息量;另一方面得益于大规模预训练语言模型的应用,提取的文本特征的质量远高于语音和视觉特征. 去除视频比去除语音对方法的性能影响更大,这是因为相比于语音,视觉特征和文本特征的冗余性相对较小,可以更好地补充文本特征.

    通过方法④~⑥的实验结果发现,去除任何一个多模态表示学习的损失函数都会降低模型的性能,这是因为样本内的协同损失函数{L_{{\text{intra}}}}保证了共享特征的相似性和特有特征的差异性;样本间的协同损失函数{L_{{\text{inter}}}}保证了同类别样本的特征具有相似性,不同类别样本的特征具有差异性;样本重构损失函数{L_{{\text{recon}}}}使得共享特征和特有特征保留了初始特征空间的相关性质,避免学习到不相干的特征表示. 通过方法⑦的实验结果发现,如果去除多模态表示学习模块,会对CoAdMu的性能造成较大的影响. 这是因为多模态数据存在互补性和一致性,对其共享特征和特有特征分开学习,能提供更加全面的视图. 通过方法⑧的实验结果发现,采用分段训练的方式会降低CoAdMu的性能,因为相比端到端的训练方式,分段训练缺乏灵活性和领域适配能力.

    通过方法⑨~⑪的实验结果发现,去除多模态融合中的视觉门控神经网络、语音门控神经网络或者整个融合模块都会影响CoAdMu的性能,因为语音和视频可能在不同时刻表现出不同的作用类型和不同级别的噪声,门控神经网络可以根据特征对预测结果的作用大小自动分配融合权重,能有效降低噪声的干扰. 相比于语音门控神经网络,视觉门控神经网络起到了更大的作用,这是因为视觉特征相比于语音特征对预测结果起到了更大的作用,方法②③也印证了这一点. 从总体实验结果看,本文设计的每个模块都发挥着各自的作用,去除任何一个模块都会影响方法的性能,证明了CoAdMu设计的合理性.

    为了对预测结果的误差进行详细分析,本文对多模态意图识别的测试结果混淆矩阵进行可视化,如图6所示. 横坐标为预测标签,纵坐标为真实标签,颜色深浅代表预测概率的大小,对角线位置的亮度越高,说明CoAdMu在该类别的精准率越高. 总体上,CoAdMu在大部分意图类别上获得了较高的精准率,例如,在Praise,Apologize,Thank,Agree,Care等类别上获得了90%以上的精准率. 然而,在Taunt,Joke,Oppose这3个类别上表现不佳,因为这些意图需要结合语言、语气、表情、动作和情景等做深层次的推理,有时候连人也无法准确地判断. 从图6也发现,CoAdMu容易把Complain误判成Criticize或Oppose,Criticize误判成 Taunt,Taunt误判成Joke,Joke误判成 Flaunt,Inform误判成 Arrange.这也是容易理解的,因为这些意图类别具有很高的相似性,有时人也会误判. 虽然我们通过样本间的协同,保证同类别样本的特征具有相似性,不同类样本的特征具有差异性,但这些类别的语义十分相似,还是不能很好地将其区分开.

    图  6  混淆矩阵可视化
    Figure  6.  Visualization of confusion matrix

    为了进一步验证本文提出的多模态特征融合方法的有效性,对MIntRec测试集上每个类别的语音和视觉特征的融合权重计算平均值,结果如表9所示. 从表9中可以看出,几乎所有类别的视觉特征都获得了很高的权重值,因为视觉特征可以很好地辅助文本特征,在消融实验的方法②中也印证了这一点. 而对于语音特征,不同的类别具有不同的融合权重值,例如Apologize,Complain,Criticize,Praise,Thank获得了较高的权重值,而Advise,Arrange,Ask for help,Care的权重值比较低. 这是因为相比于后者,前者具有明显的语气特征,能为意图的判断提供帮助. 从这些结果中可以看出,CoAdMu实现了自适应的多模态特征融合,当特征能为决策提供有效信息时则增加融合权重,反之则减少.

    表  9  不同意图类别下的语音和视觉特征融合权重
    Table  9.  Speech and Visual Feature Fusion Weights under Different Intent Categories
    类别语音特征融合权重视觉特征融合权重
    Advise0.170.97
    Agree0.400.98
    Apologize0.930.98
    Arrange0.240.99
    Ask for help0.150.99
    Care0.240.97
    Comfort0.800.99
    Complain0.920.94
    Criticize0.930.98
    Flaunt0.880.92
    Greet0.470.97
    Inform0.730.95
    Introduce0.720.96
    Joke0.850.98
    Leave0.780.96
    Oppose0.500.99
    Praise0.960.68
    Prevent0.520.98
    Taunt0.870.96
    Thank0.980.92
    下载: 导出CSV 
    | 显示表格

    本文从MIntRec测试集中挑选Complain和Inform这2类样本,利用PCA对样本的初始模态特征、共享和特有特征进行降维并可视化,如图7所示.

    图  7  特征分布可视化
    Figure  7.  Feature distribution visualization

    图7(a)是经过Transformer预处理后的文本初始特征{{\boldsymbol{u}}^t}、语音初始特征{{\boldsymbol{u}}^a}和视频初始特征{{\boldsymbol{u}}^v}的分布;图7(b)是只考虑样本内多模态协同的共享特征{\boldsymbol{h}}_{\text{c}}^t{\boldsymbol{h}}_{\text{c}}^a{\boldsymbol{h}}_{\text{c}}^v和特有特征{\boldsymbol{h}}_{\text{p}}^t{\boldsymbol{h}}_{\text{p}}^a{\boldsymbol{h}}_{\text{p}}^v的分布;图7(c)是同时考虑样本内和样本间多模态协同的共享特征{\boldsymbol{h}}_{\text{c}}^t{\boldsymbol{h}}_{\text{c}}^a{\boldsymbol{h}}_{\text{c}}^v和特有特征{\boldsymbol{h}}_{\text{p}}^t{\boldsymbol{h}}_{\text{p}}^a{\boldsymbol{h}}_{\text{p}}^v的分布;图7(d)(e)分别是对图7(c)(b)中视频特有特征{\boldsymbol{h}}_{\text{p}}^v的放大视图.

    图7(a)中可以看出,由于文本、语音和视频的异构性,它们的初始特征空间的分布具有很大的差异性. 从图7(b)(e)中可以看出,只考虑样本内多模态协同,所有样本的共享特征的分布具有相似性,特有特征具有差异性,但不同类别样本的特征没有很好地被区分. 从图7(c)(d)中可以看出,同时考虑样本内和样本间的多模态协同,不仅保证了共享特征的相似性和特有特征的差异性,而且实现了不同类别样本的特征具有一定的差异性.

    多模态表示和融合是多模态机器学习的2个关键任务,针对多模态协同表示时没有考虑样本间协同和多模态融合对噪声数据敏感的问题,本文提出一种基于样本内外协同表示和自适应融合的多模态学习方法. 通过构建模态共用和模态特定编码器,基于样本内和样本间的多模态协同约束,学习模态的共享特征和特有特征. 通过注意力机制和门控神经网络实现多模态特征的自适应融合,有效降低了噪声数据的干扰. 在多模态意图识别和多模态情感分析任务上的实验结果表明,本文方法在多个评价指标上优于基线方法,大量的消融实验分析、误差分析、融合权重分析和特征可视化分析也证明了本文方法的有效性. 然而,在实验中也发现本文方法和目前已有方法在多模态联合的深层次推理任务上还有很大的提升空间,例如讽刺和暗喻识别任务. 在下一步的研究计划中,将设计融合知识的多模态学习方法,提升模型在深层次推理任务上的性能.

    作者贡献声明:黄学坚负责研究方案的构建,并完成实验和撰写论文;马廷淮提出了算法思路和实验方案;王根生提出了指导意见并修改论文.

  • 图  1   本文框架图

    Figure  1.   Our proposed framework diagram

    图  2   越狱攻击示例

    Figure  2.   Example of the jailbreak attack

    图  3   越狱攻击机制

    Figure  3.   Mechanism of jailbreak attacks

    图  4   3种类型的越狱提示

    Figure  4.   Three types of jailbreak prompts

    图  5   上下文攻击与防御

    Figure  5.   In-context attack and defense

    图  6   PAIR攻击图解

    Figure  6.   Schematic of PAIR attack

    图  7   大语言模型在线对话系统中可能的防御措施

    Figure  7.   Possible defensive measures in online LLM chat system

    图  8   GCG针对GPT-3.5生成的对抗性提示

    Figure  8.   Adversarial prompt for GPT-3.5 generated by GCG

    图  9   基于检测与基于抑制的防御

    Figure  9.   Detection-based and mitigation-based defenses

    表  1   3种越狱攻击的对比

    Table  1   Comparison of Three Jailbreak Attacks

    攻击威胁模型提示可读性是否自动化
    基于人工设计的攻击黑盒
    基于模型生成的攻击黑盒
    基于对抗性优化的攻击白盒或黑盒
    下载: 导出CSV

    表  2   基于人工设计的越狱攻击总结

    Table  2   Summary of Manually Designed Jailbreak Attacks

    分类 攻击方法 是否基于
    越狱提示
    攻击原理
    早期攻击 前缀注入[21] 目标竞争
    拒绝抑制[21] 目标竞争
    风格注入[21] 目标竞争
    base64编码[21] 不匹配的泛化
    基于虚构场
    景的攻击
    伪装[22] 角色赋予与模拟场景
    注意力转移[22] 改变上下文与任务
    权限提升[22] 虚构高权限场景
    Deep Inception[47] 虚构多层场景
    基于上下文
    学习的攻击
    ICA[48] 利用模型的上下文学习能力
    多步越狱[49] 利用模型的上下文学习能力
    基于生成策
    略的攻击
    生成利用[50] 调整生成超参数以破坏对齐
    基于编码与
    翻译的攻击
    低资源语言[51] 不匹配的泛化
    CipherChat[52] 不匹配的泛化
    下载: 导出CSV

    表  3   基于大语言模型生成的越狱攻击总结

    Table  3   Summary of LLM-generated Jailbreak Attacks

    分类 攻击方法 助手模型的作用 攻击原理
    基于迭代优化的攻击 PAIR[53] 生成并优化提示 利用助手模型多次修改以优化原始提示
    基于模块化生成的攻击 PMA[54] 组合并生成提示 利用助手模型组合多个提示模块,以针对性地生成基于角色扮演的越狱提示
    PAP[55] 生成部分提示 利用助手模型生成说服目标模型的文本
    基于模糊测试的攻击 FuzzLLM[56] 创造原始提示的变体 令模型组合原始提示,通过自我指导改写提示,增加提示数量
    GPTFUZZER[58] 创造原始提示的变体 利用模型对原始提示进行多种操作,以增加提示数量,追求多样性与有效性
    基于防御分析的攻击 MasterKey[60] 生成越狱提示 对攻击目标的外部防御措施进行基于时间的分析;在越狱数据集上微调
    助手模型使其能够生成更有效的越狱提示
    下载: 导出CSV

    表  4   基于对抗性优化的越狱攻击总结

    Table  4   Summary of Adversarial Optimization-Based Jailbreak Attacks

    分类 攻击方法 提示可读性 攻击特点
    早期方法 AutoPrompt[76] 基线对抗性攻击方法
    GBDA[78] 基线对抗性攻击方法
    UTSC[74] 诱发对话模型毒性的同时保持提示流畅性
    白盒场景 ARCA[81] 面向大语言模型的基线攻击方法
    GCG[46] 通用且可转移的对抗性攻击
    AudoDAN[84] 通过概率约束提高越狱提示可读性
    黑盒场景 GA[87] 利用遗传算法优化对抗性提示
    HGA[88] 从基于人工的越狱提示出发,利用分层遗传算法以优化越狱提示
    JADE[89] 基于语言学规则,对提示进行解析与变异
    下载: 导出CSV
  • [1]

    Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need[C]//Advances in Neural Information Processing Systems 30: Annual Conf on Neural Information Processing Systems 2017. New York: Curran Associates, 2017: 5998−6008

    [2]

    Bender E M, Gebru T, McMillan-Major A, et al. On the dangers of stochastic parrots: Can language models be too big?[C]//Proc of the 2021 ACM Conf on Fairness, Accountability, and Transparency. New York: ACM, 2021: 610−623

    [3]

    OpenAI. GPT-4 technical report[J]. arXiv preprint, arXiv: 2305.10403, 2023

    [4]

    Radford A, Wu J, Child R, et al. Language models are unsupervised multitask learners[J]. OpenAI Blog, 2019, 1(8): 1−24

    [5]

    Anil R, Dai A M, Firat O, et al. PaLM 2 technical report[J]. arXiv preprint, arXiv: 2305.10403, 2023

    [6]

    Touvron H, Martin L, Stone K, et al. LLaMA 2: Open foundation and fine-tuned chat models[J]. arXiv preprint, arXiv: 2307.09288, 2023

    [7]

    Sun Yu, Wang Shuohuan, Feng Shikun, et al. ERNIE 3.0: Large-scale knowledge enhanced pre-training for language understanding and generation[J]. arXiv preprint, arXiv: 2107.02137, 2021

    [8]

    Du Zhengxiao, Qian Yujie, Liu Xiao, et al. GLM: General language model pretraining with autoregressive blank infilling[C]//Proc of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Stroudsburg, PA: ACL, 2022: 320−335

    [9]

    Ren Xiaozhe, Zhou Pingyi, Meng Xinfan, et al. PanGu-Σ: Towards trillion parameter language model with sparse heterogeneous computing[J]. arXiv preprint, arXiv: 2303.10845, 2023

    [10]

    Bai Jinze, Bai Shuai, Yang Shusheng, et al. Qwen-VL: A versatile vision-language model for understanding, localization, text reading, and beyond[J]. arXiv preprint, arXiv: 2308.12966, 2023

    [11]

    Bubeck S, Chandrasekaran V, Eldan R, et al. Sparks of artificial general intelligence: Early experiments with GPT-4[J]. arXiv preprint, arXiv: 2303.12712, 2023

    [12]

    Tamkin A, Brundage M, Clark J, et al. Understanding the capabilities, limitations, and societal impact of large language models[J]. arXiv preprint, arXiv: 2102.02503, 2021

    [13]

    Bommasani R, Hudson D A, Adeli E, et al. On the opportunities and risks of foundation models[J]. arXiv preprint, arXiv: 2108.07258, 2021

    [14]

    Weidinger L, Mellor J, Rauh M, et al. Ethical and social risks of harm from language models[J]. arXiv preprint, arXiv: 2112.04359, 2021

    [15]

    Lin S, Hilton J, Evans O. TruthfulQA: Measuring how models mimic human falsehoods[C]//Proc of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Stroudsburg, PA: ACL, 2022: 3214−3252

    [16]

    Pal A, Umapathi L K, Sankarasubbu M. Med-HALT: Medical domain Hallucination test for large language models[C]//Proc of the 27th Conf on Computational Natural Language Learning. Stroudsburg, PA: ACL, 2023: 314−334

    [17]

    Wei J, Bosma M, Zhao V Y, et al. Finetuned language models are zero-shot learners[C]//Proc of the 10th Int Conf on Learning Representations. Amherst, MA: OpenReview. net, 2022: 1−46

    [18]

    Christiano P F, Leike J, Brown T B, et al. Deep reinforcement learning from human preferences[C]//Advances in Neural Information Processing Systems 30: Annual Conf on Neural Information Processing Systems 2017. New York: Curran Associates, 2017: 4299−4307

    [19]

    Ziegler D M, Stiennon N, Wu J, et al. Fine-Tuning language models from human preferences[J]. arXiv preprint, arXiv: 1909.08593, 2019

    [20]

    Yao Jing, Yi Xiaoyuan, Wang Xiting, et al. From instructions to intrinsic human values-A survey of alignment goals for big models[J]. arXiv preprint, arXiv: 2308.12014, 2023

    [21]

    Wei A, Haghtalab N, Steinhardt J. Jailbroken: How does LLM safety training fail?[J]. arXiv preprint, arXiv: 2307.02483, 2023

    [22]

    Liu Yi, Deng Gelei, Xu Zhengzi, et al. Jailbreaking ChatGPT via prompt engineering: An empirical study[J]. arXiv preprint, arXiv: 2305.13860, 2023

    [23]

    Albert A. Jailbreak chat[EB/OL]. [2023-11-15]. https://www.jailbreakchat.com

    [24]

    Bai Yuntao, Kadavath S, Kundu S, et al. Constitutional AI: Harmlessness from AI feedback[J]. arXiv preprint, arXiv: 2212.08073, 2022

    [25]

    Wang Jindong, Hu Xixu, Hou Wenxin, et al. On the robustness of ChatGPT: An adversarial and out-of-distribution perspective[J]. arXiv preprint, arXiv: 2302.12095, 2023

    [26]

    Zhuo T Y, Li Zhuang, Huang Yujin, et al. On robustness of prompt-based semantic parsing with large pre-trained language model: An empirical study on codex[C]//Proc of the 17th Conf of the European Chapter of the Association for Computational Linguistics. Stroudsburg, PA: ACL, 2023: 1090−1102

    [27]

    McKenzie I R, Lyzhov A, Pieler M, et al. Inverse scaling: When bigger isn’t better[J]. arXiv preprint, arXiv: 2306.09479, 2023

    [28]

    Devlin J, Chang M W, Lee K, et al. BERT: Pre-training of deep bidirectional Transformers for language understanding[C]//Proc of the 2019 Conf of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. Stroudsburg, PA: ACL, 2019: 4171−4186

    [29]

    Raffel C, Shazeer N, Roberts A, et al. Exploring the limits of transfer learning with a unified text-to-text Transformer[J]. Machine Learning Research, 2020, 21: 140: 1−140: 67

    [30]

    Pauls A, Klein D. Faster and smaller n-gram language models[C]//Proc of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies - Volume 1. Stroudsburg, PA: ACL, 2011: 258−267

    [31]

    Mikolov T, Karafiát M, Burget L, et al. Recurrent neural network based language model[C]//Proc of the 11th Annual Conf of the Int Speech Communication Association (Interspeech 2010). New York: ISCA, 2010: 1045−1048

    [32]

    Laurençon H, Saulnier L, Wang T, et al. The BigScience ROOTS Corpus: A 1.6TB composite multilingual dataset[C]//Advances in Neural Information Processing Systems: Vol. 35. New York: Curran Associates, 2022: 31809−31826

    [33]

    Yuan Sha, Zhao Hanyu, Du Zhengxiao, et al. WuDaoCorpora: A super large-scale Chinese corpora for pre-training language models[J]. AI Open, 2021, 2: 65−68 doi: 10.1016/j.aiopen.2021.06.001

    [34]

    Henighan T, Kaplan J, Katz M, et al. Scaling laws for autoregressive generative modeling[J]. arXiv preprint, arXiv: 2010.14701, 2020

    [35]

    Brown T, Mann B, Ryder N, et al. Language models are few-shot learners[C]//Advances in Neural Information Processing Systems: Vol. 33. New York: Curran Associates, 2020: 1877−1901

    [36]

    Ouyang Long, Wu J, Jiang Xu, et al. Training language models to follow instructions with human feedback[C]//Advances in Neural Information Processing Systems: Vol. 35. New York: Curran Associates, 2022: 27730−27744

    [37]

    Wei J, Wang Xuezhi, Schuurmans D, et al. Chain-of-thought prompting elicits reasoning in large language models[C]//Advances in Neural Information Processing Systems: Vol. 35. New York: Curran Associates, 2022: 24824−24837

    [38]

    Vicuna Team. Vicuna: An open-source Chatbot impressing GPT-4 with 90% ChatGPT quality[EB/OL]. [2023-11-20]. https://lmsys.org/blog/2023-03-30-vicuna

    [39]

    Anthropic. Claude[EB/OL]. [2023-11-20].https://claude.ai

    [40]

    Shayegani E, Dong Yue, Abu-Ghazaleh N. Jailbreak in pieces: Compositional adversarial attacks on multi-modal language models[J]. arXiv preprint, arXiv: 2307.14539, 2023

    [41]

    WitchBOT. You can use GPT-4 to create prompt injections against GPT-4[EB/OL]. [2023-11-22]. https://www.lesswrong.com/posts/bNCDexejSZpkuu3yz/you-can-use-gpt-4-to-create-prompt-injections-against-gpt-4.

    [42]

    Bai Yuntao, Jones A, Ndousse K, et al. Training a helpful and harmless assistant with reinforcement learning from human feedback[J]. arXiv preprint, arXiv: 2204.05862, 2022

    [43]

    Abdelnabi S, Greshake K, Mishra S, et al. Not what you’ve signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection[C]//Proc of the 16th ACM Workshop on Artificial Intelligence and Security. New York: ACM, 2023: 79−90

    [44]

    Shayegani E, Mamun M A A, Fu Yu, et al. Survey of vulnerabilities in large language models revealed by adversarial attacks[J]. arXiv preprint, arXiv: 2310.10844, 2023

    [45]

    Wolf Y, Wies N, Avnery O, et al. Fundamental limitations of alignment in large language models[J]. arXiv preprint, arXiv: 2304.11082, 2023

    [46]

    Zou A, Wang Zifan, Kolter J Z, et al. Universal and transferable adversarial attacks on aligned language models[J]. arXiv preprint, arXiv: 2307.15043, 2023

    [47]

    Li Xuan, Zhou Zhanke, Zhu Jianing, et al. DeepInception: Hypnotize large language model to be jailbreaker[J]. arXiv preprint, arXiv: 2311.03191, 2023

    [48]

    Wei Zeming, Wang Yifei, Wang Yisen. Jailbreak and guard aligned language models with only few in-context demonstrations[J]. arXiv preprint, arXiv: 2310.06387, 2023

    [49]

    Li Haoran, Guo Dadi, Fan Wei, et al. Multi-step jailbreaking privacy attacks on ChatGPT[J]. arXiv preprint, arXiv: 2304.05197, 2023

    [50]

    Huang Yangsibo, Gupta S, Xia Mengzhou, et al. Catastrophic jailbreak of open-source LLMs via exploiting generation[J]. arXiv preprint, arXiv: 2310.06987, 2023

    [51]

    Yong Z X, Menghini C, Bach S H. Low-resource languages jailbreak GPT-4[J]. arXiv preprint, arXiv: 2310.02446, 2023

    [52]

    Yuan Youliang, Jiao Wenxiang, Wang Wenxuan, et al. GPT-4 is too smart to be safe: Stealthy chat with LLMs via cipher[J]. arXiv preprint, arXiv: 2308.06463, 2023

    [53]

    Chao P, Robey A, Dobriban E, et al. Jailbreaking black box large language models in twenty queries[J]. arXiv preprint, arXiv: 2310.08419, 2023

    [54]

    Shah R, Feuillade--Montixi Q, Pour S, et al. Scalable and transferable black-box jailbreaks for language models via persona modulation[J]. arXiv preprint, arXiv: 2311.03348, 2023

    [55]

    Zeng Yi, Lin Hongpeng, Zhang Jingwen, et al. How Johnny can persuade LLMs to jailbreak them: Rethinking persuasion to challenge AI safety by humanizing LLMs[J]. arXiv preprint, arXiv: 2401.06373, 2024

    [56]

    Yao Dongyu, Zhang Jianshu, Harris I G, et al. FuzzLLM: A novel and universal fuzzing framework for proactively discovering jailbreak vulnerabilities in large language models[J]. arXiv preprint, arXiv: 2309.05274, 2023

    [57]

    Wang Yizhong, Kordi Y, Mishra S, et al. Self-Instruct: Aligning language models with self-generated instructions[J]. arXiv preprint, arXiv: 2212.10560, 2022

    [58]

    Yu Jiahao, Lin Xingwei, Xing Xinyu, et al. GPTFUZZER: Red teaming large language models with auto-generated jailbreak prompts[J]. arXiv preprint, arXiv: 2309.10253

    [59]

    Coulom R. Efficient selectivity and backup operators in Monte-Carlo tree search[C]//Proc of the 5th Int Conf on Computers and Games. Berlin: Springer, 2006: 72−83

    [60]

    Deng Gelei, Liu Yi, Li Yuekang, et al. MasterKey: Automated jailbreak across multiple large language model Chatbots[J]. arXiv preprint, arXiv: 2307.08715, 2023

    [61]

    Microsoft. Bing Search[EB/OL]. [2023-11-10]. https://www.bing.com/

    [62]

    Google. ‎Google Bard[EB/OL]. [2023-11-22]. https://bard.google.com

    [63]

    Szegedy C, Zaremba W, Sutskever I, et al. Intriguing properties of neural networks[C]//Proc of the 2nd Int Conf on Learning Representations. Amherst, MA: OpenReview. net, 2014: 1−10

    [64]

    Biggio B, Corona I, Maiorca D, et al. Evasion attacks against machine learning at test time[C]//Proc of European Conf on Machine Learning and Knowledge Discovery in Databases. Berlin: Springer, 2013: 387−402

    [65]

    Papernot N, McDaniel P, Jha S, et al. The limitations of deep learning in adversarial settings[C]// Proc of 2016 IEEE European Symp on Security and Privacy. Piscataway, NJ: IEEE, 2016: 372−387

    [66]

    Carlini N, Wagner D. Towards evaluating the robustness of neural networks[C]//Proc of 2017 IEEE Symp on Security and Privacy. Piscataway, NJ: IEEE, 2017: 39−57

    [67]

    Jia R, Liang P. Adversarial examples for evaluating reading comprehension systems[C]//Proc of the 2017 Conf on Empirical Methods in Natural Language Processing. Stroudsburg, PA: ACL, 2017: 2021−2031

    [68]

    Wallace E, Feng Shi, Kandpal N, et al. Universal adversarial triggers for attacking and analyzing NLP[C]//Proc of the 2019 Conf on Empirical Methods in Natural Language Processing and the 9th Int Joint Conf on Natural Language Processing. Stroudsburg, PA: ACL, 2019: 2153−2162

    [69]

    Ebrahimi J, Rao A, Lowd D, et al. HotFlip: White-Box adversarial examples for text classification[C]//Proc of the 56th Annual Meeting of the Association for Computational Linguistics. Stroudsburg, PA: ACL, 2018: 31−36

    [70]

    Shao Zhihong, Wu Zhongqin, Huang Minlie. AdvExpander: Generating natural language adversarial examples by expanding text[J]. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 2021, 30: 1184−1196

    [71]

    Madry A, Makelov A, Schmidt L, et al. Towards deep learning models resistant to adversarial attacks[C]// Proc of the 6th Int Conf on Learning Representations. Amherst, MA: OpenReview. net, 2018: 1−28

    [72]

    Ilyas A, Santurkar S, Tsipras D, et al. Adversarial examples are not bugs, they are features[C]//Advances in Neural Information Processing Systems 32: Annual Conf on Neural Information Processing Systems 2019. New York: Curran Associates, 2019: 125−136

    [73]

    Zhou Chunting, Sun Chonglin, Liu Zhiyuan, et al. A C-LSTM neural network for text classification[J]. arXiv preprint, arXiv: 1511.08630, 2015

    [74]

    Mehrabi N, Beirami A, Morstatter F, et al. Robust conversational agents against imperceptible toxicity triggers[C]//Proc of the 2022 Conf of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. Stroudsburg, PA: ACL, 2022: 2831−2847

    [75]

    Zhang Yizhe, Sun Siqi, Galley M, et al. DialoGPT : Large-scale generative pre-training for conversational response generation[C]//Proc of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations. Stroudsburg, PA: ACL, 2020: 270−278

    [76]

    Shin T, Razeghi Y, Robert L, et al. AutoPrompt: Eliciting knowledge from language models with automatically generated prompts[C]//Proc of the 2020 Conf on Empirical Methods in Natural Language Processing. Stroudsburg, PA: ACL, 2020: 4222−4235

    [77]

    Liu Yinhan, Ott M, Goyal N, et al. RoBERTa: A robustly optimized bert pretraining approach[J]. arXiv preprint, arXiv: 1907.11692, 2019

    [78]

    Guo Chuan, Sablayrolles A, Jégou H, et al. Gradient-based adversarial attacks against text Transformers[C]//Proc of the 2021 Conf on Empirical Methods in Natural Language Processing. Stroudsburg, PA: ACL, 2021: 5747−5757

    [79]

    Jang E, Gu Shixiang, Poole B. Categorical reparameterization with Gumbel-Softmax[C]// Proc of the 5th Int Conf on Learning Representations. Amherst, MA: OpenReview. net, 2017: 1−13

    [80]

    Carlini N, Nasr M, Choquette-Choo C A, et al. Are aligned neural networks adversarially aligned?[J]. arXiv preprint, arXiv: 2306.15447, 2023

    [81]

    Jones E, Dragan A D, Raghunathan A, et al. Automatically auditing large language models via discrete optimization[C]// Proc of Int Conf on Machine Learning. New York: PMLR, 2023: 15307−15329

    [82]

    Dettmers T, Pagnoni A, Holtzman A, et al. QLoRA: Efficient finetuning of quantized LLMs[J]. arXiv preprint, arXiv: 2305.14314, 2023

    [83]

    Subhash V, Bialas A, Pan Weiwei, et al. Why do universal adversarial attacks work on large language models?: Geometry might be the answer[J]. arXiv preprint, arXiv: 2309.00254, 2023

    [84]

    Zhu Sicheng, Zhang Ruiyi, An Bang, et al. AutoDAN: Automatic and interpretable adversarial attacks on large language models[J]. arXiv preprint, arXiv: 2310.15140, 2023

    [85]

    Alon G, Kamfonas M. Detecting language model attacks with perplexity[J]. arXiv preprint, arXiv: 2308.14132, 2023

    [86]

    Jain N, Schwarzschild A, Wen Yuxin, et al. Baseline defenses for adversarial attacks against aligned language models[J]. arXiv preprint, arXiv: 2309.00614, 2023

    [87]

    Lapid R, Langberg R, Sipper M. Open Sesame! Universal black box jailbreaking of large language models[J]. arXiv preprint, arXiv: 2309.01446, 2023

    [88]

    Liu Xiaogeng, Xu Nan, Chen Muhao, et al. AutoDAN: Generating stealthy jailbreak prompts on aligned large language models[J]. arXiv preprint, arXiv: 2310.04451, 2023

    [89]

    Zhang Mi, Pan Xudong, Yang Min. JADE: A linguistics-based safety evaluation platform for large language models[J]. arXiv preprint, arXiv: 2311.00286, 2023

    [90]

    Zhou Chunting, Liu Pengfei, Xu Puxin, et al. LIMA: Less is more for alignment[J]. arXiv preprint, arXiv: 2305.11206, 2023

    [91]

    Marchant A, Hawton K, Stewart A, et al. A systematic review of the relationship between internet use, self-harm and suicidal behaviour in young people: The good, the bad and the unknown[J]. PLOS ONE, 2017, 12(8): 1−26

    [92]

    Sobkowicz P, Sobkowicz A. Dynamics of hate based Internet user networks[J]. The European Physical Journal B, 2010, 73(4): 633−643 doi: 10.1140/epjb/e2010-00039-0

    [93]

    Boxell L, Gentzkow M, Shapiro J M. Is the Internet causing political polarization? Evidence from demographics: 23258[R]. New York: National Bureau of Economic Research, 2017

    [94]

    Akyürek E, Bolukbasi T, Liu F, et al. Towards tracing knowledge in language models back to the training data[C]//Findings of the Association for Computational Linguistics. Stroudsburg, PA: ACL, 2022: 2429−2446

    [95]

    Gardent C, Shimorina A, Narayan S, et al. Creating training corpora for NLG micro-planners[C]//Proc of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Stroudsburg, PA: ACL, 2017: 179−188

    [96]

    Wang Hongmin. Revisiting challenges in data-to-text generation with fact grounding[C]//Proc of the 12th Int Conf on Natural Language Generation. Stroudsburg, PA: ACL, 2019: 311−322

    [97]

    Parikh A, Wang Xuezhi, Gehrmann S, et al. ToTTo: A controlled table-to-text generation dataset[C]//Proc of the 2020 Conf on Empirical Methods in Natural Language Processing. Stroudsburg, PA: ACL, 2020: 1173−1186

    [98]

    Deng Jiawen, Sun Hao, Zhang Zhexin, et al. Recent advances towards safe, responsible, and moral dialogue systems: A survey[J]. arXiv preprint, arXiv: 2302.09270, 2023

    [99]

    Dinan E, Humeau S, Chintagunta B, et al. Build it break it fix it for dialogue safety: Robustness from adversarial human attack[C]//Proc of the 2019 Conf on Empirical Methods in Natural Language Processing and the 9th Int Joint Conf on Natural Language Processing. Stroudsburg, PA: ACL, 2019: 4537−4546

    [100]

    Penedo G, Malartic Q, Hesslow D, et al. The RefinedWeb dataset for Falcon LLM: Outperforming curated corpora with web data, and web data only[J]. arXiv preprint, arXiv: 2306.01116, 2023

    [101]

    Wang Yida, Ke Pei, Zheng Yinhe, et al. A large-scale Chinese short-text conversation dataset[C]//Proc of the 9th CCF Int Conf on Natural Language Processing and Chinese Computing. Berlin: Springer, 2020: 91−103

    [102]

    Gu Yuxian, Wen Jiaxin, Sun Hao, et al. EVA2.0: Investigating open-domain Chinese dialogue systems with large-scale pre-training[J]. Machine Intelligence Research, 2023, 20: 207−219 doi: 10.1007/s11633-022-1387-3

    [103]

    Roller S, Dinan E, Goyal N, et al. Recipes for building an open-domain Chatbot[C]//Proc of the 16th Conf of the European Chapter of the Association for Computational Linguistics. Stroudsburg, PA: ACL, 2021: 300−325

    [104]

    Baumgartner J, Zannettou S, Keegan B, et al. The Pushshift Reddit dataset[J]. arXiv preprint, arXiv: 2001.08435, 2020

    [105]

    Chung H W, Hou Le, Longpre S, et al. Scaling instruction-finetuned language models[J]. arXiv preprint, arXiv: 2210.11416, 2022

    [106]

    Taori R, Gulrajani I, Zhang Tianyi, et al. Stanford Alpaca: An instruction-following LLaMA model[EB/OL]. [2023-11-24]. https://github.com/tatsu-lab/stanford_alpaca.

    [107]

    Ji Jiaming, Liu Mickel, Dai Juntao, et al. BeaverTails: Towards improved safety alignment of LLM via a human-preference dataset[J]. arXiv preprint, arXiv: 2307.04657, 2023

    [108]

    Deng Yue, Zhang Wenxuan, Pan S J, et al. Multilingual jailbreak challenges in large language models[J]. arXiv preprint, arXiv: 2310.06474, 2023

    [109]

    Wang Zezhong, Yang Fangkai, Wang Lu, et al. Self-Guard: Empower the LLM to safeguard itself[J]. arXiv preprint, arXiv: 2310.15851, 2023

    [110]

    Zhang Zhexin, Yang Junxiao, Ke Pei, et al. Defending large language models against Jailbreaking attacks through goal prioritization[J]. arXiv preprint, arXiv: 2311.09096, 2023

    [111]

    Xie Yueqi, Yi Jingwei, Shao Jiawei, et al. Defending ChatGPT against jailbreak attack via self-reminders[J]. Nature Machine Intelligence, 2023, 5(12): 1486−1496

    [112]

    Perez F, Ribeiro I. Ignore previous prompt: Attack techniques for language models[J]. arXiv preprint, arXiv: 2211.09527, 2022

    [113]

    Li Yuhui, Wei Fangyun, Zhao Jinjing, et al. RAIN: Your language models can align themselves without finetuning[J]. arXiv preprint, arXiv: 2309.07124, 2023

    [114]

    Zhang Yuqi, Ding Liang, Zhang Lefei, et al. Intention analysis prompting makes large language models a good Jailbreak defender[J]. arXiv preprint, arXiv: 2401.06561, 2024

    [115]

    Jigsaw. Perspective API[EB/OL]. [2023-11-24]. https://www.perspectiveapi.com/

    [116]

    Markov T, Zhang Chong, Agarwal S, et al. A holistic approach to undesired content detection in the real world[C]//Proc of the AAAI Conf on Artificial Intelligence. Menlo Park, CA: AAAI, 2023, 37(12): 15009−15018

    [117]

    Kumar A, Agarwal C, Srinivas S, et al. Certifying LLM safety against adversarial prompting[J]. arXiv preprint, arXiv: 2309.02705, 2023

    [118]

    Cao Bochuan, Cao Yuanpu, Lin Lu, et al. Defending against alignment-breaking attacks via robustly aligned LLM[J]. arXiv preprint, arXiv: 2309.14348, 2023

    [119]

    Meng Dongyu, Chen Hao. Magnet: A two-pronged defense against adversarial examples[C]//Proc of the 2017 ACM SIGSAC Conf on Computer and Communications Security. New York: ACM, 2017: 135−147

    [120]

    Robey A, Wong E, Hassani H, et al. SmoothLLM: Defending large language models against jailbreaking attacks[J]. arXiv preprint, arXiv: 2310.03684, 2023

    [121]

    Zhu Deyao, Chen Jun, Shen Xiaoqian, et al. MiniGPT-4: Enhancing vision-language understanding with advanced large language models[J]. arXiv preprint, arXiv: 2304.10592, 2023

    [122]

    Liu Haotian, Li Chunyuan, Wu Qingyang, et al. Visual instruction tuning[J]. arXiv preprint, arXiv: 2304.08485, 2023

    [123]

    Wu Jian, Gaur Yashesh, Chen Zhuo, et al. On decoder-only architecture for speech-to-text and large language model integration[C]//Proc of 2023 IEEE Automatic Speech Recognition and Understanding Workshop. Piscataway, NJ: IEEE, 2023: 1−8

    [124]

    Maaz M, Rasheed H, Khan S, et al. Video-ChatGPT: Towards detailed video understanding via large vision and language models[J]. arXiv preprint, arXiv: 2306.05424, 2023

    [125]

    Sinitsin A, Plokhotnyuk V, Pyrkin D V, et al. Editable neural networks[C]// Proc of the 8th Int Conf on Learning Representations. Amherst, MA: OpenReview. net, 2020: 1−12

    [126]

    Lee N, Ping Wei, Xu Peng, et al. Factuality enhanced language models for open-ended text generation[C]//Advances in Neural Information Processing Systems. New York: Curran Associates, 2022: 34586−34599

    [127]

    Zhu Chen, Rawat A S, Zaheer M, et al. Modifying memories in transformer models[J]. arXiv preprint, arXiv: 2012.00363, 2020

    [128]

    Mitchell E, Lin C, Bosselut A, et al. Fast model editing at scale[C]//The Tenth Int Conf on Learning Representations. Amherst, MA: OpenReview. net, 2022: 1−21

    [129]

    Meng K, Bau D, Andonian A, et al. Locating and editing factual associations in GPT[J]. Advances in Neural Information Processing Systems, 2022, 35: 17359−17372

    [130]

    Pinter Y, Elhadad M. Emptying the ocean with a spoon: Should we edit models?[C]//Findings of the Association for Computational Linguistics: EMNLP 2023. Stroudsburg, PA: ACL, 2023: 15164−15172

    [131]

    Zou A, Phan L, Chen S, et al. Representation engineering: A top-down approach to AI transparency[J]. arXiv preprint, arXiv: 2310.01405, 2023

    [132]

    Li Tianlong, Zheng Xiaoqing, Huang Xuanjing. Open the Pandora’s Box of LLMs: Jailbreaking LLMs through representation engineering[J]. arXiv preprint, arXiv: 2401.06824, 2024

    [133]

    Huang Changran. The intelligent agent NLP-based customer service system[C]// Proc of 2021 2nd Int Conf on Artificial Intelligence in Electronics Engineering. New York: ACM, 2021: 41−50

    [134]

    Du Yilun, Li Shuang, Torralba A, et al. Improving factuality and reasoning in language models through multiagent debate[J]. arXiv preprint, arXiv: 2305.14325, 2023

    [135]

    Sadasivan V S, Kumar A, Balasubramanian S, et al. Can AI-generated text be reliably detected?[J]. arXiv preprint, arXiv: 2303.11156, 2023

    [136]

    Glukhov D, Shumailov I, Gal Y, et al. LLM censorship: A machine learning challenge or a computer security problem?[J]. arXiv preprint, arXiv: 2307.10719, 2023

    [137]

    Brcic M, Yampolskiy R V. Impossibility results in AI: A survey[J]. ACM Computing Surveys, 2024, 56(1): 8: 1−8: 24

  • 期刊类型引用(2)

    1. 王全新,刘音. Android应用中的Java题库系统的设计与优化. 信息记录材料. 2024(01): 142-144 . 百度学术
    2. 杜厚勤. 档案一体化平台中的分布式数据库优化研究. 信息与电脑(理论版). 2024(17): 10-13 . 百度学术

    其他类型引用(2)

图(9)  /  表(4)
计量
  • 文章访问数:  1668
  • HTML全文浏览量:  666
  • PDF下载量:  511
  • 被引次数: 4
出版历程
  • 收稿日期:  2023-11-29
  • 修回日期:  2024-01-30
  • 网络出版日期:  2024-03-06
  • 刊出日期:  2024-05-13

目录

/

返回文章
返回