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

Tree Cross Attention(树状交叉注意力)

Tree Cross Attention

Mila – Université de Montréal(米拉-蒙特利尔大学);Borealis AI(北极星人工智能)

Leo Feng, Frederick Tung, Hossein Hajimirsadeghi, Yoshua Bengio, Mohamed Osama Ahmed

AI总结:

本文提出树状交叉注意力 TCA 及 ReTreever 架构,通过树结构与树搜索将推理检索复杂度降至 O(log(N)),在多任务中以更少 token 达到接近 Cross Attention 的性能,并优于 Perceiver IO。

摘要:

Cross Attention(交叉注意力)是一种从一组上下文中检索信息以进行预测的常用方法。在推理阶段,对于每次预测,Cross Attention 都会扫描完整的 $\mathcal{O}(N)$ 个 token 集合。然而在实践中,通常只需要很小一部分 token 即可获得良好性能。诸如 Perceiver IO 之类的方法在推理时成本较低,因为它们将信息蒸馏到规模更小的潜在 token 集合 $L < N$ 中,随后再对该集合应用交叉注意力,因此复杂度仅为 $\mathcal{O}(L)$。但在实际应用中,随着输入 token 数量以及需要蒸馏的信息量增加,所需的潜在 token 数量也会显著增长。在本工作中,我们提出 Tree Cross Attention(TCA,树状交叉注意力)——一个基于 Cross Attention 的模块,它在执行推理时仅从对数级的 $\mathcal{O}(\log(N))$ 个 token 中检索信息。TCA 将数据组织成树状结构,并在推理时执行树搜索,以检索与预测相关的 token。借助 TCA,我们提出了 ReTreever,这是一种用于 token 高效推理的灵活架构。我们通过实验表明,Tree Cross Attention(TCA)在各类分类和不确定性回归任务上的表现与 Cross Attention 相当,同时具有显著更高的 token 效率。此外,我们将 ReTreever 与 Perceiver IO 进行比较,结果显示在推理使用相同 token 数量的情况下,ReTreever 取得了显著提升。

英文摘要:

Cross Attention is a popular method for retrieving information from a set of context tokens for making predictions. At inference time, for each prediction, Cross Attention scans the full set of $\mathcal{O}(N)$ tokens. In practice, however, often only a small subset of tokens are required for good performance. Methods such as Perceiver IO are cheap at inference as they distill the information to a smaller-sized set of latent tokens $L < N$ on which cross attention is then applied, resulting in only $\mathcal{O}(L)$ complexity. However, in practice, as the number of input tokens and the amount of information to distill increases, the number of latent tokens needed also increases significantly. In this work, we propose Tree Cross Attention (TCA) - a module based on Cross Attention that only retrieves information from a logarithmic $\mathcal{O}(\log(N))$ number of tokens for performing inference. TCA organizes the data in a tree structure and performs a tree search at inference time to retrieve the relevant tokens for prediction. Leveraging TCA, we introduce ReTreever, a flexible architecture for token-efficient inference. We show empirically that Tree Cross Attention (TCA) performs comparable to Cross Attention across various classification and uncertainty regression tasks while being significantly more token-efficient. Furthermore, we compare ReTreever against Perceiver IO, showing significant gains while using the same number of tokens for inference.

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

↑