---
title: 'Locas-GLU: Architecture-Matched Memory Module'
url: https://www.emergentmind.com/topics/locas-glu
type: topic
---

# Locas-GLU: Architecture-Matched Memory Module

Locas-GLU is a sideway parametric memory module introduced as the practical, architecture-matched variant of Locas, a “Locally-Supported” memory mechanism designed to bridge test-time training with a parametric memory that can be offloaded from or merged into model parameters [2602.05085]. It shares the gated linear unit feed-forward structure used in modern large language models, can be attached to an existing transformer without modifying backbone weights, and is intended to store long-context information in parameters rather than exclusively in the prompt. In the formulation of the paper, Locas-GLU treats the transformer feed-forward network as a persistent key-value memory and extends it with a parallel GLU-shaped branch whose initialization is derived in a principled way from the pretrained model’s own parameters and activations [2602.05085].

## 1. Conceptual basis

The paper interprets a standard feed-forward network as a memory system. For an FFN written as
\[
\mathrm{FFN}(\mathcal{A}_t^i)=V^\top \phi(K^\top \mathcal{A}_t^i),
\]
the columns of \(K\) and the rows of \(V\) are treated as key-value memory slots [2602.05085]. In this view, each intermediate neuron corresponds to a slot whose key determines when it fires and whose value determines what information is retrieved.

Locas extends this interpretation by adding a new FFN-like pathway that can be grown during test time and then updated by gradient descent. The stated aim is to store long-context information “into parameters” while preserving the pretrained backbone as a stable baseline [2602.05085]. This design is presented as a way to support efficient continual learning and to reduce reliance on large context windows.

A central point of the framework is that initialization is not incidental. The paper argues that proper initialization of low-rank sideway-FFN-style memories—performed by reusing model parameters, activations, and/or gradients—is essential for fast convergence, improved generalization, and catastrophic forgetting prevention [2602.05085]. This emphasis on principled initialization distinguishes Locas from memory additions that are randomly initialized and then optimized in isolation.

## 2. Architectural form of Locas-GLU

Locas-GLU is the GLU-shaped version of Locas and is intended to match the native FFN design of contemporary LLMs such as LLaMA, Qwen, and Mistral [2602.05085]. Its operator is
\[
\text{Locas-GLU}(\mathcal{A}) = V^\top \big(\sigma(G^\top \mathcal{A}) \odot K^\top \mathcal{A}\big),
\]
where \(G \in \mathbb{R}^{d \times r}\) is the gate matrix, \(K \in \mathbb{R}^{d \times r}\) is the up-projection or key matrix, \(V \in \mathbb{R}^{r \times d}\) is the down-projection or value matrix, \(r\) is the latent width, \(\sigma\) is SiLU, and \(\odot\) denotes elementwise multiplication [2602.05085].

The module is added in parallel to the backbone FFN rather than replacing it. The hidden output is written as
\[
\mathcal{H}_{\text{out}}=\mathrm{FFN}(\mathcal{A})+\tau\cdot \text{Locas-GLU}(\mathcal{A}),
\]
so the pretrained path remains intact and the new memory branch contributes additively with scale \(\tau\) [2602.05085]. This makes the mechanism a genuine capacity expansion rather than a low-rank perturbation of existing weights.

Two negative clarifications are important. First, the paper explicitly characterizes Locas-GLU as neither an external memory nor a low-rank perturbation of existing parameters [2602.05085]. Second, because the new branch is parallel to the backbone, the backbone remains untouched at attachment time. This suggests a modular interpretation: Locas-GLU augments the model’s memory capacity without requiring architectural surgery on the original transformer.

## 3. Initialization by activation-guided cloning

