arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.02686cs.CLcs.AIcs.CRcs.LG
收藏

单调性作为提升语言模型鲁棒性的架构偏倚

Monotonicity as an Architectural Bias for Robust Language Models

Department of Computer Science, University of Colorado Boulder, Boulder, CO, USA(计算机科学系,科罗拉多大学波尔德分校,波尔德,科罗拉多州,美国)

Patrick Cooper, Alireza Nadali, Ashutosh Trivedi, Alvaro Velasquez

AI总结:

本研究通过在Transformer模型中引入单调性约束,提升语言模型对对抗攻击的鲁棒性,同时保持预训练性能。

摘要:

大型语言模型(LLMs)在面对对抗性提示和越狱攻击时表现出脆弱性,即使经过大量对齐和微调后也是如此。这种脆弱性反映了现代神经语言模型的更大挑战:在高维输入空间中,微小但精心设计的扰动可以导致内部语义表示和输出的大幅且不可预测的变化。我们研究了单调性作为改进基于Transformer的语言模型鲁棒性的架构归纳偏倚。单调性约束语义转换,使得增强信息、证据或约束不能导致相应内部表示的退化。这种顺序保持行为长期以来被用于控制和安全关键系统中,以简化推理并提高鲁棒性,但传统上被视为与神经语言模型所需的表达性不兼容。我们证明这种权衡并非本质。通过在序列到序列Transformer的前馈子层中选择性地强制单调性——同时不约束注意力机制——我们获得了保持预训练模型性能的单调语言模型。这种架构分离允许否定、矛盾和上下文交互通过注意力机制显式引入,同时确保后续语义细化是顺序保持的。实证上,单调性显著提高了鲁棒性:对抗性攻击成功率从大约69%降至19%,而标准摘要性能仅略微下降。

英文摘要:

Large language models (LLMs) are known to exhibit brittle behavior under adversarial prompts and jailbreak attacks, even after extensive alignment and fine-tuning. This fragility reflects a broader challenge of modern neural language models: small, carefully structured perturbations in high-dimensional input spaces can induce large and unpredictable changes in internal semantic representations and output. We investigate monotonicity as an architectural inductive bias for improving the robustness of Transformer-based language models. Monotonicity constrains semantic transformations so that strengthening information, evidence, or constraints cannot lead to regressions in the corresponding internal representations. Such order-preserving behavior has long been exploited in control and safety-critical systems to simplify reasoning and improve robustness, but has traditionally been viewed as incompatible with the expressivity required by neural language models. We show that this trade-off is not inherent. By enforcing monotonicity selectively in the feed-forward sublayers of sequence-to-sequence Transformers -- while leaving attention mechanisms unconstrained -- we obtain monotone language models that preserve the performance of their pretrained counterparts. This architectural separation allows negation, contradiction, and contextual interactions to be introduced explicitly through attention, while ensuring that subsequent semantic refinement is order-preserving. Empirically, monotonicity substantially improves robustness: adversarial attack success rates drop from approximately 69% to 19%, while standard summarization performance degrades only marginally.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