当前位置: 首页 > news >正文

HiPPO: Recurrent Memory with Optimal Polynomial Projections论文精读(逐段解析)

HiPPO: Recurrent Memory with Optimal Polynomial Projections论文精读(逐段解析)

Albert Gu, Tri Dao †, Stefano Ermon, Atri Rudra, and Christopher Ré

论文地址:https://arxiv.org/abs/2008.07669
斯坦福大学计算机科学系
纽约州立大学布法罗分校计算机科学与工程系

2020

Abstract

A central problem in learning from sequential data is representing cumulative history in an incremental fashion as more data is processed. We introduce a general framework (HiPPO) for the online compression of continuous signals and discrete time series by projection onto polynomial bases. Given a measure that specifies the importance of each time step in the past, HiPPO produces an optimal solution to a natural online function approximation problem. As special cases, our framework yields a short derivation of the recent Legendre Memory Unit (LMU) from first principles, and generalizes the ubiquitous gating mechanism of recurrent neural networks such as GRUs. This formal framework yields a new memory update mechanism (HiPPO-LegS) that scales through time to remember all history, avoiding priors on the timescale. HiPPO-LegS enjoys the theoretical benefits of timescale robustness, fast updates, and bounded gradients. By incorporating the memory dynamics into recurrent neural networks, HiPPO RNNs can empirically capture complex temporal dependencies. On the benchmark permuted MNIST dataset, HiPPO-LegS sets a new state-of-the-art accuracy of 98.3%98.3\%98.3% . Finally, on a novel trajectory classification task testing robustness to out-of-distribution timescales and missing data, HiPPO-LegS outperforms RNN and neural ODE baselines by 25−40%25\mathrm{-}40\%2540% accuracy.

【翻译】从序列数据中学习的一个核心问题是在处理更多数据时以增量方式表示累积历史。我们引入了一个通用框架(HiPPO),通过投影到多项式基上对连续信号和离散时间序列进行在线压缩。给定一个指定过去每个时间步重要性的测度,HiPPO为自然的在线函数逼近问题产生最优解。作为特殊情况,我们的框架从第一性原理出发简短推导了最近的勒让德记忆单元(LMU),并推广了循环神经网络(如GRU)中普遍存在的门控机制。这个形式化框架产生了一种新的记忆更新机制(HiPPO-LegS),它能够随时间扩展以记住所有历史,避免了对时间尺度的先验假设。HiPPO-LegS享有时间尺度鲁棒性、快速更新和有界梯度的理论优势。通过将记忆动力学融入循环神经网络,HiPPO RNN能够在经验上捕获复杂的时间依赖关系。在基准置换MNIST数据集上,HiPPO-LegS创造了新的最先进准确率98.3%98.3\%98.3%。最后,在一个测试对分布外时间尺度和缺失数据鲁棒性的新颖轨迹分类任务上,HiPPO-LegS比RNN和神经ODE基线方法的准确率高出25−40%25\mathrm{-}40\%2540%

【解析】这段摘要描述了一个处理序列数据记忆问题的数学框架。当我们处理时间序列数据时,比如语音识别或视频分析,系统需要记住之前发生的事情来理解当前的情况。但是随着时间推移,历史信息会越来越多,我们不可能把所有信息都完整保存下来,这就需要一种压缩方法。

HiPPO框架的核心思想是使用多项式基函数来压缩历史信息。多项式基函数就像是一套标准的"模板",任何复杂的函数都可以用这些模板的组合来近似表示。这个框架的巧妙之处在于它引入了一个"测度"概念,这个测度决定了历史上不同时间点的重要程度。比如,我们可能认为最近的信息更重要,或者某些特定时间点的信息更关键。

该框架的一个重要贡献是统一了现有的多种方法。它不仅能够重新推导出已知的勒让德记忆单元,还能解释为什么LSTM和GRU中的门控机制是有效的。更重要的是,它提出了HiPPO-LegS这种新的记忆更新机制,这种机制不需要预先知道序列的长度或时间尺度,能够自适应地处理不同长度的序列。

从理论角度来看,HiPPO-LegS具有几个重要性质:时间尺度鲁棒性说明它能够处理不同速度的输入;快速更新说明计算效率高;有界梯度说明训练过程稳定,不会出现梯度爆炸或消失问题。实验结果显示,这个方法在标准基准测试中取得了优异表现,特别是在需要长期记忆的任务上显著超越了传统方法。

1 Introduction

Modeling and learning from sequential data is a fundamental problem in modern machine learning, underlying tasks such as language modeling, speech recognition, video processing, and reinforcement learning. A core aspect of modeling long-term and complex temporal dependencies is memory , or storing and incorporating information from previous time steps. The challenge is learning a representation of the entire cumulative history using bounded storage, which must be updated online as more data is received.

【翻译】对序列数据进行建模和学习是现代机器学习中的一个基本问题,它是语言建模、语音识别、视频处理和强化学习等任务的基础。建模长期和复杂时间依赖关系的核心方面是记忆,即存储和整合来自先前时间步的信息。挑战在于使用有界存储学习整个累积历史的表示,该表示必须在接收到更多数据时在线更新。

【解析】这段话阐述了序列数据处理中的核心挑战。在处理时间序列数据时,系统需要同时面对两个矛盾的需求:一方面要记住所有重要的历史信息来理解当前状态,另一方面存储空间是有限的。这就像人类的记忆系统一样,我们不可能记住生活中的每一个细节,但又需要保留足够的信息来做出合理的判断。在线更新的要求进一步增加了复杂性,因为系统必须在数据流不断到来的情况下实时调整其内部表示,而不能等到所有数据都收集完毕后再进行批处理。

One established approach is to model a state that evolves over time as it incorporates more information. The deep learning instantiation of this approach is the recurrent neural network (RNN), which is known to suffer from a limited memory horizon [ 34 , 38 , 56 ] (e.g., the “vanishing gradients” problem). Although various heuristics have been proposed to overcome this, such as gates in the successful LSTM and GRU [16, 34], or higher-order frequencies in the recent Fourier Recurrent Unit [ 79 ] and Legendre Memory Unit (LMU) [ 71 ], a unified understanding of memory remains a challenge. Furthermore, existing methods generally require priors on the sequence length or timescale and are ineffective outside this range [ 66 , 71 ]; this can be problematic in settings with distribution shift (e.g. arising from different instrument sampling rates in medical data [ 62 , 63 ]). Finally, many of them lack theoretical guarantees on how well they capture long-term dependencies, such as gradient bounds. To design a better memory representation, we would ideally (i) have a unified view of these existing methods, (ii) be able to address dependencies of any length without priors on the timescale, and (iii) have a rigorous theoretical understanding of their memory mechanism.

【翻译】一种既定的方法是建模一个随时间演化的状态,该状态在整合更多信息时不断发展。这种方法在深度学习中的实例化是循环神经网络(RNN),众所周知它受到有限记忆视野的困扰(例如"梯度消失"问题)。尽管已经提出了各种启发式方法来克服这个问题,如成功的LSTM和GRU中的门控机制,或最近的傅里叶循环单元和勒让德记忆单元(LMU)中的高阶频率,但对记忆的统一理解仍然是一个挑战。此外,现有方法通常需要对序列长度或时间尺度的先验知识,在此范围之外效果不佳;这在存在分布偏移的设置中可能会有问题(例如,医疗数据中不同仪器采样率引起的问题)。最后,其中许多方法缺乏关于它们如何很好地捕获长期依赖关系的理论保证,如梯度界限。为了设计更好的记忆表示,我们理想情况下希望:(i) 对这些现有方法有统一的观点,(ii) 能够处理任何长度的依赖关系而无需时间尺度的先验知识,(iii) 对其记忆机制有严格的理论理解。

【解析】这段话分析了现有序列建模方法的局限性。RNN虽然是处理序列数据的经典方法,但其固有的梯度消失问题限制了它处理长序列的能力。后续的改进方法如LSTM、GRU等通过引入门控机制部分解决了这个问题,但这些解决方案更多是基于经验和直觉,缺乏统一的理论框架。更严重的问题是,这些方法通常需要预先知道序列的大致长度或时间特性,这在实际应用中往往是不现实的。特别是在医疗等领域,不同设备的采样频率可能差异很大,导致模型在面对新的时间尺度时性能急剧下降。作者提出了三个理想目标:建立统一理论框架、实现时间尺度无关性、提供严格的理论保证,这为后续的HiPPO框架奠定了动机基础。

Our insight is to phrase memory as a technical problem of online function approximation where a function f(t):R+→Rf(t):\mathbb{R}_{+}\rightarrow\mathbb{R}f(t):R+R is summarized by storing its optimal coefficients in terms of some basis functions. This approximation is evaluated with respect to a measure that specifies the importance of each time in the past. Given this function approximation formulation, orthogonal polynomials (OPs) emerge as a natural basis since their optimal coefficients can be expressed in closed form [ 14 ]. With their rich and well-studied history [ 65 ], along with their widespread use in approximation theory [ 68 ] and signal processing [ 57 ], OPs bring a library of techniques to this memory representation problem. We formalize a framework, HiPPO (high-order polynomial projection operators), which produces operators that project arbitrary functions onto the space of orthogonal polynomials with respect to a given measure. This general framework allows us to analyze several families of measures, where this operator, as a closed-form ODE or linear recurrence, allows fast incremental updating of the optimal polynomial approximation as the input function is revealed through time.

【翻译】我们的洞察是将记忆表述为在线函数逼近的技术问题,其中函数f(t):R+→Rf(t):\mathbb{R}_{+}\rightarrow\mathbb{R}f(t):R+R通过存储其在某些基函数方面的最优系数来进行总结。这种逼近是相对于一个测度来评估的,该测度指定了过去每个时间的重要性。给定这种函数逼近公式,正交多项式(OPs)作为自然基础出现,因为它们的最优系数可以用闭式形式表达。凭借其丰富且经过充分研究的历史,以及在逼近理论和信号处理中的广泛应用,正交多项式为这个记忆表示问题带来了一个技术库。我们形式化了一个框架,HiPPO(高阶多项式投影算子),它产生将任意函数投影到相对于给定测度的正交多项式空间的算子。这个通用框架允许我们分析几个测度族,其中该算子作为闭式ODE或线性递归,允许在输入函数随时间揭示时快速增量更新最优多项式逼近。

【解析】这段话提出了HiPPO框架的核心思想。作者将记忆问题重新定义为函数逼近问题,这是一个非常巧妙的数学抽象。在这个框架中,历史信息被看作是一个连续函数,而记忆的过程就是用有限个系数来近似表示这个函数。正交多项式的选择并非偶然,它们具有几个关键优势:首先,正交性保证了系数之间的独立性,避免了冗余;其次,最优系数可以通过闭式公式计算,这为实时更新提供了可能;最后,正交多项式在数学上有深厚的理论基础和丰富的性质。测度的概念引入了灵活性,允许系统根据不同的应用场景来定义历史信息的重要性权重。整个框架的优雅之处在于,它将复杂的记忆更新问题转化为标准的微分方程或线性递归问题,这些都有成熟的数值求解方法。

By posing a formal optimization problem underlying recurrent sequence models, the HiPPO framework (Section 2) generalizes and explains previous methods, unlocks new methods appropriate for sequential data at different timescales, and comes with several theoretical guarantees. (i) For example, with a short derivation we exactly recover as a special case the LMU [ 71 ] (Section 2.3), which proposes an update rule that projects onto fixed-length sliding windows through time. HiPPO also sheds new light on classic techniques such as the gating mechanism of LSTMs and GRUs, which arise in one extreme using only low-order degrees in the approximation (Section 2.5). (ii) By choosing more suitable measures, HiPPO yields a novel mechanism (Scaled Legendre, or LegS) that always takes into account the function’s full history instead of a sliding window. This flexibility removes the need for hyperparameters or priors on the sequence length, allowing LegS to generalize to different input timescales. (iii) The connections to dynamical systems and approximation theory allows us to show several theoretical benefits of HiPPO-LegS: invariance to input timescale, asymptotically more efficient updates, and bounds on gradient flow and approximation error (Section 3).

【翻译】通过提出循环序列模型底层的形式化优化问题,HiPPO框架(第2节)概括和解释了以前的方法,解锁了适用于不同时间尺度序列数据的新方法,并带来了几个理论保证。(i) 例如,通过简短的推导,我们精确地恢复了LMU作为特殊情况,它提出了一个投影到固定长度滑动窗口的更新规则。HiPPO还为经典技术如LSTM和GRU的门控机制提供了新的见解,这些技术在逼近中仅使用低阶度数的一个极端情况下出现(第2.5节)。(ii) 通过选择更合适的测度,HiPPO产生了一种新颖的机制(缩放勒让德,或LegS),它总是考虑函数的完整历史而不是滑动窗口。这种灵活性消除了对序列长度的超参数或先验知识的需要,允许LegS泛化到不同的输入时间尺度。(iii) 与动力系统和逼近理论的联系使我们能够展示HiPPO-LegS的几个理论优势:对输入时间尺度的不变性、渐近更高效的更新,以及梯度流和逼近误差的界限(第3节)。

【解析】这段话总结了HiPPO框架的三大贡献。首先,统一性贡献表现在它能够从统一的数学框架中推导出现有的多种方法,这不仅验证了框架的正确性,也为理解这些方法的本质提供了新的视角。特别是能够解释LSTM和GRU中门控机制的数学原理,这为这些经验性设计提供了理论基础。其次,创新性贡献体现在LegS方法的提出,它突破了传统滑动窗口的限制,能够利用完整的历史信息,这种设计消除了对序列长度预设的依赖,大大提高了模型的适应性。最后,理论性贡献提供了严格的数学保证,包括时间尺度不变性(模型性能不受输入速度影响)、计算效率的渐近优势,以及训练稳定性的数学界限,这些理论保证为实际应用提供了可靠的基础。

