Visual Sketchpad: Sketching as a Visual Chain of Thought for Multimodal Language Models

Authors: yushi  hu
weijia  shi
xingyu  fu
dan  roth
mari  ostendorf
luke  zettlemoyer
noah a smith
ranjay  krishna
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-15 03:40:07

Abstract: Humans draw to facilitate reasoning: we draw auxiliary lines when solving geometry problems; we mark and circle when reasoning on maps; we use sketches to amplify our ideas and relieve our limited-capacity working memory. However, such actions are missing in current multimodal language models (LMs). Current chain-of-thought and tool-use paradigms only use text as intermediate reasoning steps. In this work, we introduce Sketchpad, a framework that gives multimodal LMs a visual sketchpad and tools to draw on the sketchpad. The LM conducts planning and reasoning according to the visual artifacts it has drawn. Different from prior work, which uses text-to-image models to enable LMs to draw, Sketchpad enables LMs to draw with lines, boxes, marks, etc., which is closer to human sketching and better facilitates reasoning. \name can also use specialist vision models during the sketching process (e.g., draw bounding boxes with object detection models, draw masks with segmentation models), to further enhance visual perception and reasoning. We experiment on a wide range of math tasks (including geometry, functions, graph, chess) and complex visual reasoning tasks. Sketchpad substantially improves performance on all tasks over strong base models with no sketching, yielding an average gain of 12.7% on math tasks, and 8.6% on vision tasks. GPT-4o with Sketchpad sets a new state of the art on all tasks, including V*Bench (80.3%), BLINK spatial reasoning (83.9%), and visual correspondence (80.8%). We will release all code and data.

Main paper: 
 introduction: 
 Sketching is a fundamental human activity, serving as a versatile tool for communication [11] , ideation [48] , and problem-solving [47] . Unlike written language, sketches have the advantage of conveying visuo-spatial ideas directly, for example by using spatial relations on paper to convey spatial relations or other more abstract relationships in the world. This may explain their ubiquity; maps [40] and architectural plans [12] have been found incised in stone, etched on leather, impressed in clay, and drawn on paper in diverse cultures scattered across the world [39] . Sketches are so fundamental that we use them to teach school children how to solve geometry problems by drawing support lines, to aid engineers conveying prototypes, to support architects creating blueprints, and to allow scientists like us to convey scientific contributions (see Figure 1 ).As multimodal language models (LMs) [35, 42, 28, 27, 1, 3, 49, 7, 31, 41, 6, 5] have begun to mature, we now expect them to solve tasks like the ones mentioned above, i.e., ones where people draw intermediate sketches to simplify reasoning. Popular benchmarks now include questions ∠4 is congruent to ∠2, and ∠5 is congruent to ∠3. ∠1, ∠4, and ∠5 form a straight angle = 180°. So ∠1, ∠2, ∠3 add up to 180°.SketchPad + GPT-4oIs f(x) an convex function?It is convex for x>0 but concave for x<0SketchPad + GPT-4o convex because line between any two points lie above the graph.According to the board, what is the type of the shop?The sign in the image reads "ceremonial matcha,". it's a cafe.Use sliding_window to find the board SketchPad + GPT-4oMath FunctionThe zoomed-in image shows the text "corepower YOGA". So it's a yoga studioAre there cookies stacked on other cookies?NoSketchPad + GPT-4o (c) (d) [8, 51, 44] . For all these examples, without SKETCHPAD, GPT-4o fails to get the correct answer, while SKETCHPAD + GPT-4o achieves the correct solution.Spatial Reasoningabout geometry (e.g., Geometry3K [32] ) and complex math problems (e.g., IsoBench [8] ). In these benchmarks, models are given images of diagrams and asked questions requiring symbolic grounding and spatial understanding, where intermediate sketches like auxiliary lines can enhance reasoning. Even benchmarks in computer vision now have a similar flavor. Specialist vision models can be viewed as sketching on natural images. For example, object detection is plotting bounding boxes around objects; depth estimation is drawing colormaps according to depth. The recently proposed BLINK benchmark [9] would benefit significantly from such intermediate visual sketches. Similarly, the V*Bench benchmark [51] could focus reasoning on image crops to find answers. Unfortunately, current LMs lack a scaffold for using sketch-based reasoning when solving tasks.In this paper, we introduce Visual SKETCHPAD: a framework that provides multimodal LMs with the tools necessary to generate intermediate sketches to reason over tasks. Inspired by textual chain-of-thought reasoning in LMs [50, 62] , SKETCHPAD prompts the underlying visual LM to produce visual artifacts as part of a chain of mixed textual, programmatic, and visual reasoning. For example, to prove that the angles of triangles sum up to 180 degrees in Figure 1 (a), SKETCHPAD enables agents to modify the diagram by introducing a new auxiliary line. This new line, along with new annotated angles, provides the critical information to solve the geometry task. Similarly, SKETCHPAD improves models' spatial reasoning for computer vision. To determine if there are cookies stacked on top of other cookies in the image (Figure 1b ), the model first produces an intermediate depth estimate. By analyzing the depth estimate, which reveals cookies overlapping at different depths, the model is able to correctly answer that the cookies are indeed stacked.We demonstrate the effectiveness of visual SKETCHPAD across a wide range of mathematics and computer vision tasks. For math, we tackle problems including (1) geometry [32] , (2) mathematical functions, (3) graph algorithms, and (4) strategy games [8] . For geometry questions, SKETCHPAD enables models to generate Matplotlib code with auxiliary lines and variables, given the diagram input and questions (Figure 1a ). Notably, even when the input is solely language-based, such as mathematical functions, SKETCHPAD enables models to plot the functions and reason about their properties, using only the mathematical function expression as input (Figure 1b ). These results highlight the ability of SKETCHPAD to aid reasoning, even in tasks with purely language-based inputs. Across all four categories of mathematical tasks, SKETCHPAD consistently improves the baseline GPT-4o performance, yielding an average gain of 11.2%. For computer vision, we tackle diverse tasks including (1) depth, (2) spatial reasoning, (3) jigsaw, (4) visual correspondence, (5) semantic correspondence, as well as questions from (6) the MMVP and ( 7) the V*Bench benchmarks [9, 44, 51] . For this domain, SKETCHPAD enables models to generate segmentation masks, crop images, draw bounding boxes, zoom into image regions, overlay images, etc. Similar to math, SKETCHPAD shows consistent improvements across all seven types of computer vision tasks. For example, GPT-4o, augmented with SKETCHPAD, sees 14.3% improvement on V*Bench, 12.1%, and 9.7% improvements on BLINK's depth and semantic correspondence tasks, setting a new state of the arts across all tasks. Finally, we analyze the effectiveness of SKETCHPAD by comparing the plans generated by our model with human-created plans, showing that they are well-aligned and exhibit similar reasoning patterns. We hope SKETCHPAD opens up new research opportunities toward more capable and interpretable multimodal intelligence. 
