随机分词提升大模型抗干扰能力,且不增加推理开销。
Stochasticity in Tokenisation Improves Robustness
- 用均匀采样的随机分词方式训练模型
- 在多种攻击下准确率提升29.8%以上
- 适合关注模型鲁棒性的研究者使用
大语言模型的广泛应用引发对其鲁棒性的担忧。输入分词的微小扰动可能导致模型表现下降,表明基于确定性标准分词训练的模型容易受到对抗攻击。最近研究表明,随机分词可生成对扰动更不敏感的内部表示。本文系统分析了随机分词对对抗攻击和随机扰动的鲁棒性影响,覆盖预训练、监督微调和上下文学习等多种学习范式、数据集与模型架构。结果表明,采用均匀采样随机分词进行预训练和微调能有效提升鲁棒性;在非标准分词下,标准训练的Llama-1b模型准确率下降29.8%。训练时使用随机分词可保持精度,且不增加推理成本。
原文摘要 · Abstract (English)
The widespread adoption of large language models (LLMs) has increased concerns about their robustness. Vulnerabilities in perturbations of tokenisation of the input indicate that models trained with a deterministic canonical tokenisation can be brittle to adversarial attacks. Recent studies suggest that stochastic tokenisation can deliver internal representations that are less sensitive to perturbations. In this paper, we analyse how stochastic tokenisations affect robustness to adversarial attacks and random perturbations. We systematically study this over a range of learning regimes (pre-training, supervised fine-tuning, and in-context learning), data sets, and model architectures. We show that pre-training and fine-tuning with uniformly sampled stochastic tokenisations improve robustness to random and adversarial perturbations. Evaluating on uniformly sampled non-canonical tokenisations reduces the accuracy of a canonically trained Llama-1b model by 29.8%. We find that training with stochastic tokenisation preserves accuracy without increasing inference cost.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。