We integrate the HiPPO memory mechanisms into RNNs, and empirically show that they outperform baselines on standard tasks used to benchmark long-term dependencies. On the permuted MNIST dataset, our hyperparameter-free HiPPO-LegS method achieves a new state-of-the-art accuracy of 98.3%98.3\%98.3% , beating the previous RNN SoTA by over 1 point and even outperforming models with global context such as transformers (Section 4.1). Next, we demonstrate the timescale robustness of HiPPO-LegS on a novel trajectory classification task, where it is able to generalize to unseen timescales and handle missing data whereas RNN and neural ODE baselines fail (Section 4.2). Finally, we validate HiPPO’s theory, including computational efficiency and scalability, allowing fast and accurate online function reconstruction over millions of time steps (Section 4.3). Code for reproducing our experiments is available at https://github.com/HazyResearch/hippo-code .

【翻译】我们将HiPPO记忆机制集成到RNN中,并通过实验证明它们在用于基准测试长期依赖关系的标准任务上优于基线方法。在置换MNIST数据集上,我们的无超参数HiPPO-LegS方法达到了新的最先进准确率98.3%98.3\%98.3%,比之前的RNN最佳结果高出超过1个百分点,甚至超过了具有全局上下文的模型如transformers(第4.1节)。接下来,我们在一个新颖的轨迹分类任务上展示了HiPPO-LegS的时间尺度鲁棒性,它能够泛化到未见过的时间尺度并处理缺失数据,而RNN和神经ODE基线方法则失败了(第4.2节)。最后,我们验证了HiPPO的理论,包括计算效率和可扩展性,允许在数百万个时间步上进行快速准确的在线函数重构(第4.3节)。复现我们实验的代码可在 https://github.com/HazyResearch/hippo-code 获得。

【解析】这段话展示了HiPPO框架的实验验证结果,从三个维度证明了其优越性。首先,在经典的长期依赖基准测试中,HiPPO-LegS不仅超越了传统RNN方法,甚至超过了transformer这样的全局注意力模型,这说明了其在捕获长期依赖关系方面的卓越能力。置换MNIST是一个特别具有挑战性的任务,因为它破坏了图像的空间结构,迫使模型完全依赖序列信息,在这样的任务上取得突破性结果具有重要意义。其次,时间尺度鲁棒性实验验证了理论预期,证明了模型能够处理训练时未见过的时间特性,这在实际应用中极其重要。最后,大规模实验验证了理论分析的计算效率优势,证明该方法不仅在理论上科学有效,在实践中也具有良好的可扩展性。

2 The HiPPO Framework: High-order Polynomial Projection Operators(HiPPO框架:高阶多项式投影算子)

We motivate the problem of online function approximation with projections as an approach to learning memory representations (Section 2.1). Section 2.2 describes the general HiPPO framework to derive memory updates, including a precise definition of the technical problem we introduce, and an overview of our approach to solving it. Section 2.3 instantiates the framework to recover the LMU and yield new memory updates (e.g. HiPPO-LagT), demonstrating the generality of the HiPPO framework. Section 2.4 discusses how to convert the main continuous-time results into practical discrete versions. Finally in Section 2.5 we show how gating in RNNs is an instance of HiPPO memory.

【翻译】我们将在线函数逼近与投影问题作为学习记忆表示的方法进行动机阐述(第2.1节)。第2.2节描述了用于推导记忆更新的通用HiPPO框架,包括我们引入的技术问题的精确定义,以及解决该问题的方法概述。第2.3节实例化该框架以恢复LMU并产生新的记忆更新(例如HiPPO-LagT),展示了HiPPO框架的通用性。第2.4节讨论如何将主要的连续时间结果转换为实用的离散版本。最后在第2.5节中,我们展示了RNN中的门控如何作为HiPPO记忆的一个实例。

2.1 HiPPO Problem Setup(HiPPO问题设置)

Given an input function f(t)∈Rf(t)\in\mathbb{R}f(t)R on t≥0t\geq0t0 , many problems require operating on the cumulative history f≤t:=f(x)∣x≤f_{\leq t}:=f(x)\mid_{x\leq}ft:=f(x)x t at every time t≥0t\geq0t0 , in order to understand the inputs seen so far and make future predictions. Since the space of functions is intractably large, the history cannot be perfectly memorized and must be compressed; we propose the general approach of projecting it onto a subspace of bounded dimension. Thus, our goal is to maintain (online) this compressed representation of the history. In order to specify this problem fully, we require two ingredients: a way to quantify the approximation, and a suitable subspace.

【翻译】给定一个在t≥0t\geq0t0上的输入函数f(t)∈Rf(t)\in\mathbb{R}f(t)R,许多问题需要在每个时间t≥0t\geq0t0处操作累积历史f≤t:=f(x)∣x≤tf_{\leq t}:=f(x)\mid_{x\leq t}ft:=f(x)xt,以便理解到目前为止看到的输入并进行未来预测。由于函数空间过于庞大,历史无法被完美记忆,必须被压缩;我们提出将其投影到有界维度子空间的通用方法。因此,我们的目标是(在线)维护这种历史的压缩表示。为了完全指定这个问题,我们需要两个要素:量化逼近的方法和合适的子空间。

【解析】当我们处理时间序列数据时,系统需要在每个时刻都能够访问和利用从开始到当前时刻的所有历史信息。然而,随着时间的推移,这些历史信息会无限增长,而计算机的存储和计算能力都是有限的,因此不可能将所有历史信息都完整保存。作者提出的解决方案是将无限维的函数空间投影到有限维的子空间中,这种投影本质上是一种有损压缩,但通过精心设计可以保留最重要的信息。在线维护这种压缩表示的要求进一步增加了挑战性,因为系统必须能够随着新数据的到来实时更新其内部表示。为了使这个问题在数学上严格定义,需要解决两个关键问题:如何衡量压缩后的表示与原始历史信息之间的差距,以及选择什么样的子空间来进行投影。

Function Approximation with respect to a Measure. Assessing the quality of an approximation requires defining a distance in function space. Any probability measure integrable functions with inner product ⟨f,g⟩μ=∫0∞f(x)g(x)dμ(x)\begin{array}{r}{\langle f,g\rangle_{\mu}=\int_{0}^{\infty}f(x)g(x)\mathrm{d}\mu(x)}\end{array}f,gμ=0f(x)g(x)dμ(x), inducing a Hilbert space structure μ\muμ on [0,∞)[0,\infty)[0,) equips the space of square Hμ\mathcal{H}_{\boldsymbol{\mu}}Hμ and corresponding norm ∥f∥L2(μ)=⟨f,f⟩μ1/2\|f\|_{L_{2}(\mu)}=\langle f,f\rangle_{\mu}^{1/2}fL2(μ)=f,fμ1/2 .

【翻译】关于测度的函数逼近。评估逼近质量需要在函数空间中定义距离。任何概率测度μ\muμ[0,∞)[0,\infty)[0,)上为平方可积函数空间配备内积⟨f,g⟩μ=∫0∞f(x)g(x)dμ(x)\langle f,g\rangle_{\mu}=\int_{0}^{\infty}f(x)g(x)\mathrm{d}\mu(x)f,gμ=0f(x)g(x)dμ(x),诱导希尔伯特空间结构Hμ\mathcal{H}_{\boldsymbol{\mu}}Hμ和相应的范数∥f∥L2(μ)=⟨f,f⟩μ1/2\|f\|_{L_{2}(\mu)}=\langle f,f\rangle_{\mu}^{1/2}fL2(μ)=f,fμ1/2

【解析】这段话引入了函数逼近的数学框架。在函数分析中,要比较两个函数的相似程度,需要定义一个合适的距离度量。这里采用的是基于测度的内积定义,其中测度μ\muμ起到了权重函数的作用,决定了函数在不同位置的重要程度。内积⟨f,g⟩μ\langle f,g\rangle_{\mu}f,gμ通过积分的形式计算两个函数的"相似度",而测度dμ(x)\mathrm{d}\mu(x)dμ(x)可以理解为在位置xxx处的权重。希尔伯特空间Hμ\mathcal{H}_{\boldsymbol{\mu}}Hμ是一个完备的内积空间,具有良好的几何性质,使得投影和逼近问题有明确的最优解。范数∥f∥L2(μ)\|f\|_{L_{2}(\mu)}fL2(μ)衡量函数的"大小",它是内积的自然延伸。这种数学结构为后续的最优逼近问题提供了严格的理论基础,确保了投影操作的唯一性和最优性。

Polynomial Basis Expansion. Any NNN -dime onal subspace G\mathcal{G}G of this function space is a suitable candidate for the approximation. The parameter N corresponds to the order of the approximation, or the size of the compression; the projected history can be represented by the NNN coefficients of its expansion in any basis of G\mathcal{G}G . For the remainder of th paper, we use the polynomials as a natural basis, so that G\mathcal{G}G is the set of polynomials of degree less than N . We note that the polynomial basis is very general; for example, the Fourier basis sin⁡(nx),cos⁡(nx)\sin(n x),\cos(n x)sin(nx),cos(nx) can be seen as polynomials on the unit circle (e2πix)n(e^{2\pi i x})^{n}(e2πix)n (cf. Appendix D.4). In Appendix C, we additionally formalize a more general framework that allows different bases other than polynomials by tilting the measure with another function.

【翻译】多项式基展开。这个函数空间的任何NNN维子空间G\mathcal{G}G都是逼近的合适候选。参数N对应于逼近的阶数,或压缩的大小;投影历史可以通过其在G\mathcal{G}G的任何基中展开的NNN个系数来表示。在本文的其余部分,我们使用多项式作为自然基,因此G\mathcal{G}G是度数小于N的多项式集合。我们注意到多项式基是非常通用的;例如,傅里叶基sin⁡(nx),cos⁡(nx)\sin(n x),\cos(n x)sin(nx),cos(nx)可以看作是单位圆上的多项式(e2πix)n(e^{2\pi i x})^{n}(e2πix)n(参见附录D.4)。在附录C中,我们还形式化了一个更通用的框架,通过用另一个函数倾斜测度来允许多项式以外的不同基。

【解析】这段话解释了HiPPO框架中基函数选择的数学原理。在函数逼近理论中,任何有限维子空间都可以用来近似无限维的函数空间,关键在于选择合适的基函数。参数N决定了逼近的精度和计算复杂度之间的权衡:N越大,逼近越精确,但需要存储和计算的系数也越多。多项式基的选择并非偶然,它具有几个重要优势:首先,多项式在数学上具有良好的性质,如连续性、可微性和逼近能力;其次,多项式的运算相对简单,便于实现高效的数值算法。作者特别指出多项式基的通用性,甚至傅里叶基也可以通过复数表示转化为多项式形式,这说明了该框架的广泛适用性。附录C中提到的更通用框架进一步扩展了这种灵活性,允许通过测度变换来适应不同类型的基函数,这为特定应用场景的优化提供了可能。

Online Approximation. Since we care about approximating f≤tf_{\leq t}ft for every time ttt , we also let the measure vary through time. For every ttt , let μ(t)\mu^{(t)}μ(t) be a measure supported on (−∞,t](-\infty,t](,t] (since f≤tf_{\leq t}ft is only defined up to time ttt ). Overall, we seek some g(t)∈Gg^{(t)}\in\mathcal Gg(t)G that minimizes ∥f≤t−g(t)∥L2(μ(t))\|f_{\leq t}-g^{(t)}\|_{L_{2}(\mu^{(t)})}ftg(t)L2(μ(t)) . Intuitively, the measure μ\muμ controls the importance of various parts of the input domain, and the basis defines the allowable approximations. The challenge is how to solve the optimization problem in closed form given μ(t)\mu^{(t)}μ(t) , and how these coefficients can be maintained online as t→∞t\to\inftyt .

【翻译】在线逼近。由于我们关心在每个时间ttt处逼近f≤tf_{\leq t}ft,我们也让测度随时间变化。对于每个ttt,设μ(t)\mu^{(t)}μ(t)是支撑在(−∞,t](-\infty,t](,t]上的测度(因为f≤tf_{\leq t}ft只定义到时间ttt)。总体而言,我们寻求某个g(t)∈Gg^{(t)}\in\mathcal Gg(t)G来最小化∥f≤t−g(t)∥L2(μ(t))\|f_{\leq t}-g^{(t)}\|_{L_{2}(\mu^{(t)})}ftg(t)L2(μ(t))。直观地,测度μ\muμ控制输入域各部分的重要性,而基定义了允许的逼近。挑战在于如何在给定μ(t)\mu^{(t)}μ(t)的情况下以闭式形式求解优化问题,以及当t→∞t\to\inftyt时如何在线维护这些系数。

【解析】这段话阐述了在线函数逼近的数学框架。时变测度μ(t)\mu^{(t)}μ(t)的引入是一个关键创新,它允许系统根据时间动态调整对历史信息不同部分的重视程度。测度的支撑集(−∞,t](-\infty,t](,t]确保了因果性,即在时间ttt的逼近只能依赖于ttt时刻及之前的信息。优化目标∥f≤t−g(t)∥L2(μ(t))\|f_{\leq t}-g^{(t)}\|_{L_{2}(\mu^{(t)})}ftg(t)L2(μ(t))是一个加权L2L_2L2范数,其中权重由测度μ(t)\mu^{(t)}μ(t)决定,这种设计允许系统对不同时间点的历史信息赋予不同的重要性。例如,可以设计测度使得近期信息权重更大,或者对某些关键时间点给予特殊关注。真正的挑战在于实现在线更新:随着时间推进和新数据到来,系统必须能够高效地更新逼近系数,而不是每次都重新计算整个优化问题。这要求找到闭式解,使得系数更新可以通过简单的递推关系实现,从而保证算法的实时性和可扩展性。

2.2 通用HiPPO框架

We provide a brief overview of the main ideas behind solving this problem, which provides a surprisingly simple and general strategy for many measure families μ(t)\mu^{(t)}μ(t) . This framework builds upon a rich history of the well-studied orthogonal polynomials and related transforms in the signal processing literature. Our formal abstraction (Definition 1) departs from prior work on sliding transforms in several ways, which we discuss in detail in Appendix A.1. For example, our concept of the time-varying measure allows choosing μ(t)\mu^{(t)}μ(t) more appropriately, which will lead to solutions with qualitatively different behavior. Appendix C contains the full details and formalisms of our framework.