related work: 
 SKETCHPAD generalizes recent work on multimodal tool-use and visual prompting. We also place our work within the larger sphere exploring LMs as agents.Visual programming and tool-use. With the advancement of LMs [4, 35, 42, 45, 13] , researchers have demonstrated the possiblity of decomposing complex vision tasks into simpler substeps that can each be solved using vision tools [57, 60, 18, 17] . Among them, the most relevant to us are Visprog [14] and ViperGPT [38] . They use LMs to generate Python code, which sequencially invokes specialized vision tools. These methods share a common problem that the multimodal modules follow a pre-defined plan outlined by the LM. By contrast, SKETCHPAD allows LMs to change their plan according to the intermediate visual artifacts, yielding better performance and robustness when solving complex multimodal tasks.Visual prompting. Recent work shows that multimodal models can be augmented by visual prompts added to natural images [37] . For example, SoM [55] shows that adding labeled segmentation masks on images unleashes GPT-4V's visual grounding ability. Prior work also reports similar findings in 3D [25] and Robotics [34] . SKETCHPAD is a generalized framework for all these methods, allowing LMs to decide what visual prompting to use as part of the multimodal reasoning process.Recent work has started to treat LMs as agents that can both reason and act [58, 33, 52, 36, 59] . Researchers have applied this idea to software engineering [20, 61, 15] , robotics [34] , vision [29, 57] , and GUI navigation [54, 23, 53] . SKETCHPAD can also be viewed as an agent that accepts multimodal inputs and outputs. One big difference is that SKETCHPAD can create visual artifacts to facilitate reasoning, while prior LM agents only generate text during reasoning. 
visual sketchpad: 
 We introduce visual SKETCHPAD, a general framework that enables multimodal LMs to draw sketches as intermediate reasoning steps and to use these sketches to facilitate further reasoning. Figure 2 shows examples of how SKETCHPAD works. Given a multimodal query, SKETCHPAD agent generates a sketching plan to address the query (Thought), and then synthesizes a program to create visual sketches (Action). By analyzing the resulting sketches (Observation), which serve as a visual representation of the reasoning process, the model generates a final response to the query.Our framework requires no finetuning or training. Multimodal LMs, out of the box, can be prompted to sketch using our framework. Our implementation is based on the AutoGen [52] framework. We give the overview of our SKETCHPAD framework in §3.1, and delve deep into how it integrates sketching into the reasoning process in §3.2.The SKETCHPAD agent solves tasks by engaging in an iterative interaction process with an environment. Given a multimodal query q that includes both visual and textual components, the model generates a series of thoughts, actions, and observations to gather the information needed to answer the query. At each time step t, the model performs three key steps: Given ∠BCJ=105°, ∠KEF=105°. Find ∠EIC THOUGHT 1: I need to draw an auxiliary Line IX parallel to Line BD ACTION 1:Draw the aux. line using Python CodeIs there a path between node 0 and node 4 in the graph?THOUGHT 1:We can use the networkx library to plot the graph [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 1, 0, 1], [0, 1, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0] Thought: The model analyzes the current context c t , which includes the query, previous thoughts, actions, and observations, to generate a thought plan p t for the next action. For example, given the query q -"find the ∠EIC" in Figure 2a , the model's thought plan p 1 is to draw an auxiliary line IX parallel to BD serving as a visual sketch to help solve the problem.Action: Based on the thought plan, the model executes an action a t , which can manipulate both visual and textual content. In the geometry example, to realize the proposed thought of drawing the auxiliary line, the model generates Python code to modify the original geometry diagram. The generated code is then compiled and executed.Observation: Based on the action a t , SKETCHPAD's environment returns a new observation o t+1 , such as a new diagram with the auxiliary line drawn in the geometry example. The multimodal context is then updated to c t+1 = (c t , p t , a t , o t+1 ).The multi-turn interaction process continues until time step T , when the model determines that it has gathered enough information from the context c T to answer the query. At this point, it generates a special Terminate action and provides the answer.Different from prior work [58] , where LMs primarily generate and manipulate text-based observations and actions, SKETCHPAD enables the model to work with multimodal observations o t and actions a t , manipulating both visual and textual content. This allows the model to plan and reason with the visual sketches it has drawn, enhancing its problem-solving capabilities.The core component of SKETCHPAD is sketching, which enables the LM to generate visual sketches by synthesizing programs that call different specialist vision models or Python plotting packages.Program Generation. Similar to recent works like ViperGPT and VPD [14, 38, 18] , SKETCHPAD enables LMs to sketch through code generation. The LM is provided, through a prompt, with a detailed description of the available tools that can generate multimodal content (an example prompt and description can be found in §C). The prompt includes Python function signatures and docstrings [16] for these modules, but does not contain their full implementation. The LM generates Python code in a code block, using the provided tools, which, when executed, generates new image and text outputs. A special display function allows the LM to visualize the sketch image in the next observation o t+1 .Modules for sketching. SKETCHPAD uses various tools to facilitate the sketching process, depending on the task at hand. For mathematical tasks, SKETCHPAD uses common Python packages like matplotlib and networkx for plotting (see §4). For vision tasks, the LM leverages specialist vision models during the sketching process. These models include detection tools that draw bounding boxes on the image, as well as segmentation and marking tools (inspired by SoM [55] ) that draw colorful masks on the image and use numbers to label segments. We find these specialists possess useful perception skills for visual reasoning tasks, and SKETCHPAD is an effective way to combine them into a multimodal LM (see §5.1). 
