Downloads · 30 days
8.9K
99% of all-time downloads
chen-l/LiveMem-RL
LiveMem-RL is a text generation model from chen-l. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
LiveMem-RL is the reinforcement-learning checkpoint of LiveMem-4B-SFT. It uses a Qwen3 attention path in parallel with a Gated DeltaNet 2 (GDN2) recurrent memory path at every decoder layer:
Downloads · 30 days
8.9K
99% of all-time downloads
All-time downloads
9K
Public
Parameters
6.4B
12.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors12.7 GB · 100%
From the Hugging Face model README
LiveMem-RL is the reinforcement-learning checkpoint of LiveMem-4B-SFT. It uses a Qwen3 attention path in parallel with a Gated DeltaNet 2 (GDN2) recurrent memory path at every decoder layer:
layer output = Qwen3 attention output + GDN2 memory output
This checkpoint was trained with GRPO from chen-l/LiveMem-SFT. During RL,
the Qwen3 main path remained frozen and the memory side path was updated. The
configured maximum context length is 262,144 tokens; actual usable context
depends on GPU memory and inference backend.
LiveMem uses custom model code and GDN2 Triton kernels. A CUDA environment is required for inference.
pip install -r requirements.txt
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "chen-l/LiveMem-4B-RL"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.bfloat16,
device_map="auto",
)
messages = [{"role": "user", "content": "Answer using the supplied long context."}]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True,
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
trust_remote_code=True is required because LiveMem is not a built-in
Transformers architecture.