← Latest papers
🤖 machine learning

Symbolic Graphics Programming with Large Language Models

This paper introduces SGP-GenBench to evaluate large language models' ability to generate symbolic graphics programs (SVGs) and proposes a reinforcement learning approach with verifiable rewards that significantly enhances generation quality and semantic alignment, enabling open-source models to match the performance of frontier systems.

Original authors: Yamei Chen, Haoquan Zhang, Yangyi Huang, Zeju Qiu, Kaipeng Zhang, Yandong Wen, Weiyang Liu

Published 2026-08-10
📖 6 min read🧠 Deep dive

Original authors: Yamei Chen, Haoquan Zhang, Yangyi Huang, Zeju Qiu, Kaipeng Zhang, Yandong Wen, Weiyang Liu

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to describe a picture to a friend who has never seen it. You might say, "Draw a red car next to a blue bike." But natural language is messy; it's full of wiggle room. Your friend might draw a car that's too big, a bike that's floating in the air, or a red that looks more like pink. This is the daily struggle for computers trying to turn words into images. For a long time, scientists have taught computers to "dream" up pictures using pixels, like a digital painter smudging colors on a canvas. But there's another way: Symbolic Graphics Programming. Instead of smudging pixels, the computer writes a precise recipe—a set of mathematical instructions—to build the image piece by piece, like assembling a LEGO set or following a strict architectural blueprint. This method is incredibly precise, but it's also very hard to get right.

Enter Large Language Models (LLMs). These are the super-smart AI brains that can write code, tell jokes, and answer questions. They are great at following instructions, but can they write the specific "blueprints" needed to build a perfect image from a simple description? That's the big question this paper tackles. The researchers wanted to know: Can these AI brains learn to be master architects of visual scenes, writing the exact code needed to draw a complex world, and if they can't do it well on their own, can we teach them to get better?

The Paper's Story: Teaching AI to Draw with Code

The researchers started by testing the current state of the art. They built a giant test called SGP-GenBench, which is like a massive driving test for AI artists. They gave various AI models a list of prompts, ranging from simple ("a red car") to complex ("three people riding on the backs of elephants"). The goal was to see if the AI could write the code (specifically a type called SVG, or Scalable Vector Graphics) that would render exactly what was asked.

The results were a bit of a mixed bag. The "frontier" models—the super-expensive, closed-source ones used by big tech companies—did pretty well. They could mostly get the shapes and colors right. But the open-source models, which are free for anyone to use and study, struggled. They often wrote code that didn't work at all, or they drew things that looked nothing like the prompt. It was like asking a novice to build a house; they might get the roof on, but the walls would be crooked, or the door might be missing entirely.

So, the team asked: How do we fix the open-source models?

They didn't just feed the models more examples to memorize. Instead, they used a technique called Reinforcement Learning (RL). Think of this like training a dog, but for a computer.

  1. The Attempt: The AI tries to write the code for a picture.
  2. The Check: The computer renders the code into an actual image.
  3. The Reward: A super-smart "judge" (another AI trained to understand pictures) compares the result to the original description.
    • If the AI wrote code that crashed or didn't render, it gets a zero.
    • If the image looks like the prompt, it gets a high score.
    • If the image is close but has a few errors, it gets a medium score.

The AI then uses these scores to learn. It realizes, "Oh, when I put the sun in the top left, the score goes up. When I forget the wheels on the car, the score goes down." Over thousands of tries, the AI learns the rules of the game.

The Surprising Results

The results were impressive. After this "training camp," the open-source model (Qwen-2.5-7B) didn't just get a little better; it jumped to a level where it could compete with the best closed-source models. It went from drawing messy, broken scribbles to creating clean, detailed, and accurate vector graphics.

But the most fascinating part wasn't just the final score; it was how the AI changed its behavior while learning. The researchers watched the AI's "thought process" evolve and found two cool tricks it started using:

  1. Breaking Things Down: At the beginning, the AI tried to draw a complex object (like a motorcycle) in one big, messy block of code. As it learned, it started breaking the motorcycle into smaller, manageable parts: "First, I'll draw the body. Then, I'll add the wheels. Now, let's add the handlebars." It was like a chef who stopped trying to throw all the ingredients in the pot at once and started prepping each one carefully.
  2. Adding "Optional" Details: The AI started adding things that weren't explicitly asked for but made the picture feel more real. If you asked for "people sitting at a table with cake," the AI might start adding sprinkles on the cake or crumbs on the table. If you asked for a beach scene, it might add waves or sand. These weren't mistakes; they were creative choices that made the scene feel complete and natural, showing the AI was starting to understand the context of the scene, not just the literal words.

Why This Matters

The paper suggests that this method is a powerful way to teach computers how to "see" and "draw" without needing millions of perfect examples to start with. By using a reward system that checks if the picture matches the words, the AI learns to align its language skills with its visual skills.

The researchers found that this approach works so well that the open-source model, which started out struggling, ended up performing on par with the most advanced commercial systems. They also discovered that the AI didn't just memorize answers; it learned a strategy of breaking complex tasks into smaller, controllable steps and adding helpful details to make the final result better.

In short, this paper shows that with the right kind of training—where the AI gets immediate feedback on whether its "drawing" matches the description—we can turn a basic language model into a precise, creative, and highly capable graphic programmer. It's a step toward AI that doesn't just guess what a picture should look like, but actually knows how to build it, one precise line of code at a time.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →