← Latest papers
💻 computer science

Reading Between the Pixels: Linking Text-Image Embedding Alignment to Typographic Attack Success on Vision-Language Models

This paper investigates typographic prompt injection attacks on vision-language models, revealing that attack success is highly sensitive to font size and visual degradation, varies significantly across different models and modalities, and is strongly negatively correlated with text-image embedding distance, thereby demonstrating that effective defenses must be tailored to specific model architectures rather than relying on universal solutions.

Original authors: Ravikumar Balakrishnan, Sanket Mendapara, Ankit Garg

Published 2026-04-16
📖 5 min read🧠 Deep dive

Original authors: Ravikumar Balakrishnan, Sanket Mendapara, Ankit Garg

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 have a very smart robot assistant (a Vision-Language Model, or VLM) that can both read text and see pictures. You want to protect this robot from bad actors who try to trick it into doing harmful things, like stealing passwords or planning a cyberattack.

Usually, you put up a "bouncer" at the door who checks the robot's text messages. If the message says "How do I hack a bank?", the bouncer stops it.

But what if the bad actor writes that harmful message on a piece of paper, takes a photo of it, and shows the photo to the robot? The robot sees a picture, not text, so the text-bouncer might miss it. This is called a Typographic Prompt Injection.

This paper is like a detective report that figures out exactly when and why these photo-tricks work, and how to spot them before they happen.

Here is the breakdown in simple terms:

1. The "Font Size" Sweet Spot

The researchers tested writing the bad messages in different sizes, from tiny specks to huge letters.

  • The Analogy: Imagine trying to read a menu in a dark restaurant.
    • Too Small (6px): If the text is microscopic, the robot's eyes just can't make it out. It's like trying to read a menu from across the street. The attack fails almost 100% of the time.
    • Just Right (10–12px): This is the "Goldilocks" zone. The text is big enough to be read clearly but small enough to look like a normal part of the image. This is when the attacks work best.
    • Too Big: Once the text gets huge, the attack doesn't get any more successful; it just plateaus.

The Lesson: If you force the robot to ignore anything smaller than a certain size, you can block a huge chunk of these attacks.

2. Not All Robots Are Equally Gullible

The researchers tested four different robot models (GPT-4o, Claude, Mistral, and Qwen). They found that some robots are much harder to trick than others.

  • The Analogy: Think of the robots as different types of security guards.
    • Guard A (GPT-4o) & Guard B (Claude): These guards are very suspicious. If you show them a photo of a note, they are still suspicious. In fact, they are more likely to listen to a direct text message than a photo of a note. For them, turning text into a picture actually weakens the attack.
    • Guard C (Mistral) & Guard D (Qwen): These guards are less picky. They don't care if the message comes as text or a photo; they are equally likely to fall for the trick.

The Lesson: You can't use the same safety rules for every robot. If you pick the "Gullible" robots for your system, you need much stronger defenses.

3. The "Blur" and "Spin" Test

The researchers also tried to mess up the photos to see if it would stop the attack. They rotated the images, blurred them, or added static noise (like an old TV).

  • The Analogy: Imagine trying to read a sign while spinning in a circle or looking through foggy glasses.
    • Heavy Blur/Noise: If the image is too blurry or noisy, the robot gets confused and can't read the text. The attack fails.
    • Rotation (Spinning): This was the surprise! Rotating the image 30 degrees didn't bother the "Gullible" robots (Mistral/Qwen) much, but it completely confused the "Suspicious" robots (Mistral dropped 50% success rate, while GPT-4o didn't change at all).

The Lesson: Sometimes, just tilting the image or adding a little static can break the attack, but it depends entirely on which robot you are using.

4. The Magic Crystal Ball (Embedding Distance)

This is the most important discovery. The researchers found a way to predict if an attack will work before the robot even sees it. They used a special "mathematical ruler" (called an embedding model) to measure the distance between the original text and the photo of the text.

  • The Analogy: Imagine you have a fingerprint scanner.
    • If the photo of the text looks very similar to the original text (the "distance" is small), the robot is very likely to read it and fall for the trap.
    • If the photo looks very different (the "distance" is large)—maybe because it's blurry, tiny, or rotated—the robot is unlikely to read it, and the attack fails.

The Magic: They found a perfect negative correlation. The closer the photo looks to the text mathematically, the higher the chance of a successful attack.
This means security teams can use this "mathematical ruler" as a cheap, fast alarm system. If the distance is too small, they can block the image before it even reaches the robot.

Summary for the Real World

If you are building a system that uses AI robots to browse the web or control cameras:

  1. Don't rely on one-size-fits-all defenses. What stops one robot might not stop another.
  2. Watch the font size. Tiny text is safe; medium text is dangerous.
  3. Use the "Math Ruler." You can predict if an image is trying to trick your robot by measuring how "text-like" the image looks mathematically. If it looks too much like text, treat it with suspicion.

This paper gives us the tools to build safer AI systems that don't get tricked by a piece of paper with a bad message written on it.

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 →