Skip to content
Preprint

Understanding Is Done Early: A Depth Division of Labor in Large Language Models and Its Use for Unbounded-Context Memory

Jul 2026 · 0 citations · 37 references
Computer Science

TL;DR

These results show that long-context memory can be organized along the layer axis, not only the token axis, and expose both the benefits of bounded retrieval and its in-window compression tax.

Abstract

Transformer depth is not used uniformly: lower and middle layers build semantic representations, while upper layers increasingly specialize them for prediction. We turn this division of labor into CoMem (Comprehension Memory), which writes each context chunk only through an intermediate layer, retrieves a fixed number of cached residual states, and recomputes the query-conditioned upper layers over the resulting pack. For a fixed retrieval budget, model-side read compute and memory are independent of stored-context length. We evaluate a continued-trained Qwen3-8B base LM under a unified chat-template-free protocol. The backbone is frozen; the flagship trains only a rank-32 self-distillation LoRA on plain PG19, and we report an adapter-free arm separately. CoMem reaches 97.05 on RULER and 38.27 on LoCoMo versus 34.59 for full-context KV-Direct; the dialogue-memory advantage survives conversation-cluster resampling and an independent judge. Results on additional long-context and long-document tasks expose both the benefits of bounded retrieval and its in-window compression tax. Controlled depth sweeps show that deeper caching lowers per-query recomputation but incurs a fidelity loss that self-distillation substantially repairs. In a separate adapter-free efficiency control on an NVIDIA H20 at 128k, CoMem uses 18.26 GB rather than 89.36 GB and achieves a 7.83x prefill speedup. These results show that long-context memory can be organized along the layer axis, not only the token axis.

View source

Similar papers

Preprint Jul 2026

Convolution for Large Language Models

These results support depthwise convolution as a lightweight complement to self-attention for modeling short-range token interactions and suggest that the convolution makes repeated token IDs more sensitive to their immediate context.

Yuchuan Tian, Yingte Shu, Wei He et al. · 0 citations
Preprint Jul 2026

Reproducing LightMem: Naive RAG Is Just as Good for Memory Management

Overall, LightMem offers a context-efficiency trade-off rather than a general advantage over Naive RAG, whose value depends on the retriever and available token budget, motivating future work on retrieval, reranking, query formulation, and their interaction with raw and constructed memory representations.

Yong Zhou, Shuai Wang, B. Koopman et al. · 0 citations
Preprint Jul 2026

Frontier Language Models Struggle to Copy: Text Can Be Better Viewed in 2D

2D-RoPE is introduced, which organizes text into a 2D grid rather than a 1D sequence and assigns each token a row ID and a column ID, and suggests that viewing text in 2D can benefit language modeling.

Haodong Wen, Yiran Zhang, Yingfa Chen et al. · 0 citations
#artificial intelligence Preprint Aug 2026

Cross-Model Memory Transfer via Target-Side Reader Adaptation

The results suggest that Engram can serve as a reusable external knowledge artifact, provided that the target has access to a compatible reader interface and target-side adaptation can further improve alignment when direct reader reuse is insufficient.

Mingyuan Li, Guangsheng Yu, Xu Wang et al. · 0 citations
Preprint Jul 2026

Co-LMLM: Continuous-Query Limited Memory Language Models

This work proposes continuous-query LMLM (CO-LMLM), where the KB pairs continuous keys with textual knowledge values, a significant departure from prior reliance on relational KB and queries, which outperforms prior LMLMs and vanilla LLMs in both perplexity and factual precision.

Yair Feldman, Lin-Xi Zhao, Nathan Godey et al. · 0 citations
Conference Open access 2026

Octopus: Gated Selective Attention for Memory-Bounded Long-Context Inference in Large Language Models

O CTOPUS is proposed, a framework that confers fixed-memory inference onto pretrained Transform-ers without the information loss of linearization and outperforms state-of-the-art linearized baselines on the GSM8K benchmark, demonstrating that learned sparse retention serves as an effective regular-izer for long-horizon reasoning.

C. Nguyen, Ryan A. Rossi, L. Van et al. · 0 citations