SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2504.02259 · CVPR · 2025

Re-thinking Temporal Search for Long-Form Video Understanding

Jiajun Wu, Yonatan Bisk, Zihan Wang, Keshigeyan Chandrasegaran, Manling Li, Jinhui Ye, Zane Durante, Cristobal Eyzaguirre, Ehsan Adeli, Fei-Fei Li, Haosen Sun, Juan Carlos Niebles

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2504.02259.json · badge: /api/ran/2504.02259.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
longvideohaystack/tstar canonical (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
FunctionStatusWhere it lives
LongVideoBench2TStarFormat Ran
ran on a synthesized input
longvideohaystack/tstar/LVHaystackBench/Longvideobench2LVHaystackFormat.py
code served (permissive licence) · get_code("1f70b85593cbea92")
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 json
import os
import tempfile
from typing import List, Dict

# Create temporary directories and files for testing
temp_dir = tempfile.mkdtemp()
dataset_file = os.path.join(temp_dir, 'dataset.json')
video_root = os.path.join(temp_dir, 'videos')
output_file = os.path.join(temp_dir, 'output.json')

# Create video root directory
os.makedirs(video_root, exist_ok=True)

# Create a sample dataset JSON file
sample_dataset = [
    {
        'video_id': 'video_001',
        'video_path': 'vid1.mp4',
        'question': 'What is happening in this video?',
        'correct_choice': 0,
        'question_category': 'Action',
        'duration_group': 3600,
        'position': [10, 20, 30],
        'candidates': ['Person running', 'Person walking', 'Person sitting', 'Person standing', 'Person jumping']
    },
    {
        'video_id': 'video_002',
        'video_path': 'vid2.mp4',
        'question': 'Which object is visible?',
        'correct_choice': 2,
        'question_category': 'Object',
        'duration_group': 3600,
        'position': [15, 25],
        'candidates': ['Car', 'Bike', 'Ball', 'Tree', 'House']
    },
    {
        'video_id': 'video_003',
        'video_path': 'vid3.mp4',
        'question': 'What time is it?',
        'correct_choice': 1,
        'question_category': 'Temporal',
        'duration_group': 3600,
        'position': [5],
        'candidates': ['Morning', 'Afternoon', 'Evening', 'Night', 'Midnight']
    },
    {
        'video_id': 'video_004',
        'video_path': 'vid4.mp4',
        'question': 'What is the color?',
        'correct_choice': 3,
        'question_category': 'Color',
        'duration_group': 1800,
        'position': [12],
        'candidates': ['Red', 'Blue', 'Green', 'Yellow', 'Purple']
    }
]

# Write sample dataset to file
with open(dataset_file, 'w', encoding='utf-8') as f:
    json.dump(sample_dataset, f)

ARGS = {
    'dataset_path': dataset_file,
    'video_root': video_root,
    'output_path': output_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 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
create_window Ran
ran on a synthesized input
longvideohaystack/tstar/LVHaystackBench/val_tstar_results.py
code served (permissive licence) · get_code("aa7d2df0ec8be08a")
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 Tensor, ndim 4, dtype family float, shape (3, 1, 5, 5) 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

torch.manual_seed(0)

ARGS = {
    "window_size": 5,
    "channel": 3,
}
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 Tensor, ndim 4, dtype family float, shape (3, 1, 5, 5) — shape (3, 1, 5, 5) 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
encode_image_to_base64 Ran
ran on a synthesized input
longvideohaystack/tstar/TStar/utilites.py
code served (permissive licence) · get_code("a949c6d092f7fa87")
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 base64
import io
import numpy as np
from PIL import Image

# Create a simple test image as numpy array
# Using a small 4x3 RGB image (height x width x channels)
image_array = np.random.randint(0, 256, (4, 3, 3), dtype=np.uint8)

# Create ARGS dict with the image parameter
ARGS = {
    'image': image_array
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — 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_frames Ran
ran on a synthesized input
longvideohaystack/tstar/LVHaystackBench/val_qa_results.py
code served (permissive licence) · get_code("ffff1df97b161c31")
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 4, dtype family int; 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 cv2
import numpy as np
from PIL import Image
import tempfile
import os

# Create a minimal valid video file using OpenCV
temp_dir = tempfile.gettempdir()
video_path = os.path.join(temp_dir, "test_video.mp4")

# Create a simple video file with 32 frames at 8 FPS
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
out = cv2.VideoWriter(video_path, fourcc, 8.0, (640, 480))

for i in range(32):
    # Create a simple frame with varying color
    frame = np.ones((480, 640, 3), dtype=np.uint8) * (i * 8 % 256)
    out.write(frame)

out.release()

# Create metadata dict with vclip_interval_in_video for clip mode testing
item = {
    'vclip_interval_in_video': [1.0, 3.0]
}

# Create frame_distribution: 32 values (one per second, but video is 4 seconds at 8 FPS = 32 frames)
# Using 4 seconds worth of scores (one score per second as per p_fps=1)
frame_distribution = [0.1, 0.5, 0.9, 0.3, 0.2, 0.8, 0.4, 0.6]

ARGS = {
    'video_path': video_path,
    'item': item,
    'frame_distribution': frame_distribution,
    'num_frames': 4,
    'p_fps': 1,
    'duration_type': 'clip'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 4, dtype family int — 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
gaussian_kernel Ran
ran on a synthesized input
longvideohaystack/tstar/LVHaystackBench/val_tstar_results.py
code served (permissive licence) · get_code("95559112c5b7be75")
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 Tensor, ndim 1, dtype family float, shape (5,) 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

torch.manual_seed(0)

# The function takes two parameters: window_size (int) and sigma (float)
# window_size: determines the size of the 1D Gaussian kernel
# sigma: standard deviation parameter for the Gaussian distribution

ARGS = {
    "window_size": 5,
    "sigma": 1.0,
}
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 Tensor, ndim 1, dtype family float, shape (5,) — shape (5,) 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
load_video_fps Ran
ran on a synthesized input
longvideohaystack/tstar/LVHaystackBench/val_qa_results.py
code served (permissive licence) · get_code("542c17d084d2221a")
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 float, 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 logging
import cv2
import tempfile
import os
import numpy as np

logging.basicConfig(level=logging.DEBUG)

# Create a temporary video file for testing
def create_test_video(filepath, fps=30, width=640, height=480, num_frames=10):
    """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):
        # Create a simple frame with changing color
        frame = np.zeros((height, width, 3), dtype=np.uint8)
        frame[:, :] = [i * 25 % 256, i * 50 % 256, i * 100 % 256]
        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, fps=30)

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 float, 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
load_video_frames Ran
ran on a synthesized input
longvideohaystack/tstar/TStar/utilites.py
code served (permissive licence) · get_code("b2e546f4d1531c7c")
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 4, dtype family int; 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 tempfile
import numpy as np
import cv2
from pathlib import Path

# Create a temporary video file for testing
temp_dir = tempfile.mkdtemp()
video_path = str(Path(temp_dir) / "test_video.mp4")

# Create a simple test video using OpenCV
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
fps = 30
frame_size = (320, 240)
out = cv2.VideoWriter(video_path, fourcc, fps, frame_size)

# Write 16 frames to the video
for i in range(16):
    frame = np.zeros((frame_size[1], frame_size[0], 3), dtype=np.uint8)
    # Add some variation to each frame
    frame[:, :, 0] = (i * 15) % 256  # Red channel
    frame[:, :, 1] = (i * 30) % 256  # Green channel
    frame[:, :, 2] = (i * 45) % 256  # Blue channel
    out.write(frame)

out.release()

ARGS = {
    "video_path": video_path,
    "num_frames": 8
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 4, dtype family int — 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
match_answer Ran
ran on a synthesized input
longvideohaystack/tstar/LVHaystackBench/val_qa_results.py
code served (permissive licence) · get_code("8c9b12c71fd729ac")
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 re

def match_answer(predicted: str, ground_truth: str) -> bool:
    """
    Check whether the predicted answer matches the ground truth answer.
    The check compares the first letter (if available) or the full string.

    Args:
        predicted: The predicted answer.
        ground_truth: The ground truth answer.

    Returns:
        True if the answers match, False otherwise.
    """
    match = re.match(r'^\s*([A-Fa-f])', predicted)
    if match:
        return match.group(1).lower() == ground_truth.strip().lower()
    else:
        return predicted.strip().lower() == ground_truth.strip().lower()


ARGS = {
    "predicted": "  A) This is the answer",
    "ground_truth": "a"
}
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 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
ssim_torch Ran
ran on a synthesized input
longvideohaystack/tstar/LVHaystackBench/val_tstar_results.py
code served (permissive licence) · get_code("cae7f32d1c26d53a")
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 Tensor, 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 torch.nn.functional as F

torch.manual_seed(0)

# Create two small image tensors
# img1 and img2 should have shape (C, H, W) where C is channels, H and W are height/width
# Using distinct sizes: 3 channels, 4x5 spatial dimensions
img1 = torch.randn(3, 4, 5, dtype=torch.float32)
img2 = torch.randn(3, 4, 5, dtype=torch.float32)

# Define the arguments dictionary
ARGS = {
    'img1': img1,
    'img2': img2,
    'window_size': 11,
    'C1': 0.01 ** 2,
    'C2': 0.03 ** 2
}
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 Tensor, 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
LVHaystack2TStarFormat Not yet run
unverified (harvested, no recorded run)
longvideohaystack/tstar/LVHaystackBench/run_TStar_onDataset.py
code served (permissive licence) · get_code("63eefe76e5d1b078")
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

Efficiently understanding long-form videos remains a significant challenge in computer vision. In this work, we revisit temporal search paradigms for long-form video understanding and address a fundamental issue pertaining to all state-of-the-art (SOTA) long-context vision-language models (VLMs). Our contributions are twofold: First, we frame temporal search as a Long Video Haystack problem -finding a minimal set of relevant frames (e.g., one to five) from tens of thousands based on specific queries. Upon this formulation, we introduce LV-HAYSTACK, the first dataset with 480 hours of videos, 15,092 human-annotated instances for both training and evaluation aiming to improve temporal search quality and efficiency. Results on LV-HAYSTACK highlight a significant research gap in temporal search capabilities, with current SOTA search methods only achieving 2.1% temporal F 1 score on the LONGVIDEOBENCH subset. Next, inspired by visual search in images, we propose a lightweight temporal search framework, T* that reframes costly temporal search as spatial search. T* leverages powerful visual localization techniques commonly used in images and introduces an adaptive zooming-in mechanism that operates across both temporal and spatial dimensions. Extensive experiments show that integrating T* with existing methods significantly improves SOTA long-form video understanding. Under an inference budget of 32 frames, T* improves GPT-4o's performance from 50.5% to 53.1% and LLaVA-OneVision-OV-72B's performance from 56.5% to 62.4% on the LONGVIDEOBENCH XL subset. Our code, benchmark, and models are provided in the Supplementary material.

For agents

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

get_harvested_code_for_paper("2504.02259")
get_code_for_paper("2504.02259")
have("2504.02259")

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

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

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

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

Connect an agent — have() is free.