SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2512.10359 · NeurIPS · 2025

Tool-Augmented Spatiotemporal Reasoning for Streamlining Video Question Answering Task

Meng-Hao Guo, Sunqi Fan, Jiashuo Cui, Shuojin Yang

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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; 1 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 5 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2512.10359.json · badge: /api/ran/2512.10359.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
fansunqi/VideoTool canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
check_videomme_option Ran
ran, violated the contract we drafted
fansunqi/VideoTool/dataset.py
code served (permissive licence) · get_code("3d3b5a6ede94a143")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

def check_videomme_option(s):
    if len(s) >= 3 and s[0].isupper() and (s[1] == '.') and (s[2] == ' ') and (s[-1] == '.' or s[-1] == '?' or s[-1] == '!'):
        return True
    return False

# Test case 1: Valid format - starts with uppercase, has ". ", ends with punctuation
s1 = "A. This is a valid option."

# Test case 2: Valid format with question mark
s2 = "B. Is this valid?"

# Test case 3: Valid format with exclamation mark
s3 = "C. This is valid!"

# Test case 4: Invalid - lowercase start
s4 = "a. This starts lowercase."

# Test case 5: Invalid - no period after first char
s5 = "A, This has comma."

# Test case 6: Invalid - no space after period
s6 = "A.This has no space."

# Test case 7: Invalid - doesn't end with punctuation
s7 = "A. This ends without punctuation"

