MemQ: Integrating Q-Learning into Self-Evolving Memory Agents over Provenance DAGs
Junwei Liao, Haoting Shi, Ruiwen Zhou, Jiaqian Wang, Shengtao Zhang, Wei Zhang, Weinan Zhang, Ying Wen, Zhiyu Li, Feiyu Xiong, Bo Tang, Muning Wen
arXiv:2605.08374 · 2026-05-12 공개 · arXiv · PDF
llm-agents code-generation q-learning function-calling memory-agents multi-step-tasks td-lambda provenance-dags
Abstract
Episodic memory allows LLM agents to accumulate and retrieve experience, but current methods treat each memory independently, i.e., evaluating retrieval quality in isolation without accounting for the dependency chains through which memories enable the creation of future memories. We introduce MemQ, which applies TD($\lambda$) eligibility traces to memory Q-values, propagating credit backward through a provenance DAG that records which memories were retrieved when each new memory was created. Credit weight decays as $(\gamma\lambda)^d$ with DAG depth $d$, replacing temporal distance with structural proximity. We formalize the setting as an Exogenous-Context MDP, whose factored transition decouples the exogenous task stream from the endogenous memory store. Across six benchmarks, spanning OS interaction, function calling, code generation, multimodal reasoning, embodied reasoning, and expert-level QA, MemQ achieves the highest success rate on all six in generalization evaluation and runtime learning, with gains largest on multi-step tasks that produce deep and relevant provenance chains (up to +5.7~pp) and smallest on single-step classification (+0.77~pp) where single-step updates already suffice. We further study how $\gamma$ and $\lambda$ interact with the EC-MDP structure, providing principled guidance for parameter selection and future research. Code will be available soon.
한국어 요약
📋 한 줄 요약
**[LLM Agents / Memory]** TD(λ) 적격성 흔적을 메모리 Q-값에 적용해 출처(provenance) DAG 깊이를 따라 신용을 역전파하는 자가진화 메모리 에이전트 MemQ를 제안한다.
🎯 핵심 기여도
- 에피소드 메모리를 독립적으로 다루던 기존 접근의 한계(의존성 사슬 무시)를 명확히 지적
- TD(λ) eligibility trace를 메모리 Q-값에 도입해 DAG 구조 기반의 신용 할당 제안
- (γλ)^d로 깊이에 따라 감쇠하는 가중치를 통해 시간 거리 대신 구조적 근접도 사용
- 외생-내생 컨텍스트를 분리하는 Exogenous-Context MDP 형식화
💡 핵심 아이디어
메모리는 다른 메모리를 만들어내는 의존 사슬 위에 존재한다. 어떤 메모리가 후속 메모리를 만들 때 사용되었는지를 기록한 출처 DAG를 만들고, TD(λ)로 그 사슬을 따라 신용을 역전파하면 메모리의 진짜 가치를 평가할 수 있다.
🔬 기술적 접근법
- **모델/방법론**: TD(λ) 적격성 흔적을 메모리 Q-값에 적용, 출처 DAG 기반 신용 전파
- **핵심 기법**: Exogenous-Context MDP 형식화로 외생적 태스크 흐름과 내생적 메모리 저장소를 분리, 구조적 근접도 기반 신용 감쇠 (γλ)^d, γ·λ와 EC-MDP 구조의 상호작용 분석
📊 주요 결과
- 6개 벤치마크(OS 상호작용, 함수 호출, 코드 생성, 멀티모달 추론, 체화 추론, 전문가급 QA) 모두에서 최고 성공률
- 깊은 출처 사슬을 가진 멀티스텝 태스크에서 최대 +5.7%p 개선
- 단일 스텝 분류 태스크에서는 최소 +0.77%p 개선 (이미 충분한 영역)
💭 의의 및 한계
**의의**: LLM 에이전트의 메모리를 강화학습 신용 할당 문제로 재정의하여, 깊은 추론·도구 사용 태스크에서 견고한 일반화를 가능하게 한다. **한계**: 출처 DAG 정확성에 의존하며, γ·λ 하이퍼파라미터 튜닝이 도메인별로 필요하다.
🚀 실용적 활용
- 장기 운영되는 LLM 에이전트의 메모리 품질 관리
- 코드 생성·자동화 에이전트의 누적 경험 학습
- 멀티모달 및 체화 에이전트의 장기 컨텍스트 관리