Google DeepMind and Stanford Researchers Find Simple Images Can Steer How AI Writes Code
Key Takeaways
- •A red heart image drove Claude Opus 4.7 and GPT-5.4 to produce recursive binary tree traversal code 100% of the time, compared with a 0% baseline without images.
- •A yellow checkmark raised Gemini 3.1 Pro's recursion rate to 90%, and each model displayed a distinct steering profile across the 288 shape-color combinations tested.
- •Replacing the images with text captions describing the same symbols produced minimal steering effects, and Gaussian noise images caused almost no change.
- •The models' reasoning traces generally failed to mention that visual cues influenced their coding approach, creating a potential blind spot for teams that audit models through self-explanations.
- •The authors frame the findings as preliminary and suggest they could affect real-world use of screenshots or diagrams, while also hinting that images might eventually serve as a deliberate communication channel with models.

A red heart shown to an AI model can push it to write recursive code every single time — and the model may never realize why. That is the headline finding of a new study from researchers at Google DeepMind and Stanford University, which suggests that unrelated pictures attached to a prompt can quietly change how vision-language models solve programming problems.
The paper, titled “A Heart Means Recursion: Exploring Visual Meaning and Communication in VLMs,” was posted to arXiv — the open preprint server where research commonly appears before formal peer review — on October 27, 2026. Its central observation is stark: the images used in the experiments had nothing to do with the task at hand, yet the models changed their behavior anyway.
A heart, a checkmark, and a coding test
The study was led by Alexa Tartaglini, a researcher affiliated with both Google DeepMind and Stanford. The team focused on vision-language models, or VLMs — AI systems capable of taking in images alongside text, a description that covers most of today's flagship chatbots.
The researchers chose a classic programming exercise as their test bed: binary tree traversal. The structure can be pictured as a family tree in which every person has at most two children, and the assignment is to write code that visits every person, or node, in that tree.
There are two broad ways to accomplish the task. A recursive solution has a function call itself over and over, like a set of Russian nesting dolls. An iterative solution uses a loop and keeps track of its place manually. Both approaches work, which made the exercise a clean way to measure whether a picture could tip a model toward one coding style or the other.
The researchers ran 20 samples for each model configuration, attached basic colored shapes to the prompts, and counted how often the models chose recursion.
The effects were pronounced. With a red heart in the prompt, Claude Opus 4.7 and GPT-5.4 produced recursive solutions 100% of the time; their baseline without any image was 0%. Gemini 3.1 Pro responded to a different symbol — a yellow checkmark pushed its recursion rate to 90%. In other words, a symbol with no obvious connection to the task was enough to dictate the approach the models took.
Across the experiment, the team evaluated 288 shape-color combinations in total. Each model displayed its own distinct steering profile, meaning the symbols that moved one system did not necessarily move another.
The controls — and an uncomfortable transparency problem
The researchers ran checks to make sure they were not simply measuring noise. When they swapped the images for text captions describing the same symbols, the steering effect was minimal. They also tried Gaussian noise images, which are essentially random static, and those produced almost no movement either.
It was not, then, the mere presence of an extra input doing the work. Specific pictures carried specific pull, and the written word for those pictures did not.
Another finding cuts against intuition. One might expect a symbol that visually resembles recursion, such as a branching arrow, to be the strongest nudge. The study found that intuitive symbols of that kind did not consistently outperform arbitrary ones. A heart has no obvious connection to functions calling themselves, yet it worked anyway — at least for two of the models.
Then comes the transparency problem. According to the study, the models often failed to recognize that the images were influencing them. Their reasoning traces — the step-by-step explanations they generate — generally contained no account of the visual cue's role. In effect, the models altered their approach without explanation, and they may not have been capable of providing one.
The authors describe the phenomenon as visual steering. They also frame the results as preliminary, a caveat worth keeping in mind before drawing any sweeping conclusions about hearts as a programming language.
Why it matters beyond the lab
The study suggests the findings could shape real-world interactions involving screenshots or diagrams. If an arbitrary shape can flip a model's coding style from 0% to 100%, incidental visual elements in a pasted image could plausibly produce effects nobody intended.
The reasoning-trace finding adds a second layer of concern. Many teams rely on a model's explanation of its own logic to audit its work; if that explanation leaves out a major driver of the output, the audit carries a blind spot.
There is also a fragmentation issue. Because each model showed a different steering profile across the 288 combinations, there is no single list of risky symbols that could simply be filtered out. What sways one system may do nothing to another.
For the labs building these models, the paper raises questions about how visual and textual inputs get blended internally. The fact that captions had little effect while the images themselves had a large one points to something specific about how these systems process pictures.
The research also admits a more optimistic reading. If images can steer behavior this strongly, they might eventually be used deliberately as a communication channel with models. The paper's title, with its focus on visual meaning and communication, hints at that direction, though the study's results remain early. Why images carry pull that their written captions lack — and how teams can account for influences their models cannot report — are the open questions this early work leaves for the field.