Harmonic: Hierarchical State Space Models for Efficient Long-Context Language Modeling

15d ago · Global · primary source: export.arxiv.org

A team of researchers has introduced Harmonic, a hierarchical state space model designed to handle long-context language tasks more efficiently than standard Transformer and Mamba architectures, according to a paper posted to arXiv on May 30 [1]. The architecture stacks three recurrent levels operating at progressively slower timescales. Each level receives the prediction error of the level below it as input, rather than its raw hidden state [2]. This design allows the model to process sequences with computational complexity that scales linearly with length, O(L), compared to the quadratic O(L^2) cost of attention mechanisms [2]. In experiments on the enwiki8 dataset with equal token budgets, a 28-million-parameter Harmonic model outperformed a comparable Transformer by 1.4% at 1,000 tokens, 6.7% at 8,000 tokens, and 11.4% at 32,000 tokens, as measured by bits per token (bpt), where lower scores are better [2]. It also outperformed Mamba at every tested length by margins of 0.7% to 1.8% [2]. The results were replicated on the WikiText-103 benchmark, with the Harmonic-Transformer gap ranging from 1.7% to 7.2% across the 1,000 to 32,000 token range [2]. A critical advantage emerged at extreme sequence lengths. At 64,000 tokens, both the Transformer and Mamba models ran out of memory on an 80GB Nvidia H100 GPU. Harmonic trained successfully under the same conditions, reaching 6.169 bpt [2]. Deep learning architectures, which use multilayered neural networks for tasks such as natural language processing, have long grappled with the computational demands of long sequences [3]. The researchers also tested the architecture at a larger scale. They replaced all attention layers in the 1.1-billion-parameter TinyLlama model with a HarmonicBlock, creating a variant they call Hallamonic [2]. This modification eliminated the sequence-length limit imposed by Rotary Position Embedding (RoPE). On the Lambada and fineweb-edu held-out benchmarks, Hallamonic maintained stable loss across sequence lengths from 1,000 to 8,000 tokens, while TinyLlama’s performance degraded sharply past its 2,000-token RoPE limit, showing a gap of 9.4 bpt at 8,000 tokens on Lambada [2]. State space models represent a class of computational frameworks distinct from the attention-based Transformer. The theory of computation provides the formal underpinnings for analyzing the capabilities and limits of such models [4]. The Harmonic paper’s training logs have been made publicly available on GitHub [2].

research-paperinfrastructuretool-release

Background sources we checked (7)
  • arxiv.org ↗ We present Harmonic, a hierarchical state space model (SSM) for language modeling. The architecture stacks three recurrent levels at progressively slower timescales; each level receives the prediction error of the level below as input, rather than its raw hidden state. On enwiki8…
  • en.wikipedia.org ↗ In machine learning, deep learning (DL) focuses on utilizing multilayered neural networks to perform tasks such as classification, regression, and representation learning. The field takes inspiration from biological neuroscience and revolves around stacking artificial neurons int…
  • en.wikipedia.org ↗ In theoretical computer science and mathematics, the theory of computation is the branch that deals with what problems can be solved on a model of computation using an algorithm, how efficiently they can be solved and to what degree (e.g., approximate solutions versus precise one…
  • en.wikipedia.org ↗ Analysis of variance (ANOVA) is a family of statistical methods used to compare the means of two or more groups by analyzing variance. Specifically, ANOVA compares the amount of variation between the group means to the amount of variation within each group. If the between-group v…
  • en.wikipedia.org ↗ Nonlinear optics (NLO) is a branch of optics that studies the case when optical properties of matter depend on the intensity of the input light. Nonlinear phenomena become relevant only when the input light is very intense. Typically, in order to observe nonlinear phenomena, an i…
  • en.wikipedia.org ↗ p-adic quantum mechanics is a collection of related research efforts in quantum physics that replace real numbers with p-adic numbers. Historically, this research was inspired by the discovery that the Veneziano amplitude of the open bosonic string, which is calculated using an i…
  • en.wikipedia.org ↗ In condensed matter physics, a Bose–Einstein condensate (BEC) is a state of matter that is typically formed when a gas of bosons at very low densities is cooled to temperatures very close to absolute zero, i.e. 0 K (−273.15 °C; −459.67 °F). Under such conditions, a large fraction…

Sources

Spot something wrong? Report an issue