sketching to solve math problems: 
 In this section, we experiment with SKETCHPAD on four complex mathematical tasks : (1) geometry, (2) mathematical functions, (3) graph algorithms, and (4) game strategies. We demonstrate that incorporating sketching capabilities into LMs significantly improves their performance on these mathematical problems, setting new state-of-the-art results ( §4.1).Details of our evaluation tasks and the tools employed for visual reasoning are as follows:Geometry Problems. Drawing auxiliary lines in geometry diagrams is often helpful for problemsolving. For example, in Figure 2 (a), when asked to find ∠EIC, the LM plans to draw an auxiliary line IX parallel to BD, allowing it to use the properties of parallel lines to determine ∠EIC. To evaluate the effectiveness of SKETCHPAD, we use the problems from the Geometry3K dataset [32] .To realize the line drawing process, SKETCHPAD takes a geometry diagram and its corresponding matplotlib code as input. The model then proposes and modifies the code to generate auxiliary lines, and executes the modified code to visualize the updated diagram with the added lines.Mathematical functions. Understanding mathematical functions is crucial for various applications in science, engineering, and economics. We focus on two tasks related to mathematical functions from the IsoBench datasets [8] :• Classifying parity aims to determine whether a function is even, odd, or neither. Even functions satisfy f (-x) = f (x) for all x, while odd functions satisfy f (-x) = -f (x).• Identifying convexity/concavity aims to determine whether a function is convex or concave.Existing LMs can only analyze functions and attempt to prove their properties analytically. 1However, SKETCHPAD enables them to visually sketch functions to solve problems more efficiently.For instance, to determine the convexity of the function in Figure 1b , SKETCHPAD allows the model to plot the function using matplotlib, and visually inspect its overall shape.Graph algorithms. Many real-world problems, such as those related to computer networks and transportation systems, can be formulated as graph problems. We evaluate SKETCHPAD on three graph problems from IsoBench [8] :• Graph connectivity determines whether there exists a path between two vertices in a graph.• Maximum flow aims to find the maximum amount of flow that can be sent through a network from a source vertex to a sink vertex, subject to capacity constraints on the edges.• Graph isomorphism tests whether two graphs are structurally equivalent.Given an adjacency matrix of a graph like in Figure 2 (b), SKETCHPAD can draw the actual graph structure, using using Python's networkx library, enabling direct visual reasoning about graph properties and relationships.Game strategies. Chess games can be represented in various formats, including visual board states and textual move notations. Given only the textual move notations, SKETCHPAD can draw the visual representations of the chess board to analyze positions and formulate strategies. We evaluate the performance of SKETCHPAD on the winnder identification task from the IsoBench datasets [8] that aims to find the outcome of a chess game (win for White, win for Black, or draw) based on the final board state. To create the graphical board, SKETCHPAD uses Python's chess library to draw the board from the Forsyth-Edwards Notation (FEN) of chess. We evaluate the performance of SKETCHPAD on multimodal LMs with API access, including gpt-4-turbo-2024-04-29 and gpt-4o-2024-05-13. We compare these results to baselines without the Visual Sketchpad and other notable closed-source models, such as Claude 3 and Gemini-Pro, as well as open-source models like Mistral [19] and LLaMA-2 70B [46] .Main results. As shown in Table 1 , SKETCHPAD consistently improves base model performance across all tasks, with an average improvement of 11.2% for GPT-4o and 23.4% for GPT-4 Turbo.In particular, we observe large gains on graph algorithms such as maximum flow and connectivity.For instance, GPT-4o with SKETCHPAD achieves an accuracy of 66.3% on the maximum flow problem, improving over the base model by 41.3%. Similarly, SKETCHPAD substantially improves the performance on mathematical functions, with GPT-4 Turbo achieving over 90% accuracy and GPT-4o over 88% accuracy on convexity and parity classification tasks. Furthermore, we observe gains (3% ∼ 10%) on game strategies, demonstrating that drawn game boards drawn can improve reasoning about game strategies. Overall, these results highlight the effectiveness of SKETCHPAD in enhancing the reasoning capabilities of multimodal language models across diverse domains. 
