CodingDINO

CodingDINO: Learning to Represent What We See as Code with Agentic Reinforcement Learning

CodingDINO

Learning to Represent What We See as Code with Agentic Reinforcement Learning

A unified visual coding harness

We propose CodingDINO, a framework that jointly trains a vision-to-code model with a unified harness and agentic RL across 2D and 3D, images and videos.

Code as a visual representation

We study code as a visual representation for LLMs and isolate what interactive training puts into the model.

Reconstruction across visual coding domains

CodingDINO surpasses its base model and its teacher and rivals frontier LLMs such as Opus 5.5 and GPT-6 Astra. It ranks first on 10 of 12 headline metrics and in the top three on 10, and its single-pass variant retains 85.4% of this quality.

* Equal contribution  † Corresponding authors

Abstract

Representations matter. As frontier LLMs become increasingly capable of reasoning and acting through code, a central challenge is how to organize visual knowledge within these models in a form that their coding capabilities can exploit. We argue that learning to reconstruct images and videos as executable programs provides a powerful proxy for developing such representations. Code makes appearance, geometry, spatial relations, and temporal dynamics explicit, connecting visual observations to the compositional abstractions that LLMs already manipulate. Existing vision-to-code methods largely emphasize single-pass generation or inference-time refinement, leaving a gap between using visual feedback and learning from it.

We introduce CodingDINO, a unified agentic reinforcement learning (RL) framework for learning internal visual representations through code-based reconstruction. Inspired by DINO, our approach uses visual consistency as a learning principle and seeks representations that remain useful across visual domains. Through a closed loop of program generation, execution, rendering, and revision, the agent learns to inspect rendered outcomes and improve its programs through interaction. Code serves as an executable expression of visual understanding, while agentic RL enables this understanding to be internalized through perceptual feedback. Training begins with supervised fine-tuning on verified teacher-generated data, followed by multi-turn RL with execution and visual fidelity rewards. A unified environment covers 2D and 3D content, static images and dynamic videos, through SVG, web, Three.js, Blender, and animation code, allowing a shared learning procedure to capture both spatial structure and temporal behavior.

Across six image-to-code and video-to-code benchmarks (3DHarnessBench, CC-HARD, VFIG-Bench, DrawAI-Bench, AnimWeb-Bench, and Code2Video-Compass), CodingDINO rivals frontier LLMs such as Opus 5.5 and GPT-6 Astra, ranking first on 10 of 12 headline metrics and in the top three on 10. In a single pass without rendering feedback, CodingDINO-Single retains 85.4% of this quality on average. These results position code-based reconstruction as a route to learning reusable internal visual representations, extending DINO’s representational ambition to LLMs that reason and act through code.

CodingDINO reconstructions, training loop and six-benchmark comparison

Demo Video

CodingDINO Open video ↗

Method

Unified visual coding harness and agentic reinforcement learning

One harness covers 2D and 3D content, static images and dynamic videos: it executes SVG, HTML, Three.js, Blender, and animation programs and returns their renders with execution diagnostics.

Training starts with supervised fine-tuning (SFT) on verified teacher programs. Multi-turn RL then lets the agent learn from its own renders, rewarding each write, render, and revise trajectory by the visual consistency between the target and its final render, measured with frozen DINO encoders and depth.

Results

Qualitative Analysis

Comparisons include the teacher DeepSeek-V4.1-Flash (high thinking effort) and the base model Qwen3.8-27B (medium thinking effort).

Editing Three.js Scenes

Each edit changes one line in the Three.js program CodingDINO wrote from the input video.

Resources

Citation