【翻译】我们提供了解决这个问题背后主要思想的简要概述,这为许多测度族μ(t)\mu^{(t)}μ(t)提供了一个令人惊讶的简单而通用的策略。这个框架建立在信号处理文献中经过充分研究的正交多项式和相关变换的丰富历史基础上。我们的形式化抽象(定义1)在几个方面偏离了先前关于滑动变换的工作,我们在附录A.1中详细讨论了这些方面。例如,我们的时变测度概念允许更恰当地选择μ(t)\mu^{(t)}μ(t),这将导致具有定性不同行为的解决方案。附录C包含了我们框架的完整细节和形式化内容。

【解析】这段话概述了HiPPO框架解决在线函数逼近问题的策略和理论基础。作者强调该方法的简单性和通用性并非偶然,而是建立在信号处理领域中正交多项式理论的深厚积累之上。正交多项式在函数逼近、数值积分、信号分析等领域的应用已经非常成熟,HiPPO框架巧妙地将这些经典理论应用到序列建模的记忆问题中。与传统滑动变换方法的关键区别在于时变测度μ(t)\mu^{(t)}μ(t)的引入,这种设计允许系统根据不同的应用需求和数据特性来动态调整历史信息的权重分布。传统方法通常使用固定的权重模式,而时变测度提供了更大的灵活性,能够产生定性不同的行为模式,比如可以实现均匀权重、指数衰减权重或其他更复杂的权重分布。这种抽象不仅统一了现有方法,还为开发新的记忆机制提供了系统性的理论指导。

Calculating the projection through continuous dynamics. As mentioned, the approximated function can be represented by the NNN coefficients of its expansion in any basis; the first key step is to choose a suitable basis {gn}n<N\{g_{n}\}_{n<N}{gn}n<N of G\mathcal{G}G . Leveraging classic techniques from approximation theory, a natural basis is the set of orthogonal polynomials for the measure μ(t)\mu^{(t)}μ(t) , which forms an orthogonal basis of the subspace. Then the coefficients of the optimal basis expansion are simply cn(t):=⟨f≤t,gn⟩μ(t)c_{n}^{(t)}:=\langle f_{\leq t},g_{n}\rangle_{\mu^{(t)}}cn(t):=ft,gnμ(t) .

【翻译】通过连续动力学计算投影。如前所述,逼近函数可以通过其在任何基中展开的NNN个系数来表示;第一个关键步骤是选择G\mathcal{G}G的合适基{gn}n<N\{g_{n}\}_{n<N}{gn}n<N。利用逼近理论的经典技术,一个自然的基是测度μ(t)\mu^{(t)}μ(t)的正交多项式集合,它形成子空间的正交基。然后最优基展开的系数简单地为cn(t):=⟨f≤t,gn⟩μ(t)c_{n}^{(t)}:=\langle f_{\leq t},g_{n}\rangle_{\mu^{(t)}}cn(t):=ft,gnμ(t)

【解析】在函数逼近问题中,选择合适的基函数是至关重要的第一步,因为基函数的性质直接影响逼近的效果和计算的复杂度。正交多项式基的选择具有深刻的数学原理:对于给定的测度μ(t)\mu^{(t)}μ(t),存在唯一的正交多项式序列,这些多项式在该测度下相互正交。正交性的重要意义在于它简化了投影计算,使得每个系数cn(t)c_{n}^{(t)}cn(t)可以独立计算,而不需要考虑其他系数的影响。系数公式cn(t):=⟨f≤t,gn⟩μ(t)c_{n}^{(t)}:=\langle f_{\leq t},g_{n}\rangle_{\mu^{(t)}}cn(t):=ft,gnμ(t)表明,第nnn个系数等于历史函数f≤tf_{\leq t}ft与第nnn个基函数gng_ngn在测度μ(t)\mu^{(t)}μ(t)下的内积。内积的线性性质使得系数的时间演化可以通过微分方程来描述。

The second key idea is to differentiate this projection in ttt , where differentiating through the integral (from the inner product terms of (ck(t))k∈[N](c_{k}(t))_{k\in[N]}(ck(t))k[N] ⟨f≤t,gn⟩μ(t))\langle f_{\leq t},g_{n}\rangle_{\mu^{(t)}}\big)ft,gnμ(t)) and f(t)f(t)f(t) . Thus the coefficients will often lead to a self-similar relation allowing c(t)∈RNc(t)\in\mathbb{R}^{N}c(t)RN should evolve as an ODE, with dynamics ddtcn(t)\begin{array}{r}{\frac{d}{d t}c_{n}(t)}\end{array}dtdcn(t) to be expressed in determined by f(t)f(t)f(t) .

【翻译】第二个关键思想是对这个投影在ttt上求导,其中通过积分求导(来自(ck(t))k∈[N](c_{k}(t))_{k\in[N]}(ck(t))k[N]的内积项⟨f≤t,gn⟩μ(t)\langle f_{\leq t},g_{n}\rangle_{\mu^{(t)}}ft,gnμ(t))和f(t)f(t)f(t)。因此系数通常会导致自相似关系,允许c(t)∈RNc(t)\in\mathbb{R}^{N}c(t)RN应该作为ODE演化,其动力学ddtcn(t)\frac{d}{d t}c_{n}(t)dtdcn(t)f(t)f(t)f(t)确定。

【解析】这段话揭示了HiPPO框架的第二个核心创新:通过对投影系数进行时间微分来建立动力学方程。这个想法的巧妙之处在于将静态的函数逼近问题转化为动态的微分方程问题。当我们对内积⟨f≤t,gn⟩μ(t)\langle f_{\leq t},g_{n}\rangle_{\mu^{(t)}}ft,gnμ(t)关于时间ttt求导时,需要应用莱布尼茨积分法则,因为积分的上限、被积函数和测度都可能随时间变化。这个微分过程会产生几个项:一个来自新输入f(t)f(t)f(t)的贡献,另一个来自测度μ(t)\mu^{(t)}μ(t)随时间变化的影响。关键的数学洞察是,由于正交多项式的特殊性质和测度的特定选择,这些微分项之间存在自相似的递归关系。这种自相似性使得系数向量c(t)c(t)c(t)的演化可以表示为一个线性常微分方程组,其中系数矩阵和输入矩阵具有明确的解析形式。

HiPPO抽象:在线函数逼近

Definition 1. Given a time-varying measure family μ(t)\mu^{(t)}μ(t) supported on (−∞,t](-\infty,t](,t] , an NNN -dimensional subspace G\mathcal{G}G of polynomials, and a continuous function $f : \mathbb{R}_{\geq 0} \rightarrow \mathbb{R} $ , HiPPO defines a projection operator projt\mathrm{proj}_{t}projt and a coefficient extraction operator coeft\mathrm{coef}_{t}coeft at every time t , with the following properties:

(1)projt(1)\mathrm{proj}_{t}(1)projt takes the function fff restricted up to time ttt , f≤t:=f(x)∣x≤tf_{\leq t}:=f(x)\mid_{x\leq t}ft:=f(x)xt , and maps it to a polynomial g(t)∈Gg^{(t)}\in\mathcal Gg(t)G , that minimizes the approximation error ∥f≤t−g(t)∥L2(μ(t))\|f_{\leq t}-g^{(t)}\|_{L_{2}(\mu^{(t)})}ftg(t)L2(μ(t)) .
(2) coeft:G→RN\mathrm{coef}_{t}:\mathcal{G}\to\mathbb{R}^{N}coeft:GRN maps the polynomial g(t)g^{(t)}g(t) to the coefficients c(t)∈RNc(t)\in\mathbb{R}^{N}c(t)RN of the basis of orthogonal polynomials defined with respect to the measure μ(t)\mu^{(t)}μ(t) .

【翻译】定义1. 给定一个支撑在(−∞,t](-\infty,t](,t]上的时变测度族μ(t)\mu^{(t)}μ(t),一个多项式的NNN维子空间G\mathcal{G}G,以及一个连续函数f:R≥0→Rf : \mathbb{R}_{\geq 0} \rightarrow \mathbb{R}f:R0R,HiPPO在每个时间ttt定义一个投影算子projt\mathrm{proj}_{t}projt和一个系数提取算子coeft\mathrm{coef}_{t}coeft,具有以下性质:

(1) projt\mathrm{proj}_{t}projt接受函数fff限制到时间ttt的部分f≤t:=f(x)∣x≤tf_{\leq t}:=f(x)\mid_{x\leq t}ft:=f(x)xt,并将其映射到多项式g(t)∈Gg^{(t)}\in\mathcal Gg(t)G,该多项式最小化逼近误差∥f≤t−g(t)∥L2(μ(t))\|f_{\leq t}-g^{(t)}\|_{L_{2}(\mu^{(t)})}ftg(t)L2(μ(t))

(2) coeft:G→RN\mathrm{coef}_{t}:\mathcal{G}\to\mathbb{R}^{N}coeft:GRN将多项式g(t)g^{(t)}g(t)映射到系数c(t)∈RNc(t)\in\mathbb{R}^{N}c(t)RN,这些系数是关于测度μ(t)\mu^{(t)}μ(t)定义的正交多项式基的系数。

【解析】这个定义是HiPPO框架的数学表述,它将整个在线函数逼近问题分解为两个操作步骤。首先理解输入:时变测度族μ(t)\mu^{(t)}μ(t)决定了在不同时刻如何对历史信息进行加权,支撑在(−∞,t](-\infty,t](,t]上确保了因果性约束;NNN维多项式子空间G\mathcal{G}G限定了逼近函数的复杂度和表达能力;连续函数fff代表输入信号。投影算子projt\mathrm{proj}_{t}projt执行的是一个优化过程,它在有限维的多项式空间中寻找最佳逼近,优化目标是最小化加权L2L_2L2范数意义下的逼近误差。这个过程本质上是将无限维的函数空间投影到有限维子空间的标准数学操作。系数提取算子coeft\mathrm{coef}_{t}coeft则完成从几何对象(多项式)到数值表示(系数向量)的转换,这些系数是相对于特定测度下的正交多项式基计算得出的。正交基的使用确保了系数之间的独立性和数值稳定性,同时也为后续的动力学推导提供了数学便利。这两个算子的组合构成了完整的HiPPO变换,将时间序列数据转换为可以高效更新的记忆表示。

在这里插入图片描述
Figure 1: Illustration of the HiPPO framework. (1) For any function fff , (2) at every time ttt there is an optimal projection g(t)g^{(t)}g(t) of fff onto the space of polynomials, with respect to a measure μ(t)\mu^{(t)}μ(t) weighing the past. (3) For an appropriately chosen basis, the corresponding coefficients c(t)∈RNc(t)\in\mathbb{R}^{N}c(t)RN representing a compression of the history of fff satisfy linear dynamics. (4) Discretizing the dynamics yields an efficient closed-form recurrence for online compression of time series (fk)k∈N(f_{k})_{k\in\mathbb{N}}(fk)kN .

【翻译】图1:HiPPO框架的图解。(1) 对于任何函数fff,(2) 在每个时间ttt处,存在fff在多项式空间上的最优投影g(t)g^{(t)}g(t),相对于对过去进行加权的测度μ(t)\mu^{(t)}μ(t)。(3) 对于适当选择的基,表示fff历史压缩的相应系数c(t)∈RNc(t)\in\mathbb{R}^{N}c(t)RN满足线性动力学。(4) 离散化动力学产生了用于时间序列(fk)k∈N(f_{k})_{k\in\mathbb{N}}(fk)kN在线压缩的高效闭式递推关系。

【解析】图展示了HiPPO框架的四个核心步骤,第一步确立了问题的普遍性:框架可以处理任意的连续函数输入,这种通用性是理论框架的重要特征。第二步揭示了投影操作的本质:在每个时刻,系统都要在有限维的多项式空间中找到最佳的函数逼近,而测度μ(t)\mu^{(t)}μ(t)的作用是为历史的不同部分分配权重,这种加权机制允许系统根据应用需求灵活调整对远近历史信息的重视程度。第三步是整个框架的数学核心:通过选择合适的正交多项式基,原本复杂的函数逼近问题转化为系数向量的线性动力学系统,这种转化不仅简化了计算,更重要的是保证了系统的稳定性和可预测性。第四步完成了从理论到实践的桥梁:通过标准的数值离散化技术,连续时间的微分方程被转换为离散时间的递推关系,这使得算法可以高效地处理实际的数字信号和时间序列数据,同时保持闭式解的计算优势。

The composition coef ∘\circ proj is whic nction f:R≥0→Rf:\mathbb{R}_{\geq0}\rightarrow\mathbb{R}f:R0R to the optimal projection coefficients c:R≥0→RNc:\mathbb{R}_{\geq0}\rightarrow\mathbb{R}^{N}c:R0RN ≥ → , i.e. (hippo(f))(t)=coeft(projt(f))(\mathrm{hippo}(f))(t)=\mathrm{coef}_{t}(\mathrm{proj}_{t}(f))(hippo(f))(t)=coeft(projt(f)) .

【翻译】组合算子coef ∘\circ proj将函数f:R≥0→Rf:\mathbb{R}_{\geq0}\rightarrow\mathbb{R}f:R0R映射到最优投影系数c:R≥0→RNc:\mathbb{R}_{\geq0}\rightarrow\mathbb{R}^{N}c:R0RN,即(hippo(f))(t)=coeft(projt(f))(\mathrm{hippo}(f))(t)=\mathrm{coef}_{t}(\mathrm{proj}_{t}(f))(hippo(f))(t)=coeft(projt(f))

【解析】组合算子∘\circ表示函数复合,coef ∘\circ proj说明HiPPO的操作是先进行投影再提取系数的两步过程。从函数映射的角度看,输入是定义在非负实数轴上的标量函数fff,输出是NNN维向量值函数ccc,这个转换过程将无限维的函数信息压缩到有限维的系数表示中。公式(hippo(f))(t)=coeft(projt(f))(\mathrm{hippo}(f))(t)=\mathrm{coef}_{t}(\mathrm{proj}_{t}(f))(hippo(f))(t)=coeft(projt(f))明确了在任意时刻ttt,HiPPO算子的输出等于先对历史函数f≤tf_{\leq t}ft进行最优投影得到g(t)g^{(t)}g(t),然后提取其在正交基下的系数向量。这种组合操作的设计确保了每个时刻的输出都是当前历史信息的最优压缩表示,同时保持了操作的因果性和实时性。算子的时变特性体现在proj和coef都依赖于当前时刻ttt,这使得系统能够动态适应不断增长的历史信息。

