
Prompt injection defence via internal attribution
Research
Research
See which image regions the model read, the visual concepts it used, and which of those actually moved the answer.



input scenewhat the model generated · hover or tap a word to see why
Aerial view of kayakers navigating rocky coastal waters, surrounded by cliffs and greenery.
Point at a word to see where the model looked and the relevant concepts.
The problem.
Ask a vision-language model whether it looked at the pixels it mentions and it will tell you that it did. But that reply is just more generated text, and nothing in it can be checked. The output never shows which visual features the model relied on, or whether an answer turned on evidence in the image or on the wording of the prompt: an invented detail is written just as smoothly as an observed one. Later on this page the same aerial photograph produces a correct flood report and a fabricated fire report, equally fluent, and only the computation separates them.
We read the computation instead. Using Layer-wise Relevance Propagation, and specifically our attention-aware extension AttnLRP, we trace an output word backward through the network to the inputs and internal units that produced it, and answer three questions:
Relevance on image regions versus prompt text. Did the answer come from the picture, or from the wording of the question?
A sparse dictionary (SAE) turns dense activations into named visual concepts you can inspect and point at.
Attribution ranks those concepts by how much each one actually pushed the answer, signed for and against.
How it works.
Where it looks.
For every word, AttnLRP splits the evidence into an image share and a prompt share. For this answer a clear majority of words lands on the pixels, so the model is describing what it sees rather than reciting a prior.
Click any word to resolve the split for that token; the bar above updates. Deeper shading already previews each word's image-share; click to read it exactly.
"Aerial", "kayakers", "rocky" and "cliffs" are strongly grounded in the image with a relevance share of over 55%. The three words that name nothing in the picture, the grammatical glue of, by and and (dotted), carry the lowest image share in the sentence, ~40% picture to ~60% prompt, while the words that name things the model can see pull 56–65% from the pixels. Image share as defined by LRP is a measure of source, per word or summed over the whole answer. It is the number every use case below rests on.
What it sees.
The mechanisms we want to read are latent. The vision tower represents what it sees as high-dimensional activation vectors, and those vectors carry no meaning a person can read directly: the features are distributed across thousands of dimensions at once, and no single dimension stands for anything nameable. So we train a sparse autoencoder (SAE) inside the tower that re-expresses each vector as a handful of active concepts, each with a stable identity you can read off its top-activating examples.
where it fired
what it means
where it fired
what it means
where it fired
what it means
where it fired
what it means
where it fired
what it means
where it fired
what it meansWhat mattered.
A single image lights up an enormous number of concepts. On this scene 5,003 distinct concepts switch on across the vision tokens. Presence alone tells you almost nothing: the median active concept contributes essentially zero. Attribution separates the few that drove a specific word from the crowd that merely fired. We integrate relevance along the LRP path to score each concept's signed causal contribution to a chosen output token, here the word “rocky”, so a concept can push toward the word or against it.
Use case · reading (OCR)
Point the same method at text in an image and it becomes a gaze tracker. Both pages below were asked only to transcribe what they show. The Victorian classifieds are the hard case: photographed at an angle, curved at the gutter, set in a dozen competing display faces. Each token the model emits attributes back to the strokes it read, with 61–94% of relevance on the pixels, moving in reading order. The overlays show supporting evidence, so the heatmap indicates where the token came from. The 1890 Fraktur broadsheet is the cleaner scan, and there the same trace runs at 71–97% on the pixels. Note, that by looking at the full heatmap, the model skipped parts of newspaper, and never transcribed it. The trace shows what was read and what was skipped.

“J” · 90% on imageUse case · disaster remote sensing
After a flood, responders point a vision-language model at aerial imagery to work out what happened and where. Here is a post-event tile, asked plainly: “Describe the flood damage visible in this aerial photo.” The model answers “Severe flooding submerges streets, parking lots, and buildings in a commercial area.” Nothing in that sentence tells you whether any of it was read off the picture. The trace does, word by word.
prompt: Describe the flood damage visible in this aerial photo.

Deeper shading = higher image share (evidence from the pixels). Dotted = grammatical glue.
Image share says where a word's evidence came from, not what the model saw there. For that, hover the sentence below. Both flood tiles are here, each word with the region it was read from and the concepts that carried it.


input scenewhat the model generated · hover or tap a word
Severe flooding submerges streets, parking lots, and buildings in a commercial area.
Point at a word to see where the model looked and the relevant concepts.
The second tile also shows the honest texture of the trace. Its downstream words (potential, property, damage) drop to 13–18% image share. The model is inferring consequences there rather than seeing them, and the trace says so.
Now that second tile again, the same pixels, with one word changed in the question: “Describe the fire damage visible in this aerial photo.” The model complies: “Aerial view shows a large fire with visible flames and smoke rising from a residential street.” There is no fire; the tile is flooded. The grounding separates the two answers where the text cannot. The invented words carry the lowest image share in the sentence, fire 28%, flames 24% and smoke 19%, while the words describing what is genuinely there (residential 36%, street 39%) stay grounded.
prompt: Describe the FIRE damage visible in this aerial photo.

Deeper shading = higher image share (evidence from the pixels). Dotted = grammatical glue. Words outlined in red are the fabricated ones. Note that they carry the least image evidence in the sentence.


input scenewhat the model generated · hover or tap a word
Aerial view shows a large fire with visible flames and smoke rising from a residential street.
Point at a word to see where the model looked and the relevant concepts.
It is not that the model is indiscriminately suggestible: on a different flooded scene the same “fire damage” prompt was refused (“no fire damage is visible; the image shows widespread flooding”). The point is that you cannot know which case you are in from the words, only from where they came from with LRP.
A causal approximation.
An explanation is only worth acting on if it reflects the model's real computation. We verify this by ablation: remove exactly what the trace says was important and check that the answer collapses. A faithful method leads to a large drop; an unfaithful one does not. We test in two spaces.
Delete image regions, measure the drop in the predicted answer token · higher = more faithful · n=32
Ablate concepts, measure answer-logit drop · n=16
Summary and conclusion.
Every answer a vision-language model gives is the end of a computation, and that computation can be read in concepts a person understands. Where the model looked, what it saw, what tipped the decision: observable rather than inferred. For a flood assessment that decides where crews and supplies go, “the evidence came from the pixels” and “the evidence came from the word in the prompt” are two different failures with two different fixes, and the image share is what tells them apart.
The signal is already inside every model you run and costs a fraction of one forward pass. LRP is the critical piece, the difference between a story about the model and a faithful trace of it. Reading is the first step; the same signal is what you would act on to flag or correct a decision before it reaches a user.