Manuscript Offprint

arXiv:2609.09157

Learning Length-Extrapolatable Recurrent Models

Hanwen Jiang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Hanwen Jiang

Adobe Research

Recurrent models provide a natural path to long-context modeling, yet models trained with backpropagation through time (BPTT) often fail beyond their training horizon. Classical analyses emphasize gradients that vanish or explode along temporal paths. However, dense per-token losses can still train a shared recurrent rule despite severe decay, showing that decay alone does not determine whether learning fails. We instead study state credit: the signal through which future losses reach earlier recurrent states before contributing to parameter updates. Accordingly, we intervene directly on state credit and propose Credit Stabilization through Time (CST). During backward propagation, CST locally rescales the state-credit signal to stabilize its norm without rotating the component being corrected, while leaving the forward computation unchanged. Because controlled synthetic tasks and real data exhibit different credit dynamics, we specialize CST to each regime. In both settings, CST improves performance beyond the training horizon, with gains observed at up to 128× the training length.

Date: Sep 5th, 2026

Adobe

1 Introduction

Long-context modeling is a central capability for intelligence [14, 20] and has gained renewed prominence [13, 33, 37, 48]. Yet training data with meaningful dependencies at extreme lengths remain scarce [9, 12, 37]. This motivates a train-short, deploy-long approach: learn from the shorter sequences available during training, then operate over substantially longer horizons at inference. Standard Transformers [49] face two obstacles in this setting. Their growing key-value cache raises the cost of long training and inference, while models that rely on positional encodings must also apply them beyond the range observed during training; both can weaken long-range retrieval [35, 44]. Recurrent models instead maintain a fixed-size state through a shared update rule, making long deployment both structurally natural and computationally practical.

Architecture alone, however, does not make recurrent dynamics extrapolate. Modern state-space and linear-attention models have substantially improved the expressiveness and efficiency of recurrence [15, 23, 55], but they are still typically learned with backpropagation through time (BPTT) [30, 39, 51]. BPTT transmits the effect of future losses through products of state-transition Jacobians before those effects reach the shared recurrent parameters. This temporal path may weaken or become uninformative with distance, leaving the optimizer unable to train earlier computation from its later consequences [4, 52, 54]. The central question is therefore not only whether the forward recurrence can run for longer, but whether short-sequence training assigns the credit needed to learn long-horizon behavior.

We study this question with a controlled task suite that separates contextual retention, state tracking, and their interaction (Section 2). These tasks reveal when local supervision is sufficient and when learning requires distant consequences. A classical diagnostic traces how temporal paths contribute to the parameter gradient [4, 34]. We argue that this provides a downstream view, after state credit has been mapped through local parameter Jacobians and aggregated across positions. Instead, we study state credit, ∇htL\nabla_{h_t} \mathcal{L}, the upstream signal through which future losses reach an earlier recurrent state (Section 3.3).

future loss→BPTTstate credit⏟our focus→map & aggregateparameter gradient⏟previous focus⟶learning.\text{future loss} \xrightarrow{\text{BPTT}} \underbrace{\text{state credit}}_{\text{our focus}} \xrightarrow{\text{map \& aggregate}} \underbrace{\text{parameter gradient}}_{\text{previous focus}} \longrightarrow \text{learning}.

Our diagnostics support this shift: gradient decay alone does not determine learning; the task must also require distant losses to credit earlier recurrent states.

Motivated by this upstream view, we propose Credit Stabilization through Time (CST) (Section 4.1). CST intervenes on state credit rather than the parameter gradient. At each intervention, it rescales a state-credit component without rotating

Table 1 Representative examples of the three controlled task families. In FSA, the transition table is fixed across examples and is not part of the input. In META-FSA, a new transition table is supplied in the context of each example and must be retained across multiple state-tracking segments. The values of NN, DD, and MM are shown for each example.

Family / TaskExample Input and TargetTask-State EvolutionControlled Properties
State trackingFINITE STATEMACHINE (FSA)A fixed transition table δ\delta is shared across examples:δ(A,0)=B,δ(B,1)=A\delta(A,0)=B,\quad \delta(B,1)=Aδ(A,1)=A,δ(B,0)=B\delta(A,1)=A,\quad \delta(B,0)=B.Input: s0=A, u=(0,1,0)s_0=A,\ u=(0,1,0).Target: y=(B,A,B)y=(B,A,B).A→0B→1A→0BA \xrightarrow{0} B \xrightarrow{1} A \xrightarrow{0} BEach input induces one dependent state transition.No example-specific context:M=0M=0.One state-tracking segment:N=D=3N=D=3.Tests stable application of a fixed transition rule.
Memory and retrievalMQARContext:C={(a,7),(b,2),(c,9)}\mathcal{C}=\{(a,7),(b,2),(c,9)\}.Queries: u=(b,a,c)u=(b,a,c).Targets: y=(2,7,9)y=(2,7,9).No task state is propagated between queries:yn=f(C,un)y_n=f(\mathcal{C},u_n).For example, f(C,b)=2f(\mathcal{C},b)=2 independently of the other queries.Three stored items: M=3M=3.Three independent queries:N=3, D=0N=3,\ D=0.Tests whether fixed context information remains accessible.
HybridMETA-FSAContext:C={A→0B,B→1A,A→1A,B→0B}\mathcal{C}=\{A \xrightarrow{0} B, B \xrightarrow{1} A, A \xrightarrow{1} A, B \xrightarrow{0} B\}.Segment 1:s0(1)=A,u(1)=(0,1)s_0^{(1)}=A,\quad u^{(1)}=(0,1).y(1)=(B,A)y^{(1)}=(B,A).Segment 2:s0(2)=B,u(2)=(1,0)s_0^{(2)}=B,\quad u^{(2)}=(1,0).y(2)=(A,B)y^{(2)}=(A,B).Segment 1:A→0B→1AA \xrightarrow{0} B \xrightarrow{1} ASegment 2:B→1A→0BB \xrightarrow{1} A \xrightarrow{0} BThe task state resets between segments, while the context-defined rule is preserved.M=4M=4: transition-table entries.K=2K=2: state-tracking segments.D=2D=2: transitions per segment.N=4N=4: total task inputs.Tests context retention and state tracking jointly.

that component. Repeated local rescaling stabilizes the signal passed to earlier recurrent states without changing the forward trajectory or training objective.

How state credit should be stabilized depends on the dependency structure of the data (Section 4.2). In controlled tasks, regular logical transitions make contraction events well defined and repeatable. This motivates Event-CST, which corrects only substantial contraction, and EMA replay, which tracks the slowly evolving locations of such events to avoid dense measurements (Section 5.1). Real text has no equally regular dependency structure: long-range dependencies are sparse, and credit may contract or expand differently across recurrent heads. We therefore apply the same stabilization principle symmetrically and independently to each head (Section 6).

CST improves length extrapolation in both regimes. Across controlled state tracking, retrieval, and hybrid tasks, its gains emerge where task structure requires credit across distant recurrent computation. On Meta-FSA, Event-CST outperforms BPTT in all 16 aggregate evaluations at lengths 16k–128k, by 6.58 percentage points on average. On real-data recurrent language modeling, CST reduces full-token negative log-likelihood in all 14 dataset-length evaluations up to 128k. At the longest contexts, its gains on labeled key tokens are several times larger than its full-token gains; on held-out LongData, context-removal controls further support improved use of information beyond the 4K training horizon. Together, these results support state credit as a direct intervention point for learning recurrent models that extrapolate beyond their training horizon in the settings studied here.

References (48)