For each ttt , the problem of optimal projection proj t(f)_t(f)t(f) is well-defined by the above inner products, but this is intractable to compute naively. Our derivations (Appendix D) will show that the coefficient function c(t)=coeft(projt(f))c(t)=\mathrm{coef}_{t}(\mathrm{proj}_{t}(f))c(t)=coeft(projt(f)) has the form of an ODE satisfying ddtc(t)=A(t)c(t)+B(t)f(t)\begin{array}{r}{\frac{d}{d t}c(t)=A(t)c(t)+B(t)f(t)}\end{array}dtdc(t)=A(t)c(t)+B(t)f(t) for some A(t)∈RN×NA(t)\in\mathbb{R}^{N\times N}A(t)RN×N , B(t)∈RN×1B(t)\in\mathbb{R}^{N\times1}B(t)RN×1 . Thus our results show how to tractably obtain c(t)c^{(t)}c(t) online by solving an ODE, or more concretely by running a discrete recurrence. When discretized, HiPPO takes in a sequence of real values and produces a sequence of NNN -dimensional vectors.

【翻译】对于每个ttt,最优投影问题projt(f)_t(f)t(f)通过上述内积是良定义的,但直接计算是不可行的。我们的推导(附录D)将表明系数函数c(t)=coeft(projt(f))c(t)=\mathrm{coef}_{t}(\mathrm{proj}_{t}(f))c(t)=coeft(projt(f))具有ODE的形式,满足ddtc(t)=A(t)c(t)+B(t)f(t)\frac{d}{d t}c(t)=A(t)c(t)+B(t)f(t)dtdc(t)=A(t)c(t)+B(t)f(t),其中A(t)∈RN×NA(t)\in\mathbb{R}^{N\times N}A(t)RN×NB(t)∈RN×1B(t)\in\mathbb{R}^{N\times1}B(t)RN×1。因此我们的结果展示了如何通过求解ODE在线可处理地获得c(t)c^{(t)}c(t),或者更具体地通过运行离散递推关系。当离散化时,HiPPO接受实数值序列并产生NNN维向量序列。

【解析】虽然通过内积定义的最优投影在数学上是严格的,但如果每次都重新计算整个优化问题,计算复杂度会随着时间增长而爆炸,这在实际应用中是完全不可行的。HiPPO的核心贡献在于发现了一个深刻的数学事实:系数函数c(t)c(t)c(t)的时间演化可以表示为一个线性常微分方程。这个ODE的形式ddtc(t)=A(t)c(t)+B(t)f(t)\frac{d}{d t}c(t)=A(t)c(t)+B(t)f(t)dtdc(t)=A(t)c(t)+B(t)f(t)具有标准的状态空间表示结构,其中A(t)A(t)A(t)是状态转移矩阵,描述了系数之间的内在耦合关系,而B(t)B(t)B(t)是输入矩阵,决定了新输入f(t)f(t)f(t)如何影响各个系数的变化。这种ODE形式的重要性在于它将复杂的函数逼近问题转化为标准的动力学系统,可以利用成熟的数值积分方法进行求解。更进一步,通过标准的离散化技术(如欧拉方法或龙格-库塔方法),连续时间的ODE可以转换为离散时间的递推关系,这使得算法能够高效处理数字信号和时间序列数据。离散化后的系统具有明确的输入输出特性:输入是标量序列(实际的时间序列数据),输出是NNN维向量序列(压缩的记忆表示),这种设计完美适配了现代深度学习框架的张量操作模式。

Figure 1 illustrates the overall framework when we use uniform measures. Next, we give our main results showing hippo for several concrete instantiations of the framework.

【翻译】图1展示了当我们使用均匀测度时的整体框架。接下来,我们给出主要结果,展示框架的几个具体实例化的hippo。

【解析】这里提到的均匀测度是指对历史信息的所有部分赋予相等权重的测度选择,这是最直观和基础的权重分配方式。图1作为框架的可视化说明,帮助读者理解从连续函数到离散递推的完整转换过程。作者接下来要展示的"具体实例化"是指针对不同测度族μ(t)\mu^{(t)}μ(t)的具体数学推导和相应的ODE形式,这些实例将证明HiPPO框架的通用性和实用性,同时也会揭示不同测度选择对记忆机制行为的影响。

2.3 高阶投影:测度族和HiPPO常微分方程

Our main theoretical results are instantiations of HiPPO for various measure families μ(t)\mu^{(t)}μ(t) . We provide two examples of natural sliding window measures and the corresponding projection operators. The unified perspective on memory mechanisms allows us to derive these closed-form solutions with the same strategy, provided in Appendices D.1,D.2. The first explains the core Legendre Memory Unit (LMU) [ 71 ] update in a principled way and characterizes its limitations, while the other is novel, demonstrating the generality of the HiPPO framework. Appendix D contrasts the tradeoffs of these measures (Fig. 5), contains proofs of their derivations, and derives additional HiPPO formulas for other bases such as Fourier (recovering the Fourier Recurrent Unit [79]) and Chebyshev.

【翻译】我们的主要理论结果是针对各种测度族μ(t)\mu^{(t)}μ(t)的HiPPO实例化。我们提供了两个自然滑动窗口测度的例子以及相应的投影算子。对记忆机制的统一视角使我们能够用相同的策略推导出这些闭式解,详见附录D.1和D.2。第一个以原理性的方式解释了核心的Legendre记忆单元(LMU)[71]更新并描述了其局限性,而另一个是新颖的,展示了HiPPO框架的通用性。附录D对比了这些测度的权衡(图5),包含了它们推导的证明,并推导了其他基(如傅里叶(恢复傅里叶递归单元[79])和切比雪夫)的额外HiPPO公式。

【解析】这段话说明了HiPPO框架的理论贡献主要体现在对不同测度族的具体实现上。测度族μ(t)\mu^{(t)}μ(t)的选择决定了系统如何对历史信息进行加权,不同的测度选择会产生不同的记忆行为特性。滑动窗口测度是信号处理中的经典概念,它通过限定一个固定长度的时间窗口来控制记忆的范围。统一视角的价值在于它提供了一个通用的数学框架,使得看似不同的记忆机制实际上都可以通过相同的数学推导策略来获得闭式解。Legendre记忆单元作为已有的成熟技术,通过HiPPO框架的重新解释,不仅能够理解其工作原理,更重要的是能够识别其理论局限性。新颖测度的引入展示了框架的创新潜力,说明通过改变测度选择可以设计出具有不同特性的记忆机制。附录中对不同测度权衡的分析为实际应用中的测度选择提供了理论指导,而对傅里叶和切比雪夫基的扩展证明了框架不仅限于多项式基,具有更广泛的数学适用性。

The translated Legen re (LegT) measures assign uniform weight to the most recent history [t−θ,t][t-\theta,t][tθ,t] There is a hyperparameter θ representing the length of the sliding window, or the length of history that is being summarized. The translated Laguerre (LagT) measures instead use the exponentially decaying measure, assigning more importance to recent history.

【翻译】平移Legendre (LegT)测度对最近的历史[t−θ,t][t-\theta,t][tθ,t]分配均匀权重。有一个超参数θ\thetaθ表示滑动窗口的长度,或者说被总结的历史长度。平移Laguerre (LagT)测度则使用指数衰减测度,对近期历史分配更多重要性。

【解析】这里介绍了两种具体的测度设计方案,它们代表了处理历史信息的两种不同哲学。LegT测度采用均匀权重策略,在固定长度的时间窗口[t−θ,t][t-\theta,t][tθ,t]内,所有时刻的信息都被赋予相等的重要性,这种设计简单直观,适合需要平等对待近期所有历史的应用场景。超参数θ\thetaθ的引入提供了控制记忆容量的机制,较大的θ\thetaθ值会保留更长的历史信息,但也会增加计算复杂度和可能的噪声干扰。LagT测度则体现了更符合人类记忆特点的设计思想:越近的事件越重要,越远的事件影响越小。指数衰减函数e−(t−x)e^{-(t-x)}e(tx)确保了权重随时间距离的增加而平滑递减,这种设计在许多实际应用中更为合理,因为通常情况下最新的信息对当前决策的影响最大。两种测度的对比揭示了记忆机制设计中的基本权衡:均匀权重保证了对历史信息的公平处理,而指数衰减权重则更符合信息的时效性特征。

