SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.14207 · 2024

Longhorn: State Space Models are Amortized Online Learners

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 6 functions out of this paper's own repositories and ran 6 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
Cranial-XIX/longhorn canonical 6 of 6
FunctionStatusWhere it lives
apply_rotary_pos_emb Ran Cranial-XIX/longhorn/models/llama.py
pointer only (licence: NONE) · get_code("14e463d5d26fe2b1")
duplicate_interleave Ran Cranial-XIX/longhorn/models/retnet.py
pointer only (licence: NONE) · get_code("03e99c761c545617")
fixed_pos_embedding Ran Cranial-XIX/longhorn/models/retnet.py
pointer only (licence: NONE) · get_code("e10a34a678e99e04")
init_feature_map Ran Cranial-XIX/longhorn/fla/layers/based.py
pointer only (licence: NONE) · get_code("02c964e3ea75cd90")
rotate_every_two Ran Cranial-XIX/longhorn/models/retnet.py
pointer only (licence: NONE) · get_code("a8e846bab37b7243")
rotate_half Ran Cranial-XIX/longhorn/models/llama.py
pointer only (licence: NONE) · get_code("08213c6683993d3b")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Modern large language models are built on sequence modeling via next-token prediction. While the Transformer remains the dominant architecture for sequence modeling, its quadratic decoding complexity in sequence length poses a major limitation. State-space models (SSMs) present a competitive alternative, offering linear decoding efficiency while maintaining parallelism during training. However, most existing SSMs rely on linear recurrence designs that appear somewhat ad hoc. In this work, we explore SSM design through the lens of online learning, conceptualizing SSMs as meta-modules for specific online learning problems. This approach links SSM design to formulating precise online learning objectives, with state transition rules derived from solving these objectives. Based on this insight, we introduce a novel deep SSM architecture, Longhorn, whose update resembles the closed-form solution for solving the online associative recall problem. Our experimental results show that Longhorn outperforms state-of-the-art SSMs, including the Mamba model, on standard sequence modeling benchmarks, language modeling, and vision tasks. Specifically, Longhorn achieves a 1.8x improvement in sample efficiency compared to Mamba, and can extrapolate over contexts that are up to 16x longer during inference.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2407.14207")
get_code_for_paper("2407.14207")
have("2407.14207")

Connect an agent — have() is free.