arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.12502cs.LGcs.AIstat.ML
收藏

Transformer神经过程——核回归

Transformer Neural Processes - Kernel Regression

Daniel Jenson, Jhonathan Navott, Mengyan Zhang, Makkunda Sharma, Elizaveta Semenova, Seth Flaxman

AI总结:

针对现代神经过程注意力机制存在的$O(n^2)$复杂度瓶颈,研究提出TNP-KR模型,通过核回归块、核注意力偏置及两种新注意力机制降低复杂度,在多基准测试中表现优异,其中SA版本达到当前最优水平。

摘要:

神经过程(Neural Processes, NPs)是一类快速发展的模型,旨在直接建模随机过程的后验预测分布。它最初是作为高斯过程(Gaussian Processes, GPs)的可扩展替代方案开发的,高斯过程受限于$O(n^3)$的运行时间复杂度。目前精度最高的现代NPs往往能与GPs相媲美,但由于其注意力机制,仍存在$O(n^2)$的瓶颈。我们提出了Transformer Neural Process - Kernel Regression(TNP-KR),这是一种可扩展的NP,具有以下特性:(1)核回归块(Kernel Regression Block, KRBlock),一种简单、可扩展且参数高效的Transformer块,复杂度为$O(n_c^2 + n_c n_t)$,其中$n_c$和$n_t$分别是上下文点和测试点的数量;(2)基于核的注意力偏置;(3)两种新颖的注意力机制:扫描注意力(scan attention, SA),一种基于扫描的内存高效注意力,当与基于核的偏置结合时,可使TNP-KR具有平移不变性;以及深度核注意力(deep kernel attention, DKA),一种Performer风格的注意力,隐式引入了距离偏置,并将复杂度进一步降低至$O(n_c)$。这些改进使得两种TNP-KR变体都能在单块24GB GPU上,在不到一分钟的时间内,对10万个上下文点、超过100万个测试点执行推理。在涵盖元回归、贝叶斯优化、图像补全和流行病学的基准测试中,带有DKA的TNP-KR几乎在所有基准上都优于其对应的Performer版本,而带有SA的TNP-KR则取得了当前最优的结果。

英文摘要:

Neural Processes (NPs) are a rapidly evolving class of models designed to directly model the posterior predictive distribution of stochastic processes. Originally developed as a scalable alternative to Gaussian Processes (GPs), which are limited by $O(n^3)$ runtime complexity, the most accurate modern NPs can often rival GPs but still suffer from an $O(n^2)$ bottleneck due to their attention mechanism. We introduce the Transformer Neural Process - Kernel Regression (TNP-KR), a scalable NP featuring: (1) a Kernel Regression Block (KRBlock), a simple, extensible, and parameter efficient transformer block with complexity $O(n_c^2 + n_c n_t)$, where $n_c$ and $n_t$ are the number of context and test points, respectively; (2) a kernel-based attention bias; and (3) two novel attention mechanisms: scan attention (SA), a memory-efficient scan-based attention that when paired with a kernel-based bias can make TNP-KR translation invariant, and deep kernel attention (DKA), a Performer-style attention that implicitly incoporates a distance bias and further reduces complexity to $O(n_c)$. These enhancements enable both TNP-KR variants to perform inference with 100K context points on over 1M test points in under a minute on a single 24GB GPU. On benchmarks spanning meta regression, Bayesian optimization, image completion, and epidemiology, TNP-KR with DKA outperforms its Performer counterpart on nearly every benchmark, while TNP-KR with SA achieves state-of-the-art results.

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

↑