sketching to solve computer vision tasks: 
 In this section, we experiment with SKETCHPAD on complex visual reasoning tasks. Recent work (BLINK) [9] finds that many core visual perception abilities are still missing from existing multimodal LMs-even though many computer vision specialist models possess such abilities. Also, SoM [55] shows that drawing segmentation masks on images unleashes the strong visual grounding ability of GPT-4V. We generalize these ideas with SKETCHPAD, allowing LMs to use specialist vision models to sketch. Details of these modules are in §5.1. SKETCHPAD enhances multimodal LMs' visual reasoning abilities and establishes new SOTAs on all 7 tasks ( §5.2).Tasks. We experiment with a wide range of complex visual reasoning tasks: (1) V * Bench [51] . This benchmark contains questions about small items in an image. (2) MMVP benchmark from Eyes Wide Shut [44] . This benchmark contains visual questions specially designed to reveal the visual shortcomings of CLIP-based multimodal LMs. (3) BLINK [9] . This benchmark contains visual perception tasks that are easy for humans, but post significant challenge for multimodal LMs. Specifically, we experiment with relative depth, spatial reasoning, jigsaw puzzle, visual correspondence, and semantic correspondence tasks. More details of each task are in §D.LMs can use the following modules to sketch and manipulate images. We wrap these modules into Python functions that the LMs can call. Refer to §C for the function definitions.Detection. This module takes an image and a simple text query (e.g., "cat") as input. We run the Grounding-DINO [30] open-vocabulary objection detection model and plot the detected bounding boxes (together with a number label) on the image. It also returns the bounding box coordinates. Is there a path between node 0 and node 4 in the graph?THOUGHT 1:We can use the networkx library to plot the graph [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 1, 0, 1], [0, 1, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0] Segmentation. This module takes an image as input and returns an image with colorful segmentation masks on it. Each mask also has a number label. We follow the implementation of SoM [55] . The underlying segmentation models are SegmentAnything [22] and Semantic-SAM [24] .Depth estimation. This module takes an image as input and returns a depth map. The underlying model is DepthAnything [56] .Visual search via sliding window. This module mimics how humans search for small items on an image. It takes a text query as input and runs a sliding window over the image. The window size is 1/3 of the image size, and the step size is 2/9 of the image size (so an image will have 4 × 4 = 16 windows). It returns a sequence of image patches in which the query is detected.Other image manipulation modules. Other modules include (1) zoom-in and crop, which takes an image and a bounding box as input and returns the image patch inside the box; (2) Overlay images, which takes two images and alpha values as input, and returns the overlayed image.We experiment with the same multimodal LMs as in §4 on complex visual reasoning tasks. We compare the performance with and without SKETCHPAD, as well as other notable multimodal LMs, including Gemini [42] , Claude 3 [2] , and the open-source LLaVA 1.5 [26] , LLaVA-NeXT [27] .Main results. Table 2 shows the performance of our SKETCHPAD and baselines. SKETCHPAD consistently improves base model performance across all tasks. GPT-4o with SKETCHPAD sets the new state-of-the-art results on all tasks. SKETCHPAD is particularly effective on V * Bench, yielding 18.5% accuracy improvement for GPT-4 Turbo and 14.3% improvement for GPT-4o, surpassing the previous state of the art SEAL [51] which used a visual search model specifically trained for this task. On BLINK tasks, SKETCHPAD on average yields 6.6% absolute accuracy gain for GPT-4 Turbo and 9.0% gain for GPT-4o. Interestingly, despite the fact that all modules in SKETCHPAD work on a single image, the LMs also get substantial improvement on multi-image tasks, including jigsaw puzzles, visual correspondence, and semantic correspondence. Finally, GPT-4o, the LM with stronger multimodal ability than GPT-4 Turbo, benefits more from SKETCHPAD. For example, on the relative depth task, GPT-4o gets 12.1% accuracy improvement, while GPT-4 Turbo only gets 2.4%, showing that GPT-4o is better at understanding the depth map SKETCHPAD generated. Overall, our experiments show that SKETCHPAD is an effective way to improve multimodal LMs' performance on visual reasoning tasks.How many times is each vision specialist used? We count the number of times each vision specialist is used in each task, as shown in Figure 4 . Here we choose the four tasks that achieve the largest improvement: V * Bench, relative depth, spatial reasoning, and semantic correspondence. We observe that (1) the use of vision specialist is task-dependent, and the two LMs analyzed utilize similar tools. For example, for V * , which needs to locate small objects, the LMs mainly use detection, sliding window search, and zoom-in, similar to how people would search. For the relative depth task, both models rely on depth estimation. For spatial reasoning, the LMs use detection and segmentation to facilitate visual reasoning. ( 2) GPT-4o likes to use more tools. GPT-4o uses the vision specialists more often than GPT-4 Turbo. Also, the two LMs behave differently for the semantic correspondence tasks. GPT-4o uses the segmentation module for 40% of the task instances, while GPT-4 Turbo uses the detection module for less than 20% of times, and rarely uses the segmentation module. This difference may explain the performance gap between the two LMs (58.3% v.s. 42.4%) on this task. Comparison with visual prompting and tool-use frameworks. In Table 3 , we compare SKETCH-PAD with the visual prompting framework SoM [55] and the LLM tool-use framework Visprog [14] . Details of these methods can be found in §2. For a fair comparison, we make the following adaptations: (1) we find that prompting LMs with SoM images can hurt performance, likely because the visual prompts confuse the model. To make a stronger baseline, we prompt the LM with both the original image and the SoM image (full prompt in §C), which we refer as "SoM + orig." (2) We replace the LM and VQA modules in Visprog with the corresponding GPT-4 model. (3) Since baseline methods are developed on single-image tasks, we compare SKETCHPAD on such tasks. From Table 3 , we can see that SKETCHPAD is the only framework that yields consistent improvement on all tasks. SoM can boost spatial reasoning ability, as the authors reported. However, it can hurt the performance on other tasks, even in the "SoM + orig." setting. Visprog performs worse than the base LM on all the tasks. As prior work [21, 18] suggests, one possible reason is that the vision modules themselves have errors, and the error propagates when the modules are composed by a program. 
