MemT-1.0 README

项目的 README,来自 github.com/MemTensor/MemT-1.0。合并为一个 markdown 文件:README.md。

MemT-1.0 — Towards Memory-Native Evolution

HuggingFace Tech Report: PDF

English | 简体中文

Overview

MemT-1.0 is a new generation of memory foundation models that makes persistent, dynamically evolving memory an intrinsic part of model computation.

MemT-1.0 integrates dynamic local memory and trainable hyper memory to retain and leverage historical information without accessing original context at inference. Its persistent state remains constant in size, reducing storage by approximately 66× versus full-context KV cache at 128K history length.

The project makes three main contributions:

Model Family

Model Backbone Total Parameters Activated Parameters Trainable Memory Parameters Dynamic Memory State
MemT-1.0-Nano Qwen3.6-35B-A3B 36B 3B 451M 10M
MemT-1.0-Flash DeepSeek-V4-Flash 288B 17B 3.61B 336M

Architecture

A Native Memory Block runs alongside the backbone attention and contains two components:

During generation, memory attention reads from the current memory state, normalizes and gates the readout, and adds it to the backbone attention output. At the end of each turn or segment, stable GDN-2 performs token-level memory updates for subsequent steps.

MemT-1.0 native memory architecture

Evaluation Results

Across 11 memory benchmarks, MemT-1.0-Flash and MemT-1.0-Nano rank first and second among the evaluated parametric-memory methods, respectively. Strong textual-memory systems remain ahead overall, particularly on long histories that require detailed evidence retrieval.

MemT-1.0 memory benchmark results

Experience-Guided Agentic Coding

MemT-1.0 introduces an agentic framework for reusing procedural experience in long-horizon coding tasks. Retrieved experience is stored in native memory and accessed through memory attention during execution, improving task performance without adding experience text to the task context.

Experience-guided coding agents

Quick Start

The examples below serve MemT-1.0-Nano with SGLang and use the memt_sglang Python client for conversations with native memory. For deployment details and MemT-1.0-Flash setup, see the inference guide in English or 简体中文.

Installation

On a Linux server with NVIDIA CUDA and Python 3.11 or newer, install from the repository's inference directory:

cd inference
uv pip install '.[server]'

If the Python client runs in a separate environment, install the client extra from the same directory in that environment:

uv pip install '.[client]'

Start the Server

Use a complete local MemT-1.0-Nano checkpoint with matching BF16 weights, configuration and tokenizer assets:

sh start_memt_nano.sh /models/MemT-1.0-Nano

This example uses two GPUs and serves at http://127.0.0.1:30000, with memory snapshots stored in ./memt-state on the server. Keep the server running and run the Python examples below in another terminal. For Flash, use start_memt_flash.sh and the Flash client setup described in the inference guide.

Connect the Client

Use local tokenizer assets matching the served checkpoint. The client loads the tokenizer; model inference runs on the SGLang server.

import os
from transformers import AutoTokenizer
from memt_sglang.client import MemTSession, NativeClient, load_chat_format

model_path = "/models/MemT-1.0-Nano"
tokenizer = AutoTokenizer.from_pretrained(
    model_path,
    local_files_only=True,
    trust_remote_code=False,
)
# chat_format builds inputs; parser extracts reasoning and tool calls.
chat_format, parser = load_chat_format(
    model_path,
    tokenizer=tokenizer,
    chat_template_kwargs={"enable_thinking": False},
)
client = NativeClient(
    "http://127.0.0.1:30000",
    api_key=os.environ.get("MEMT_API_KEY"),
)

A Conversation with Memory

Memory reading is enabled by default, so committed memory is used automatically. Set enable_memory=True to save unsaved past and current turns to latent local memory after the reply completes, then clear their plaintext conversation context. This also works on the first turn. Tool chains are saved after the final answer; truncated replies remain available for a later commit or save. chat() returns answer text by default. Use return_dict=True for a structured result. Responses shown below are illustrative.

session = MemTSession(client, chat_format, parser)

answer = session.chat(
    "I have a three-month-old kitten named memmy who loves eating "
    "small shrimp and is excellent at remembering things."
)
print(answer)
# Memmy is three months old, loves small shrimp, and has an excellent memory.

# After replying, save the kitten-description and current game Q&As to latent
# local memory and clear their plaintext conversation context.
answer = session.chat(
    "What is a simple game I can play with my kitten?",
    enable_memory=True,
)
print(answer)
# Try gently moving a wand toy for your kitten to chase.

# Answer using the latent local memory of the kitten-description Q&A.
answer = session.chat(
    "What are my kitten's name, age, favorite food, and special trait?",
    enable_memory=True,
)
print(answer)
# Based on the information you provided earlier:
#
# *   **Name:** Memmy
# *   **Age:** Three months old
# *   **Favorite Food:** Small shrimp
# *   **Special Trait:** An excellent memory

