SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.17647 · NeurIPS · 2024

MECD: Unlocking Multi-Event Causal Discovery in Video Reasoning

Xiao Ma, Yang Zhang, Yihang Chen, Weiyao Lin, Cheng Zhong, Hui Lin, Tieyuan Chen, Huabin Liu, Tianyao He, Chaofan Gan, Yingxue Wang

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2409.17647.json · badge: /api/ran/2409.17647.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
tychen-SJTU/MECD-Benchmark canonical (classifier label)
classifier basis: census
3 ran · 0 no recorded run
tychen-sjtu/mecd-benchmark canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
FunctionStatusWhere it lives
encode_image Ran
ran; our contract draft was wrong, not the code
tychen-SJTU/MECD-Benchmark/mecd_llm_fewshot/gpt4o.py
code served (permissive licence) · get_code("6163d22216816e96")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from PIL import Image
import torch
import numpy as np

# Create a small test image
img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
test_image = Image.fromarray(img_array, mode='RGB')

# Save to a temporary location in memory using BytesIO
from io import BytesIO
buffered = BytesIO()
test_image.save(buffered, format='PNG')
buffered.seek(0)

# Create image as PIL Image object
image_pil = Image.open(buffered)

ARGS = {
    'image': image_pil
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
encode_image_gpt4v Ran
ran; our contract draft was wrong, not the code
tychen-SJTU/MECD-Benchmark/mecd_llm_fewshot/gpt4o.py
code served (permissive licence) · get_code("6553c070217c1ca9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from PIL import Image
import io

# Create a small test image in memory
img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
test_image = Image.fromarray(img_array, mode='RGB')

# Save to bytes buffer to get a valid image object
buffer = io.BytesIO()
test_image.save(buffer, format='JPEG')
buffer.seek(0)
test_image_obj = Image.open(buffer)

ARGS = {
    'image': test_image_obj
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_first_bracket_content Ran
ran; our contract draft was wrong, not the code
tychen-SJTU/MECD-Benchmark/mecd_llm_fewshot/gemini.py
code served (permissive licence) · get_code("061cb32540ba3358")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def extract_first_bracket_content(s):
    match = re.search('\\[(0|1).*?\\]', s)
    if match:
        return match.group(0)
    else:
        return None

ARGS = {
    's': 'some text [1 content here] and more text'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_chunk Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from kahnchana/mvu
pointer only · get_code("42a46570620cd9fa")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_prompt Ran
ran; our contract draft was wrong, not the code
tychen-sjtu/mecd-benchmark/mecd_vllm_fewshot/VideoChat2/multi_event.py
code served (permissive licence) · get_code("748d5a2586ca3178")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class Conv:
    def __init__(self):
        self.system = "You are a helpful assistant."
        self.sep = "\n"
        self.messages = [
            ("User", "Hello, how are you?"),
            ("Assistant", "I'm doing well, thank you for asking."),
            ("User", "What is 2+2?"),
            ("Assistant", ""),
        ]

conv = Conv()

ARGS = {
    "conv": conv
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_prompt2 Ran
ran; our contract draft was wrong, not the code
tychen-sjtu/mecd-benchmark/mecd_vllm_fewshot/VideoChat2/multi_event.py
code served (permissive licence) · get_code("db17c3cf4c7f44a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class MockConversation:
    def __init__(self):
        self.system = "You are a helpful assistant."
        self.sep = "\n"
        self.messages = [
            ("User", "Hello, how are you?"),
            ("Assistant", "I'm doing well, thank you for asking."),
            ("User", "What is 2+2?"),
            ("Assistant", "2+2 equals 4.")
        ]

conv = MockConversation()

ARGS = {
    "conv": conv
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_video_format Ran
ran; our contract draft was wrong, not the code
tychen-sjtu/mecd-benchmark/mecd_vllm_fewshot/Video-LLaVA/videollava/eval/video/run_inference_causal_inference.py
code served (permissive licence) · get_code("a9b8321d09aef11c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile

# Create a temporary directory and a test video file
temp_dir = tempfile.mkdtemp()
test_video_base = os.path.join(temp_dir, "test_video")

# Create a dummy .mp4 file
with open(test_video_base + ".mp4", "w") as f:
    f.write("dummy video content")

ARGS = {
    "video_path": test_video_base
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_list Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from kahnchana/mvu
pointer only · get_code("076c252c52cbb161")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 2 the same month, 2 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
split_list 197 other papers
92 dated earlier, 16 the same month, 82 later, 6 same year, order not determinable, 1 undated
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2306.17107 (2023-06)
LLaVAR: Enhanced Visual Instruction Tuning for Text-Rich Image Understanding
2307.10490 (2023-07)
Abusing Images and Sounds for Indirect Instruction Injection in Multi-Modal LLMs
and 194 more not named here
get_chunk 189 other papers
88 dated earlier, 15 the same month, 80 later, 6 same year, order not determinable
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2306.17107 (2023-06)
LLaVAR: Enhanced Visual Instruction Tuning for Text-Rich Image Understanding
2307.10490 (2023-07)
Abusing Images and Sounds for Indirect Instruction Injection in Multi-Modal LLMs
and 186 more not named here
get_prompt 3 other papers
3 dated earlier
2311.17005 (2023-11)
MVBench: A Comprehensive Multi-modal Video Understanding Benchmark
2406.04264 (2024-06)
MLVU: Benchmarking Multi-task Long Video Understanding
2406.06040 (2024-06)
Vript: A Video Is Worth Thousands of Words
get_prompt2 2 other papers
2 dated earlier
2406.04264 (2024-06)
MLVU: Benchmarking Multi-task Long Video Understanding
2406.06040 (2024-06)
Vript: A Video Is Worth Thousands of Words

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Video causal reasoning aims to achieve a high-level understanding of video content from a causal perspective. However, current video reasoning tasks are limited in scope, primarily executed in a question-answering paradigm and focusing on short videos containing only a single event and simple causal relationships, lacking comprehensive and structured causality analysis for videos with multiple events. To fill this gap, we introduce a new task and dataset, Multi-Event Causal Discovery (MECD). It aims to uncover the causal relationships between events distributed chronologically across long videos. Given visual segments and textual descriptions of events, MECD requires identifying the causal associations between these events to derive a comprehensive, structured event-level video causal diagram explaining why and how the final result event occurred. To address MECD, we devise a novel framework inspired by the Granger Causality method, using an efficient maskbased event prediction model to perform an Event Granger Test, which estimates causality by comparing the predicted result event when premise events are masked versus unmasked. Furthermore, we integrate causal inference techniques such as front-door adjustment and counterfactual inference to address challenges in MECD like causality confounding and illusory causality. Experiments validate the effectiveness of our framework in providing causal relationships in multi-event videos, outperforming GPT-4o and VideoLLaVA by 5.7% and 4.1%, respectively.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2409.17647")
get_code_for_paper("2409.17647")
have("2409.17647")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2409.17647.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2409.17647.svg)](https://syntology.ai/paper/2409.17647)

Connect an agent — have() is free.