δ-mem: Efficient Online Memory for Large Language Models
Paper • 2605.12357 • Published • 125
How to use ofthetrees/delta-mem-qwen3-4b-instruct-mlx-adapter with MLX:
# Make sure mlx-lm is installed
# pip install --upgrade mlx-lm
# if on a CUDA device, also pip install mlx[cuda]
# Generate text with mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("ofthetrees/delta-mem-qwen3-4b-instruct-mlx-adapter")
prompt = "Once upon a time in"
text = generate(model, tokenizer, prompt=prompt, verbose=True)How to use ofthetrees/delta-mem-qwen3-4b-instruct-mlx-adapter with MLX LM:
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "ofthetrees/delta-mem-qwen3-4b-instruct-mlx-adapter" --prompt "Once upon a time"
This repository contains an MLX-converted copy of the public δ-mem TSW adapter for Qwen/Qwen3-4B-Instruct-2507.
δ-mem is an online memory mechanism for frozen LLMs. It adds a compact memory path that writes earlier context into a small online state and reads that state back through attention during later generation. This is an adapter artifact, not a merged base model.
delta_mem_adapter_mlx.npz: MLX-converted adapter weights.delta_mem_config.json: δ-mem adapter configuration copied from the upstream adapter repo.conversion_info.json: provenance for this conversion package.c46dc31155608e412d44bf56638d5a6f856f2e7eThis adapter is intended for the δ-mem MLX sidecar runtime, not stock mlx_lm.load(). Use it with a compatible MLX Qwen3-4B backbone and a δ-mem-aware attention/runtime implementation.
Example environment shape:
DELTA_MEM_RUNTIME=mlx
DELTA_MEM_MODEL_PATH=mlx-community/Qwen3-4B-Instruct-2507-4bit
DELTA_MEM_ADAPTER_DIR=/path/to/this/adapter
DELTA_MEM_MODEL_ID=delta-mem-qwen3-4b-mlx
@misc{lei2026deltamemefficientonlinememory,
title={$\delta$-mem: Efficient Online Memory for Large Language Models},
author={Jingdi Lei and Di Zhang and Junxian Li and Weida Wang and Kaixuan Fan and Xiang Liu and Qihan Liu and Xiaoteng Ma and Baian Chen and Soujanya Poria},
year={2026},
eprint={2605.12357},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2605.12357}
}
Base model
Qwen/Qwen3-4B-Instruct-2507