Save and Resume

save_state(path) commits remaining turns before saving. The returned path identifies the snapshot in the server's configured state directory; pass it as state when restoring a session.

# Save local memory, including any unsaved conversation turns.
snapshot = session.save_state("memmy_memory.safetensors")
session.close()

# Restore memory without the previous conversation transcript.
with MemTSession(client, chat_format, parser, state=snapshot["path"]) as restored:
    print(len(restored.messages))
    # 0

    answer = restored.chat("How old is my kitten?")
    print(answer)
    # Your kitten is **3 months old**.

Standard Chat

Create a fresh session without a snapshot and disable memory reading. Keep automatic history writes off with enable_memory=False; previous turns remain in the conversation transcript.

with MemTSession(client, chat_format, parser) as chat:
    chat.set_memory_read(False)
    answer = chat.chat(
        "Type 'I love MemT' exactly.",
        enable_memory=False,
    )
    print(answer)
    # I love MemT

Citation

For the MemT-1.0 technical report:

@misc{memtensor2026memt1,
  title         = {MemT-1.0: Towards Memory-Native Evolution},
  author        = {{MemTensor Team}},
  year          = {2026},
  eprint        = {2610.26825},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CL},
  url           = {https://arxiv.org/abs/2610.26825}
}

⚖️ License

This project uses separate licenses for the paper and the repository software:

Bundled third-party components retain their own licenses. The SGLang integration includes flash-linear-attention code under MIT; see the component license table.

Commercial use of the repository software is not permitted under the PolyForm Noncommercial License. For commercial licensing inquiries, please contact the authors.

Unless explicitly stated otherwise, model weights, datasets, benchmark assets, trademarks, and third-party materials are not covered by the licenses above. Their applicable terms will be provided with the corresponding releases.

📬 Contact

Research correspondence: [email protected].

MemT-1.0 (MemTensor/MemT-1.0)

正在搜索数据库…

这是什么?MemT-1.0 是新一代记忆基础模型,它将持久且动态演化的记忆内化为模型计算的一部分,使模型能够保留并复用历史信息,而无需在推理时重新读取原始上下文。
这是我可以下载的模型,还是我需要写代码调用的库?两者兼有:它是一系列经过训练的记忆增强型大语言模型(Nano 和 Flash),可用 SGLang 部署;同时还提供名为 'memtsglang' 的 Python 客户端库,用于与正在运行的服务器进行具备记忆功能的对话。
我该怎么让模型跑起来?在装有 NVIDIA CUDA 的 Linux 服务器上,从仓库的 inference 目录安装软件包,然后用完整的 BF16 检查点(权重、配置和分词器)启动 SGLang 服务器,最后使用 memtsglang 客户端连接,并配上与之匹配的本地分词器资源。
运行之前我需要准备什么?一台装有 NVIDIA CUDA 的 Linux 机器、Python 3.11 或更高版本,以及完整的本地 MemT-1.0 检查点,其中包括匹配的 BF16 权重、配置和分词器;快速入门示例会在两块 GPU 上部署 Nano 模型。
使用代码或权重有什么需要注意的地方吗?仓库中的软件采用非商业许可证,因此未经作者同意不得用于商业用途;模型权重、基准测试和数据集不适用同一条款,发布时会有各自的许可证。
这适合哪些人?从事长上下文、记忆增强型大语言模型和智能体系统研究的研究人员与工程师,尤其是那些探索长周期编程智能体中经验复用的人。
MemT-1.0 的两个模型版本是什么?Nano 基于 Qwen3.6-35B-A3B 骨干网络(总参数 36B,激活参数 3B,可训练记忆参数 451M,记忆状态 10M);Flash 基于 DeepSeek-V4-Flash(总参数 288B,激活参数 17B,可训练记忆参数 3.61B,记忆状态 336M)。
与 KV 缓存相比,这种记忆架构能节省多少存储?其持久记忆状态大小保持恒定,在 128K 历史长度下,与完整上下文的 KV 缓存相比,存储占用约减少 66 倍。
什么是经验引导的智能体编程?这是一个框架:可复用的编程经验被存入原生记忆中,并在任务执行期间通过记忆注意力机制检索出来,从而提升长周期编程表现,而无需把这些经验文本塞进上下文窗口。
它在记忆基准测试中表现如何?在 11 个记忆基准测试中,Flash 和 Nano 在评估的参数化记忆方法中分列第一和第二;不过,在需要细节证据的超长历史任务上,专门的文本记忆检索系统仍然领先。
作者
MemTensor
大小
9 MB
星标
542
更新
提交Nov 08
时长
1个月
提交 · 90 天