arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2112.13776cs.CLcs.AI
收藏

基于分层随机注意的Transformer不确定性估计

Transformer Uncertainty Estimation with Hierarchical Stochastic Attention

University of Amsterdam(阿姆斯特丹大学);Amazon Development Center Germany GmbH(亚马逊德国开发中心有限公司)

Jiahuan Pei, Cheng Wang, György Szarvas

摘要:

Transformers在广泛的NLP任务中是最先进的,也已应用于许多现实世界的产品。了解Transformer模型预测的可靠性和确定性对于构建可信的机器学习应用程序至关重要,例如,医学诊断虽然最近已经提出了许多Transformer扩展,Transformer模型的不确定性估计的研究是欠探索。在这项工作中,我们提出了一种新的方法,使Transformers具有不确定性估计的能力,同时,保持原来的预测性能。这是通过学习一个分层的随机自我注意力,分别出席值和一组可学习的质心。然后,使用Gumbel-Softmax技巧,用采样质心的混合物形成新的注意力头部。我们从理论上证明了从Gumbel分布采样的自注意近似是有界的。我们经验性地评估我们的模型在两个文本分类任务与域内(ID)和域外(OOD)数据集。实验结果表明:(1)在比较的方法中,该方法具有最好的预测性能和不确定性权衡;(2)在ID数据集上表现出非常有竞争力的(在大多数情况下,提高了)预测性能;(3)在OOD数据集上的不确定性估计中与Monte Carlo dropout和集成方法相当。

英文摘要:

Transformers are state-of-the-art in a wide range of NLP tasks and have also been applied to many real-world products. Understanding the reliability and certainty of transformer model predictions is crucial for building trustable machine learning applications, e.g., medical diagnosis. Although many recent transformer extensions have been proposed, the study of the uncertainty estimation of transformer models is under-explored. In this work, we propose a novel way to enable transformers to have the capability of uncertainty estimation and, meanwhile, retain the original predictive performance. This is achieved by learning a hierarchical stochastic self-attention that attends to values and a set of learnable centroids, respectively. Then new attention heads are formed with a mixture of sampled centroids using the Gumbel-Softmax trick. We theoretically show that the self-attention approximation by sampling from a Gumbel distribution is upper bounded. We empirically evaluate our model on two text classification tasks with both in-domain (ID) and out-of-domain (OOD) datasets. The experimental results demonstrate that our approach: (1) achieves the best predictive performance and uncertainty trade-off among compared methods; (2) exhibits very competitive (in most cases, improved) predictive performance on ID datasets; (3) is on par with Monte Carlo dropout and ensemble methods in uncertainty estimation on OOD datasets.

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

↑