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 — это новое поколение базовых моделей с памятью, в которых постоянная память, динамически развивающаяся в процессе работы, становится неотъемлемой частью вычислений модели. Благодаря этому модель может сохранять и повторно использовать исторические данные, не перечитывая исходный контекст во время вывода.
Это модель, которую я скачиваю, или библиотека, с которой я пишу код?И то, и другое: это семейство обученных LLM с расширенной памятью (Nano и Flash), которые вы запускаете через SGLang, а также клиентская библиотека на Python под названием 'memtsglang' для диалогов с учётом памяти на запущенном сервере.
Как запустить модель?Установите пакет из каталога inference репозитория на Linux-сервере с NVIDIA CUDA, запустите сервер SGLang с полной контрольной точкой BF16 (веса, конфигурация, токенизатор), затем подключитесь с помощью клиента memtsglang с подходящими локальными файлами токенизатора.
Что нужно перед тем, как попробовать?Машина с Linux и NVIDIA CUDA, Python 3.11 или новее, а также полная локальная контрольная точка MemT-1.0 с соответствующими весами BF16, конфигурацией и токенизатором; пример быстрого старта запускает модель Nano на двух GPU.
Есть ли подвох при использовании кода или весов?Программное обеспечение репозитория распространяется по некоммерческой лицензии, поэтому коммерческое использование без связи с авторами не допускается. Веса моделей, бенчмарки и наборы данных явно не подпадают под эти условия и будут получать собственные лицензии при публикации.
Для кого это предназначено?Для исследователей и инженеров, которые работают с LLM с длинным контекстом и расширенной памятью, а также с агентными системами, особенно для тех, кто изучает повторное использование опыта в агентах для программирования с длинным горизонтом задач.
Какие два варианта моделей MemT-1.0?Nano работает на базе Qwen3.6-35B-A3B (всего 36 млрд параметров, из них 3 млрд активируются; 451 млн обучаемых параметров памяти; 10 млн состояния памяти), а Flash — на базе DeepSeek-V4-Flash (всего 288 млрд параметров, из них 17 млрд активируются; 3,61 млрд обучаемых параметров памяти; 336 млн состояния памяти).
Насколько архитектура памяти экономит место по сравнению с KV-кешем?Постоянное состояние памяти сохраняет свой размер и уменьшает объём хранения примерно в 66 раз по сравнению с полным KV-кешем контекста при длине истории 128K.
Что такое агентное программирование, управляемое опытом?Это подход, при котором накопленный опыт программирования хранится во встроенной памяти и извлекается через механизм внимания к памяти во время выполнения задачи. Это повышает качество работы над задачами с длинным горизонтом, не добавляя текст этого опыта в окно контекста.
Каковы результаты на бенчмарках памяти?На 11 бенчмарках памяти Flash и Nano занимают первое и второе место среди оценённых методов параметрической памяти, однако специализированные системы поиска по текстовой памяти по-прежнему лидируют на очень длинных историях, где требуются подробные доказательства.
Какие есть похожие проекты?jeeves, CLM, ZDTaichu5.0-9B, StartLux-Decision, NeoHorse, MSA, TypeLLM, Hy4-preview
Автор
MemTensor
Размер
9 MB
Звёзды
542
Обновлён
КоммитNov 08
Возраст
1 мес
Коммиты · 90 дней