The most technically distinctive component of Locas-GLU is its initialization scheme. For a memorization chunk \(x_{<T}\), the pretrained backbone is run forward and the intermediate GLU activation at layer \(i\) is computed as
\[
\mathcal{M}_t^i=\sigma(W_G^i \mathcal{A}_t^i)\odot(W_K^i \mathcal{A}_t^i).
\]
The importance of each intermediate dimension \(j\) is then averaged over the chunk:
\[
\alpha_j^i=\frac{1}{T}\sum_{t=1}^{T} |\mathcal{M}_{t,j}^i|.
\]
The top-\(r\) most activated dimensions are selected,
\[
\mathcal{S}_r^i=\text{indices of the top-}r\text{ }\alpha_j^i,
\]
and the Locas-GLU parameters are initialized by cloning the corresponding backbone rows:
\[
K^i \leftarrow \mathrm{Normalize}([W_K^i]_{j\in\mathcal{S}_r^i}), \qquad
G^i \leftarrow \mathrm{Normalize}([W_G^i]_{j\in\mathcal{S}_r^i}),
\]
with
\[
V^i \leftarrow \mathbf{0}.
\]
All of these steps are given explicitly in the paper [2602.05085].

The zero initialization of \(V\) has a specific operational consequence: immediately after creation, the Locas-GLU branch contributes nothing to the model output, so the model’s behavior is unchanged at initialization [2602.05085]. The paper compares this safe start to the logic of LoRA initialization. Only subsequent updates cause the memory branch to affect predictions.

The paper interprets this top-\(K\) selection as a kind of nonlinear PCA in activation space [2602.05085]. That interpretation is explicitly framed in the source as an interpretation rather than a formal theorem. A plausible implication is that the initialization preferentially aligns the new memory with context-relevant backbone directions instead of forcing optimization to discover them from scratch.

## 4. Optimization, control, and permanentization

After attachment, the Locas branch is updated during memorization with standard backpropagation on the language-modeling objective as new tokens arrive [2602.05085]. The backbone parameters stay fixed, while the side branch absorbs context-specific information. The paper describes this as storing past context into parametric knowledge so that later inference can proceed with a much smaller context window.

The framework includes explicit control mechanisms. One is weight norm clipping,
\[
w \leftarrow \frac{w}{\max(\|w\|_2,1)},
\]
applied rowwise or columnwise to the key, gate, and value matrices [2602.05085]. The other is the output scale \(\tau\), which is set from the backbone FFN’s down-projection norm statistics and normalized by \(r\) [2602.05085]. These safeguards are described as ways to bound per-step behavioral change and to reduce the risk of destabilizing the pretrained model.

The paper also frames Locas as a memory that can be expanded during streaming context and later compressed or merged into model parameters [2602.05085]. In this sense, “permanentization” denotes a shift from prompt-resident information to parameter-resident information. In the reported evaluations, this is reflected by using only a \(2\text{K}\) context truncation for test-time-training baselines while relying on the memory branch to preserve information from much longer spans [2602.05085].

A recurring theme is that Locas-GLU is practical because it mirrors the GLU-FFN decomposition already present in many modern models. The paper states that this makes the module easy to attach “beside” existing FFNs and suitable for both parameter-efficient and computation-efficient continual learning [2602.05085].

## 5. Empirical evaluation

The paper validates Locas-GLU on PG-19 whole-book language modeling and LoCoMo long-context dialogue question answering, and further measures general capability retention with MMLU after memorizing an entire book [2602.05085]. The abstract reports that, with only \(0.02\%\) additional parameters in the lowest case, Locas-GLU is capable of storing information from past context while maintaining a much smaller context window [2602.05085].

On PG-19, Locas-GLU is compared against context truncation, long-context attention, and TempLoRA. For Qwen3-0.6B-Base, TempLoRA uses \(36.7\text{M}\) extra parameters and \(4.3\times\) relative time, whereas Locas-GLU uses \(5.5\text{M}\) extra parameters and \(1.4\times\) relative time [2602.05085]. At \(200\text{K}\) context, the reported perplexities are \(27.28\) for truncation, \(25.22\) for TempLoRA, and \(25.00\) for Locas-GLU [2602.05085]. For Qwen3-1.7B-Base, TempLoRA uses \(73.4\text{M}\) parameters while Locas-GLU uses \(11.0\text{M}\), and at \(200\text{K}\) context the perplexities are \(20.50\), \(19.13\), and \(19.04\), respectively [2602.05085]. The paper summarizes these results by stating that Locas-GLU reaches comparable or better performance than TempLoRA while using roughly \(15\text{–}25\%\) of the extra parameters and about \(38\%\) of the compute [2602.05085].

