变形修补程序:一个错误值得一个神经元
Transformer-Patcher: One Mistake worth One Neuron
摘要:
基于transformer的大型预训练语言模型(PLM)主导了几乎所有的自然语言处理(NLP)任务。尽管如此,他们仍然时不时地犯错误。对于部署在工业环境中的模型来说,快速而稳健地修复这些错误对于改善用户体验至关重要。以前的工作形式化的模型编辑(ME)等问题,主要集中在修复一个错误。然而,一个错误修复场景并不是对现实世界挑战的准确抽象。在人工智能服务的部署中,不断出现错误,如果不及时纠正,同样的错误可能会再次发生。因此,一个更好的解决办法是,一旦错误不断出现,就立即纠正。因此,我们扩展现有的ME到顺序模型编辑(SME),以帮助开发更实用的编辑方法。我们的研究表明,目前大多数ME方法在这种情况下可能会产生不满意的结果。然后,我们介绍了Transformer-Patcher,这是一种新型的模型编辑器,可以通过在最后一个前馈网络层中添加和训练一些神经元来改变基于transformer的模型的行为。分类和生成任务的实验结果表明,Transformer-Patcher可以连续纠正多达数千个错误(可靠性),并推广到它们的等效输入(通用性),同时保留模型在不相关输入(局部性)上的准确性。我们的方法优于以前的微调和基于超网络的方法,并实现了最先进的性能顺序模型编辑(SME)。该代码可在www.example.com上获得。
英文摘要:
Large Transformer-based Pretrained Language Models (PLMs) dominate almost all Natural Language Processing (NLP) tasks. Nevertheless, they still make mistakes from time to time. For a model deployed in an industrial environment, fixing these mistakes quickly and robustly is vital to improve user experiences. Previous works formalize such problems as Model Editing (ME) and mostly focus on fixing one mistake. However, the one-mistake-fixing scenario is not an accurate abstraction of the real-world challenge. In the deployment of AI services, there are ever-emerging mistakes, and the same mistake may recur if not corrected in time. Thus a preferable solution is to rectify the mistakes as soon as they appear nonstop. Therefore, we extend the existing ME into Sequential Model Editing (SME) to help develop more practical editing methods. Our study shows that most current ME methods could yield unsatisfying results in this scenario. We then introduce Transformer-Patcher, a novel model editor that can shift the behavior of transformer-based models by simply adding and training a few neurons in the last Feed-Forward Network layer. Experimental results on both classification and generation tasks show that Transformer-Patcher can successively correct up to thousands of errors (Reliability) and generalize to their equivalent inputs (Generality) while retaining the model's accuracy on irrelevant inputs (Locality). Our method outperforms previous fine-tuning and HyperNetwork-based methods and achieves state-of-the-art performance for Sequential Model Editing (SME). The code is available at https://github.com/ZeroYuHuang/Transformer-Patcher.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。