arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.15693cs.SEcs.AI
收藏

代码编辑的不完美视觉验证:以TikZ为例的案例研究

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

Univ Rennes, Inria, IRISA, INSA(里昂大学、Inria、IRISA、INSA);Univ Rennes, Inria, CNRS, IUF, IRISA(里昂大学、Inria、CNRS、IUF、IRISA);Univ Rennes, Inria, CNRS, IRISA(里昂大学、Inria、CNRS、IRISA);Univ. Lille, CNRS, Inria(里尔大学、CNRS、Inria);Univ. Rennes, IRISA, Inria(里昂大学、IRISA、Inria)

Charly Reux, Mathieu Acher, Djamel Eddine Khelladi, Clément Quinton, Olivier Barais

AI总结:

针对TikZ等视觉代码定制任务,研究不完美验证器在迭代精炼中的有效性,发现即使不完美验证器也能适度准确判断指令是否应用,反馈对弱模型提升显著。

摘要:

LLMs显著推进了代码生成,使得功能程序的合成成为可能。尽管最近的系统在许多编码基准测试中表现强劲,但涉及生成视觉产物(如TikZ)的程序任务仍然具有挑战性,尤其是在视觉代码定制方面。与从头生成不同,定制需要局部、保持语义的编辑:模型必须定位相关代码,根据指令修改它,并保留其余结构和渲染。基于事后迭代精炼/纠正的方法(其中验证器提供反馈以指导纠正)已显示出前景。然而,对于具有视觉结果(如TikZ)的程序,其正确性难以或不可能自动形式化和评估,因此不存在确定性验证器。因此,开发者只能依赖不完美的验证器。在本文中,我们进行了一项实证研究以回答:当验证器本身不可靠时,迭代精炼在多大程度上仍然有效?我们使用TikZ作为聚焦的案例研究,在受控且具有挑战性的环境中隔离问题的核心难点(弱代码结构、细粒度视觉语义和困难的特征定位)。我们将视觉代码定制定义为一个具有不完美预言机的迭代编辑问题,并引入一个分析此类迭代精炼的框架。我们进行了大规模研究,在迭代精炼流程中评估了多个基于LLM和工具增强的视觉验证器,并对精炼轨迹进行了广泛的手动标注以评估验证器行为和反馈质量。我们的发现表明,即使是不完美的验证器也能以中等准确度确定视觉指令是否应用于代码,F1分数高达0.815。反馈改善了迭代精炼,特别是对于较弱的模型,为Qwen3-vl-30b-a3b-Instruct增加了11-20个完美定制,而更强的模型(如Gemini-3)获得的改进较少(+5),但受益于更准确的验证,防止了过早接受。反馈仅在精确识别图像问题、提供可操作指导、解决所有相关问题并保持基于原始指令时有效。

英文摘要:

LLMs have significantly advanced code generation, enabling the synthesis of functional programs. While recent systems achieve strong performance on many coding benchmarks, tasks involving programs such as TikZ that generate visual artifacts remain challenging, in particular on visual code customization. Unlike generation from scratch, customization requires localized, semantics-preserving edits: the model must locate relevant code, modify it according to the instruction, and preserve the remaining structure and rendering. Approaches based on post-hoc iterative refinement/correction where a verifier provides feedback to guide corrections, have shown promise. However, in the case of programs with a visual outcome such as in TikZ, where correctness is harder or likely impossible to formalize and evaluate automatically, deterministic verifiers do not exist. Hence, developers can only rely on imperfect verifiers. In this paper, we conduct an empirical study to answer:to what extent can iterative refinement remain effective when the verifier itself is unreliable?} We use TikZ as a focused case study that isolates the core difficulties of the problem (weak code structure, fine-grained visual semantics, and difficult feature localization) in a controlled and challenging setting. We define visual code customization as an iterative editing problem with an imperfect oracle, and introduce a framework for analyzing such iterative refinements. We conduct a large-scale study and evaluate multiple LLM-based and tool-augmented visual verifiers within iterative refinement pipelines, and perform extensive manual annotation of refinement trajectories to assess verifier behavior and feedback quality. Our findings show that even imperfect verifiers can determine with moderate accuracy whether visual instructions are applied to code, achieving F1-scores up to 0.815. Feedback improves iterative refinement, especially for weaker models, adding 11--20 perfect customizations for Qwen3-vl-30b-a3b-Instruct, while stronger models like Gemini-3 gain fewer improvements (+5) but benefit more from accurate verification that prevents premature acceptance. Feedback is effective only when it precisely identifies image issues, provides actionable guidance, addresses all relevant problems, and remains grounded in the original instruction.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