LMIS-ORG/MemAgent_Slime_Agentic_Qwen2.5_7B

Model

license: apache-2.0

1

5 commits

1 linked in READMEs

updated Apr 3, 2026

See the code

README


license: apache-2.0 license_link: https://huggingface.co/Qwen/Qwen2.5-7B-Instruct/blob/main/LICENSE language:

  • en pipeline_tag: text-generation base_model: Qwen/Qwen2.5-7B tags:
  • chat

MemAgent — agentic/memagent/

Our code hub is :https://github.com/LMIS-ORG/slime-agentic

Reproduces the core idea of MemAgent: compressing arbitrarily long documents into a fixed-size recurrent memory via a chunk-by-chunk LLM update loop, then answering questions from memory alone. RL (GRPO) is applied to all memory-update turns using a Multi-Conversation training objective, so the model learns to retain what matters across chunks without ever seeing the full context at once.

Architecture

Input: question + long document
  │
  â–¼
memory = "No previous memory"
  │
  └─► for chunk in split(document, chunk_tokens):
        │
        └─ LLM(problem, memory, chunk) → updated memory   (loss_mask=1)
  │
  â–¼
LLM(problem, memory) → final answer in \boxed{}           (loss_mask=0)
  │
  â–¼
Reward: exact-match / F1 against ground truth
         (distributed evenly across all memory-update turns)

Each memory-update turn is an independent training sequence. The reward is evenly amortised across all turns in the conversation (via custom_convert), matching the Multi-Conv RL objective in the MemAgent paper.

Results

Evaluated on RULER-HQA across context lengths from 7K to 448K tokens (5 runs, best score reported):

Model7K14K28K56K112K224K448K
MemAgent (ours)78.1276.5675.7874.2277.3472.6669.53
QwenLong-L1-32B72.6675.0072.6660.9431.2517.1913.28
Qwen2.5-Instruct-14B-1M60.1660.9450.0057.0350.0037.508.59
Qwen2.5-Instruct-7B-1M61.7256.2553.9155.4751.5633.5912.50
DS-Distill-Qwen-32B70.3166.4165.6246.8823.4413.287.81
DS-Distill-Qwen-14B64.0664.8457.0340.6214.848.593.12
DS-Distill-Qwen-7B30.4712.503.120.000.000.780.00

MemAgent (ours) is trained on a 7B base model and consistently outperforms all baselines, including much larger models, across all context lengths.

qwen2
safetensors

Contributors

Lil2J

5 commits

LMIS-ORG/MemAgent_Slime_Agentic_Qwen2.5_7B

Model

license: apache-2.0

1

5 commits

1 linked in READMEs

updated Apr 3, 2026

See the code

README


license: apache-2.0 license_link: https://huggingface.co/Qwen/Qwen2.5-7B-Instruct/blob/main/LICENSE language:

  • en pipeline_tag: text-generation base_model: Qwen/Qwen2.5-7B tags:
  • chat

MemAgent — agentic/memagent/

Our code hub is :https://github.com/LMIS-ORG/slime-agentic

Reproduces the core idea of MemAgent: compressing arbitrarily long documents into a fixed-size recurrent memory via a chunk-by-chunk LLM update loop, then answering questions from memory alone. RL (GRPO) is applied to all memory-update turns using a Multi-Conversation training objective, so the model learns to retain what matters across chunks without ever seeing the full context at once.

Architecture

Input: question + long document
  │
  â–¼
memory = "No previous memory"
  │
  └─► for chunk in split(document, chunk_tokens):
        │
        └─ LLM(problem, memory, chunk) → updated memory   (loss_mask=1)
  │
  â–¼
LLM(problem, memory) → final answer in \boxed{}           (loss_mask=0)
  │
  â–¼
Reward: exact-match / F1 against ground truth
         (distributed evenly across all memory-update turns)

Each memory-update turn is an independent training sequence. The reward is evenly amortised across all turns in the conversation (via custom_convert), matching the Multi-Conv RL objective in the MemAgent paper.

Results

Evaluated on RULER-HQA across context lengths from 7K to 448K tokens (5 runs, best score reported):

Model7K14K28K56K112K224K448K
MemAgent (ours)78.1276.5675.7874.2277.3472.6669.53
QwenLong-L1-32B72.6675.0072.6660.9431.2517.1913.28
Qwen2.5-Instruct-14B-1M60.1660.9450.0057.0350.0037.508.59
Qwen2.5-Instruct-7B-1M61.7256.2553.9155.4751.5633.5912.50
DS-Distill-Qwen-32B70.3166.4165.6246.8823.4413.287.81
DS-Distill-Qwen-14B64.0664.8457.0340.6214.848.593.12
DS-Distill-Qwen-7B30.4712.503.120.000.000.780.00

MemAgent (ours) is trained on a 7B base model and consistently outperforms all baselines, including much larger models, across all context lengths.

qwen2
safetensors

Contributors

Lil2J

5 commits