ReMe/benchmark/beam
xyf2020 fa6d8fcef7
Some checks are pending
CI / macOS sandbox / Seatbelt - clt (push) Waiting to run
CI / macOS sandbox / Seatbelt - xcode (push) Waiting to run
CI / Python packages / Build and verify distributions (push) Waiting to run
CI / Python quality / GitHub Actions (push) Waiting to run
CI / Python quality / Pre-commit (push) Waiting to run
CI / Python tests / Unit Tests - py3.11 (push) Waiting to run
CI / Python tests / Unit Tests - py3.12 (push) Waiting to run
CI / Python tests / Unit Tests - py3.13 (push) Waiting to run
CI / Python tests / Unit Tests - py3.14 (push) Waiting to run
CI / ReMe Studio / Studio checks (push) Waiting to run
CI / Windows / CLI smoke - py3.11 (push) Waiting to run
Deploy / Documentation / Build documentation (push) Waiting to run
Deploy / Documentation / deploy (push) Blocked by required conditions
CI and Release / Docker / Build and test / amd64 (push) Waiting to run
CI and Release / Docker / Build and test / arm64 (push) Waiting to run
CI and Release / Docker / Publish multi-platform tags (push) Blocked by required conditions
Security / CodeQL / Analyze javascript-typescript (push) Waiting to run
Security / CodeQL / Analyze python (push) Waiting to run
feat(home): add reproducible benchmark preparation and candidate evaluation (#693)
* Add sandboxed Python execution and home AutoBash plugin

* Harden read-only shell commands and filesystem sandboxes

* Group file sandbox backends in one package

* Fix macOS file sandbox isolation and runtime access

* Refine file sandbox limits and executor checks

* Harden AutoBash policy and macOS sandbox supervision

* fix(home): require ReMe release with file sandbox

* refactor(home): simplify sandbox calls and redundant tests

* fix(execution): bound output and clean up cancelled sandbox startup

* fix(tests): mock Seatbelt platform requirements on Linux

* fix(home): block Git help helpers and harden sandbox cleanup

* Fix sandbox runtime links and subprocess cleanup

* ci: cover Home plugin tests

* test: wait for pipeline descendants to exit after cancellation

* fix: align Home dependencies and preserve cleanup cancellation

Require ReMe 0.4.2.1 and verify isolated Home wheel installation in package CI. Share cancellation-safe cleanup with thread calls, retain AnyIO cancellation semantics, and record Bubblewrap mount targets during argument construction.

* feat(home): prepare self-evolution workspaces and benchmark inputs

* fix(home): load only selected cases for debug derivation

* feat(home): evaluate candidates with benchmark judges and prepare workspace docs

* refactor(home): organize workflows and unify debug evaluation mode

* fix(home): align Docker runtime and preserve evaluation failures

* refactor(home): align evaluation summaries with dev_meta

* feat(home): migrate agent, sampling and evidence inspection tooling

* feat(home): add case-study agent and query evidence tracing tools

- Add home_case_study job with CaseStudyAgentWrapper and a read-only
  sandboxed investigation step for per-case diagnostic reports
- Add home_trace_query_evidence job/step to locate a query's source
  evidence sessions, memory checkpoints and answer/score previews
- Compact evaluation summaries: record per-query failure errors, round
  scores to four decimals, expose scoring_enabled and observed means
- Slim run manifests: drop schema_version and trusted_judge fingerprint,
  exclude debug/sampling_policy options, keep construction_source only
  for query-only replay
- Simplify history index internals and update guide docs and tests

* feat(home): support multi-case case-study runs with dedicated LLM and Git sandbox

- Allow home_case_study to investigate up to eight ordered cases per
  invocation with a shared focus, one isolated agent per case, while
  keeping the legacy single-case selector as a deprecated alias
- Configure a dedicated home_case_study LLM component instead of the
  shared judge backend
- Wrap ReMe's OS file sandbox with a Home-specific Git runtime grant
  (developer directory on macOS) and argv-based child environment
- Tighten case-study prompts around evidence certainty, code-tool path
  scoping, citation form, and unresolved-cause reporting
- Extend evidence tracing and expand case-study/sandbox tests and docs

* feat(home): run case studies with bounded concurrency and fix sandbox test

* feat(home): guard repeated evaluations and preserve retry selections

* feat(home): migrate optimization workflows and evaluation budgets

* feat(home): add candidate admission gate and construction-equivalence replay

Add host-side candidate gate agent that reviews committed changes before
sampling, and construction-equivalence agent that compares a candidate
against its nearest reusable ancestor to select query-only replay with
60% probability when construction is unchanged. Wire both into
plugin.yaml application defaults, update optimizer prompt to explain the
new host behaviors, extend snapshot/evaluation components with reuse
support, and add focused tests.

* feat(home): add structured-report agent and gate/equivalence test coverage

Add StructuredReportAgent wrapper selectable via the
_structured_report_model option in BoundedAgentWrapper, plus its
dedicated unit tests. Extend candidate gate, construction equivalence,
evaluation history, sampling, and validation budget tests, and document
the new behavior in the plugin README.

* feat(home): add standalone benchmark test evaluation and fix compression recovery

* fix(home): preserve top-level answer failure classification

* refactor(home): rename max_validations to max_evaluations

* refactor(home): extract shared review_report workflow helper and bump version to 0.4.2.2

* fix(home): load runner credentials and localize dataset evaluation

* fix(benchmark): propagate Home sandbox memory limits

* refactor(home): consolidate Git exports and candidate validation

* fix(home): clarify branch and diff tool parameter contracts

* feat(home): bound case-study reports and migrate draft tools

* fix(home): align benchmark report limits with plugin defaults

* Fix Home evaluation recovery and cancellation boundaries

* fix(home): tolerate fenced optimizer results and finalize exhausted budgets

* fix(benchmark): align Docker runtime with AgentScope 2.0.11

* fix(home): unify history writes and cancellation cleanup

* refactor(home): reuse structured report parsing

* ci: remove redundant Home compatibility install check

* fix(home): preserve literal formatting in structured reports

---------

Co-authored-by: jinli.yl <jinli.yl@alibaba-inc.com>
2026-11-05 14:54:31 +08:00
..
config.yaml Separate benchmark judge plugins (#535) 2026-09-10 20:16:46 +08:00
config_home.yaml feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
config_home_eval.yaml feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
kill.sh refactor(benchmark): isolate per-benchmark assets and simplify LME agentic prompt (#422) 2026-08-06 15:13:52 +08:00
README.md feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
README_ZH.md feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
run.py Separate benchmark judge plugins (#535) 2026-09-10 20:16:46 +08:00
run_home.py feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
run_home_eval.py feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00

中文版 / Chinese version

BEAM Benchmark

BEAM is a benchmark for memory capability over long-context chat cases. Each case contains a very long chat history split into batches; ReMe converts each batch into a session, ingests them in chronological order, then answers probing questions via an agentic (ReAct) mode. Answers are scored with BEAM's rubric-based answer_judge job, which produces both a graded score and a binary verdict, and per-type averages are reported.

BEAM ships dataset variants by chat size — 100K / 500K / 1M / 10M — so memory systems can be stressed at different context lengths. Question types include abstention, contradiction resolution, event ordering, information extraction, instruction following, knowledge update, multi-session reasoning, preference following, summarization, and temporal reasoning.

Install ReMe and the BEAM plugin in editable mode from the repository root:

python -m pip install -e ".[as]"
reme plugins install ./plugins/beam --editable
reme plugins install ./plugins/beam-judge --editable
reme plugins validate beam

The runner explicitly enables the installed beam plugin and combines its defaults with ReMe's built-in benchmark preset. Editable installation keeps changes under plugins/beam visible without reinstalling the plugin. Custom application config paths still work through reme.config and can use extends: benchmark. This directory continues to own the runner, evaluation settings, dataset and outputs. Model credentials use the environment variables declared by the shared benchmark configuration.

The shared preset keeps python_execute private (enable_serve: false); in-process benchmark jobs remain callable. Python always uses a sandbox with workspace_dir read-only by default, no network, and a minimal environment. Linux requires Bubblewrap and, for the default memory cap, a writable delegated cgroup v2; macOS requires Seatbelt. Unavailable isolation fails the call. Custom path grants must be configured on the Python Step, not passed as job arguments. Read-only workspace files, including any .env files, remain readable: keep credentials outside the workspace.

1. Get the Dataset

BEAM is a public repository, cloned into benchmark/beam/dataset/:

mkdir -p benchmark/beam/dataset
cd benchmark/beam/dataset
git clone https://github.com/mohammadtavakoli78/BEAM.git

After cloning, benchmark/beam/dataset/BEAM/ should contain chats/, src/, topics/ and other subdirectories.

2. Run

From the repository root:

python benchmark/beam/run.py
python benchmark/beam/run.py --config benchmark/beam/config.yaml
python benchmark/beam/run.py -q                        # quiet
python benchmark/beam/run.py --eval_only               # reuse existing workspaces, query + judge only

3. Pipeline

  1. For each case, load chat.json and convert each batch into a ReMe session.
  2. Ingest sessions in chronological order into an isolated workspace, then digest_update.
  3. Answer each probing question via agentic (ReAct) mode.
  4. Score answers with BEAM's rubric-based answer_judge job and print per-type averages.

4. Key config — benchmark/beam/config.yaml

Key Meaning
dataset.beam_root BEAM dataset root (benchmark/beam/dataset/BEAM).
dataset.chat_size Variant to run: 100K / 500K / 1M / 10M.
dataset.case_ids Specific cases (e.g. ["1","2"]); empty = all cases.
dataset.start_index / num_items Case pagination (num_items 0 = all).
dataset.workspace_root Per-case workspace root (benchmark/beam/workspaces/beam).
evaluation.num_workers 0 = auto, 1 = sequential, >1 = parallel.
reme.config ReMe config used (benchmark).
output.dir Results directory (benchmark/beam/results).

5. Outputs

Results are JSON files written to output.dir as results_<chat_size>_<timestamp>.json, with a per-type score summary also printed to the console. Logging conventions are shared across benchmarks — see the top-level README.

6. Reference Results

The results below use the longmemeval-version prompt.

100K

agentscope==2.0.4.post1, conda reme env, 20 workers, eval-only (reusing prebuilt memory) (2026-08-05, 20 cases / 400 Qs, total 46.0 min)

Type Agentic Binary input tok/q output tok/q total tok/q tool calls/q
abstention 0.550 0.550 96,031 1,070 97,101 4.58
contradiction_resolution 0.438 0.412 32,263 872 33,135 2.48
event_ordering 0.501 0.423 140,195 5,163 145,358 4.70
information_extraction 0.873 0.832 50,245 883 51,128 3.15
instruction_following 0.750 0.725 37,986 848 38,834 2.67
knowledge_update 0.688 0.675 31,198 651 31,849 2.27
multi_session_reasoning 0.626 0.584 85,038 4,563 89,601 4.28
preference_following 0.925 0.912 34,281 989 35,270 2.50
summarization 0.623 0.461 89,657 2,056 91,713 4.12
temporal_reasoning 0.637 0.625 34,563 1,049 35,612 2.52
OVERALL 0.661 0.620 63,146 1,814 64,960 3.33

Memory Construction average token consumption (default agent, full build over 20 cases):

Agent input tok/case output tok/case total tok/case
default 2,172,316 136,697 2,309,013

1M

agentscope==2.0.4.post1, conda reme env, 20 workers, full memory build (2026-08-05, 35 cases / 700 Qs, total 459.2 min)

Type Agentic Binary input tok/q output tok/q total tok/q tool calls/q
abstention 0.429 0.429 118,707 1,178 119,886 4.20
contradiction_resolution 0.391 0.364 49,787 810 50,597 2.50
event_ordering 0.558 0.456 201,514 3,889 205,403 4.79
information_extraction 0.809 0.772 78,950 894 79,844 3.00
instruction_following 0.852 0.832 55,757 924 56,681 2.81
knowledge_update 0.779 0.771 45,981 665 46,646 2.37
multi_session_reasoning 0.658 0.612 138,133 2,873 141,006 4.40
preference_following 0.798 0.777 51,796 920 52,716 2.53
summarization 0.693 0.537 158,794 2,905 161,700 4.44
temporal_reasoning 0.536 0.536 100,176 3,148 103,324 3.90
OVERALL 0.650 0.609 99,959 1,821 101,780 3.49

Memory Construction average token consumption (default agent, full build over 35 cases):

Agent input tok/case output tok/case total tok/case
default 31,943,817 1,417,061 33,360,878

Prepare a Home experiment

run_home.py prepares all BEAM 100K cases, the workspace, and committed candidate code. It exits after preparation; it does not evaluate cases or start optimization. Run from the repository root after obtaining the dataset described above:

reme plugins install plugins/home
python benchmark/beam/run_home.py
# Optional separate workspace (a successful preparation cannot be repeated):
python benchmark/beam/run_home.py --workspace-dir /path/to/new-workspace

config_home.yaml controls the preparation. Its paths are repository-relative regardless of the current working directory; --config accepts an alternative runner YAML file. The default workspace is benchmark/beam/workspaces/home-100K. The evaluated runtime loads beam; the host application loads home. source_ref: HEAD exports committed source only, excluding uncommitted modifications. Preparation failure rolls back its outputs; after success, another call fails instead of resetting the experiment.

The top-level sampling_policy configures Home evaluation defaults: max_cases, max_queries (null means unlimited), temperature, ewma_alpha and uniform_exploration. The runner validates these and passes them to the host home.evaluation Component. It still only prepares; it does not run evaluations. Each evaluation controls sampling and record_history separately.

The top-level validation_cycle_time_budget_minutes configures the host optimizer's advisory time between completed formal evaluations. It defaults to 150 minutes; set a positive number to change it or null to disable timed reminders.

The top-level max_evaluations sets the optimizer's formal-evaluation budget (positive integer, default 10). A slot is consumed at first sandbox startup, including later failures or cancellations; initial baseline and debug are excluded.

The top-level memory_limit_mib sets the host agent sandbox memory limit for optimization, diagnosis, case studies and evaluation reviews. Set memory_limit_mib: 0 in the runner YAML to disable the Linux cgroup limit. Null or omission keeps platform defaults (4096 MiB on Linux); macOS does not enforce memory limits.

After preparation, run local one-shot optimization with the same configuration:

python benchmark/beam/run_home.py --optimize
# Use the same --config and --workspace-dir overrides as preparation, if supplied.
python benchmark/beam/run_home.py --optimize --instruction "Improve retrieval quality"

This starts a fresh application, applies both budgets and the sampling policy, runs home_optimize, and closes the application. It does not repeat preparation. Python callers can use await optimize(config_path, workspace_dir=...) from the same module. The default run() and CLI behavior remain preparation only.

Python callers can use the same lifecycle:

from benchmark.beam.run_home import run

result = await run(workspace_dir="/path/to/new-workspace")

Evaluate a candidate on an independent test set

The default evaluates every 100K case, matching the previous standalone evaluation. This is an independent workspace, not a disjoint held-out split. Select another variant, or replace all_cases: true with case_ids: [...], in config_home_eval.yaml for a different test set.

The entry point imports a full candidate SHA or unambiguous hexadecimal prefix from an existing Home optimization workspace and copies its prepared fixed runtime. It does not require the original ReMe source repository or change the optimizer's checkout. Paths in the configuration are repository-relative.

Prepare first, then use the service from two terminals (replace CANDIDATE_SHA):

python benchmark/beam/run_home_eval.py --commit CANDIDATE_SHA --prepare-only
# Terminal 1:
reme start workspace_dir=benchmark/beam/workspaces/home-test-100K 'plugins=["home","beam-judge"]'
# Terminal 2:
reme home_evaluate workspace_dir=benchmark/beam/workspaces/home-test-100K record_history=false

Local one-shot test evaluation

python benchmark/beam/run_home_eval.py --commit CANDIDATE_SHA
# Optional overrides: --config /path/to/test.yaml --source-workspace /path/to/search --test-workspace /path/to/test

Python callers can use await benchmark.beam.run_home_eval.run(commit="CANDIDATE_SHA"). The runner rebuilds construction and scores every selected query with sampling and history recording disabled. It uses the existing Docker evaluation runtime and host judge configuration; model credentials are required for evaluation. Results stay in the test workspace's home/evaluations/, with original candidate provenance in each manifest's test_evaluation. The exported snapshot has its own local evaluation_commit_sha. Rerunning the same request reopens unchanged prepared inputs and creates another evaluation result. Use a new test workspace for another candidate or selection. Source and test workspaces must not overlap.