arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.09084cs.CL
收藏

面向长文档分类的预训练句子嵌入注意力机制

Attention over pre-trained Sentence Embeddings for Long Document Classification

Huawei Ireland Research Center(华为爱尔兰研究中心)

Amine Abdaoui, Sourav Dutta

AI总结:

针对Transformer处理长文档的复杂度问题,提出基于预训练句子嵌入加小型注意力层的长文档分类方法,在三个数据集上取得有竞争力的结果,冻结底层Transformer时效果更优。

摘要:

尽管Transformer是当前大多数自然语言处理任务中事实上的标准模型,但由于其注意力复杂度随token数量呈二次方增长,通常仅适用于短序列。已有研究从两方面尝试解决该问题:一是降低自注意力计算成本,二是对更短序列建模后通过循环机制或新型Transformer模型进行组合。本文提出利用预训练Sentence Transformer(句子Transformer),从单句的语义有效嵌入出发,再通过一个随文档长度线性扩展的小型注意力层对其进行融合。我们在三个标准文档分类数据集上报告了该简单架构的实验结果。与采用标准微调的当前最优模型相比,该方法取得了具有竞争力的结果(尽管在该配置下不存在绝对最优的模型)。我们还发现,当冻结底层Transformer时,该架构能取得更优的结果——这种配置适用于需要避免完全微调的场景(例如同一冻结Transformer被多个应用共享的情况)。最后,我们补充了两组额外实验,以进一步评估该架构相较于简单基线的有效性。

英文摘要:

Despite being the current de-facto models in most NLP tasks, transformers are often limited to short sequences due to their quadratic attention complexity on the number of tokens. Several attempts to address this issue were studied, either by reducing the cost of the self-attention computation or by modeling smaller sequences and combining them through a recurrence mechanism or using a new transformer model. In this paper, we suggest to take advantage of pre-trained sentence transformers to start from semantically meaningful embeddings of the individual sentences, and then combine them through a small attention layer that scales linearly with the document length. We report the results obtained by this simple architecture on three standard document classification datasets. When compared with the current state-of-the-art models using standard fine-tuning, the studied method obtains competitive results (even if there is no clear best model in this configuration). We also showcase that the studied architecture obtains better results when freezing the underlying transformers. A configuration that is useful when we need to avoid complete fine-tuning (e.g. when the same frozen transformer is shared by different applications). Finally, two additional experiments are provided to further evaluate the relevancy of the studied architecture over simpler baselines.

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

↑