analysis and discussion: 
 Why does SKETCHPAD work? First, vision is a versatile and informational interface that complements language. Dense information like depth and segmentation cannot be described easily through language [9] . In a broader perspective, humans have developed many visualization techniques that are direct, efficient, and informational. SKETCHPAD provides LMs the opportunity to use them. Second, in SKETCHPAD, multimodal LMs can plan and reason based on the intermediate visual artifacts they created. In contrast, in prior modular vision work [14, 38, 55] , multimodal modules follow a predefined plan by either humans or code. SKETCHPAD is much more flexible and robust to errors. For example, suppose object detection makes an error. The LM can (in principle) find the error by viewing the bounding boxes, and change its following plans, but prior methods cannot. Third, as discussed next, the plans of multimodal LMs are similar to human plans, and therefore likely benefit from the fact that the underlying LMs have seen data with similar reasoning patterns.We conduct a human study on all geometry problems and 10 problems on each vision task. On geometry, humans draw the same auxiliary line as GPT-4o 80% of the time. On vision, we show 2 human subjects the full plan of GPT-4o, which they rate is valid in 92.8% of instances. Most errors are caused by failures in the vision specialists (e.g., fail to detect an object) and mistakes in simple visual question answering, rather than planning. 4 . We use the visual artifacts generated in the last action of GPT-4o + SKETCHPAD experiment as the image input for open-source LLaVA-NEXT models [27] . We can see that this oracle SKETCHPAD brings consistent improvement to math tasks and boosts mathematical reasoning. 
conclusion: 
 We present Visual SKETCHPAD, a framework that provides multimodal LMs with the tools necessary to generate intermediate sketches to reason over tasks. For complex mathematical reasoning tasks, SKETCHPAD yields large performance gains, by visualizing auxiliary lines, math functions, graphs, and games during reasoning. For visual reasoning tasks, we add vision specialists to SKETCHPAD.The LM can call these specialists during reasoning, observing the visualization of these specialists' predictions (e.g., bounding boxes from the object detection model; masks from the segmentation model), and then conduct further planning and reasoning. Experiments show that SKETCHPAD enhances the LMs' performance across all tasks, and sets new state-of-the-art results. Ultimately, SKETCHPAD represents a step toward endowing LMs with more human-like multimodal intelligence, leveraging the complementary strengths of language and vision to tackle increasingly complex reasoning challenges.Limitations and future directions. First, SKETCHPAD requires more computing resources than directly outputting language tokens. We discuss more about computing costs in E. Second, this work focuses on existing off-the-shelf LMs. Future work may explore the training side of SKETCHPAD. For example, recent multimodal models like Unified-IO 2 [31] and Chameleon [41] are natively multimodal and can output both text and images. SKETCHPAD may emerge as a new paradigm for instruction tuning these models. Finally, SKETCHPAD can be applied in more areas. For example, for robotics, we can apply SKETCHPAD to search for small things in a crowded space, highlight the object of interest, and zoom the camera for a better view or use depth estimation to help navigation.  