LegT:μ(t)(x)=1θI[t−θ,t](x)LagT:μ(t)(x)=e−(t−x)I(−∞,t](x)={ex−tifx≤t0ifx>t\mathbf{LegT}:\mu^{(t)}(x)=\frac{1}{\theta}\mathbb{I}_{[t-\theta,t]}(x)\\\qquad\mathbf{LagT}:\mu^{(t)}(x)=e^{-(t-x)}\mathbb{I}_{(-\infty,t]}(x)=\left\{\begin{array}{l l}{e^{x-t}}&{\mathrm{if~}x\leq t}\\ {0}&{\mathrm{if~}x>t}\end{array}\right. LegT:μ(t)(x)=θ1I[tθ,t](x)LagT:μ(t)(x)=e(tx)I(,t](x)={ext0if xtif x>t

Theorem 1. For LegT and LagT, the hippo operators satisfying Definition 1\mathit{1}1 are given by linear time-invariant (LTI) ODEs ddtc(t)=−Ac(t)+Bf(t)\begin{array}{r}{\frac{d}{d t}c(t)=-A c(t)+B f(t)}\end{array}dtdc(t)=Ac(t)+Bf(t) , where A∈RN×N,B∈RN×1A\in\mathbb{R}^{N\times N},B\in\mathbb{R}^{N\times1}ARN×N,BRN×1 :

【翻译】定理1. 对于LegT和LagT,满足定义1的hippo算子由线性时不变(LTI)常微分方程ddtc(t)=−Ac(t)+Bf(t)\frac{d}{d t}c(t)=-A c(t)+B f(t)dtdc(t)=Ac(t)+Bf(t)给出,其中A∈RN×N,B∈RN×1A\in\mathbb{R}^{N\times N},B\in\mathbb{R}^{N\times1}ARN×N,BRN×1

【解析】这个定理是HiPPO框架的核心数学结果,它将抽象的函数逼近问题转化为具体的线性动力学系统。线性时不变(LTI)系统的重要性在于其数学性质良好且计算高效,线性性保证了系统的可叠加性和比例性,时不变性说明系统参数不随时间变化,这大大简化了分析和实现。常微分方程的标准形式ddtc(t)=−Ac(t)+Bf(t)\frac{d}{d t}c(t)=-A c(t)+B f(t)dtdc(t)=Ac(t)+Bf(t)物理解释:−Ac(t)-Ac(t)Ac(t)项描述了系统的内在动力学,负号通常对应于稳定的衰减行为,而Bf(t)Bf(t)Bf(t)项表示外部输入对系统状态的驱动作用。矩阵AAA的维度N×NN\times NN×N说明它描述了NNN个系数之间的相互耦合关系,这种耦合是正交多项式基函数之间数学关系的体现。向量BBB的维度N×1N\times 1N×1表明每个新的输入值f(t)f(t)f(t)会同时影响所有NNN个系数,但影响的程度由BBB的各个分量决定。这种ODE形式的优势在于可以利用成熟的数值积分方法进行求解,同时也为后续的离散化实现提供了理论基础。

LegT:Ank=1θ{(−1)n−k(2n+1)if n≥k2n+1if n≤k,Bn=1θ(2n+1)(−1)n\textbf{LegT:} A_{nk} = \frac{1}{\theta} \begin{cases} (-1)^{n-k}(2n+1) & \text{if } n \geq k \\ 2n+1 & \text{if } n \leq k \end{cases}, \quad B_n = \frac{1}{\theta}(2n+1)(-1)^n LegT:Ank=θ1{(1)nk(2n+1)2n+1if nkif nk,Bn=θ1(2n+1)(1)n

LagT:Ank={1if n≥k0if n<k,Bn=1\textbf{LagT:} A_{nk} = \begin{cases} 1 & \text{if } n \geq k \\ 0 & \text{if } n < k \end{cases}, \quad B_n = 1 LagT:Ank={10if nkif n<k,Bn=1

Equation (1) proves the LMU update [ 71 , equation (1)]. Additionally, our derivation (Appendix D.1) shows that outside of the projections, there is another source of approximation. This sliding window update rule requires access to f(t−θ)f(t-\theta)f(tθ) , which is no longer available; it instead assumes that the current coefficients c(t)c(t)c(t) are an accurate enough model of the function f(x)x≤t\boldsymbol{f}(\boldsymbol{x})_{\boldsymbol{x}\le t}f(x)xt that f(t−θ)f(t-\theta)f(tθ) can be recovered.

【翻译】方程(1)证明了LMU更新[71,方程(1)]。此外,我们的推导(附录D.1)显示除了投影之外,还有另一个近似来源。这个滑动窗口更新规则需要访问f(t−θ)f(t-\theta)f(tθ),但这已经不再可用;它假设当前系数c(t)c(t)c(t)是函数f(x)x≤t\boldsymbol{f}(\boldsymbol{x})_{\boldsymbol{x}\le t}f(x)xt的足够准确的模型,从而可以恢复f(t−θ)f(t-\theta)f(tθ)

【解析】这段话揭示了LMU(Legendre记忆单元)实现中的一个关键技术细节。方程(1)的证明建立了HiPPO框架与已有LMU技术之间的数学联系,说明LMU实际上是HiPPO框架在特定测度选择下的一个特例。更重要的是,作者指出了滑动窗口机制中存在的第二个近似误差源,这个误差源独立于正交投影本身的截断误差。在滑动窗口的更新过程中,系统需要知道窗口边界处的函数值f(t−θ)f(t-\theta)f(tθ)来正确地"遗忘"过时的信息,但在实际的在线处理中,这个历史值已经不再直接可获得。因此,系统必须依赖当前的系数向量c(t)c(t)c(t)来重构这个边界值,这就引入了一个重构误差。这种重构的可行性基于一个关键假设:当前的多项式系数c(t)c(t)c(t)能够充分准确地表示整个历史函数f(x)x≤t\boldsymbol{f}(\boldsymbol{x})_{\boldsymbol{x}\le t}f(x)xt,使得边界值f(t−θ)f(t-\theta)f(tθ)可以通过这些系数可靠地计算出来。这个假设的有效性直接影响到滑动窗口机制的精度,也解释了为什么在某些情况下LMU的性能可能会受到限制。

2.4 HiPPO递推关系:通过ODE离散化从连续时间到离散时间

Since actual data is inherently discrete (e.g. sequences and time series), we discuss how the HiPPO projection operators can be discretized using standard techniques, so that the continuous-time HiPPO ODEs become discrete-time linear recurrences.

【翻译】由于实际数据本质上是离散的(例如序列和时间序列),我们讨论如何使用标准技术将HiPPO投影算子离散化,使得连续时间HiPPO常微分方程变成离散时间线性递推关系。

【解析】虽然HiPPO框架在数学上是基于连续时间函数和微分方程建立的,但现实世界中的数据都是以离散形式存在的,比如每秒采样的传感器读数、每天的股价数据、或者文本中的词序列。因此必须将连续的数学理论转换为可以处理离散数据的算法。离散化过程的核心是将微分方程转换为差分方程,这样就可以用计算机进行数值计算。线性递推关系的形式特别适合序列处理,因为它可以逐步更新状态,每次处理一个新的数据点,这正是RNN等序列模型的基本工作方式。

In the continuous case, these operators consume an input function f(t)f(t)f(t) and produce an output function c(t)c(t)c(t) . The discrete time case (i) consumes an input sequence (fk)k∈N(f_{k})_{k\in\mathbb{N}}(fk)kN , (ii) implicitly defines a function f(t)f(t)f(t) where f(k⋅Δt)=fkf(k\cdot\Delta t)=f_{k}f(kΔt)=fk for some step size Δt\Delta tΔt , (iii) produces a function c(t)c(t)c(t) through the ODE dynamics, and (iv) discretizes back to an output sequence ck:=c(k⋅Δt)c_{k}:=c(k\cdot\Delta t)ck:=c(kΔt) .

【翻译】在连续情况下,这些算子消费输入函数f(t)f(t)f(t)并产生输出函数c(t)c(t)c(t)。离散时间情况下:(i)消费输入序列(fk)k∈N(f_{k})_{k\in\mathbb{N}}(fk)kN,(ii)隐式定义一个函数f(t)f(t)f(t),其中对于某个步长Δt\Delta tΔtf(k⋅Δt)=fkf(k\cdot\Delta t)=f_{k}f(kΔt)=fk,(iii)通过ODE动力学产生函数c(t)c(t)c(t),(iv)离散化回输出序列ck:=c(k⋅Δt)c_{k}:=c(k\cdot\Delta t)ck:=c(kΔt)

【解析】这里详细描述了离散化处理的四个关键步骤,这个过程体现了连续数学理论与离散计算实现之间的桥梁作用。第一步是接收实际的离散数据序列,这些数据点按照自然数索引排列。第二步是关键的插值步骤,通过引入时间步长Δt\Delta tΔt,将离散的数据点映射到连续时间轴上,这样就可以将离散序列视为连续函数在特定时刻的采样值。第三步利用已经建立的连续时间ODE理论来计算系统的演化,这保证了数学理论的完整性和严谨性。第四步将连续的理论结果重新采样为离散序列,这样就得到了可以在计算机中存储和处理的数值结果。这种"离散→连续→离散"的处理流程既保持了理论的数学优雅性,又确保了实际计算的可行性。

The basic method of discretizating an ODE ddtc(t)=u(t,c(t),f(t))\begin{array}{r}{\frac{d}{d t}c(t)=u(t,c(t),f(t))}\end{array}dtdc(t)=u(t,c(t),f(t)) chooses a step size Δt\Delta tΔt and performs the discrete updates c(t+Δt)=c(t)+Δt⋅u(t,c(t),f(t))c(t+\Delta t)=c(t)+\Delta t\cdot u(t,c(t),f(t))c(t+Δt)=c(t)+Δtu(t,c(t),f(t)) . In general, this process is sensitive to the discretization step size hyperparameter Δt\Delta tΔt.

【翻译】离散化常微分方程ddtc(t)=u(t,c(t),f(t))\frac{d}{d t}c(t)=u(t,c(t),f(t))dtdc(t)=u(t,c(t),f(t))的基本方法是选择一个步长Δt\Delta tΔt并执行离散更新c(t+Δt)=c(t)+Δt⋅u(t,c(t),f(t))c(t+\Delta t)=c(t)+\Delta t\cdot u(t,c(t),f(t))c(t+Δt)=c(t)+Δtu(t,c(t),f(t))。一般来说,这个过程对离散化步长超参数Δt\Delta tΔt很敏感。

【解析】这段话介绍了数值微分方程求解中最基础的欧拉方法。微分方程ddtc(t)=u(t,c(t),f(t))\frac{d}{d t}c(t)=u(t,c(t),f(t))dtdc(t)=u(t,c(t),f(t))描述了系统状态c(t)c(t)c(t)随时间的变化率,而欧拉方法通过将这个瞬时变化率近似为有限时间间隔内的平均变化率来进行数值求解。更新公式c(t+Δt)=c(t)+Δt⋅u(t,c(t),f(t))c(t+\Delta t)=c(t)+\Delta t\cdot u(t,c(t),f(t))c(t+Δt)=c(t)+Δtu(t,c(t),f(t))的物理含义是:下一时刻的状态等于当前状态加上当前变化率乘以时间步长。步长Δt\Delta tΔt的选择至关重要,太大的步长会导致数值不稳定和精度损失,太小的步长虽然精度高但计算成本昂贵。这种敏感性在实际应用中需要仔细调节,不同的问题和不同的ODE系统可能需要完全不同的最优步长设置。这也解释了为什么后续提到的HiPPO-LegS方法的步长不变性是一个重要的理论优势。

Finally, we note that this provides a way to seamlessly handle timestamped data, even with missing values: the difference between timestamps indicates the (adaptive) Δt\Delta tΔt to use in discretization [ 13 ]. Appendix B.3 contains a full discussion of discretization.

【翻译】最后,我们注意到这提供了一种无缝处理时间戳数据的方法,即使有缺失值:时间戳之间的差异指示了在离散化中使用的(自适应)Δt\Delta tΔt[13]。附录B.3包含了离散化的完整讨论。

【解析】这段话揭示了HiPPO框架的一个重要实用优势:处理不规则时间序列数据的能力。在现实应用中,数据采集往往不是完全规律的,可能存在采样间隔不均匀、数据点缺失、或者不同传感器有不同采样频率等问题。传统的序列处理方法通常假设数据是等间隔采样的,面对不规则数据时需要进行复杂的预处理。而HiPPO框架通过自适应步长机制解决了这个问题:系统可以根据实际的时间戳差异动态调整Δt\Delta tΔt,这样每个更新步骤都能准确反映真实的时间间隔。当某些时间点的数据缺失时,系统会自动使用更大的时间步长跳过缺失区间,而不需要人工插值或其他预处理步骤。这种设计使得HiPPO特别适合处理不规则时间序列数据。

2.5 低阶投影:门控RNN的记忆机制

As a special case, we consider what happens if we do not incorporate higher-order polynomials in the projection problem. Specifically, if N=1N=1N=1 , then the discretized version of HiPPO-LagT (2) becomes c(t+Δt)=c(t)+Δt(−Ac(t)+Bf(t))=(1−Δt)c(t)+Δtf(t)c(t+\Delta t)=c(t)+\Delta t(-A c(t)+B f(t))=(1-\Delta t)c(t)+\Delta t f(t)c(t+Δt)=c(t)+Δt(Ac(t)+Bf(t))=(1Δt)c(t)+Δtf(t) , nce A=B=1A=B=1A=B=1 . If the inputs f(t)f(t)f(t) can depend on the hidden state c(t)c(t)c(t) and the discretization step size ∆ t is chosen adaptively (as a function of input f(t)f(t)f(t) and state c(t)c(t)c(t) ), as in RNNs, then this becomes exactly a gated RNN. For instance, by stacking multiple units in parallel and choosing a specific update function, we obtain the GRU update cell as a special case. In contrast to HiPPO which uses one hidden feature and projects it onto high order polynomials, these models use many hidden features but only project them with degree 1. This view sheds light on these classic techniques by showing how they can be derived from first principles.

【翻译】作为一个特殊情况,我们考虑如果在投影问题中不包含高阶多项式会发生什么。具体地,如果N=1N=1N=1,那么HiPPO-LagT (2)的离散化版本变成c(t+Δt)=c(t)+Δt(−Ac(t)+Bf(t))=(1−Δt)c(t)+Δtf(t)c(t+\Delta t)=c(t)+\Delta t(-A c(t)+B f(t))=(1-\Delta t)c(t)+\Delta t f(t)c(t+Δt)=c(t)+Δt(Ac(t)+Bf(t))=(1Δt)c(t)+Δtf(t),因为A=B=1A=B=1A=B=1。如果输入f(t)f(t)f(t)可以依赖于隐藏状态c(t)c(t)c(t),并且离散化步长Δt\Delta tΔt被自适应地选择(作为输入f(t)f(t)f(t)和状态c(t)c(t)c(t)的函数),就像在RNN中一样,那么这就完全变成了一个门控RNN。例如,通过并行堆叠多个单元并选择特定的更新函数,我们可以得到GRU更新单元作为特殊情况。与HiPPO使用一个隐藏特征并将其投影到高阶多项式上相反,这些模型使用许多隐藏特征但只用1次多项式对它们进行投影。这种观点通过展示如何从第一性原理推导出这些经典技术来阐明它们。

【解析】这段话揭示了HiPPO框架与传统门控RNN之间的深层数学联系。当我们将HiPPO的多项式阶数降低到最简单的情况N=1N=1N=1时,整个复杂的正交多项式投影系统就退化为一个简单的线性组合。在HiPPO-LagT的设置下,系数矩阵AAABBB都等于1,这使得更新方程变成了(1−Δt)c(t)+Δtf(t)(1-\Delta t)c(t)+\Delta t f(t)(1Δt)c(t)+Δtf(t)的形式。这个公式的结构与门控机制完全一致:(1−Δt)(1-\Delta t)(1Δt)可以理解为"遗忘门",控制保留多少历史信息;Δt\Delta tΔt可以理解为"输入门",控制接受多少新信息。当步长Δt\Delta tΔt变成输入和状态的自适应函数时,这就是标准RNN中门控机制的数学表达。更进一步,通过并行使用多个这样的单元并设计特定的门控函数,就可以构造出GRU等复杂的门控单元。这个发现说明了两种看似不同的记忆机制策略:HiPPO使用单一隐藏状态但通过高阶多项式捕获复杂的时间依赖关系,而传统RNN使用多个隐藏状态但每个状态只进行简单的线性组合。

3 HiPPO-LegS:用于时间尺度鲁棒性的缩放测度

Exposing the tight connection between online function approximation and memory allows us to produce memory mechanisms with better theoretical properties, simply by choosing the measure appropriately. Although sliding windows are common in signal processing (Appendix A.1), a more intuitive approach for memory should scale the window over time to avoid forgetting.

【翻译】揭示在线函数逼近与记忆之间的紧密联系使我们能够通过适当选择测度来产生具有更好理论性质的记忆机制。尽管滑动窗口在信号处理中很常见(附录A.1),但对于记忆来说,一种更直观的方法应该是随时间缩放窗口以避免遗忘。

【解析】前面的章节已经建立了在线函数逼近与记忆机制之间的数学等价性,现在作者要利用这个理论基础来设计更优秀的记忆系统。关键洞察是:不同的测度选择会导致完全不同的记忆行为特性。传统的滑动窗口方法虽然在信号处理领域应用广泛,但存在一个根本性问题:它使用固定大小的窗口,这会导致系统在处理长序列时不可避免地"遗忘"早期的重要信息。更合理的记忆机制应该具有自适应性:随着时间的推移,记忆窗口应该动态扩展,这样系统就能够保持对整个历史的访问能力,而不是机械地丢弃超出固定窗口范围的信息。这种"缩放窗口"的概念为设计长期记忆系统提供了新的理论方向。

Our novel scaled Legendre measure (LegS) assigns uniform weight to all history [0,t][0,t][0,t] : μ(t)=1tI[0,t]\begin{array}{r}{\mu^{(t)}=\frac{1}{t}\mathbb{I}_{[0,t]}}\end{array}μ(t)=t1I[0,t] . App D, Fig. 5 compares LegS, LegT, and LagT visually, showing the advantages of the scaled measure.

【翻译】我们新颖的缩放勒让德测度(LegS)对所有历史[0,t][0,t][0,t]分配均匀权重:μ(t)=1tI[0,t]\mu^{(t)}=\frac{1}{t}\mathbb{I}_{[0,t]}μ(t)=t1I[0,t]。附录D,图5直观地比较了LegS、LegT和LagT,显示了缩放测度的优势。

【解析】这里引入了HiPPO框架中创新之一:缩放勒让德测度(LegS)。这个测度的数学表达式μ(t)=1tI[0,t]\mu^{(t)}=\frac{1}{t}\mathbb{I}_{[0,t]}μ(t)=t1I[0,t]包含了深刻的设计理念。指示函数I[0,t]\mathbb{I}_{[0,t]}I[0,t]说明系统考虑从时间0到当前时间t的所有历史信息,没有任何截断或遗忘。前面的归一化因子1t\frac{1}{t}t1确保了测度的总权重始终为1,这是概率测度的基本要求。更重要的是,这种设计实现了"均匀权重"的理念:无论历史有多长,每个时间点的信息都被赋予相同的重要性。随着时间t的增长,虽然历史区间[0,t][0,t][0,t]在不断扩大,但归一化因子1t\frac{1}{t}t1会相应调整,确保整个历史的权重分布保持均匀。这与固定窗口的LagT和固定权重衰减的LegT形成鲜明对比,LegS能够在保持计算效率的同时实现真正的长期记忆能力。

Simply by specifying the desired measure, specializing the HiPPO framework (Sections 2.2, 2.4) yields a new memory mechanism (proof in Appendix D.3).

【翻译】仅仅通过指定所需的测度,特化HiPPO框架(第2.2节,第2.4节)就能产生新的记忆机制(证明见附录D.3)。

【解析】HiPPO框架的核心价值在于它提供了一个统一的数学基础,使得设计新的记忆机制变成了一个相对简单的测度选择问题。一旦确定了测度函数,前面建立的理论机制(正交多项式投影、ODE动力学、离散化方法等)就可以自动应用,无需重新推导复杂的数学公式。这种设计大大降低了创新的门槛:研究者不需要从头构建整套数学理论,只需要根据具体应用需求选择合适的测度,框架就会自动生成相应的记忆机制。附录D.3中的严格数学证明确保了这种自动化过程的理论正确性。

Theorem 2. The continuous (This is known as the Euler method, used for illustration here; our experiments use the more numerically stable Bilinear and ZOH methods. Appendix B.3 provides a self-contained overview of our full discretization framework.) and discrete (The LSTM cell update is similar, with a parameterization known as “tied” gates [30].) time dynamics for HiPPO-LegS are:

ddtc(t)=−1tAc(t)+1tBf(t)(3)\frac{d}{dt}c(t) = -\frac{1}{t}Ac(t) + \frac{1}{t}Bf(t) \quad (3) dtdc(t)=t1Ac(t)+t1Bf(t)(3)
ck+1=(1−Ak)ck+1kBfk(4)c_{k+1} = \left(1 - \frac{A}{k}\right)c_k + \frac{1}{k}Bf_k \quad (4) ck+1=(1kA)ck+k1Bfk(4)
Ank={(2n+1)1/2(2k+1)1/2if n>kn+1if n=k0if n<k,Bn=(2n+1)1/2A_{nk} = \begin{cases} (2n+1)^{1/2}(2k+1)^{1/2} & \text{if } n > k \\ n+1 & \text{if } n = k \\ 0 & \text{if } n < k \end{cases}, \quad B_n = (2n+1)^{1/2} Ank=(2n+1)1/2(2k+1)1/2n+10if n>kif n=kif n<k,Bn=(2n+1)1/2

【翻译】定理2. HiPPO-LegS的连续时间(这被称为欧拉方法,这里用于说明;我们的实验使用数值上更稳定的双线性和ZOH方法。附录B.3提供了我们完整离散化框架的自包含概述。)和离散时间(LSTM单元更新类似,使用一种称为"绑定"门的参数化[30]。)动力学为:

【解析】这个定理给出了HiPPO-LegS方法的数学表达,包括连续时间和离散时间两种形式。连续时间方程(3)描述了系统状态c(t)c(t)c(t)随时间的演化规律,其中−1tAc(t)-\frac{1}{t}Ac(t)t1Ac(t)项表示当前状态的衰减,而1tBf(t)\frac{1}{t}Bf(t)t1Bf(t)项表示新输入信息的融入。这里的关键特征是两个系数都包含1t\frac{1}{t}t1因子,这正是LegS测度的核心特性:随着时间增长,系统会自动调整权重分配。离散时间方程(4)是连续方程的数值实现版本,其中kkk代表离散时间步。更新公式(1−Ak)ck+1kBfk(1 - \frac{A}{k})c_k + \frac{1}{k}Bf_k(1kA)ck+k1Bfk的结构类似于门控机制:第一项控制历史信息的保留程度,第二项控制新信息的接受程度。矩阵AAA和向量BBB的具体定义基于勒让德多项式的正交性质,其中AAA是上三角矩阵结构,对角线元素为n+1n+1n+1,上三角部分为(2n+1)1/2(2k+1)1/2(2n+1)^{1/2}(2k+1)^{1/2}(2n+1)1/2(2k+1)1/2,下三角部分为0。这种特殊结构不仅保证了数学上的正交性,还使得矩阵运算可以在O(N)O(N)O(N)时间内完成。向量BBB的每个元素Bn=(2n+1)1/2B_n = (2n+1)^{1/2}Bn=(2n+1)1/2确保了输入信息能够正确地投影到相应的多项式基函数上。

We show that HiPPO-LegS enjoys favorable theoretical properties: it is invariant to input timescale, is fast to compute, and has bounded gradients and approximation error. All proofs are in Appendix E\mathrm{E}E .

【翻译】我们证明HiPPO-LegS具有良好的理论性质:它对输入时间尺度不变,计算速度快,并且具有有界的梯度和逼近误差。所有证明都在附录E中。

Timescale robustness. As the window size of LegS is adaptive, projection onto this measure is intuitively robust to timescales. Formally, the HiPPO-LegS operator is timescale-equivariant : dilating the input fff does not change the approximation coefficients.

【翻译】时间尺度鲁棒性。由于LegS的窗口大小是自适应的,对这个测度的投影在直觉上对时间尺度是鲁棒的。形式上,HiPPO-LegS算子是时间尺度等变的:扩张输入fff不会改变逼近系数。

【解析】时间尺度鲁棒性是HiPPO-LegS的理论特性之一。传统的序列处理方法通常对输入数据的时间特征非常敏感,当数据的采样频率、时间间隔或整体时间跨度发生变化时,模型性能会显著下降。LegS通过自适应窗口机制解决了这个问题:窗口大小会根据当前时间自动调整,使得系统能够自然地适应不同的时间尺度。时间尺度等变性是一个更强的数学性质,它说明当我们对输入信号进行时间拉伸或压缩时,HiPPO算子的输出会以相同的方式进行相应的变换,而逼近系数本身保持不变。这种等变性保证了无论输入信号的时间特征如何变化,系统都能保持一致的表示能力和处理质量。

Proposition 3. For any scalar α>0\alpha>0α>0 , if h(t)=f(αt)h(t)=f(\alpha t)h(t)=f(αt) , then hippo(h)(t)=hippo(f)(αt).\mathrm{hippo}(h)(t)=\mathrm{hippo}(f)(\alpha t).hippo(h)(t)=hippo(f)(αt). .
In other words, if γ:t↦αt\gamma:t\mapsto\alpha tγ:tαt is any dilation function, then hi ppo⁡(f∘γ)=hippo⁡(f)∘γ\operatorname{ppo}(f\circ\gamma)=\operatorname{hippo}(f)\circ\gammappo(fγ)=hippo(f)γ .

【翻译】命题3. 对于任意标量α>0\alpha>0α>0,如果h(t)=f(αt)h(t)=f(\alpha t)h(t)=f(αt),那么hippo(h)(t)=hippo(f)(αt)\mathrm{hippo}(h)(t)=\mathrm{hippo}(f)(\alpha t)hippo(h)(t)=hippo(f)(αt)。换句话说,如果γ:t↦αt\gamma:t\mapsto\alpha tγ:tαt是任意扩张函数,那么hippo⁡(f∘γ)=hippo⁡(f)∘γ\operatorname{hippo}(f\circ\gamma)=\operatorname{hippo}(f)\circ\gammahippo(fγ)=hippo(f)γ

【解析】命题3提供了时间尺度等变性的数学表述。第一个等式hippo(h)(t)=hippo(f)(αt)\mathrm{hippo}(h)(t)=\mathrm{hippo}(f)(\alpha t)hippo(h)(t)=hippo(f)(αt)说明了一个对称性:如果我们先对输入函数fff进行时间缩放得到h(t)=f(αt)h(t)=f(\alpha t)h(t)=f(αt),然后对hhh应用HiPPO算子,其结果等价于先对原函数fff应用HiPPO算子,再对结果进行相同的时间缩放。这种性质在函数分析中被称为等变性,它表明HiPPO算子与时间缩放操作是可交换的。第二个表述使用了函数复合的记号,其中γ\gammaγ是时间扩张函数,f∘γf\circ\gammafγ表示复合函数,这个等式以更一般的形式表达了相同的等变性质。这个性质的实际意义是:无论输入数据的时间采样率如何变化,HiPPO-LegS都能产生一致且可预测的输出,这使得模型在面对不同时间特征的数据时具有极强的适应性和稳定性。

Informally, this is reflected by HiPPO-LegS having no timescale hyperparameters ; in particular, the discrete recurrence (4) is invariant to the discretization step size. By contrast, LegT has a hyperparameter θ\thetaθ for the window size, and both LegT and LagT have a step size hyperparameter Δt\Delta tΔt in the discrete time case. This hyperparameter is important in practice; Section 2.5 showed that Δt\Delta tΔt relates to the gates of RNNs, which are known to be sensitive to their parameterization [ 31 , 39 , 66 ]. We empirically demonstrate the benefits of timescale robustness in Section 4.2.

【翻译】非正式地说,这体现在HiPPO-LegS没有时间尺度超参数;特别是,离散递归(4)对离散化步长不变。相比之下,LegT有一个窗口大小的超参数θ\thetaθ,而LegT和LagT在离散时间情况下都有步长超参数Δt\Delta tΔt。这个超参数在实践中很重要;第2.5节显示Δt\Delta tΔt与RNN的门相关,而这些门对其参数化是敏感的[31, 39, 66]。我们在第4.2节中实证展示了时间尺度鲁棒性的好处。

【解析】这段话强调了HiPPO-LegS相对于其他变体的一个优势:无需时间尺度相关的超参数调节。在传统的序列模型中,超参数的选择往往是一个棘手的问题,需要大量的实验和调优工作。LegT方法需要预先设定窗口大小参数θ\thetaθ,这要求研究者对数据的时间特征有先验知识。更麻烦的是,LegT和LagT都需要调节离散化步长Δt\Delta tΔt,这个参数直接影响数值稳定性和计算精度。文中提到Δt\Delta tΔt与RNN门控机制的关系特别重要,因为门控参数的微小变化都可能导致梯度爆炸或消失问题。HiPPO-LegS通过其数学设计巧妙地避开了这些问题:离散递归公式(4)对步长选择具有不变性,这说明无论我们选择什么样的时间离散化方案,系统的行为都保持一致。这种特性大大简化了模型的使用和部署,使得HiPPO-LegS在实际应用中更加可靠和易用。

Computational efficiency. In order to compute a single step of the discrete HiPPO update, the main operation is multiplication by the (discretized) square matrix AAA . More general discretization specifically requires fast multiplication for any matrix of the form I+Δt⋅AI+\Delta t\cdot AI+ΔtA and (I−Δt⋅A)−1(I-\Delta t\cdot A)^{-1}(IΔtA)1 for arbitrary step sizes Δt\Delta tΔt . Although this is generically a O(N2)O(N^{2})O(N2) operation, LegS operators use a fixed A matrix with special structure that turns out to have fast multiplication algorithms for any discretization.

【翻译】计算效率。为了计算离散HiPPO更新的单个步骤,主要操作是与(离散化的)方阵AAA相乘。更一般的离散化特别需要对任意步长Δt\Delta tΔt的形式为I+Δt⋅AI+\Delta t\cdot AI+ΔtA(I−Δt⋅A)−1(I-\Delta t\cdot A)^{-1}(IΔtA)1的任何矩阵进行快速乘法。虽然这通常是O(N2)O(N^{2})O(N2)操作,但LegS算子使用具有特殊结构的固定AAA矩阵,该矩阵对任何离散化都有快速乘法算法。

【解析】这段话揭示了HiPPO-LegS在计算优化方面的重要突破。在标准的矩阵运算中,N×NN \times NN×N矩阵的乘法需要O(N2)O(N^2)O(N2)的时间复杂度,当状态维度NNN较大时,这会成为严重的计算瓶颈。更复杂的离散化方法(如双线性变换和零阶保持方法)需要处理更复杂的矩阵形式,包括I+Δt⋅AI+\Delta t\cdot AI+ΔtA(前向欧拉格式)和(I−Δt⋅A)−1(I-\Delta t\cdot A)^{-1}(IΔtA)1(后向欧拉格式),这些操作的计算成本通常更高。HiPPO-LegS的创新在于其矩阵AAA具有特殊的数学结构:它是基于勒让德多项式正交性质构造的上三角矩阵,这种结构使得矩阵乘法可以通过专门的算法优化到线性时间复杂度。这种优化不仅适用于简单的矩阵乘法,还适用于各种离散化方案中涉及的复杂矩阵运算,从而在保持数学严谨性的同时实现了显著的计算加速。

Proposition 4. Under any generalized bilinear transform discretization (cf. Appendix B.3), each step of the HiPPO-LegS recurrence in equation (4) can be computed in O(N)O(N)O(N) operations.

【翻译】命题4. 在任何广义双线性变换离散化下(参见附录B.3),方程(4)中HiPPO-LegS递归的每一步都可以在O(N)O(N)O(N)操作内计算完成。

【解析】传统的矩阵-向量乘法需要O(N2)O(N^2)O(N2)的时间复杂度,但HiPPO-LegS通过其特殊的矩阵结构实现了线性时间复杂度。广义双线性变换是一类重要的离散化方法,包括前向欧拉、后向欧拉、双线性变换(Tustin变换)和零阶保持等多种数值积分方案。这些方法在将连续时间系统转换为离散时间系统时各有优劣:前向欧拉简单但可能不稳定,后向欧拉稳定但需要求解线性方程组,双线性变换在频域特性保持方面表现优异。无论选择哪种离散化方案,HiPPO-LegS都能保持线性时间复杂度,这种一致性对于实际应用至关重要。线性复杂度的实现依赖于LegS矩阵的上三角结构和勒让德多项式的递推关系,使得矩阵乘法可以通过专门优化的算法完成,而不需要进行完整的矩阵运算。

Section 4.3 validates the efficiency of HiPPO layers in practice, where unrolling the discretized versions of Theorem 2 is 10x faster than standard matrix multiplication as done in standard RNNs.

【翻译】第4.3节在实践中验证了HiPPO层的效率,其中展开定理2的离散化版本比标准RNN中使用的标准矩阵乘法快10倍。

【解析】在深度学习实践中,理论上的复杂度优势并不总能转化为实际的性能提升,因为现代计算硬件(如GPU)对矩阵运算进行了高度优化。然而,10倍的速度提升说明HiPPO-LegS的算法优化确实能够在实际硬件上产生显著效果。这种性能提升的来源是多方面的:首先,线性时间复杂度减少了总的计算量;其次,HiPPO的递推结构更适合序列化计算,减少了内存访问的开销;最后,专门的矩阵乘法算法能够更好地利用硬件的并行计算能力。展开(unrolling)是指将递归计算转换为显式的序列操作,这种转换通常能够提高计算效率并便于并行化。

Gradient flow. Much effort has been spent to alleviate the vanishing gradient problem in RNNs [ 56 ], where backpropagation-based learning is hindered by gradient magnitudes decaying exponentially in time. As LegS is designed for memory, it avoids the vanishing gradient issue.

【翻译】梯度流。在RNN中已经花费了大量努力来缓解梯度消失问题[56],其中基于反向传播的学习受到梯度幅度随时间指数衰减的阻碍。由于LegS是为记忆而设计的,它避免了梯度消失问题。

【解析】在标准RNN的反向传播过程中,梯度需要通过时间步向后传播,每经过一个时间步,梯度都会与权重矩阵相乘。如果权重矩阵的最大特征值小于1,梯度会指数级衰减;如果大于1,则会指数级增长导致梯度爆炸。这种现象使得网络难以学习长期依赖关系,因为来自远程时间步的梯度信号会变得极其微弱。LSTM和GRU通过门控机制部分解决了这个问题,但仍然存在局限性。HiPPO-LegS的设计理念从根本上不同:它不是试图通过架构技巧来缓解梯度问题,而是通过数学上严格的记忆机制来保持长期信息。LegS的自适应窗口和正交多项式基础确保了信息能够以数学上可控的方式在时间中传播,从而自然地避免了梯度消失问题。

Proposition 5. For any times t0<t1t_0 < t_1t0<t1, the gradient norm of HiPPO-LegS operator for the output at time t1t_1t1 with respect to input at time t0t_0t0 is ∥∂c(t1)∂f(t0)∥=Θ(1/t1)\left\|\frac{\partial c(t_1)}{\partial f(t_0)}\right\| = \Theta(1/t_1)f(t0)c(t1)=Θ(1/t1).

【翻译】命题5. 对于任意时间t0<t1t_0 < t_1t0<t1,HiPPO-LegS算子在时间t1t_1t1的输出相对于时间t0t_0t0输入的梯度范数为∥∂c(t1)∂f(t0)∥=Θ(1/t1)\left\|\frac{\partial c(t_1)}{\partial f(t_0)}\right\| = \Theta(1/t_1)f(t0)c(t1)=Θ(1/t1)

【解析】梯度范数∥∂c(t1)∂f(t0)∥\left\|\frac{\partial c(t_1)}{\partial f(t_0)}\right\|f(t0)c(t1)衡量的是时间t1t_1t1的输出对早期时间t0t_0t0输入的敏感性。Θ(1/t1)\Theta(1/t_1)Θ(1/t1)的渐近行为说明了几个重要特性:首先,梯度不会随时间指数衰减到零,这避免了传统RNN的梯度消失问题;其次,梯度以1/t11/t_11/t1的速度多项式衰减,这种衰减是可控的且符合LegS测度的数学性质;最后,这种衰减模式反映了HiPPO-LegS对历史信息的处理方式——较远的历史信息仍然保持影响,但影响程度会随时间合理地减弱。Θ\ThetaΘ记号表示渐近紧界,说明梯度范数既不会比1/t11/t_11/t1衰减得更快,也不会衰减得更慢,这个性质保证了网络在长序列训练中能够保持稳定的学习动态,既不会出现梯度消失导致的学习停滞,也不会出现梯度爆炸导致的训练不稳定。

Approximation error bounds. The error rate of LegS decreases with the smoothness of the input.

【翻译】逼近误差界。LegS的误差率随输入的平滑性而降低。

【解析】函数的平滑性通常用导数的有界性来衡量,越平滑的函数具有越多阶的有界导数。这种关系的数学基础来自于多项式逼近理论:勒让德多项式作为正交多项式系统,在逼近平滑函数时具有优异的收敛性质。对于高度振荡或不连续的信号,多项式逼近的效果相对较差,需要更高的多项式阶数才能达到相同的精度。相反,对于平滑的信号,即使较低阶的多项式也能提供很好的逼近效果。这个性质在实际应用中具有重要指导意义:对于自然信号(如语音、图像序列)这类通常具有一定平滑性的数据,HiPPO-LegS能够提供高质量的记忆表示;而对于高频噪声或突变信号,可能需要增加多项式阶数或采用预处理技术。

Proposition 6. Let f:R+→Rf : \mathbb{R}_+ \rightarrow \mathbb{R}f:R+R be a differentiable function, and let g(t)=projt(f)g^{(t)} = \text{proj}_t(f)g(t)=projt(f) be its projection at time ttt by HiPPO-LegS with maximum polynomial degree N−1N-1N1. If fff is LLL-Lipschitz then ∥f≤t−g(t)∥=O(tL/N)\left\|f_{\leq t} - g^{(t)}\right\| = O(tL/\sqrt{N})ftg(t)=O(tL/N). If fff has order-kkk bounded derivatives then ∥f≤t−g(t)∥=O(tkN−k+1/2)\left\|f_{\leq t} - g^{(t)}\right\| = O(t^kN^{-k+1/2})ftg(t)=O(tkNk+1/2).

【翻译】命题6. 设f:R+→Rf : \mathbb{R}_+ \rightarrow \mathbb{R}f:R+R是一个可微函数,设g(t)=projt(f)g^{(t)} = \text{proj}_t(f)g(t)=projt(f)是其在时间ttt通过最大多项式阶数为N−1N-1N1的HiPPO-LegS的投影。如果fffLLL-Lipschitz的,那么∥f≤t−g(t)∥=O(tL/N)\left\|f_{\leq t} - g^{(t)}\right\| = O(tL/\sqrt{N})ftg(t)=O(tL/N)。如果fff具有kkk阶有界导数,那么∥f≤t−g(t)∥=O(tkN−k+1/2)\left\|f_{\leq t} - g^{(t)}\right\| = O(t^kN^{-k+1/2})ftg(t)=O(tkNk+1/2)

【解析】命题6提供了HiPPO-LegS逼近误差的定量分析。第一个误差界针对Lipschitz连续函数:LLL-Lipschitz条件说明函数的变化率有界,即∣f(x)−f(y)∣≤L∣x−y∣|f(x) - f(y)| \leq L|x - y|f(x)f(y)Lxy。在这种条件下,逼近误差为O(tL/N)O(tL/\sqrt{N})O(tL/N),这个界有几个含义:误差与时间ttt线性增长,这反映了随着时间窗口增大,需要逼近的函数支撑变大;误差与Lipschitz常数LLL成正比,说明变化更剧烈的函数更难逼近;误差与N\sqrt{N}N成反比,说明增加多项式阶数能够有效降低误差。第二个误差界更加精细,针对具有kkk阶有界导数的函数:这类函数具有更高的平滑性,因此能够获得更好的逼近效果。误差界O(tkN−k+1/2)O(t^kN^{-k+1/2})O(tkNk+1/2)显示了平滑性的威力:对于kkk阶平滑的函数,误差以N−k+1/2N^{-k+1/2}Nk+1/2的速度衰减,这比Lipschitz情况的N−1/2N^{-1/2}N1/2快得多。时间因子tkt^ktk的出现反映了高阶平滑性在长时间窗口上的累积效应。

4 实证验证

The HiPPO dynamics are simple recurrences that can be easily incorporated into various models. We validate three claims that suggest that when incorporated into a simple RNN, these methods–especially HiPPO-LegS–yield a recurrent architecture with improved memory capability. In Section 4.1, the HiPPO-LegS RNN outperforms other RNN approaches in benchmark long-term dependency tasks for RNNs. Section 4.2 shows that HiPPO-LegS RNN is much more robust to timescale shifts compared to other RNN and neural ODE models. Section 4.3 validates the distinct theoretical advantages of the HiPPO-LegS memory mechanism, allowing fast and accurate online function reconstruction over millions of time steps. Experiment details and additional results are described in Appendix F.

【翻译】HiPPO动态是简单的递归,可以轻松地融入各种模型中。我们验证了三个声明,表明当融入简单RNN时,这些方法——特别是HiPPO-LegS——产生了具有改进记忆能力的递归架构。在第4.1节中,HiPPO-LegS RNN在RNN的基准长期依赖任务中优于其他RNN方法。第4.2节显示,与其他RNN和神经ODE模型相比,HiPPO-LegS RNN对时间尺度变化更加鲁棒。第4.3节验证了HiPPO-LegS记忆机制的独特理论优势,允许在数百万个时间步上进行快速准确的在线函数重构。实验细节和额外结果在附录F中描述。

Model Architectures. We first describe briefly how HiPPO memory updates can be incorporated into a simple neural network architecture, yielding a simple RNN model reminiscent of the classic LSTM. Given inputs xtx_{t}xt or features thereof ft=u(xt)f_{t}=u(x_{t})ft=u(xt) in any model, the HiPPO framework can be used to memorize the history of features ftf_{t}ft . Thus, given any RNN update function ht=τ(ht−1,xt)h_{t}=\tau(h_{t-1},x_{t})ht=τ(ht1,xt) , we simply replace ht−1h_{t-1}ht1 with a projected version of the entire history of hhh , as described in Figure 2. The output of each cell is hth_{t}ht , which can be passed through any downstream module (e.g. a classification head trained with cross-entropy) to produce predictions.

【翻译】模型架构。我们首先简要描述如何将HiPPO记忆更新融入简单的神经网络架构中,产生一个类似于经典LSTM的简单RNN模型。给定任何模型中的输入xtx_{t}xt或其特征ft=u(xt)f_{t}=u(x_{t})ft=u(xt),HiPPO框架可以用来记忆特征ftf_{t}ft的历史。因此,给定任何RNN更新函数ht=τ(ht−1,xt)h_{t}=\tau(h_{t-1},x_{t})ht=τ(ht1,xt),我们简单地用整个hhh历史的投影版本替换ht−1h_{t-1}ht1,如图2所述。每个单元的输出是hth_{t}ht,它可以通过任何下游模块(例如用交叉熵训练的分类头)来产生预测。

We map the vector ht−1h_{t-1}ht1 to 1D with a learned encoding before passing to hippo (full architecture in App. F.1).

【翻译】我们在传递给hippo之前,使用学习的编码将向量ht−1h_{t-1}ht1映射到1D(完整架构见附录F.1)。

4.1 长程记忆基准任务

Models and Baselines. We consider all of the HiPPO methods ( LegT , LagT , and LegS ). As we show that many different update dynamics seem to lead to LTI systems that give sensible results (Section 2.3), we additionally consider the Rand baseline that uses random AAA and BBB matrices (normalized appropriately) in its updates, to confirm that the precise derived dynamics are important. LegT additionally considers an additional hyperparameter θ\thetaθ , which should be set to the timescale of the data if known a priori; to show the effect of the timescale, we set it to the ideal value as well as values that are too large and small. The MGU is a minimal gated architecture, equivalent to a GRU without the reset gate. The HiPPO architecture we use is simply the MGU with an additional hippo intermediate layer.

【翻译】模型和基线。我们考虑所有的HiPPO方法(LegT、LagT和LegS)。正如我们显示的那样,许多不同的更新动态似乎都导致给出合理结果的LTI系统(第2.3节),我们另外考虑了Rand基线,它在更新中使用随机的AAABBB矩阵(适当归一化),以确认精确推导的动态是重要的。LegT另外考虑了一个额外的超参数θ\thetaθ,如果先验已知,它应该设置为数据的时间尺度;为了显示时间尺度的影响,我们将其设置为理想值以及过大和过小的值。MGU是一个最小门控架构,等价于没有重置门的GRU。我们使用的HiPPO架构简单地是带有额外hippo中间层的MGU。

We also compare to several RNN baselines designed for long-term dependencies, including the LSTM [ 34 ], GRU [17], expRNN [48], and LMU [71].

【翻译】我们还与几个为长期依赖设计的RNN基线进行比较,包括LSTM [34]、GRU [17]、expRNN [48]和LMU [71]。

All methods have the same hidden size in our experiments. In particular, for simplicity and to reduce hyperparameters, HiPPO variants tie the memory size NNN to the hidden state dimension ddd , so that all methods and baselines have a comparable number of hidden units and parameters. A more detailed comparison of model architectures is in Appendix F.1.

【翻译】在我们的实验中,所有方法都具有相同的隐藏大小。特别是,为了简单起见并减少超参数,HiPPO变体将记忆大小NNN与隐藏状态维度ddd绑定,使得所有方法和基线具有可比较的隐藏单元数量和参数。模型架构的更详细比较在附录F.1中。

Sequential Image Classification on Permuted MNIST. The permuted MNIST (pMNIST) task feeds inputs to a model pixel-by-pixel in the order of a fixed permutation. The model must process the entire image sequentially – with non-local structure – before outputting a classification label, requiring learning long-term dependencies.

【翻译】置换MNIST上的序列图像分类。置换MNIST(pMNIST)任务按照固定置换的顺序逐像素地向模型输入数据。模型必须在输出分类标签之前顺序处理整个图像——具有非局部结构——这需要学习长期依赖关系。

Table 1 shows the validation accuracy on the pMNIST task for the instantiations of our framework and baselines. We highlight that LegS has the best performance of all models. While LegT is close at the optimal hyperparameter θ\thetaθ , its performance can fall off drastically for a mis-specified window length. LagT also performs well at its best hyperparameter Δt\Delta tΔt .

【翻译】表1显示了我们框架实例化和基线在pMNIST任务上的验证准确率。我们强调LegS在所有模型中具有最佳性能。虽然LegT在最优超参数θ\thetaθ时接近,但对于错误指定的窗口长度,其性能可能急剧下降。LagT在其最佳超参数Δt\Delta tΔt时也表现良好。

Table 1 also compares test accuracy of our methods against reported results from the literature, where the LMU was the state-of-the-art for recurrent models. In addition to RNN-based baselines, other sequence models have been evaluated on this dataset, despite being against the spirit of the task because they have global receptive field instead of being strictly sequential. With a test accuracy of 98.3%98.3\%98.3% , HiPPO-LegS sets a true state-of-the-art accuracy on the permuted MNIST dataset.

【翻译】表1还将我们方法的测试准确率与文献中报告的结果进行比较,其中LMU是递归模型的最先进方法。除了基于RNN的基线外,其他序列模型也在此数据集上进行了评估,尽管这违背了任务的精神,因为它们具有全局感受野而不是严格顺序的。HiPPO-LegS以98.3%98.3\%98.3%的测试准确率在置换MNIST数据集上设立了真正的最先进准确率。

在这里插入图片描述
Figure 2: HiPPO incorporated into a simple RNN model. hippo is the HiPPO memory operator which projects the history of the ftf_{t}ft features depending on the chosen measure.

【翻译】图2:HiPPO融入简单RNN模型。hippo是HiPPO记忆算子,它根据选择的测度投影ftf_{t}ft特征的历史。

Table 1: (Left) pMNIST validation, average over 3 seeds. Top: Our methods. Bottom: RNN baselines. (Right) Reported test accuracies from previous works. Top: Our methods. Middle: Recurrent models. Bottom: Non-recurrent models requiring global receptive field.
在这里插入图片描述

【翻译】表1:(左)pMNIST验证,3个种子的平均值。上:我们的方法。下:RNN基线。(右)先前工作报告的测试准确率。上:我们的方法。中:递归模型。下:需要全局感受野的非递归模型。

Copying task. This standard RNN task [ 3 ] directly tests memorization, where models must regurgitate a sequence of tokens seen at the beginning of the sequence. It is well-known that standard models such as LSTMs struggle to solve this task. Appendix F shows the loss for the Copying task with length L=200L=200L=200 . Our proposed update LegS solves the task almost perfectly, while LegT is very sensitive to the window length hyperparameter. As expected, most baselines make little progress.

【翻译】复制任务。这个标准RNN任务[3]直接测试记忆能力,其中模型必须重复在序列开始时看到的标记序列。众所周知,LSTM等标准模型难以解决这个任务。附录F显示了长度为L=200L=200L=200的复制任务的损失。我们提出的LegS更新几乎完美地解决了这个任务,而LegT对窗口长度超参数非常敏感。正如预期的那样,大多数基线几乎没有进展。

4.2 HiPPO-LegS 的时间尺度鲁棒性

Timescale priors. Sequence models generally benefit from priors on the timescale, which take the form of additional hyperparameters in standard models. Examples include the “forget bias” of LSTMs which needs to be modified to address long-term dependencies [ 39 , 66 ], or the discretization step size Δt\Delta tΔt of HiPPO-Lag and HiPPO-LegT (Section 2.4). The experiments in Section 4.1 confirm their importance. Fig. 7 (Appendix) and Table 1 ablate these hyperparameters, showing that for example the sliding window length θ\thetaθ must be set correctly for LegT. Additional ablations for other hyperparameters are in Appendix F.

【翻译】时间尺度先验。序列模型通常受益于时间尺度上的先验,这在标准模型中表现为额外的超参数形式。例子包括LSTM的"遗忘偏置",需要修改以解决长期依赖问题[39, 66],或者HiPPO-Lag和HiPPO-LegT的离散化步长Δt\Delta tΔt(第2.4节)。第4.1节的实验证实了它们的重要性。图7(附录)和表1消融了这些超参数,显示例如滑动窗口长度θ\thetaθ必须为LegT正确设置。其他超参数的额外消融在附录F中。

Distribution shift in trajectory classification. Recent trends in ML have stressed the importance of understanding robustness under distribution shift, when training and testing distributions are not i.i.d. For time series data, for example, models may be trained on EEG data from one hospital, but deployed at another using instruments with different sampling rates [ 62 , 63 ]; or a time series may involve the same trajectory evolving at different speeds. Following Kidger et al. [40] , we consider the Character Trajectories dataset [ 4 ], where the goal is to classify a character from a sequence of pen stroke measurements, collected from one user at a fixed sampling rate. To emulate timescale shift (e.g. testing on another user with slower handwriting), we consider two standard time series generation processes: (1) In the setting of sampling an underlying sequence at a fixed rate, we change the test sampling rate; crucially, the sequences are variable length so the models are unable to detect the sampling rate of the data. (2) In the setting of irregular-sampled (or missing) data with timestamps, we scale the test timestamps.

【翻译】轨迹分类中的分布偏移。机器学习的最新趋势强调了理解分布偏移下鲁棒性的重要性,即训练和测试分布不是独立同分布的。例如,对于时间序列数据,模型可能在一家医院的脑电图数据上训练,但部署在另一家使用不同采样率仪器的医院[62, 63];或者时间序列可能涉及以不同速度演化的相同轨迹。跟随Kidger等人[40],我们考虑字符轨迹数据集[4],其目标是从一个用户以固定采样率收集的笔画测量序列中分类字符。为了模拟时间尺度偏移(例如在另一个书写较慢的用户上测试),我们考虑两个标准时间序列生成过程:(1) 在以固定速率采样底层序列的设置中,我们改变测试采样率;关键是,序列是可变长度的,因此模型无法检测数据的采样率。(2) 在带时间戳的不规则采样(或缺失)数据设置中,我们缩放测试时间戳。

Recall that the HiPPO framework models the underlying data as a continuous function and interacts with discrete input only through the discretization. Thus, it seamlessly handles missing or irregularly-sampled data by simply evolving according to the given discretization step sizes (details in Appendix B.3). Combined with LegS timescale invariance (Prop. 3), we expect HiPPO-LegS to work automatically in all these settings. We note that the setting of missing data is a topic of independent interest and we compare against SOTA methods, including the GRU-D [ 11 ] which learns a decay between observations, and neural ODE methods which models segments between observations with an ODE.

【翻译】回想一下,HiPPO框架将底层数据建模为连续函数,仅通过离散化与离散输入交互。因此,它通过简单地根据给定的离散化步长演化来无缝处理缺失或不规则采样的数据(详细信息在附录B.3中)。结合LegS时间尺度不变性(命题3),我们期望HiPPO-LegS在所有这些设置中自动工作。我们注意到缺失数据的设置是一个独立感兴趣的话题,我们与最先进方法进行比较,包括学习观测间衰减的GRU-D [11],以及用ODE建模观测间片段的神经ODE方法。

Table 2 validates that standard models can go catastrophically wrong when tested on sequences at different timescales than expected. Though all methods achieve near-perfect accuracy ( ≥95%\mathrm{\geq95\%}95% ) without distribution shift, aside from HiPPO-LegS, no method is able to generalize to unseen timescales.

【翻译】表2验证了标准模型在与预期不同时间尺度的序列上测试时可能出现灾难性错误。尽管所有方法在没有分布偏移的情况下都达到了近乎完美的准确率(≥95%\geq95\%95%),但除了HiPPO-LegS之外,没有方法能够泛化到未见过的时间尺度。

Table 2: Test set accuracy on Character Trajectory classification on out-of-distribution timescales.
在这里插入图片描述

【翻译】表2:字符轨迹分类在分布外时间尺度上的测试集准确率。

4.3 理论验证和可扩展性

We empirically show that HiPPO-LegS can scale to capture dependencies across millions of time steps, and its memory updates are computationally efficient (processing up to 470,000 time steps/s).

【翻译】我们通过实验证明HiPPO-LegS可以扩展到捕获数百万时间步长的依赖关系,其记忆更新在计算上是高效的(处理速度高达470,000时间步/秒)。

Long-range function approximation. We test the ability of different memory mechanisms in approximating an input function, as described in the problem setup in Section 2.1. The model only consists of the memory update (Section 3) and not the additional RNN architecture. We choose random samples from a continuous-time band-limited white noise process, with length 10610^{6}106 . The model is to traverse the input sequence, and then asked to reconstruct the input, while maintaining no more than 256 units in memory (Fig. 3). This is a difficult task; the LSTM fails with even sequences of length 1000 (MSE in Table 3, both the LMU and HiPPO-LegS are able to accurately reconstruct the input function, validating ≈ 0.25). As shown that HiPPO can solve the function approximation problem even for very long sequences. Fig. 3 illustrates the function and its approximations, with HiPPO-LegS almost matching the input function while LSTM unable to do so.

【翻译】长程函数逼近。我们测试不同记忆机制在逼近输入函数方面的能力,如第2.1节问题设置中所述。模型仅包含记忆更新(第3节)而不包含额外的RNN架构。我们从连续时间带限白噪声过程中选择随机样本,长度为10610^{6}106。模型需要遍历输入序列,然后被要求重构输入,同时在记忆中保持不超过256个单元(图3)。这是一个困难的任务;LSTM甚至在长度为1000的序列上就失败了(表3中的MSE约为0.25),而LMU和HiPPO-LegS都能够准确重构输入函数,验证了HiPPO即使对于非常长的序列也能解决函数逼近问题。图3展示了函数及其逼近,HiPPO-LegS几乎匹配输入函数,而LSTM无法做到这一点。

Speed. HiPPO-LegS operator is computationally efficient both in theory (Section 3) and in practice. We implement the fast update in C++ with Pytorch binding and show in Table 3 that it can perform 470,000 time step updates per second on a single CPU core, 10x faster than the LSTM and LMU.

【翻译】速度。HiPPO-LegS算子在理论上(第3节)和实践中都是计算高效的。我们用C++实现了快速更新并使用Pytorch绑定,在表3中显示它可以在单个CPU核心上每秒执行470,000次时间步更新,比LSTM和LMU快10倍。

Table 3: Function approximation error after 1 million time steps, with 256 hidden units.
在这里插入图片描述

【翻译】表3:100万时间步后的函数逼近误差,使用256个隐藏单元。

在这里插入图片描述
Figure 3: Input function and its reconstructions.

【翻译】图3:输入函数及其重构。

4.4 Additional Experiments

We validate that the HiPPO memory updates also perform well on more generic sequence prediction tasks not exclusively focused on memory. Full results and details for these tasks are in Appendix F.

【翻译】我们验证了HiPPO记忆更新在不专门关注记忆的更通用序列预测任务上也表现良好。这些任务的完整结果和详细信息在附录F中。

Sentiment classification task on the IMDB movie review dataset. Our RNNs with HiPPO memory updates perform on par with the LSTM, while other long-range memory approaches such as expRNN perform poorly on this more generic task (Appendix F.6).

【翻译】IMDB电影评论数据集上的情感分类任务。我们使用HiPPO记忆更新的RNN与LSTM表现相当,而其他长程记忆方法如expRNN在这个更通用的任务上表现较差(附录F.6)。

Mackey spin glass prediction. This physical simulation task tests the ability to model chaotic dynamical systems. HiPPO-LegS outperforms the LSTM, LMU, and the best hybrid LSTM+LMU model from [ 71 ], reducing normalized MSE by 30%30\%30% (Appendix F.7).

【翻译】Mackey自旋玻璃预测。这个物理仿真任务测试建模混沌动力系统的能力。HiPPO-LegS优于LSTM、LMU以及来自[71]的最佳混合LSTM+LMU模型,将归一化MSE降低了30%30\%30%(附录F.7)。

5 Conclusion

We address the fundamental problem of memory in sequential data by proposing a framework (HiPPO) that poses the abstraction of optimal function approximation with respect to time-varying measures. In addition to unifying and explaining existing memory approaches, HiPPO unlocks a new method (HiPPO-LegS) that takes a first step toward timescale robustness and can efficiently handle dependencies across millions of time steps. We anticipate that the study of this core problem will be useful in improving a variety of sequence models, and are excited about future work on integrating our memory mechanisms with other models in addition to RNNs. We hope to realize the benefits of long-range memory on large-scale tasks such as speech recognition, video processing, and reinforcement learning.

【翻译】我们通过提出一个框架(HiPPO)来解决序列数据中记忆的基本问题,该框架提出了关于时变测度的最优函数逼近的抽象。除了统一和解释现有的记忆方法外,HiPPO还解锁了一种新方法(HiPPO-LegS),该方法向时间尺度鲁棒性迈出了第一步,并且可以有效地处理数百万时间步长的依赖关系。我们预期对这个核心问题的研究将有助于改进各种序列模型,并且对于将我们的记忆机制与除RNN之外的其他模型集成的未来工作感到兴奋。我们希望在语音识别、视频处理和强化学习等大规模任务上实现长程记忆的好处。

http://www.dtcms.com/a/278010.html

相关文章:

  • QT控件命名简写
  • Linux内核高效之道:Slab分配器与task_struct缓存管理
  • 编译器优化——LLVM IR,零基础入门
  • 学习C++、QT---23(QT中QFileDialog库实现文件选择框打开、保存讲解)
  • 7月13日日记
  • 时间管理四象限理论
  • 小白学Python,操作文件和文件夹
  • 阶段性渗透总结
  • 第五章 Python手写数字识别【CNN卷积神经网络实现】
  • Windows怎样同步时间服务器?
  • 最简约的Windows多标签页文件管理器推荐 - 360文件夹 - 免费开源绿色软件推荐
  • Lucene原理
  • Android自定义View的事件分发流程
  • (33)记录描述窗体组件属性的枚举量 enum Qt :: WidgetAttribute, 简记为 WA_
  • Java结构型模式---外观模式
  • 和 *,以及 -> 和 .
  • C语言基础知识--柔性数组
  • 串口学习和蓝牙通信HC05(第八天)
  • LlamaIndex 检索器 Retriever
  • 题目V^V
  • 008_Claude_Code开发工具
  • 自注意力机制及其与早期注意力机制的区别
  • C++高频知识点(十)
  • Android 响应式编程完整指南:StateFlow、SharedFlow、LiveData 详解
  • 封装---统一封装处理页面标题
  • 关于 java:11. 项目结构、Maven、Gradle 构建系统
  • DAY02:【ML 第一弹】KNN算法
  • Datawhale AI夏令营——用AI预测新增用户学习笔记
  • 【VLLM】大模型本地化部署
  • 【图片识别内容改名】用图片的内容改图片文件的名字,批量OCR识别图片上的文字并同时进行批量改名的操作步骤和注意事项