# Using a valid test case
ARGS = {
    "s": "A. This is a valid option."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
check_videomme_option Ran
ran, violated the contract we drafted
fansunqi/VideoTool/testcases/extract_testcase_from_videomme.py
code served (permissive licence) · get_code("f1ecd2f415293840")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

# The function check_videomme_option takes a single string parameter
# and checks if it matches the format: uppercase letter, period, space, then more characters

# Valid examples: "A. xxxxx.", "B. test.", etc.
# Invalid examples: "a. test.", "A.test.", "A  test.", etc.

ARGS = {
    "s": "A. This is a valid option."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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_tool_instances Ran
ran, honoured the contract we drafted
fansunqi/VideoTool/run_single_video.py
code served (permissive licence) · get_code("2a7e37b022633a01")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 torch.nn as nn

# Define a stand-in tool class
class Tool1(nn.Module):
    def __init__(self, conf):
        super().__init__()
        self.conf = conf
    
    def forward(self, x):
        return x

class Tool2(nn.Module):
    def __init__(self, conf):
        super().__init__()
        self.conf = conf
    
    def forward(self, x):
        return x

class Tool3(nn.Module):
    def __init__(self, conf):
        super().__init__()
        self.conf = conf
    
    def forward(self, x):
        return x

# Stand-in configuration class
class Config:
    def __init__(self):
        self.tool = ToolConfig()

class ToolConfig:
    def __init__(self):
        self.tool_list = ['Tool1', 'Tool2', 'NonExistentTool', 'Tool3']

# Create configuration
conf = Config()

# Make tool classes available in globals for the function to find
globals()['Tool1'] = Tool1
globals()['Tool2'] = Tool2
globals()['Tool3'] = Tool3

ARGS = {
    'conf': conf
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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_info Ran
ran; our contract draft was wrong, not the code
fansunqi/VideoTool/visible_frames.py
code served (permissive licence) · get_code("6f99f335c87103a2")
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 dict. 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 cv2
import numpy as np
import tempfile
import os

# Create a minimal valid video file for testing
def create_test_video(filepath, num_frames=10, fps=30, width=640, height=480):
    """Create a simple test video file"""
    fourcc = cv2.VideoWriter_fourcc(*'mp4v')
    out = cv2.VideoWriter(filepath, fourcc, fps, (width, height))
    
    for i in range(num_frames):
        frame = np.random.randint(0, 255, (height, width, 3), dtype=np.uint8)
        out.write(frame)
    
    out.release()

# Create temporary video file
temp_dir = tempfile.gettempdir()
video_path = os.path.join(temp_dir, 'test_video.mp4')
create_test_video(video_path, num_frames=10, fps=30, width=640, height=480)

ARGS = {
    'video_path': video_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
identify_tools Ran
ran; our contract draft was wrong, not the code
fansunqi/VideoTool/reasoning.py
code served (permissive licence) · get_code("bffb29c594b85f95")
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 Hammer. 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 torch.nn as nn

# Define a simple tool class hierarchy
class Tool:
    def __init__(self, name):
        self.name = name

class Hammer(Tool):
    def __init__(self, name="hammer"):
        super().__init__(name)

class Screwdriver(Tool):
    def __init__(self, name="screwdriver"):
        super().__init__(name)

class Wrench(Tool):
    def __init__(self, name="wrench"):
        super().__init__(name)

# Create instances to search through
tools = [
    Hammer("claw_hammer"),
    Screwdriver("phillips"),
    Wrench("adjustable"),
    Hammer("ball_peen"),
]

# Define the arguments
ARGS = {
    "tool_class": Hammer,
    "tools": tools
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Hammer — a Hammer output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Hammer 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
load_cache Ran
ran; our contract draft was wrong, not the code
fansunqi/VideoTool/util.py
code served (permissive licence) · get_code("bc33bf64eaeb089c")
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 dict. 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 pickle
import tempfile

# Create a temporary cache file path
temp_dir = tempfile.gettempdir()
mannual_cache_file = os.path.join(temp_dir, "test_llm_cache.pkl")

# Clean up any existing cache file to test the "Creating" path
if os.path.exists(mannual_cache_file):
    os.remove(mannual_cache_file)

ARGS = {
    "mannual_cache_file": mannual_cache_file
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_llava_model Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
fansunqi/VideoTool/util.py
code served (permissive licence) · get_code("008a66014da94a6f")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim 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 torch.nn as nn

torch.manual_seed(0)

# Create minimal mock classes for LLaVA components
class MockTokenizer:
    def __call__(self, text, return_tensors=None):
        return {"input_ids": torch.tensor([[1, 2, 3]])}
    
    def encode(self, text):
        return [1, 2, 3]
    
    def decode(self, ids):
        return "mock text"

class MockImageProcessor:
    def __call__(self, images, return_tensors=None):
        return torch.randn(1, 3, 224, 224)
    
    def preprocess(self, images, return_tensors=None):
        return torch.randn(1, 3, 224, 224)

class MockLLaVAModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(768, 4096)
    
    def forward(self, input_ids, pixel_values=None):
        return torch.randn(1, 10, 4096)
    
    def generate(self, input_ids, pixel_values=None, max_length=100):
        return torch.randint(0, 1000, (1, 50))

# Mock the llava imports
class MockLLaVABuilder:
    @staticmethod
    def load_pretrained_model(model_path, model_base, model_name):
        tokenizer = MockTokenizer()
        model = MockLLaVAModel()
        image_processor = MockImageProcessor()
        context_len = 2048
        return (tokenizer, model, image_processor, context_len)

class MockMMUtils:
    @staticmethod
    def get_model_name_from_path(path):
        return "llava-v1.5-7b"

import sys
from unittest.mock import MagicMock

# Inject mocks into sys.modules
sys.modules['llava'] = MagicMock()
sys.modules['llava.model'] = MagicMock()
sys.modules['llava.model.builder'] = MagicMock()
sys.modules['llava.mm_utils'] = MagicMock()

sys.modules['llava.model.builder'].load_pretrained_model = MockLLaVABuilder.load_pretrained_model
sys.modules['llava.mm_utils'].get_model_name_from_path = MockMMUtils.get_model_name_from_path

ARGS = {
    "model_path": "mock_llava_model",
    "device": "cpu"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
llava, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
strip_option_prefix Ran
ran; our contract draft was wrong, not the code
fansunqi/VideoTool/testcases/extract_testcase_from_videomme.py
code served (permissive licence) · get_code("e37d7eb84d2fafdf")
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

# Analyze the function strip_option_prefix
# It takes one parameter: option (str)
# The function checks if the option matches a specific format and strips a prefix
# Valid options have format like "A. text." where A is uppercase letter, followed by dot and space

ARGS = {
    "option": "A. Apples."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
get_dataset Not yet run
unverified (harvested, no recorded run)
fansunqi/VideoTool/dataset.py
code served (permissive licence) · get_code("42677134b9a94956")
How it ran

no invocation recorded.

get_tool_category Not yet run
unverified (harvested, no recorded run)
fansunqi/VideoTool/star_prompts.py
code served (permissive licence) · get_code("11b4ab61b5277e1f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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.

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-23.

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 Question Answering (VideoQA) task serves as a critical playground for evaluating whether foundation models can effectively perceive, understand, and reason about dynamic real-world scenarios. However, existing Multimodal Large Language Models (MLLMs) struggle with simultaneously modeling spatial relationships within video frames and understanding the causal dynamics of temporal evolution on complex and reasoning-intensive VideoQA task. In this work, we equip MLLM with a comprehensive and extensible Video Toolkit, to enhance MLLM's spatiotemporal reasoning capabilities and ensure the harmony between the quantity and diversity of tools. To better control the tool invocation sequence and avoid toolchain shortcut issues, we propose a Spatiotemporal Reasoning Framework (STAR) that strategically schedules temporal and spatial tools, thereby progressively localizing the key area in the video. Our STAR framework enhances GPT-4o using lightweight tools, achieving an 8.2% gain on VideoMME and 4.6% on LongVideoBench. We believe that our proposed Video Toolkit and STAR framework make an important step towards building autonomous and intelligent video analysis assistants. The code is publicly available at https://github.com/fansunqi/VideoTool.

For agents

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

get_harvested_code_for_paper("2512.10359")
get_code_for_paper("2512.10359")
have("2512.10359")

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

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

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

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

Connect an agent — have() is free.