safeguards: 
 Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?Answer: [NA] Justification: This paper focus on inference of language models, and thus there is no data or models to release.Guidelines:• The answer NA means that the paper poses no such risks.• Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters. • Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images. • We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.12. Licenses for existing assets Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?Answer: [Yes] Justification: Yes. We acknowledge the codebases we have referred to, cite and provide the urls of datasets and models in ??.Guidelines:• The answer NA means that the paper does not use existing assets.• The authors should cite the original paper that produced the code package or dataset.• The authors should state which version of the asset is used and, if possible, include a URL. • The name of the license (e.g., CC-BY 4.0) should be included for each asset.• For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided. • If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset. 
 
 Appendix: This work is in part supported by gifts from Allen Institute for Artificial Intelligence, Meta, Apple, and Amazon Science. We also greatly appreciate the help from Zixian Ma, Wei-Chiu Ma, Benlin Liu, Jieyu Zhang, UW NLP, AllenNLP, AI2 PRIOR, and UW RAIVN for their help.Here we provide more details of how GPT-4o and SKETCHPAD solve complex mathematical and visual reasoning tasks.Is f(x) even, odd, or neither? Prompts for computer vision tasks. Here we provide the running log of GPT-4o + SKETCHPAD tackling a visual search problem from V * Bench [51] . We use the same prompt template for all computer vision problems in this work. For visualization purposes, we present the prompts that contain codes differently. In our implementation, they are all text inputs to the LLM. Prompts for math tasks. The prompts are similar to the vision task for math tasks, except we remove the computer vision specialists, and add example codes for math plotting. Besides, the user query is different. For each task, the user query part of the prompt is as follows.PROMPT You are given a real-valued, scalar function f (x). YOUR TASK is to determine whether f (x) is an even function, an odd function, or neither. Definition of an odd function: A function such thatf (-x) = -f (x)where the sign is reversed but the absolute value remains the same if the sign of the independent variable is reversed. A function is neither even nor odd if it does not satisfy either condition.Here is the expression of f (x):f (x) = -2x 5 2x 8 -4x 6 + 12x 4 + 4x 2 + 11.16Respond with 'even', 'odd', 'neither' first on whether the function f (x) is even, odd, or neither, based on the definitions and your observation of the function. You can generate matplotlib code to visualize the function. If you can get the answer, please reply with ANSWER: <your answer>, extract the final answer in FINAL ANSWER: <final answer> and ends with TERMINATE in the RESULT. Answer:Figure 6 : Prompt for the Math Parity task. We follow a similar prompt format to [8] , except prompting the models to write the code to generate images.You are given a real-valued, scalar function f (x). YOUR TASK is to determine whether f (x) is an convex function or concave function. Definition of a convex function: A function such that ∀x, y,0 ≤ t ≤ 1, f (tx + (1 -t)y) ≤ tf (x) + (1 -t)f (y) Definition of a concave function: A function such that ∀x, y, 0 ≤ t ≤ 1, f (tx + (1 -t)y) ≥ tf (x) + (1 -t)f (y)Here is the expression of f (x):f (x) = 7.57 -0.08 * Abs(x)Respond with 'convex' or 'concave' first on whether the function f (x) is convex or concave, based on the definitions and your observation of the function.You can generate matplotlib code to visualize the function.If you can get the answer, please reply with ANSWER: <your answer>, extract the final answer in FINAL ANSWER: <final answer> and ends with TERMINATE in the RESULT. Answer:Figure 7 : Prompt for the Math Convexity task. We follow the similar prompt format to [8] , except prompting the models to write the code to generate images.You are given an adjacency matrix of a graph and two query nodes. YOUR TASK is to find if there is a path between the two nodes.In an undirected graph G, two vertices u and v are called connected if G contains a path from u to v. A path in a graph is a finite sequence of edges which joins a sequence of vertices. In the query example, the nodes and the adjacency matrix are zero-indexed. Query Example: Adjacency Matrix:           0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0           Query nodes indices (zero-indexed): 4 and 0 Respond with 'yes' or 'no' first on whether the query nodes are connected or not in the graph.If there is a path, first provide the path as a sequence of vertices (nodes), and then explain your reasoning. You can use networkx to draw the graph. If there is no path, explain why in details. Answer (start with 'yes' or 'no'): If you can get the answer, please reply with ANSWER: <your answer>, extract the final answer in FINAL ANSWER: <final answer> and ends with TERMINATE in the RE-SULT.Answer:Figure 8 : Prompt for the Graph Connectivity task. We follow the similar prompt format to [8] , except prompting the models to write the code to generate images.You are given a visual representation of two graphs, graph G on the left and graph H on the right. YOUR TASK is to determine whether the two graphs are isomorphic to each other. Definition of graph isomorphism: In graph theory, an isomorphism of graphs G and H is a bijection f between the vertex sets of G and H, denoted as f : V (G) → V (H). G and H are said to be isomorphic when f satisfies the following: any two vertices u and v of G are adjacent in G if and only if f (u) and f (v) are adjacent in H. This kind of bijection is commonly described as "edge-preserving bijection", in accordance with the general notion of isomorphism being a structure-preserving bijection.In the query example, the adjacency matrices are zero-indexed. Adjacency Matrix G:           0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0            Adjacency Matrix H:            0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0           Respond with 'yes' or 'no' first on whether the two graphs are isomorphic to each other. You can use networkx to draw the graph. If they are isomorphic, first provide the bijection between the two graphs, and then explain your reasoning. You can use networkx to draw the graph. If they are not isomorphic, explain why in detail. Answer (start with 'yes' or 'no'): If you can get the answer, please reply with ANSWER: <your answer>, extract the final answer in FINAL ANSWER: <final answer> and ends with TERMINATE in the RESULT. Answer:Figure 9 : Prompt for the Graph Isomorphism task. We follow a similar prompt format to [8] , except prompting the models to write the code to generate images.You are given an adjacency matrix of a graph and two query nodes (one source node and one sink node). The source node is the node where the flow starts and the sink node is the node where the flow ends. YOUR TASK is to solve the maxflow problem given the weighted directed graph. Definition of Maxflow problem: In the max flow problem, we have a directed graph with a source node s and a sink node t, and each edge has a capacity (integer valued, colored in green) that represents the maximum amount of flow that can be sent through it. The goal is to find the maximum amount of flow that can be sent from s to t, while respecting the capacity constraints on the edges. Query Example: Adjacency Matrix: EQUATIONTable 5 and 6 show the statistics of the datasets we used, including IsoBench [8] , BLINK [9] , MMVP [44] , and V * Bench [51] . The cost of running each task using GPT-4o is in Table 7 . Our work proposes SKETCHPAD, a framework aiming at advancing academic research and meeting industry needs. In a broader perspective, SKETCHPAD proposes a new way that humans can interact with LMs, and makes LMs more interpretable by eliciting their reasoning process with both language and sketches. On the other hand, if misused, the LMs may be used to generate harmful vision and text artifacts. Nevertheless, this is not directly related to our research, and more researchers can be involved to research on the safety issue in a multimodal context.Justification: The dataset is accessible online. We are committed to releasing the code. Guidelines:• The answer NA means that paper does not include experiments requiring code.• Please see the NeurIPS code and data submission guidelines (https://nips.cc/ public/guides/CodeSubmissionPolicy) for more details. • While we encourage the release of code and data, we understand that this might not be possible, so "No" is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark). Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact. • Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.• The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster. • The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology. • If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).For humans, the analytical approach is the correct way to tackle these math tasks. However, we observe that LMs are not good at analytical reasoning in math. They make errors when deducing f (-x) and derivatives. 


Decision: BpTp considers the problem useful/well motivatated and experiments to be comprehensive, covering diverse reasoning tasks.   They ask about determinism of the response and accuracy of responses and receive a satisfactory response in the rebuttal.  The score is maintained at accept (7)

nzNU recognizes the paper contributes to a research trajectory, and asks whether the CoT contribution could be built upon one such technique (VisProg).  A minor point is made re: the use of the terminology ‘sketch’ in this context.  Some questions are asked regarding the technical exposition and about the ground truth for geometry problems.  In my interpretation there are no serious concerns raised by the reviewer only some questions raised out of interest, and the rebuttal has answered them. The reviewer does not reply to the rebuttal so the final score is borderline accept (5).  

2LyD is concerned that introducing the modality of ‘sketch’ i.e. diagrams into the chain of thought is not a novel step over existing chain of thought-like approaches.  They also had some questions on how the work is positioned, partially echoing nzNU.  They specifically ask for clarification of novelty over [See et al] and [60], and on the baseline comparisons.  .  There is some reply given around novelty and performance relative [60] and [a] and it should be noted these papers are in arxiv/unpublished state.  The reviewer does not reply to the rebuttal and the score remains at (5).

jSat considers the framework to be interesting and effective, noting the performance gain and SOTA results.  The main weakness identified is lack of comparison with existing CoT frameworks.  The majority of the questions raised are clarification on image formation and edge case behaviour.  The reviewer notes that ‘most’ of their concerns are addressed but has not amended their score of (5).
This is a borderline paper.  No reviewer has argued against acceptance, but only one reviewer is firmly arguing to accept it. The main deficiency in the paper is the lack of comparison to other published visual CoT methods, as the reviewers flagged.  In my view the paper could do better to motivate/position itself relative these works (also see Chen et al. AAAI 2024) as there is an implication in the motivation that this work is first out of the gate on the topic.  The baseline comparisons requested would be interesting but not all of the techniques discussed by the reviewers are published yet.

On the balance the score is low but I don’t see any critical concerns raised by the reviewers that remain post-rebuttal.  I would consider that the paper is borderline acceptable on that bass and so recommend acceptance.

Reviews: review: paper_summary: paper_summary: The Visual SKETCHPAD framework integrates sketching capabilities into multimodal language models, enabling them to iteratively draw, plan, and reason using visual artifacts - similar to how humans leverage sketching to facilitate problem-solving. Unlike prior approaches that relied on text-to-image models, Visual SKETCHPAD allows language models to directly create visual elements like lines, boxes, and marks, and can even incorporate specialized vision models to enhance the sketching process. Experiments across a range of math and complex visual reasoning tasks demonstrated that Visual SKETCHPAD substantially improves performance.
strength_weakness: strength_weakness: More discussion about the robustness (repeatibility) is needed, since a common problem for these commercial LVLMs is the instability. Does the method alleviate the invalid responces? How robust is it? Does multiple re-try helps to improve the performance?
questions: questions: More explaination about the human evaluation is needed. I noticed the author have included the user study. How exactly the user study is conducted? The author is suggested to elablorate this.
limitations: limitations: Yes
paper_summary: paper_summary: This paper studies the problem of using language models to generate code to draw for intermediate reasoning. Particularly, the idea of chain-of-thought is applied to facilitate the reasoning process, such that the auxiliary "drawings" enhance the LM's reasoning ability. The proposed method is tested both on math and vision tasks, showing promising results.
strength_weakness: strength_weakness: - The overall idea of using LM to generate code to manipulate images is not new. As the authors pointed out, VisProg is one of the most similar works. Personally, this work could be an incremental work based on VisProg by introducing chain-of-thought and applying multimodal reasoning.

- It is very confusing to use the word "sketches" since the drawings are straight lines, boxes, or marks, which are in fact irrelevant to sketches from my view.
questions: questions: - Is there any evidence that LMs can change the plan given the intermediate visual outcomes during reasoning?
- Is there an in-context learning for LM-based code generator?
- Is that possible to equipt CoT to VisProg (using the same specialist vision models of this work), thus achieving similar performances on math and vision problems?
- To solve the geometry problem, the proposed model is going to generate auxiliary lines. Is there GT that can be used to quantitatively assess the correctness of the lines?
- In Table 3, VisProg performs poorly and the reason claimed is the errors from vision modules. Why Sketchpad did not suffer from this issue?
limitations: limitations: Adequately discussed.
paper_summary: paper_summary: This work proposes Visual SKETCHPAD, a framework designed to incorporate visual reasoning into chain-of-thought and tool-use paradigms. Specifically, a multimodal LLM (Large Language Model) addresses a query by (1) generating a plan, (2) executing an action, (3) updating the current context with the result of the action, and (4) iterating until sufficient information is gathered to answer the query.
The plan can include various types of visual reasoning, such as visual program generation via matplotlib and networkx, leveraging specialist vision models like object detectors, segmentation models, and depth estimation models. It also includes the use of specialized tools such as image overlay or a chess drawing Python library. The main contribution of Visual SKETCHPAD lies in the reuse of intermediate visual outputs as additional observations, which enable effective chain-of-thought reasoning. SKETCHPAD demonstrates significant performance improvements compared to text-only chain-of-thought LLMs across multiple tasks.
strength_weakness: strength_weakness: - *Clarity:* The reviewer found the title and general positioning of this work slightly misleading. Visual SKETCHPAD naturally would refer to chain of thought framework with that includes generalised sketching capabilities. Troughout this work sketching soley refers to drawing of auxiliary lines for geometric problems and is only one of the multiple tools that the proposed framework makes use of for visual artefact generation.

- *Originality:* The main concern of the reviewer is with the extent of the novelty of this work. The single differentiating factor compared to standard pipelines is the incorporation of visual artefacts on intermediate CoT steps. Incoorporation of visual reasoning information for LLM reasoning cannot be considered a purely novel proposition (for example [a] or [60]). Even though the proposed approach departs from these methods by iteratively updating the context with newly formed visual artefacts, the reviewer is still skeptical w.r.t the extent of the contribution for NeurIPS standards.

[a] See, Think, Confirm: Interactive Prompting Between Vision and Language Models for Knowledge-based Visual Reasoning. Zhenfang Chen, Qinhong Zhou, Yikang Shen, Yining Hong, Hao Zhang, Chuang Gan
questions: questions: - Could the authors elaborate further on the extent of their contribution and how their work is different from [a] and [60]?

- Authors could include more details about baselines reported on Table 1. Where these follow a similar text-based CoT pipeline?
limitations: limitations: The limitations were properly addressed by the authors.
paper_summary: paper_summary: This paper proposes visual sketchpad that aims to aid the existing multimodal language models (MLMs). Specifically, the visual sketchpad serves as a task-specific prompting technique that calls tools to draw sketches for the input problem as additional context to help solve the problem. This prompt technique is like a chain of thought but in a visual way, and the tools include code generation as image drawer as well as vision specialist models. Benchmarks show that the proposed visual sketchpad frameworks can significantly boost the performance of base models (e.g., GPT-4o and LLAVA-Next) on multiple math and vision tasks.
strength_weakness: strength_weakness: 1. As the proposed visual sketchpad attempts to generate code to draw the images. I wonder if it is possible that sometimes code has issues and cannot generate images properly. If so, how to deal with such issues.

2. For the geometry problem, can the visual sketchpad support geometry image (e.g., in jpg) as input? If so, how does the visual sketchpad overlay lines on the image?

3. Currently, the visual sketchpad is a set of different prompts that tackle specific problems with a corresponding set of tools. Can the visual sketchpad be a single prompt to call tools and tackle all the problems listed in the evaluation? If so, that would be useful as the prompt can be integrated into the system prompt for MLMs as an enhanced version.

4. The evaluation misses an important set of comparisions: There is no comparison between the proposed approach and the existing chain-of-thought frameworks.

5. Although most benchmarks in the evaluation show that the additional context from visual sketchpad brings benefits, I wonder if there are some cases that the additional context introduces noises and causes errors compared with the baseline model.

6. Typos
Line 64: jigwaw -> jigsaw
questions: questions: Please see Weaknesses section for the questions.
limitations: limitations: Yes, the author discusses some limitations in Section 7.

Comments: title: Answer to author rebuttal
Thank you for the rebuttal
comment: Thanks for the rebuttal. The reviewer still disagrees with the general positioning of the paper and the amount of the technical novelty. However, as pointed out in the review, this paper showcases some important insights that can help the community in re-iterating over it. The reviewer maintains the initial rating of 5.
Thank you for the rebuttal. I think the rebuttal has addressed most of my concerns.
Thank you very much for your time and effort in reviewing our paper! If you have any additional questions for discussion, we would be more than happy to address them. We will make every effort to revise our paper based on the reviewer's feedback and suggestions.
Thank you very much for your time and effort in reviewing our paper! If you have any additional questions for discussion, we would be more than happy to address them. We will make every effort to revise our paper based on the reviewer's feedback and suggestions.
Thank you very much for your time and effort in reviewing our paper! If you have any additional questions for discussion, we would be more than happy to address them. We will make every effort to revise our paper based on the reviewer's feedback and suggestions.
Thank you very much for your time and effort in reviewing our paper! If you have any additional questions for discussion, we would be more than happy to address them. We will make every effort to revise our paper based on the reviewer's feedback and suggestions.