CodeCap-Bench: Can Code Serve as a Good Video Caption?

Jiafu Tang, Yifan Xu, Eric Tang, Junjie Zhao, Shipeng Luo, Te Sun, Haoxuan Hu, Yiyan Ji, Xinlong Chen, Zihao Wang, Yang Shi, Yuanxing Zhang, Pengfei Wan, Jiaheng Liu

arXiv:2610.37341 · 2026-10-29 공개 · arXiv · PDF

code-generation multimodal-llms question-answering video-captioning mllm-evaluation video-reconstruction evaluation-benchmarks temporal-dynamics

Abstract

Video captioning aims to preserve visual information through compact descriptions, predominantly using natural language. However, precisely expressing fine-grained spatial structures and temporal dynamics in natural language often leads to lengthy and potentially ambiguous descriptions. In this work, we explore Code as Video Caption, a paradigm where executable programs serve as a complementary representation of visual content through graphical primitives, layout rules, and functions of time. To examine whether code captions effectively preserve video information, we compare them with natural language captions on downstream question answering and video reconstruction tasks. Our results show that code captions achieve superior reasoning accuracy and reconstruction fidelity. Despite these advantages, realizing the potential of code captioning depends on whether current multimodal large language models (MLLMs) can generate faithful code captions. To systematically assess this capability, we introduce CodeCap-Bench, which comprises 323 videos spanning five categories of structured 2D content, along with fine-grained annotations and a multi-level evaluation framework. Extensive experiments reveal that while leading proprietary MLLMs demonstrate promising code captioning capabilities, they still struggle to faithfully capture complex temporal dynamics, with open-source models lagging substantially behind.

한국어 요약

한 줄 요약

코드 기반 비디오 캡션(CodeCap)이 자연어 캡션보다 시각 정보를 더 정확히 보존하며, 이를 평가하기 위한 CodeCap-Bench 벤치마크가 제안되었다.

핵심 기여도

핵심 아이디어

기존 비디오 캡션은 자연어로 시공간 구조와 시간적 변화를 표현하지만, 이는 불확실성과 길이 증가를 유발한다. 본 연구는 실행 가능한 코드를 사용하여 시각 정보를 명확하고 계산 가능한 방식으로 표현하는 Code as Video Caption을 제안한다. 예를 들어, 비행기 좌석 선택 인터페이스에서 격자 레이아웃과 공유된 그리기 함수를 통해 반복 요소와 공간 관계를 간결하게 표현한다. 또한, 시간 함수를 통해 스크롤 속도, 이동 거리, 가속도를 정의하여 중간 시간의 시각 상태를 계산할 수 있다. 이는 자연어보다 명확한 시각 해석을 가능하게 하며, 렌더링을 통해 참조 영상과 비교할 수 있는 실행 가능한 시각 규칙을 제공한다.

기술적 접근법

주요 결과

의의 및 한계

CodeCap-Bench는 체계적인 코드 캡션 평가 기반을 제공하며, MLLMs의 시공간 표현 능력을 정량적으로 평가할 수 있는 도구로 활용 가능하다. 코드 캡션은 시각 정보의 명확성과 계산 가능성이라는 장점을 가지지만, 현재 MLLMs는 복잡한 시간적 변화를 정확히 포착하는 데 어려움이 있다. 특히, 오픈소스 모델의 성능 저하는 연구 및 개발의 한계를 드러내며, 코드 생성의 신뢰도와 비용 효율성 사이의 균형이 필요하다는 점이 드러난다.

실용적 활용

CodeCap은 UI/UX 디자인, 게임 개발, 데이터 시각화, 인터랙티브 미디어 제작 등 구조화된 2D 콘텐츠 분야에서 활용 가능하다. 또한, MLLMs의 시공간 이해 능력을 향상시키기 위한 훈련 데이터로도 사용될 수 있다.