The width study reports the scaling \(3 \times L \times d \times r\) for the \(K\), \(G\), and \(V\) matrices [2602.05085]. Empirically, \(r=16\) corresponds to \(2.8\text{M}\) parameters, \(r=32\) to \(5.5\text{M}\), \(r=64\) to \(11.0\text{M}\), and \(r=128\) to \(22.0\text{M}\) [2602.05085]. The paper states that performance saturates early and that even \(r=16\) is competitive with much larger TempLoRA ranks [2602.05085].

On LoCoMo, the reported gains are framed as evidence that dialogue facts have been internalized into parametric memory rather than merely reused from prompt access. For Qwen3-1.7B-Base with full context, Locas-GLU obtains \(41.6\) on Single-hop, \(25.2\) on Multi-hop, \(34.1\) on Temporal, and \(-28.7\) on Adversarial, compared with \(37.3\), \(23.8\), \(33.5\), and \(-33.0\) for full attention, and \(37.7\), \(23.1\), \(29.1\), and \(-31.8\) for TempLoRA [2602.05085]. In the no-context evaluation, Locas-GLU retains more information in parameters than TempLoRA, with \(6.8\) versus \(5.2\) on Single-hop, \(8.4\) versus \(4.5\) on Multi-hop, and \(4.3\) versus \(1.3\) on Temporal [2602.05085].

The MMLU comparison is used to measure catastrophic forgetting. For Qwen3-1.7B-Base, the baseline MMLU score is \(60.4\), TempLoRA yields \(59.8\) \(( -0.6)\), and Locas-GLU yields \(60.2\) \(( -0.2)\) [2602.05085]. At larger memory width \(r=512\), TempLoRA gives \(59.2\) \(( -1.2)\), whereas Locas-GLU gives \(60.3\) \(( -0.1)\) [2602.05085]. The paper interprets this as evidence that Locas-GLU exhibits much less catastrophic forgetting because it preserves the backbone and adds a parallel additive pathway rather than directly altering existing parameters.

## 6. Relation to Locas-MLP and scope of the method

The paper introduces two variants of Locas. The first, Locas-MLP,
\[
\text{Locas-MLP}(\mathcal{A}) = V^\top \mathrm{ReLU}(K^\top \mathcal{A}),
\]
is presented as the theoretically cleaner version, with a simpler two-layer MLP form and a step-wise optimal key/value initialization under assumptions [2602.05085]. It also supports an explicit compression procedure, NL-SVD. The second, Locas-GLU, is presented as the practical version that matches the native FFN structure of modern LLMs [2602.05085].

This distinction matters because Locas-GLU is not merely a cosmetic rewrite of Locas-MLP. The paper explicitly states that MLP-style piecewise-linear separability at the FFN input is often poor for GLU-based backbones, whereas Locas-GLU reuses the gate/up/down decomposition already present in the pretrained model [2602.05085]. This suggests that Locas-GLU is intended less as a minimal theoretical construction than as an architecture-compatible memory extension for current transformer families.

A common misconception would be to treat Locas-GLU as a variant of LoRA or as a standard retrieval memory. The paper rejects both descriptions. Locas-GLU is not a low-rank perturbation of existing weights and not an external memory; it is a parallel FFN-style module whose parameters can be updated during streaming context and whose content can later be permanentized into model parameters [2602.05085]. Another misconception would be to treat it as a replacement for long-context attention. The reported experiments instead position it as a complementary mechanism: it stores information from past context while allowing the operational context window to remain much smaller [2602.05085].

Within the paper’s framing, the significance of Locas-GLU lies in three linked claims: modern FFNs can be interpreted as persistent key-value memories, architecture-matched sideway memories can be initialized from pretrained model structure rather than from scratch, and such memories can absorb long-context information with limited catastrophic forgetting and modest parameter overhead [2602.05085].

Source: https://www.emergentmind.com/topics/locas-glu