CoCo: 텍스트-이미지 미리보기 및 희귀 개념 생성을 위한 코드형 사고
CoCo: Code as CoT for Text-to-Image Preview and Rare Concept Generation
March 9, 2026
저자: Haodong Li, Chunmei Qing, Huanyu Zhang, Dongzhi Jiang, Yihang Zou, Hongbo Peng, Dingming Li, Yuhong Dai, ZePeng Lin, Juanxi Tian, Yi Zhou, Siqi Dai, Jingwei Wu
cs.AI
초록
통합 멀티모달 모델(UMM)의 최근 발전은 사고 연쇄(CoT) 추론의 통합을 통해 텍스트-이미지(T2I) 생성 기술을 크게 진전시켰습니다. 그러나 기존 CoT 기반 T2I 방법은 대부분 추상적인 자연어 기반 계획에 의존하여 복잡한 공간 배치, 구조화된 시각 요소, 밀집된 텍스트 콘텐츠를 정확하게 표현하는 데 한계가 있습니다. 본 연구에서는 추론 과정을 실행 가능한 코드로 표현하여 이미지 생성을 위한 명시적이고 검증 가능한 중간 계획을 가능하게 하는 코드 기반 추론 프레임워크인 CoCo(Code-as-CoT)를 제안합니다. 텍스트 프롬프트가 주어지면 CoCo는 먼저 장면의 구조적 레이아웃을 명시하는 실행 코드를 생성하며, 이 코드는 샌드박스 환경에서 실행되어 결정론적인 초안 이미지를 렌더링합니다. 이후 모델은 이 초안을 세밀한 이미지 편집을 통해 정제하여 최종 고품질 결과물을 생성합니다. 이러한 훈련 패러다임을 지원하기 위해 구조화된 초안-최종 이미지 쌍으로 구성된 정제된 데이터셋인 CoCo-10K를 구축하여 구조화된 초안 구성과 수정적 시각 정제를 학습하도록 설계했습니다. StructT2IBench, OneIG-Bench, LongText-Bench에 대한 실험적 평가 결과, CoCo는 직접 생성 방식 대비 각각 +68.83%, +54.8%, +41.23%의 성능 향상을 달성했으며, CoT를 활용한 다른 생성 방법들보다도 우수한 성능을 보였습니다. 이러한 결과는 실행 가능한 코드가 정밀하고 제어 가능하며 구조화된 텍스트-이미지 생성을 위한 효과적이고 신뢰할 수 있는 추론 패러다임임을 입증합니다. 코드는 https://github.com/micky-li-hd/CoCo 에서 확인할 수 있습니다.
English
Recent advancements in Unified Multimodal Models (UMMs) have significantly advanced text-to-image (T2I) generation, particularly through the integration of Chain-of-Thought (CoT) reasoning. However, existing CoT-based T2I methods largely rely on abstract natural-language planning, which lacks the precision required for complex spatial layouts, structured visual elements, and dense textual content. In this work, we propose CoCo (Code-as-CoT), a code-driven reasoning framework that represents the reasoning process as executable code, enabling explicit and verifiable intermediate planning for image generation. Given a text prompt, CoCo first generates executable code that specifies the structural layout of the scene, which is then executed in a sandboxed environment to render a deterministic draft image. The model subsequently refines this draft through fine-grained image editing to produce the final high-fidelity result. To support this training paradigm, we construct CoCo-10K, a curated dataset containing structured draft-final image pairs designed to teach both structured draft construction and corrective visual refinement. Empirical evaluations on StructT2IBench, OneIG-Bench, and LongText-Bench show that CoCo achieves improvements of +68.83%, +54.8%, and +41.23% over direct generation, while also outperforming other generation methods empowered by CoT. These results demonstrate that executable code is an effective and reliable reasoning paradigm for precise, controllable, and structured text-to-image generation. The code is available at: https://github.com/micky-li-hd/CoCo