Graph Memory Transformer (GMT)
Pith reviewed 2026-07-01 09:08 UTC · model grok-4.3
The pith
A decoder-only transformer can replace its per-token FFN sublayers with a learned graph of 128 centroids linked by a directed transition matrix while training stably and exposing internal routing as inspectable quantities.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
The FFN sublayer can be replaced by a memory cell that routes each token representation from an estimated source centroid toward a token-conditioned target centroid across a learned directed transition matrix, returning a gated displacement rather than a retrieved value; the resulting architecture trains stably as a fully decoder-only language model, exposes routing quantities for direct inspection, and achieves near-parity zero-shot behavior despite a remaining gap in validation loss relative to a dense baseline.
What carries the argument
Graph memory cell containing 128 centroids, a 128x128 directed transition matrix, gravitational source routing, token-conditioned target selection, and gated displacement readout, which substitutes for the usual FFN by computing per-token movement between memory states.
If this is right
- Centroid usage statistics, transition-matrix structure, and source-to-target displacements become directly readable from the forward computation without auxiliary probes.
- The model trains to convergence with zero dense FFN sublayers and 82.2 M total parameters.
- Zero-shot benchmark scores remain close to those of the larger dense baseline despite the architectural substitution.
- Further gains are expected from scaling the centroid bank or refining the routing kernels rather than from reintroducing dense layers.
Where Pith is reading between the lines
- The explicit transition matrix could be inspected post-training to recover reusable computational motifs that dense layers bury inside weight matrices.
- Because movement rather than retrieval is returned, the same cell might be reused across multiple blocks without the parameter duplication typical of stacked FFNs.
- If centroid count is increased while keeping the transition matrix sparse, the approach might close the remaining perplexity gap without restoring dense sublayers.
Load-bearing premise
Routing over a bank of 128 learned centroids connected by a directed transition matrix can supply the per-token nonlinear transformations normally performed by a dense FFN sublayer.
What would settle it
A controlled run in which the same architecture with the graph cell disabled (or replaced by a standard FFN of matched parameter count) produces validation loss indistinguishable from the reported 3.2903 baseline.
Figures
read the original abstract
We investigate whether the Feed-Forward Network (FFN) sublayer in a decoder-only transformer can be replaced by an explicit learned memory graph while preserving the surrounding autoregressive architecture. The proposed Graph Memory Transformer (GMT) keeps causal self-attention intact, but replaces the usual per-token FFN transformation with a memory cell that routes token representations over a learned bank of centroids connected by a learned directed transition matrix. In the base GMT v7 instantiation studied here, each of 16 transformer blocks contains 128 centroids, a 128 * 128 edge matrix, gravitational source routing, token-conditioned target selection, and a gated displacement readout. The cell therefore returns movement from an estimated source memory state toward a target memory state, rather than a retrieved value. The resulting model is a fully decoder-only language model with 82.2M trainable parameters and no dense FFN sublayers, compared with a 103.0M-parameter dense GPT-style baseline used in the evaluation. The base v7 model trains stably and exposes centroid usage, transition structure, and source-to-target movement as directly inspectable quantities of the forward computation. It remains behind the larger dense baseline in validation loss and perplexity (3.5995/36.58 vs. 3.2903/26.85), while showing close zero-shot benchmark behavior under the evaluated setting. These results are not intended as a state-of-the-art claim; they support the viability and structural interpretability of replacing dense within-token transformation with graph-mediated memory navigation. Broader scaling, optimized kernels, and more extensive benchmark evaluation are left for subsequent work.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes replacing the per-token FFN sublayers in a decoder-only transformer with an explicit Graph Memory cell (GMT v7) that routes representations over a bank of 128 learned centroids connected by a 128x128 directed transition matrix, using gravitational source routing, token-conditioned target selection, and gated displacement readout. The resulting 82.2M-parameter model preserves causal self-attention, trains stably, exposes centroid usage, transitions, and source-to-target movements as inspectable quantities, and achieves close zero-shot benchmark behavior to a 103M dense GPT-style baseline while reporting higher validation loss (3.5995 vs. 3.2903) and perplexity (36.58 vs. 26.85). The work frames these outcomes as evidence of viability and structural interpretability rather than performance equivalence.
Significance. If the empirical results hold under fuller verification, the work provides a concrete demonstration that dense FFN transformations can be substituted by graph-mediated memory navigation while retaining the autoregressive decoder structure and yielding directly interpretable internal quantities. This could support future research on transparent, memory-centric alternatives to standard transformer sublayers, particularly if scaling or kernel optimizations close the observed performance gap.
major comments (1)
- Abstract: the claim that the model 'trains stably' rests on a single reported run without error bars, multiple seeds, or ablation on the routing components; this weakens the viability conclusion because the 0.3 loss gap to the baseline could reflect run-to-run variance rather than a reliable architectural property.
minor comments (2)
- Abstract: the number of transformer blocks (stated as 16) and total layer count should be cross-referenced with the parameter count (82.2M) to allow direct comparison with the 103M baseline.
- Abstract: the zero-shot benchmark results are described only qualitatively ('close behavior'); quantitative scores or a table would strengthen the interpretability claim.
Simulated Author's Rebuttal
We thank the referee for highlighting the limitations in our stability claim. We address the point directly below and propose a targeted revision.
read point-by-point responses
-
Referee: Abstract: the claim that the model 'trains stably' rests on a single reported run without error bars, multiple seeds, or ablation on the routing components; this weakens the viability conclusion because the 0.3 loss gap to the baseline could reflect run-to-run variance rather than a reliable architectural property.
Authors: We agree the single-run observation is a genuine limitation that weakens the strength of the 'trains stably' phrasing. The reported run converged without divergence, NaNs, or exploding gradients, but we lack multiple seeds or variance estimates. We will revise the abstract to replace 'trains stably' with 'trains without divergence in the reported run' and add a short limitations paragraph noting the absence of multi-seed statistics and routing ablations. The 0.3 loss gap is presented as an observed difference rather than a claim of equivalence; we will not reinterpret it as architectural superiority. revision: partial
Circularity Check
No significant circularity
full rationale
The GMT paper is an empirical architecture proposal that replaces FFN sublayers with a graph memory cell (128 centroids, 128x128 transitions, gravitational routing, gated readout) while keeping causal attention. It reports forward-pass quantities, stable training, and benchmark numbers against a dense baseline without any derivation chain, uniqueness theorem, or self-citation that reduces a claimed result to its own inputs by construction. No equations are presented as first-principles predictions; the work is limited to viability and interpretability of the stated cell, making the derivation self-contained against external benchmarks.
Axiom & Free-Parameter Ledger
free parameters (2)
- number of centroids per block
- transition matrix size
axioms (1)
- domain assumption A learned directed graph over centroids can perform the nonlinear per-token mapping previously done by an FFN.
invented entities (1)
-
gravitational source routing and token-conditioned target selection
no independent evidence
Reference graph
Works this paper leans on
-
[1]
Gomez, Lukasz Kaiser, and Illia Polosukhin
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In�������� �� ������ ����������� ���������� �������, volume 30, 2017
2017
-
[2]
Transformer feed-forward layers are key-value memories
Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. Transformer feed-forward layers are key-value memories. In����������� �� ��� ���� ���������� �� ��������� ������� �� ������� �������� ����������, pages 5484–5495, 2021
2021
-
[3]
Lo- cating and editing factual associations in GPT
Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Lo- cating and editing factual associations in GPT. In�������� �� ������ ����������� ���������� �������, volume 35, pages 17359–17372, 2022
2022
-
[4]
A practical review of mechanistic interpretability for transformer-based language models.����� �������� ����������������, 2024
Daking Rai, Yilun Zhou, Shi Feng, Abulhair Saparov, and Ziyu Yao. A practical review of mechanistic interpretability for transformer-based language models.����� �������� ����������������, 2024
2024
-
[5]
Memory networks
Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. In������������� ���������� �� �������� ���������������, 2015
2015
-
[6]
End-to-end mem- ory networks
Sainbayar Sukhbaatar, Jason Weston, and Rob Fergus. End-to-end mem- ory networks. In�������� �� ������ ����������� ���������� �������, volume 28, 2015
2015
-
[7]
Large memory layers with product keys
Guillaume Lample, Alexandre Sablayrolles, Marc’Aurelio Ranzato, Lu- dovic Denoyer, and Herv´ e J´ egou. Large memory layers with product keys. In�������� �� ������ ����������� ���������� �������, volume 32, 2019
2019
-
[8]
Rabe, DeLesley Hutchins, and Christian Szegedy
Yuhuai Wu, Markus N. Rabe, DeLesley Hutchins, and Christian Szegedy. Memorizing transformers. In������������� ���������� �� �������� ���� ������������, 2022
2022
-
[9]
Memory layers at scale
Vincent-Pierre Berges, Barlas Oguz, Daniel Haziza, Wen-Tau Yih, Luke Zettlemoyer, and Gargi Ghosh. Memory layers at scale. In����������� �� ��� ���� ������������� ���������� �� ������� ��������, volume 267 of����������� �� ������� �������� ��������, pages 3831–3842, 2025
2025
-
[10]
MemoryLLM: Plug-n- play interpretable feed-forward memory for transformers.����� �������� ����������������, 2026
Ajay Jaiswal, Lauren Hannah, Han-Byul Kim, Duc Hoang, Arnav Kundu, Mehrdad Farajtabar, and Minsik Cho. MemoryLLM: Plug-n- play interpretable feed-forward memory for transformers.����� �������� ����������������, 2026. 58
2026
-
[11]
Zoom in: An introduction to circuits.�������, 2020
Chris Olah, Nick Cammarata, Ludwig Schubert, Gabriel Goh, Michael Petrov, and Shan Carter. Zoom in: An introduction to circuits.�������, 2020
2020
-
[12]
Thread: Circuits.�������, 2020
Nick Cammarata, Shan Carter, Gabriel Goh, Chris Olah, Michael Petrov, Ludwig Schubert, Chelsea Voss, Ben Egan, and Swee Kiat Lim. Thread: Circuits.�������, 2020
2020
-
[13]
Prototype transformer: Towards language model architectures interpretable by design.����� �������� ����������������, 2026
Yordan Yordanov, Matteo Forasassi, Bayar Menzat, Ruizhi Wang, Chang Qi, Markus Kaltenberger, Amine M’Charrak, Tommaso Salvatori, and Thomas Lukasiewicz. Prototype transformer: Towards language model architectures interpretable by design.����� �������� ����������������, 2026
2026
-
[14]
A comprehensive study of knowledge editing for large language models.����� �������� ����������������, 2024
Ningyu Zhang, Yunzhi Yao, Bozhong Tian, Peng Wang, Shumin Deng, Mengru Wang, Zekun Xi, Shengyu Mao, et al. A comprehensive study of knowledge editing for large language models.����� �������� ����������������, 2024
2024
-
[15]
Neural turing machines
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. ����� �������� ���������������, 2014
2014
-
[16]
Hybrid computing using a neu- ral network with dynamic external memory.������, 538(7626):471–476, 2016
Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Dani- helka, Agnieszka Grabska-Barwi´ nska, Sergio G´ omez Colmenarejo, Ed- ward Grefenstette, Tiago Ramalho, John Agapiou, Adri` a Puigdom` enech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Has...
2016
-
[17]
Hopfield networks is all you need
Hubert Ramsauer, Bernhard Sch¨ afl, Johannes Lehner, Philipp Seidl, Michael Widrich, Lukas Gruber, Markus Holzleitner, Thomas Adler, David Kreil, Michael K Kopp, G¨ unter Klambauer, Johannes Brand- stetter, and Sepp Hochreiter. Hopfield networks is all you need. In ������������� ���������� �� �������� ���������������, 2021
2021
-
[18]
Generalization through memorization: Nearest neighbor lan- guage models
Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. Generalization through memorization: Nearest neighbor lan- guage models. In������������� ���������� �� �������� ���������������, 2020. 59
2020
-
[19]
Jacobs, Michael I
Robert A. Jacobs, Michael I. Jordan, Steven J. Nowlan, and Geoffrey E. Hinton. Adaptive mixtures of local experts.������ �����������, 3(1):79– 87, 1991
1991
-
[20]
Outrageously large neural networks: The sparsely-gated mixture-of-experts layer
Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. In������������� ���������� �� �������� ���������������, 2017
2017
-
[21]
Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity
William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. ������� �� ������� �������� ��������, 23(120):1–39, 2022
2022
-
[22]
MemoryFormer: Minimize transformer computation by removing fully-connected layers.����� �������� ����������������, 2024
Ning Ding, Yehui Tang, Haochen Qin, Zhenli Zhou, Chao Xu, Lin Li, Kai Han, Heng Liao, and Yunhe Wang. MemoryFormer: Minimize transformer computation by removing fully-connected layers.����� �������� ����������������, 2024
2024
-
[23]
Graph transformers: A survey
Ahsan Shehzad, Feng Xia, Shagufta Abid, Ciyuan Peng, Shuo Yu, Dongyu Zhang, and Karin Verspoor. Graph transformers: A survey. ���� ������������ �� ������ �������� ��� �������� �������, pages 1–20, 2026
2026
-
[24]
Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D. Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Lit...
2020
-
[25]
Using the output embedding to improve language models
Ofir Press and Lior Wolf. Using the output embedding to improve language models. In����������� �� ��� ���� ���������� �� ��� �������� ������� �� ��� ����������� ��� ������������� ������������ ������ �� ����� ������, pages 157–163, 2017
2017
-
[26]
On layer normalization in the transformer architecture
Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan, Liwei Wang, and Tie-Yan Liu. On layer normalization in the transformer architecture. In����������� �� ��� ���� ������������� ���������� �� ������� ��������, volume 119 of ����������� �� ������� �������� ��������, 2020. 60
2020
-
[27]
Neural discrete representation learning
Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. In�������� �� ������ ����������� ���������� �������, volume 30, 2017
2017
-
[28]
OpenWebText Corpus
Aaron Gokaslan and Vanya Cohen. OpenWebText Corpus. ������ �����������������������������������������, 2019
2019
-
[29]
Language models are unsupervised multitask learners
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. Technical report, OpenAI, 2019
2019
-
[30]
Think you have solved question answering? try ARC, the AI2 reasoning challenge.����� �������� ����������������, 2018
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabhar- wal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try ARC, the AI2 reasoning challenge.����� �������� ����������������, 2018
2018
-
[31]
The language model evaluation harness, July 2024
Leo Gao, Jonathan Tow, Baber Abbasi, Stella Biderman, Sid Black, Anthony DiPofi, Charles Foster, Laurence Golding, Jeffrey Hsu, Alain Le Noac’h, Haonan Li, Kyle McDonell, Niklas Muennighoff, Chris Ociepa, Jason Phang, Laria Reynolds, Hailey Schoelkopf, Aviya Skowron, Lin- tang Sutawika, Eric Tang, Anish Thite, Ben Wang, Kevin Wang, and Andy Zou. The langu...
2024
-
[32]
HellaSwag: Can a machine really finish your sentence? In�������� ���� �� ��� ���� ������ ������� �� ��� ����������� ��� ������������� �����������, pages 4791–4800, 2019
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. HellaSwag: Can a machine really finish your sentence? In�������� ���� �� ��� ���� ������ ������� �� ��� ����������� ��� ������������� �����������, pages 4791–4800, 2019
2019
-
[33]
PIQA: Reasoning about physical commonsense in natural lan- guage
Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, and Yejin Choi. PIQA: Reasoning about physical commonsense in natural lan- guage. In����������� �� ��� ���� ���������� �� ��������� ������������, volume 34, pages 7432–7439, 2020
2020
-
[34]
WinoGrande: An adversarial winograd schema challenge at scale
Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. WinoGrande: An adversarial winograd schema challenge at scale. In����������� �� ��� ���� ���������� �� ��������� ������������, vol- ume 34, pages 8732–8740, 2020
2020
-
[35]
Generating diverse high-fidelity images with VQ-V AE-2
Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with VQ-V AE-2. In�������� �� ������ ����������� ���������� �������, volume 32, pages 14837–14847, 2019
2019
-
[36]
Taming transformers for high-resolution image synthesis
Patrick Esser, Robin Rombach, and Bjorn Ommer. Taming transformers for high-resolution image synthesis. In����������� �� ��� �������� 61 ���������� �� �������� ������ ��� ������� ����������� ������, pages 12873–12883, 2021
2021
-
[37]
How contextual are contextualized word represen- tations? comparing the geometry of BERT, ELMo, and GPT-2 embed- dings
Kawin Ethayarajh. How contextual are contextualized word represen- tations? comparing the geometry of BERT, ELMo, and GPT-2 embed- dings. In����������� �� ��� ���� ���������� �� ��������� ������� �� ������� �������� ���������� ��� ��� ��� ������������� ����� ���������� �� ������� �������� ����������, pages 55–65, 2019
2019
-
[38]
Interpretability in the wild: A circuit for indirect object identification in GPT-2 small.����� �������� ����������������, 2022
Kevin Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris, and Jacob Steinhardt. Interpretability in the wild: A circuit for indirect object identification in GPT-2 small.����� �������� ����������������, 2022
2022
-
[39]
Mavor-Parker, Aengus Lynch, Stefan Heimersheim, and Adri` a Garriga-Alonso
Arthur Conmy, Augustine N. Mavor-Parker, Aengus Lynch, Stefan Heimersheim, and Adri` a Garriga-Alonso. Towards automated circuit discovery for mechanistic interpretability. In�������� �� ������ ������ ������ ���������� �������, volume 36, 2023
2023
-
[40]
Sparse autoencoders find highly interpretable features in language models.����� �������� ����������������, 2023
Hoagy Cunningham, Aidan Ewart, Logan Riggs, Robert Huben, and Lee Sharkey. Sparse autoencoders find highly interpretable features in language models.����� �������� ����������������, 2023
2023
-
[41]
Exploring activation pat- terns of parameters in language models.����� �������� ����������������, 2024
Yudong Wang, Damai Dai, and Zhifang Sui. Exploring activation pat- terns of parameters in language models.����� �������� ����������������, 2024
2024
-
[42]
Neuron-guided interpretation of code LLMs: Where, why, and how?����� �������� ����������������, 2025
Zhe Yin, Xiaodong Gu, and Beijun Shen. Neuron-guided interpretation of code LLMs: Where, why, and how?����� �������� ����������������, 2025
2025
-
[43]
Memorizing normality to detect anomaly: Memory-augmented deep autoencoder for unsupervised anomaly detection
Dong Gong, Lingqiao Liu, Vuong Le, Budhaditya Saha, Moussa Reda Mansour, Svetha Venkatesh, and Anton van den Hengel. Memorizing normality to detect anomaly: Memory-augmented deep autoencoder for unsupervised anomaly detection. In����������� �� ��� �������� ������������� ���������� �� �������� ������, pages 1705–1714, 2019
2019
-
[44]
PaDiM: A patch distribution modeling framework for anomaly detection and localization
Thomas Defard, Aleksandr Setkov, Angelique Loesch, and Romaric Au- digier. PaDiM: A patch distribution modeling framework for anomaly detection and localization. In������� ������������ ���� ������������� ��������� ��� ����������, pages 475–489, 2021
2021
-
[45]
Towards total recall in industrial 62 anomaly detection
Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard Sch¨ olkopf, Thomas Brox, and Peter Gehler. Towards total recall in industrial 62 anomaly detection. In����������� �� ��� �������� ���������� �� �������� ������ ��� ������� �����������, pages 14318–14328, 2022
2022
-
[46]
MVTec AD: A comprehensive real-world dataset for unsupervised anomaly detection
Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Ste- ger. MVTec AD: A comprehensive real-world dataset for unsupervised anomaly detection. In����������� �� ��� �������� ���������� �� �������� ������ ��� ������� �����������, pages 9592–9600, 2019. 63 � ��������� �� ����������� ������� This appendix records implementation-fidelity details neede...
2019
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.