Manuscript Offprint

arXiv:2611.04902

Attending to Memory Writes Reduces Seed Variability in Recurrent Length Generalization

Sungwoo Goo, Hwi-yeol Yun, Sangkeun Jung

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

Abstract

Recurrent memory requires learning useful updates, but attention added to assist learning can also compromise length generalization. We study bounded delta attention: causal attention over uncorrected update proposals whose bounded correction enters the recurrent update. Its implementation in TraceRelay combines additive phase recurrence with attention computed before a parallel scan. On prefix-supervised modulo-5, trained at lengths 1–40, three findings characterize its behavior at length 80. First, upper delta attention attains 70.81 ± 8.26% accuracy across seven seeds, versus 69.21 ± 22.42% for the local-attention recurrent baseline (mean ± sample SD): a 63.2% reduction in SD with a similar mean. Upper state attention also reduces variation, reaching 74.75 ± 6.24%, so this benefit is not unique to update-level attention. Disabling the upper delta correction retains 70.62 ± 8.60%. Second, blocking gradients at the delta-attention inputs changes accuracy to 65.25 ± 12.40% in the matched seven-seed comparison, increasing SD by 50.2%. It also delays a 99% validation threshold on average among the same six seeds that reach it; the 95% threshold is reached earlier on average with input-gradient blocking across all seven seeds. Third, lower delta attention exhibits substantially less extrapolation degradation than lower state attention: 62.60% versus 19.40%, against a 71.06% baseline. Removing its correction reduces accuracy to 22.56%; its advantage over lower state attention also persists under input-gradient blocking. These observations motivate bounded update-level attention as a recurrent learning scaffold, combining reduced seed variation with less severe degradation in a placement where state attention fails. Improved credit assignment is a candidate explanation, not an established mechanism. Longer-length failures and mixed all-layer results delimit the evidence; next-token-trained recurrent memory remains a future objective.

1 Introduction

Maintaining useful information over a long interaction requires more than recovering an earlier token. A model may need to revise a belief, accumulate a quantity, or preserve the current status of a task as new observations arrive. Such computations motivate recurrent state updates, but access to a recurrent path does not ensure that training consistently discovers an update rule that generalizes. State-tracking experiments show that strong performance within the training lengths can coexist with length-specific solutions and poor transfer to longer sequences [1].

Attention offers a natural way to connect distant computations during learning. Temporal attention and skip connections have previously improved recurrent optimization and credit assignment [2, 3]. However, attention can also change which computation a recurrent hybrid learns. Delayed Attention Training (DAT) demonstrates that jointly trained attention can compromise an RNN's length generalization and that delaying attention can improve it [4]. SWAX shows that shorter training-time attention windows can improve long-context recall in recurrent hybrids [5]. These findings motivate examining how a temporal shortcut is coupled to recurrence, alongside when it is trained and how far it can reach.

https://github.com/swgoo/trace_relay

We study a particularly simple coupling: attention over proposed recurrent increments. A local computation first produces an update δt\delta_t. Causal attention accesses the current and previous uncorrected updates and produces a bounded correction. The corrected increment then enters the recurrent transition. We call this operation bounded delta attention. In the TraceRelay implementation used here, the transition accumulates phase angles and exposes their sine and cosine features. The correction can therefore be bounded directly in radians.

Our empirical question is whether this update-level route can support useful recurrent learning while mitigating the extrapolation degradation observed with long-window attention over state representations. We use modulo-5 prefix tracking, which has a small sufficient state and an exactly repeatable update rule. Every input position receives its prefix-state label; no generated intermediate answer is fed back as an input. This isolates a state-update problem while providing dense supervision.

The results center on three observations. First, upper layer's delta attention reduces the observed spread across seven seeds while retaining a similar mean to the local-attention recurrent baseline; most performance remains when its correction is disabled at evaluation. Second, blocking the attention-input gradient route increases the length-80 spread again in a matched seven-seed comparison. It delays the 99% validation-accuracy threshold on average among the same six seeds that reach it, while reaching the 95% threshold earlier on average across all seven seeds. Third, lower layer's delta attention causes substantially less extrapolation degradation than state attention, but depends strongly on its correction at inference. This advantage over lower state attention also persists under input-gradient blocking, indicating that the forward correction contributes alongside the additional gradient route.

Upper layer's state attention remains a strong control, with a higher length-80 mean and smaller SD than upper delta attention. Scheduled removal, training-time diagnostics, and all-layer variants further characterize the intervention behavior. The contribution is therefore a specific bounded update mechanism and evidence about how it affects learned variability and inference-time dependence, rather than a general ranking of attention types.

The evidence also bounds the interpretation. The attention targets, parameter counts, direct receptive fields, and output constraints differ between the state- and delta-attention variants.

References (14)