Chain of Images for Intuitively Reasoning

Fanxu Meng, Haotong Yang, Yiding Wang, Muhan Zhang · Submission to ICLR 2024 · Rejected

TL;DR

Current multimodal language models reason purely in words, missing the visual intuition humans use when scribbling diagrams or tracking a chessboard. Chain of Images (CoI) replaces verbal-only reasoning steps with dynamically generated visual representations—using Scalable Vector Graphics (SVG) rendered into images and read back by vision encoders. By converting complex symbolic and spatial calculations into pattern-recognition tasks, CoI dramatically boosts accuracy across geometry, chess, topological graph analysis, and commonsense reasoning.

What Problem Does This Paper Address?

Standard Chain-of-Thought (CoT) prompting forces Large Language Models (LLMs) to solve everything textually, step-by-step. While effective for arithmetic, text-only reasoning struggles with:

  1. Spatial and geometric calculations (e.g., finding intersections between shapes, where models routinely make algebraic errors or miss segment boundaries).
  2. State tracking over long sequences (e.g., tracking a 60-move chess game in Portable Game Notation, where errors compound over time).
  3. Implicit physical commonsense that is obvious in an image but unstated in text.

Even advanced multimodal systems (like GPT-4V or LLaVA) typically project visual inputs into textual representations rather than actively "imagining" or drawing intermediate visual steps to aid deduction.

Methods

The authors introduce Chain of Images (CoI) alongside a model architecture called SyMLLM (Symbolic Multimodal Large Language Model):

  • Symbolic Graphics Generation (SVG): Diffusion decoders (like Stable Diffusion) struggle with exact coordinate precision and symbolic constraints. Instead, SyMLLM outputs text-based Scalable Vector Graphics (SVG) code.
  • Render-and-Encode Loop: The model outputs an SVG snippet, renders it on the fly into a bitmap image using CairoSVG, passes the image through a frozen visual encoder (CLIP ViT-L/14), projects the visual embeddings into the language space via an MLP, and conditions subsequent token generation on these visual embeddings.
  • Progressive Visualization: For multi-step tasks (e.g., adding geometric shapes one-by-one or tracking board states), the model can iteratively render intermediate images ($CoI^\dagger$).
  • Diffusion-Assisted CoI for Commonsense: For open-domain commonsense tasks where SVG is unsuitable, text prompts invoke generative models (SDXL, DALL·E 3) to produce scenes that a visual instruction-tuned model (LLaVA-13B) inspects.
Text Prompt ──> LLM outputs SVG ──> CairoSVG (Bitmap) ──> ViT Encoder ──> Projection ──> LLM continues reasoning

Datasets

The authors created CoIEval, a collection of 17 reasoning domains curated using a 3-shot prompt with GPT-4 across standard benchmarks (BIG-bench, AGIEval, OGB, MMLU, NYCC). Primary experiments focus on:

  • Intersect Geometric (BIG-bench): Counting intersection points among 2 to 6 overlapping shapes (lines, circles, polygons) defined by coordinate lists.
  • Checkmate in One Move (ChessGPT / CCRL): Identifying winning moves from chess move histories binned by game length ([1, 20) up to [81, 100) moves).
  • Topological (OGBG-HIV): Counting 6-cycles (e.g., benzene rings) in molecular graph edge lists.
  • Temporal: Identifying which clock time is closest to a given target on a 12-hour cyclical clock.
  • Commonsense (NYCC): "Location" identification and "Unusual" scene anomaly detection.

Key Insights and Ideas

  • Turning algebra into perception: When calculating line-circle intersections algebraically, LLMs fail at solving quadratics and checking boundary conditions. When drawn as an image, finding intersections becomes an easy visual counting task for the vision encoder.
  • Lossless Markovian state collapsing: In chess, predicting checkmate from 80 lines of move notation requires immense working memory. Rendering the current board state collapses 80 moves of history into a single 2D image, decoupling task difficulty from move history length.
  • Symbolic generation beats diffusion for structured reasoning: NExT-GPT (which relies on Stable Diffusion 1.5) scored 0% accuracy across chess and complex geometry, whereas generating SVG code achieved nearly 100% rendering accuracy.

Key Results

  • Geometric Intersection: On the hardest split (6 overlapping shapes), a fine-tuned text-only model (Vicuna-7b*) achieved 16.0% accuracy. SyMLLM using single-image CoI reached 25.5%, and multi-image CoI reached 58.04%.
  • Chess Tactics: SyMLLM-3b with multi-image CoI outperformed text-based ChessGPT-3b across all move depths, widening the gap on long games: on move ranges [81, 100), accuracy rose from 45.45% (text) to 86.36% (CoI).
  • Zero-Shot / In-Context Reasoning with GPT-4V:
  • Topological (6-cycle counting): Rose from 30% (pure-text GPT-4) to 57% (GPT-4V + SVG CoI).
  • Temporal reasoning: Rose from 78% to 87%.
  • Commonsense Tasks: Generating a DALL·E 3 scene before answering pushed Location accuracy from 73.63% (text-only) to 85.01%, and anomaly detection on Unusual descriptions from 90.4% to 100%.

Limitations and Future Work

  • Visual Encoder Resolution: Failure cases in geometry show that when shapes overlap tightly or intersections occur near vertex boundaries, CLIP ViT-L/14 miscounts points due to resolution limits.
  • API Bottlenecks: Evaluating commercial Vision-LLMs (GPT-4V) was constrained by restrictive daily request quotas.
  • Modality Split: The system currently relies on two distinct regimes: SVG for formal/diagrammatic problems and heavy text-to-image diffusion models for open-world commonsense, leaving a unified generative reasoning architecture as future work.

Summary updated

BibTeX
@misc{meng2023chain,
  author = {Fanxu Meng and Haotong Yang and Yiding Wang and Muhan Zhang},
  title = {{Chain of Images for Intuitively Reasoning}},
  year = {2023},
  eprint = {2311.09241},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.09241},
}

Loading related content...

Figure