File size: 8,400 Bytes
59eddb6 270df7b 59eddb6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | ---
pretty_name: CMBench
language:
- en
tags:
- video
- benchmark
- video-generation
---
# CMBench: Context Memory Benchmark
**Zeqi Xiao<sup>1,*</sup> · Qingle Liu<sup>1,2,*</sup> · Kaiwen Zhang<sup>1</sup> · Yifan Zhou<sup>1</sup> · Zihan Ding<sup>3</sup> · Xingang Pan<sup>1</sup>**
<sup>1</sup>S-Lab, Nanyang Technological University · <sup>2</sup>Tsinghua University · <sup>3</sup>Princeton University<br>
<sup>*</sup>Equal contribution.
[Paper](https://arxiv.org/abs/2609.39096) · [Code](https://github.com/DeCoPrune/CMBench) · [Project page](https://decoprune.github.io/)
CMBench evaluates whether a video generator can recall and reproduce visual evidence from an approximately one-minute context. Given a context video and a continuation instruction, the model must bring back a specific person, object, or view observed earlier. The benchmark contains **58 context videos and 116 continuation tasks**, combining synthetic and real-world footage.
The central question is whether information from the video history remains available when it is needed again. A continuation can look natural while failing to reproduce the requested target. CMBench therefore measures recall against visual references from the context itself. It is designed to evaluate context memory in autoregressive video generation, particularly under controlled compression of historical key-value (KV) caches.
## Benchmark design
CMBench combines three design choices:
- **Recall beyond the recent context.** Target events occur earlier in a minute-scale video, and continuation instructions request information that is absent from the recent view. Multiple events within a context serve as distractors for one another.
- **Reference-grounded evaluation.** Each task has an annotated reference frame and target bounding box. Evaluation compares the generated target with the entity actually visible in the context, so it tests preservation of specific visual evidence rather than prompt adherence alone.
- **Controlled and natural contexts.** Synthetic videos support control over event timing, target visibility, and camera transitions. Real-world videos provide complementary natural footage evaluated with the same task definitions and scoring protocol.
Synthetic contexts consist of six 10-second clips constructed with first–last frame conditioning. A boundary frame is shared between adjacent clips to maintain continuity. Each clip contains at most one complete target event, keeping that event within a single clip. Pairing a target event with a continuation instruction defines one task; one context video can support multiple tasks.
## Tasks and dataset composition
**Reappear** asks a person or object observed earlier to appear again. Success requires reproducing the same entity and appearance, including its distinguishing visual details.
**Revisit** starts from a context that shows a camera transition from scene A to scene B and back to A. The continuation must return to B. A salient object in B serves as the evaluation anchor. In synthetic contexts, the complete A → B → A event occurs within one 10-second clip, providing a consistent reference for the requested return.
| Video type | Videos | Reappear tasks | Revisit tasks | Total tasks |
| --- | ---: | ---: | ---: | ---: |
| Synthetic | 50 | 67 | 35 | 102 |
| Real | 8 | 10 | 4 | 14 |
| **Total** | **58** | **77** | **39** | **116** |
Both tasks test recall of previously observed evidence. The release contains 58 MP4 context videos and 116 task records, with six ordered clip descriptions, a continuation instruction, target labels and aliases, and a reference annotation for each task.
## Evaluation protocol
For each task, provide the context video and `continue_prompt` to the generator, then evaluate the resulting continuation against `references`:
1. Extract the annotated reference frame and target bounding box from the context video.
2. Use OWL-ViT to localize the target in generated frames, and SAM 2 to segment the reference and generated targets.
3. Compare DINOv2 embeddings of the resulting target crops using cosine similarity.
For reference crop $r$ and generated target crop $g_t$ at continuation frame $t$, the task score is
$$
S_{\mathrm{DINO}} = \max_t \operatorname{cos}\!\left(f_{\mathrm{DINO}}(r), f_{\mathrm{DINO}}(g_t)\right).
$$
Taking the maximum allows the requested event to occur at any point in the continuation. A task receives zero if the target is never detected. For Revisit, the salient object in scene B is the target, so both task types use the same scoring protocol. The benchmark score is the mean over all tasks; higher scores indicate better recall of the annotated targets.
### Evaluating memory compression
For historical-KV compression experiments, report recall alongside the effective pruning ratio (PR) and continuation-generation throughput. For each task,
$$
\mathrm{PR} = 1 - \frac{\sum_{i,\ell,h} k_{i,\ell,h}}{\sum_{i,\ell,h} k^{\mathrm{full}}_{i,\ell,h}},
$$
where $k_{i,\ell,h}$ counts historical KV token positions visible to attention head $h$ in layer $\ell$ when denoising generated chunk $i$, and $k^{\mathrm{full}}_{i,\ell,h}$ is the corresponding count when retaining the full history. Exclude the current noisy chunk from both sums and report the arithmetic mean of per-task PR values. This measures cumulative historical-token reduction; peak memory usage and computation require separate measurements. FPS and speedup measure continuation generation, excluding context-prefix processing. General video-quality metrics can complement the reference-grounded recall score.
## Files and identifiers
```text
CMBench/
├── README.md
├── metadata.jsonl
└── videos/
├── synthetic/
│ ├── syn_001.mp4
│ └── ...
└── real/
├── real_001.mp4
└── ...
```
`metadata.jsonl` contains one JSON object per task. Multiple tasks can share one context video. Video paths are relative to the dataset root.
Video identifiers are `syn_001`–`syn_050` and `real_001`–`real_008`. Task identifiers follow `{video_id}_{task_type}_{task_number}`, for example `syn_001_reappear_01`. Task numbers start at `01` within each video and task type.
## Metadata
| Field | Description |
| --- | --- |
| `type` | `synthetic` or `real`. |
| `task_id` | Unique task identifier. |
| `scene` | One- or two-word English scene description. Scene descriptions need not be unique. |
| `video` | Relative path to the context video. |
| `context_clip_prompts` | Six descriptions in chronological order. Each entry contains `clip_id` (`01`–`06`) and `clip_prompt`. These describe consecutive portions of the context video. |
| `continue_prompt` | Instruction for continuing the context video from its final frame. |
| `task_type` | `reappear` or `revisit`. |
| `target_label` | English description of the evaluation target. |
| `target_aliases` | Alternative English labels for the target. |
| `references` | Reference timestamps and target bounding boxes in the context video. |
### References
Each `references` entry has the same schema:
| Field | Description |
| --- | --- |
| `timestamp_seconds` | Reference time in seconds from the start of the context video. |
| `frame_index` | Zero-based reference frame index when explicitly annotated; otherwise `null`. |
| `bbox_xyxy_normalized` | `[x_min, y_min, x_max, y_max]`, normalized by the full frame width and height. Coordinates range from 0 to 1, with the origin at the top-left corner. |
For a frame of width `W` and height `H`, multiply the box coordinates by `[W, H, W, H]` to obtain pixel coordinates. Use floor for the top-left corner and ceil for the bottom-right corner when an integer crop is needed.
Use `frame_index` to select the reference frame when it is present; otherwise seek by `timestamp_seconds`. Synthetic references include explicit frame indices. Real references are annotated by timestamp. Each of the 116 tasks has one reference.
## Reading the benchmark
```python
import json
from pathlib import Path
root = Path("CMBench")
with (root / "metadata.jsonl").open(encoding="utf-8") as f:
tasks = [json.loads(line) for line in f if line.strip()]
for task in tasks:
video_path = root / task["video"]
instruction = task["continue_prompt"]
references = task["references"]
```
|