Instructions to use NewBeeKing/MemPO_Qwen2.5-SFT-RL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NewBeeKing/MemPO_Qwen2.5-SFT-RL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NewBeeKing/MemPO_Qwen2.5-SFT-RL") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("NewBeeKing/MemPO_Qwen2.5-SFT-RL") model = AutoModel.from_pretrained("NewBeeKing/MemPO_Qwen2.5-SFT-RL", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NewBeeKing/MemPO_Qwen2.5-SFT-RL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NewBeeKing/MemPO_Qwen2.5-SFT-RL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NewBeeKing/MemPO_Qwen2.5-SFT-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NewBeeKing/MemPO_Qwen2.5-SFT-RL
- SGLang
How to use NewBeeKing/MemPO_Qwen2.5-SFT-RL with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "NewBeeKing/MemPO_Qwen2.5-SFT-RL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NewBeeKing/MemPO_Qwen2.5-SFT-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "NewBeeKing/MemPO_Qwen2.5-SFT-RL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NewBeeKing/MemPO_Qwen2.5-SFT-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NewBeeKing/MemPO_Qwen2.5-SFT-RL with Docker Model Runner:
docker model run hf.co/NewBeeKing/MemPO_Qwen2.5-SFT-RL
🧠 MemPO: Self-Memory Policy Optimization for Long-Horizon Agents
📌 Model Description
Model name: NewBeeKing/MemPO_Qwen2.5-SFT-RL
This model is the reinforcement learning (RL) optimized version of NewBeeKing/MemPO_Qwen2.5-SFT, trained using the MemPO algorithm on the NewBeeKing/MemPO_RL-train-dataset.
- 📄 Paper: MemPO: Self-Memory Policy Optimization for Long-Horizon Agents
- 💻 Code: Official GitHub Repository
After downloading the model, you can refer to the code repository https://github.com/TheNewBeeKing/MemPO to test or train the model.
MemPO is designed for long-horizon agent tasks, where the interaction history with the environment can grow rapidly and hurt both performance and stability. Instead of relying only on external memory retrieval, MemPO enables the policy model itself to proactively summarize, retain, and manage memory during interaction.
By improving credit assignment based on memory effectiveness, MemPO helps the agent keep crucial information while discarding less useful context, leading to much better token efficiency without sacrificing task performance.
✨ Abstract
Long-horizon agents face the challenge of growing context size during interaction with environment, which degrades performance and stability. We propose the self-memory policy optimization algorithm (MemPO), which enables the agent to autonomously summarize and manage their memory during interaction. By improving the credit assignment mechanism, the policy model can selectively retain crucial information, significantly reducing token consumption while preserving task performance. Extensive experiments confirm that MemPO achieves absolute F1 score gains of 25.98% over the base model while reducing token usage by up to 73.12%.
🧱 Base Model
- Base SFT model:
NewBeeKing/MemPO_Qwen2.5-SFT
📚 Dataset
- RL training dataset:
NewBeeKing/MemPO_RL-train-dataset
📝 Citation
@misc{li2025mempo,
title={MemPO: Self-Memory Policy Optimization for Long-Horizon Agents},
author={Ruoran Li and Xinghua Zhang and Haiyang Yu and Shitong Duan and Xiang Li and Wenxin Xiang and Chonghua Liao and Xudong Guo and Yongbin Li and Jinli Suo},
year={2025},
eprint={2603.00680},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2603.00680},
}
- Downloads last month
- 8
Model tree for NewBeeKing/MemPO_Qwen2.5-SFT-RL
Base model
NewBeeKing/MemPO_Qwen2.5-SFT