我们研究是否可以在解码器-only Transformer中,用显式学习的记忆图替换前馈网络(FFN)子层,同时保留周围的自回归架构。所提出的图记忆Transformer(GMT)保持因果自注意力不变,但将通常的逐token FFN变换替换为一个记忆单元,该单元通过一个由学习的有向转移矩阵连接的质心库来路由token表示。在此处研究的基础GMT v7实例中,16个Transformer块中的每个块包含128个质心、一个128*128的边矩阵、引力源路由、token条件目标选择以及门控位移读出。因此,该单元返回从估计的源记忆状态到目标记忆状态的移动,而不是检索到的值。由此产生的模型是一个完全解码器-only的语言模型,具有82.2M可训练参数且没有密集的FFN子层,而评估中使用的密集GPT风格基线有103.0M参数。基础v7模型训练稳定,并将质心使用、转移结构和源到目标移动作为前向计算中可直接检查的量。在验证损失和困惑度方面,它落后于较大的密集基线(3.5995/36.58 vs. 3.2903/26.85),但在评估设置下显示出接近的零样本基准表现。这些结果并非旨在声称最先进性能;它们支持用图介导的记忆导航替换密集的token内变换的可行性和结构可解释性。更广泛的扩展、优化的内核以及更广泛的基准评估留待后续工作。
英文摘要:
We investigate whether an explicit learned memory graph can replace the Feed-Forward Network (FFN) sublayer in a decoder-only transformer while preserving the surrounding autoregressive architecture. In the proposed graph Memory Transformer (GMT), a memory cell routes token representations over a learned bank of centroids connected by a learned directed transition matrix, while causal self-attention remains unchanged. In the base v7 instantiation, each of 16 transformer blocks contains 128 centroids and a 128 x 128 edge matrix. Each cell uses gravitational source routing and token-conditioned target selection to return a gated displacement from the estimated source memory state toward the target memory state, rather than a retrieved value. The resulting decoder-only language model has 82.2M trainable parameters and no dense FFN sublayers; the evaluated dense GPT-style baseline has 103.0M. It trains stably and exposes centroid usage, transition structure, and source-to-target movement for direct inspection in the forward computation. It trails the larger 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 support the viability and structural interpretability of replacing dense within-token transformation with graph-mediated memory navigation, without claiming state-of-the-art performance. Broader scaling, optimized kernels, and more extensive benchmark evaluation remain for future work.
Mention Memory: incorporating textual knowledge into Transformers through entity mention attention
University of Southern California(南加利福尼亚大学);Google(谷歌);Google Research(谷歌研究院)
诸如开放域问答之类的自然语言理解任务通常需要从多个源检索和吸收事实信息。我们建议通过将大型文本语料库的半参数表示集成到Transformer模型中作为事实知识的来源来解决这个问题。具体来说,我们的方法表示知识与“提及记忆”,一个表的密集向量表示的每一个实体中提到的语料库。所提出的模型- TOME -是一个Transformer,它通过内部记忆层访问信息,其中输入通道中提到的每个实体都参与提到记忆。这种方法支持在单个Transformer模型中对许多不同的信息源进行合成和推理。在使用1.5亿次维基百科提及的记忆的实验中,TOME在几个开放领域知识密集型任务上实现了强大的性能,包括声明验证基准HoVer和FEVER以及几个基于实体的QA基准。我们还表明,该模型学习参加信息提及没有任何直接的监督。最后,我们证明了该模型可以推广到新的看不见的实体更新的内存,而无需再训练。
SPARTAN: Sparse Hierarchical Memory for Parameter-Efficient Transformers
Princeton University(普林斯顿大学);IBM Research AI(IBM研究院AI);Amazon AWS AI(亚马逊AWS AI);The Allen Institute for AI(艾伦人工智能研究所)
微调预训练的语言模型(PLM)在一系列下游任务上实现了令人印象深刻的性能,因此它们的规模越来越大。由于每个任务都需要模型的不同副本,因此这种范例对于移动电话等存储受限的边缘设备是不可行的。在本文中,我们提出了SPARTAN,一个参数高效(PE)和计算速度快的边缘设备,每个Transformer层后增加分层组织的稀疏内存架构。SPARTAN冻结PLM参数并仅微调其内存,从而通过为不同任务重复使用PLM主干来显著降低存储成本。SPARTAN包含两个级别的内存,在第一级中为每个输入仅选择父节点的稀疏子集,并且与这些父节点对应的子单元用于计算输出表示。与PE基线(适配器)相比,这种稀疏性与其他架构优化相结合,在Raspberry Pi 4上进行推理时,SPARTAN的吞吐量提高了90%以上,同时在GLUE基准测试中也超过后者0.1个点。此外,它可以在Few-Shot设置中训练速度快34%,同时在适配器的0.9点内执行。定性分析表明,SPARTAN中不同的父细胞专注于不同的主题,从而有效地划分责任。
Time and Memory Trade-off of KV-Cache Compression in Tensor Transformer Decoding
The University of Chicago(芝加哥大学);Stevens Institute of Technology(史蒂文斯理工学院);The University of Hong Kong(香港大学);University of Wisconsin-Madison(威斯康星大学麦迪逊分校);The Simons Institute for the Theory of Computing at UC Berkeley(加州大学伯克利分校西蒙斯理论计算研究所)
Academy for Advanced Interdisciplinary Studies, Peking University(北京大学前沿交叉学科研究院);School of Mathematical Sciences, Peking University(北京大学数学科学学院);Microsoft Corporation(微软公司)
Transformers通过在大规模文本语料库上进行预训练,实现了自然语言处理任务的最新性能。它们是非常计算密集型的,并且具有非常高的样本复杂性。内存重放是一种通过保存到内存缓冲区和从内存缓冲区重放来记住和重用过去的示例的机制。由于更好的样本效率,它已成功用于强化学习和GANs。在本文中,我们提出了\emph{Transformer with Memory Replay}(TMR),它集成了存储器重放与Transformer,使Transformer更采样效率。在GLUE和SQuAD基准数据集上的实验表明,与使用相同数量的示例进行预训练的基线Transformer模型相比,具有内存重放的Transformer至少实现了$1\%$点的增加。此外,通过采用一个精心的设计,减少内存重放的挂钟时间开销,我们也经验性地实现了更好的运行时效率。
AtMan: Understanding Transformer Predictions Through Memory Efficient Attention Manipulation
Aleph Alpha(阿列夫阿尔法);Technical University Darmstadt(达姆施塔特工业大学);Hessian Center for Artificial Intelligence (hessian.AI)(黑森州人工智能中心);German Center for Artificial Intelligence (DFKI)(德国人工智能研究中心);LAION
CoMeT: Collaborative Memory Transformer for Efficient Long Context Modeling
School of Computer Science and Engineering, Northeastern University, Shenyang 110819, China(东北大学计算机科学与工程学院);Tsinghua University(清华大学);Future Living Lab of Alibaba(阿里巴巴未来生活实验室)