Google DeepMind and Stanford study finds simple images can steer how AI writes code
A red heart pushed two frontier models to write recursive code every time, and the models mostly didn't notice why
Show an AI model a red heart, and it might start writing recursive code. That is the headline finding of a new paper from researchers at Google DeepMind and Stanford University.
The paper is titled “A Heart Means Recursion: Exploring Visual Meaning and Communication in VLMs.” It was posted to arXiv on October 27, 2026. It suggests that unrelated pictures attached to a prompt can quietly change how vision-language models solve programming problems.
The images had nothing to do with the task. The models changed their behavior anyway.
A heart, a checkmark, and a coding test
The study is led by Alexa Tartaglini, a researcher affiliated with both Google DeepMind and Stanford. The team focused on vision-language models, or VLMs. These are AI systems that can take in images alongside text, which describes most of today’s flagship chatbots.
The test was a classic programming exercise: binary tree traversal. Picture a family tree where every person has at most two children. The job is to write code that visits every person in that tree.
There are two broad ways to do it. 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. That made the task a clean way to see whether a picture could tip a model toward one style or the other.
The researchers ran 20 samples for each model configuration. They then attached basic colored shapes to the prompts and counted how often the models chose recursion.
The results were not subtle. 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 the image was 0%.
Gemini 3.1 Pro responded to a different symbol. A yellow checkmark pushed its recursion rate to 90%.
AI, tech, and the markets they move—in one daily briefing.
Daily. Free. Join 34,000+ readers across crypto, finance, and policy.
The team evaluated a total of 288 shape-color combinations. Each model showed its own distinct steering profile, meaning the symbols that moved one model did not necessarily move another.
The controls, and the part that gets uncomfortable
The researchers ran checks to make sure they weren’t just 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. Those barely moved the needle either.
So it was not simply the 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. You might expect a symbol that looks like recursion, such as a branching arrow, to be the strongest nudge. The study found that intuitive symbols like branching arrows did not consistently outperform arbitrary ones.
A heart has no obvious link to functions calling themselves. It worked anyway, at least for two of the models.
Then comes the transparency problem. According to the study, the models often did not recognize that the images were influencing them. Their reasoning traces, the step-by-step explanations they generate, generally lacked any account of the visual cue’s role.
Put simply, the models changed their approach and didn’t say why. They may not have been able to.
The authors describe the phenomenon as visual steering. They frame the results as preliminary, which is worth keeping in mind before anyone declares hearts a programming language.
Why this matters beyond a lab curiosity
The study suggests these findings could shape interactions involving screenshots or diagrams in real-world applications. If an arbitrary shape can flip a model’s coding style from 0% to 100%, then incidental visual elements in a pasted image could plausibly have effects nobody intended.
The reasoning-trace finding adds a second layer. Many teams lean on a model’s explanation of its own logic to audit its work. If the explanation leaves out a major driver of the output, that audit has 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 to filter 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 has 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.
Disclosure: This article was edited by Diego Almada Lopez. For more information on how we create and review content, see our Editorial Policy.
More in Technology
See all-
Jupiter brings Asian equity perpetuals to Solana with Chainlink data
-
Big Tech lines up more than $60 billion in new bonds in one week
-
85% of family offices prioritize AI investments, 75% foresee a bubble
-
Perplexity defends AI agent in Amazon lawsuit over shopping access
-
Meta returns to the bond market with a five-part benchmark debt offering
-
Penguin Solutions 13D filing reveals SK hynix acquires $377M stake

