Skip to content

A red heart image made Claude and GPT-5.4 write recursion every time

Comic-style robot at a monitor showing a recursive tree spiral, a red heart sticker sending glowing threads into it Models

A picture of a red heart can change how AI models write code. A new paper from Google DeepMind and Stanford placed a heart next to a simple coding task. It pushed Claude Opus 4.7 and GPT-5.4 from iterative code to recursion in every sample. The models' own reasoning rarely admitted the picture played a role.

The paper, "A Heart Means Recursion," went up on arXiv on October 27, 2026. Viral posts now call it a "terrifying blind spot in every major AI model," but that goes too far. The findings are real and strange, but the study is smaller and calmer than that framing suggests.

What the red heart experiment found

The researchers gave models one classic problem: return the inorder traversal of a binary tree. It can be solved with recursion or with a loop. The prompt asked the model to look at an attached image and choose a strategy.

Without any image, Claude Opus 4.7 and GPT-5.4 never chose recursion. Gemini 3.1 Pro did 40% of the time. With a red heart, Claude and GPT-5.4 switched to recursion in 100% of samples. A yellow checkmark pushed Gemini to 90%.

Red heart steering results: Claude Opus 4.7 and GPT-5.4 at 100% recursion with a red heart vs 0% without, Gemini 3.1 Pro 90% with a yellow checkmark
Results from Tartaglini et al., arXiv 2610.36449

Each condition used 20 samples. The team tested 288 symbols, made from 24 shapes in 12 colors. For Claude, triangles moved behavior even more than hearts. For GPT-5.4, hearts were the strongest cue.

The obvious next question is whether the models simply read the heart as a hint. The controls say no.

The pixels matter, not the word

When the researchers swapped the image for a text caption, the effect did not carry over. A line like "an image of a yellow heart" steered models differently from the picture. For Claude Opus 4.7, the correlation between image steering and caption steering was close to zero.

Random noise and ordinary photos of animals did not steer Claude or GPT-5.4 at all. Shuffling the symbol's pixels or rotating it weakened the effect. The shape itself, as the model sees it, does the work.

The authors also asked the models directly whether each symbol means recursion or iteration. Those answers correlated only weakly with what the models actually did. That gap leads to the most unsettling part of the paper.

Models do not report why they changed course

The steering is mostly hidden from the model's own explanations. Gemini 3.1 Pro's thinking traces were checked in 2,880 runs. When a symbol changed its behavior, 71.5% of the traces dismissed the image as irrelevant. They cited technical reasons like stack overhead or code elegance instead.

GPT-5.4 erred the other way. When a symbol had no effect, 74.7% of its traces still claimed the symbol decided the outcome. In a "silent" setup, where the image was included without being mentioned in the prompt, GPT-5.4's traces never referred to the image at all.

The viral post says the models "misattributed their own decisions 75% of the time." The paper reports no single number like that. The 74.7% figure describes GPT-5.4 crediting a symbol that did nothing, not hiding one that worked. Claude Opus 4.7 returned no thinking traces, so it was not part of this test.

The paper then asks the reverse question: can models use pictures to talk to each other on purpose?

When models send pictures to each other

In communication games, one copy of a model drew a picture to steer another copy toward recursion or iteration. The senders chose shapes that humans find intuitive, like spirals, infinity signs and arrows. Those often failed. Claude, for example, sent spirals while its own strongest triggers were hearts and triangles.

The authors call this a generation–interpretation gap. On average, Claude needed 5.2 turns to get its message across, Gemini 1.3 turns and GPT-5.4 14 turns.

Free drawing worked far better for abstract ideas. When models could draw anything with code, 97.8% of concept and story games ended in success, 91.2% on the first try. Restricted to simple symbols, first-try success fell to 47.8%.

What the paper does and does not claim

The study covers three main models: Claude Opus 4.7, Gemini 3.1 Pro and GPT-5.4. A few experiments add Claude Sonnet 4.5, Gemma 4 31B and GPT-4o. That is a strong set, but not every major model.

The authors call their tasks synthetic and describe their human study as "exploratory and small-scale," with seven people. They test "non-adversarial" symbols and do not present the effect as an attack. They do flag one practical risk. As AI agents work in visual environments, "the influence of visual inputs on their behavior should be transparent," the paper says.

Coding style is also a low-stakes target. Choosing recursion over a loop for a tree traversal is a matter of taste, not a broken program.

Should you worry about the red heart effect

Not as a security hole, at least not yet. The paper shows a stray symbol can swing a harmless coding choice from 0% to 100%, and that reasoning traces often hide the cause. It does not show anyone hijacking an agent with an icon.

The real lesson is about trust in explanations. A heart can change a model's code while its reasoning cites stack overhead. So reasoning logs are not a full record of why an agent acted. For AI agents that browse websites and read screens, visual inputs will need their own checks.

Sources

Portrait of Felix Laurent, author at thehype.news

Felix Laurent

News Writer at thehype. Felix is a journalist with experience in marketing. He covers artificial intelligence and emerging technologies, focusing on the ideas, innovations, and trends shaping the future of tech.

More articles by Felix Laurent →
On air · radio.thehype.news ↗ AI news radio — 24/7