cs.CLNov 7, 2026

Simple Test-Time Refinement for Plot-to-Code Generation via Visual-Code Diagnostics

Authors: Peiming Guo, Jinpeng Huang, Yangbin Sun, Gaoxiong Cao, Ensheng Shi, Yuchi Ma, Yu Zhang, Meishan Zhang, 

Organizations: Institute of Computing and Intelligence, Harbin Institute of Technology (Shenzhen) · Huawei CodeArts Model Team, HUAWEI · School of Computer Science and Technology, Soochow University

Abstract

Plot-to-code generation has been greatly advanced by recent multimodal large language models (MLLMs). However, existing studies mainly focus on one-pass generation or iterative sampling guided by verifier-based filtering, which does not align with the typical human programming workflow of generate first, then iteratively error-location and fix. This naturally motivates a test-time refinement paradigm for plot-to-code generation. In this work, we present the first study on plot-to-code generation via iterative test-time refinement. We propose a Visual-Code Diagnostics framework that enables refinement through visual feedback from source code. Specifically, we first categorize generation errors into four coarse-grained types, and then train lightweight discriminators to recognize and localize these errors based on the rendered visual outputs and corresponding code. Unlike traditional compiler- or debugger-based verification, our approach performs iterative refinement guided by one diagnostics system, enabling more effective semantic and visual correction during test time. Extensive experiments demonstrate that our method consistently improves generation quality across diverse generators and significantly outperforms strong test-time scaling baselines.

Figures & tables

Appendix figures & tables6 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Imperfect Visual Verification for Code Edition : A Case Study on TikZ

    Apr 9, 2026Charly Reux, Mathieu Acher, Djamel Eddine Khelladi +2LLM Self-RefinementCode Generation

  2. Vision-Guided Iterative Refinement for Frontend Code Generation

    Apr 7, 2026Hannah Sansford, Derek H. C. Law, Wei Liu +3Code GenerationVision-Language Model-as-a-Judge

  3. LLMLOOP: Improving LLM-Generated Code and Tests through Automated Iterative Feedback Loops

    Mar 24, 2026Ravin Ravi, Dylan Bradshaw, Stefano Ruberto +2LLM Code GenerationLLM Self-Refinement