EMemBench 开源交互式 VLM 智能体情景记忆评测框架
GitHub - InternLM/EMemBench: [EMNLP 2026 Findings] Official Repository of EMemBench: Interactive Benchmarking of Episodic Memory for VLM Agents · GitHub
InternLM 开源 EMemBench,用智能体自身的交互轨迹生成问答,并依据底层游戏信号计算可验证的标准答案。该框架覆盖文本环境 Jericho 和视觉环境 Crafter,提供从运行智能体、记录轨迹到生成问答及评分的端到端流程,相关论文入选 EMNLP 2026 Findings。
正文
BranchesTagsOpen more actions menu
Latest commit
History26 Commits26 Commits
Folders and files
NameNameLast commit messageLast commit date
requirements.txtrequirements.txt
Repository files navigationEMemBench: Interactive Benchmarking of Episodic Memory for VLM Agents
EMemBench is a programmatic benchmark framework for evaluating episodic (experience-grounded) memory in interactive agents.
Instead of using a fixed, static QA set, EMemBench generates questions from each agent’s own interaction trajectory and computes verifiable ground-truth answers from underlying game signals.
This repo provides an end-to-end pipeline for:
Jericho (text-only interactive fiction)
Crafter (visual, partially observed survival & crafting)
EMemBench is not a single fixed dataset. It is a benchmark generator + evaluation harness: run an agent → log → generate QA with programmatic GT → answer & score.
Figure 1: EMemBench overview. An agent interacts with game environment to produce an episode trajectory. We log agent-observable signals and all underlying game signals. A carefully designed algorithm converts each episode into a QA set with calculated ground truths, and the same agent then answers these questions using only agent-observable context plus its own memory.
Key Ideas
Trajectory-conditioned QA: questions are derived from the agent’s own interaction trace.
Programmatic, verifiable ground truth: answers are computed from game signals / structured logs.
Query Horizon Control (QHC): templates can optionally restrict evidence selection and answer computation to a prefix window (e.g., steps 1..50) to reduce confounds from variable episode lengths.
Legacy naming note: current code passes QHC values via flags named --difficulties / --difficulty, and writes to folders like DIF_-1, DIF_50. These values correspond to QHC settings.
Repository Layout
Text (Jericho)
text_game/ game_envs/ # Jericho ROMs (.z3/.z5/...) run_jericho_openai.py # play + log generate_jericho_qa.py # QA generation (+ indices/maps) answer_jericho_qa.py # answer + eval run_text_game_pipeline.py # E2E entry (play -> gen -> answer)
game_envs/ advent.z5 ... zork3.z5
logs/ /..._logs.jsonl
generated_qa/ / / DIF_-1/ # legacy folder name = QHC=-1 DIF_50/ # legacy folder name = QHC=50 ...
eval/ / /...
Visual (Crafter)
visual_game/ instructions/ run_crafter_openai.py # play + log + frames + map file generate_crafter_qa.py # QA generation answer_crafter_qa.py # answer + eval run_visual_game_pipeline.py # E2E entry (play -> gen -> answer)
log/ seed{SEED}/{RUN_NAME}/ logs.jsonl map_seed{SEED}.txt frames/*.png
generated_qa/ seed{SEED}/{RUN_NAME}/ qa_context.json DIF_-1/qa.jsonl # legacy folder name = QHC=-1 DIF_50/qa.jsonl # legacy folder name = QHC=50 ...
eval/ seed{SEED}/{RUN_NAME}/...
Installation
1) Python environment
conda create -n emembench python=3.10 conda activate emembench pip install -r requirements.txt
2) Jericho (text games)
Jericho typically requires Linux + basic build tools. Install and download the spaCy model:
pip install jericho python -m spacy download en_core_web_sm
You must place Jericho ROM files under text_game/game_envs/ (they are not included in this repo).
3) Crafter (visual game)
pip install crafter
4) Model API (OpenAI-compatible)
The provided runners assume an OpenAI-compatible chat API.
export OPENAI_API_KEY="YOUR_KEY" # Set a trusted HTTPS OpenAI-compatible endpoint (include /v1 if needed): export OPENAI_BASE_URL="https://YOUR_ENDPOINT/v1" # Optional: export OPENAI_MODEL="gpt-5.1"
Quickstart: End-to-End Pipelines
A) Jericho (Text) — one command
From the text_game/ directory (or repo root, depending on your working directory):
python run_text_game_pipeline.py \ --model gpt-5.1 \ --max-steps 200 \ --history-turns 30 \ --difficulties -1 50 \ --max-per-type 2 \ --logs-root logs \ --qa-root generated_qa
What it does (per game):
Play & log → logs/ /*_logs.jsonl
Generate QA (QHC values) → generated_qa/ / /DIF_*
Answer & evaluate → eval/ / /...
Notes
--history-turns controls how many recent turns are included in the policy prompt during play.
The list of games is defined in run_text_game_pipeline.py (edit JERICHO_GAMES to run more/fewer titles).
B) Crafter (Visual) — one command (multi-seed)
From the visual_game/ directory (or repo root):
python run_visual_game_pipeline.py \ --seeds 1 42 43 100 123 \ --steps 500 \ --history-turns 10 \ --difficulties -1 50 \ --qa-source paraphrase \ --qa-temperature 0.0 \ --qa-max-tokens 4096 \ --batch-size 8 \ --frames-mode mosaic
Override the answering model (optional):
python run_visual_game_pipeline.py \ --seeds 42 \ --qa-model gpt-5.1
Notes
--frames-mode controls how frames are packaged into evaluation prompts (mosaic is typically the most economical).
Outputs are grouped by seed: log/seed{SEED}/{RUN_NAME}/...
Outputs
Logs
Jericho: logs/ /*_logs.jsonl
Crafter: log/seed{SEED}/{RUN_NAME}/logs.jsonl + frames/ + map_seed{SEED}.txt
QA artifacts
qa_context.json: agent-observable context used to build evaluation prompts
qa.jsonl: one QA per line (question, metadata, GT answer, evidence pointers, etc.)
Evaluation
per-question predictions: answers.jsonl (or equivalent)
aggregated metrics: index.json (or equivalent)
Upstream Environments
✒️Citation
ACL Anthology · BibTeX
@inproceedings{li-etal-2026-emembench, title = "{EM}em{B}ench: Interactive Benchmarking of Episodic Memory for {VLM} Agents", author = "Li, Xinze and Zhu, Ziyue and Liu, Siyuan and Ma, Yubo and Zang, Yuhang and Cao, Yixin and Sun, Aixin", editor = "Lee, Hung-Yi and Dev, Sunipa and Li, Jessy and Elliott, Desmond", booktitle = "Findings of the {A}ssociation for {C}omputational {L}inguistics: {EMNLP} 2026", month = oct, year = "2026", address = "Budapest, Hungary", publisher = "Association for Computational Linguistics", url = "https://aclanthology.org/2026.findings-emnlp.905/", doi = "10.18653/2026.findings-emnlp.905", pages = "19163--19192", ISBN = "979-8-89176-462-0" }
📄 License
Usage and License Notices: The data and code are intended and licensed for research use only. License: Attribution-NonCommercial 4.0 International It should abide by the policy of OpenAI: https://openai.com/policies/terms-of-use
ResourcesReadmeApache-2.0 licenseActivityCustom properties
Stars13 stars
Watchers0 watching
Forks1 forkReport repository
AI 热点