TL;DR
When Multimodal Large Language Models (MLLMs) inspect an image for tampering, they actually "see" the forgery clearest about three-quarters of the way through their neural layers—only to blur that evidence away at the end while trying to form coherent sentences. The authors discover this "mid-layer forgery evidence peak" and build a lightweight, plug-and-play shortcut called Gated Forensic Memory (GFM) that rescues those crisp mid-layer clues and delivers them straight to the finish line, boosting both detection accuracy and explanations without retraining the base LLM.
What Problem Does This Paper Address?
Asking an MLLM to do image forensics is a bit like asking a witness to describe a crime scene while simultaneously summarizing the plot of a novel. Standard vision–language tasks thrive on semantic aggregation: the deeper an image goes into the language decoder, the more local pixels get smoothed together into high-level, language-friendly concepts ("a green snake on a leaf").
Image forgery detection needs the exact opposite. It relies on fragile, hyper-local, low-amplitude traces—weird boundary discontinuities, subtle inpainting textures, or denoising artifacts. Nearly all existing forensic MLLMs make their final authenticity call and generate explanations from the final decoder layer. The authors ask a fundamental question: by the time representations reach the end of the decoder, have those subtle, pixel-grounded forgery clues been washed out by language-oriented aggregation?
Methods
The paper unfolds in two acts: a forensic diagnostic, followed by a surgical intervention.
First, the Layer-Wise Forgery Evidence Diagnostic. Taking frozen forensic MLLMs (FakeVLM, FakeShield, SIDA), the authors train offline linear probes at every single decoder layer to distinguish real-image vision tokens from tampered-region tokens in fake images. They quantify this linear separability via a metric called the Forgery Separability Score (FSS) (an AUC score). Ground-truth pixel masks are used strictly here to label tokens for the diagnostic probe, never to train the actual model.
Second, motivated by what the probe revealed, they introduce Gated Forensic Memory (GFM)—a hidden-state "evidence relay" bolted onto a frozen LLM:
- Read & Route: At the diagnosed peak layer ($r = \ell^\star$, around layer 22–25 of 32), a lightweight MLP router scores each vision token independently with a continuous probability $p_i \in (0, 1)$, deciding how strongly it needs the relay.
- Re-encode: A separate MLP memory encoder translates those mid-layer states into a representation compatible with deeper layers.
- Zero-Initialized Gated Write-Back: Right before the final decoder block ($\ell_w = L-1$), GFM blends the re-encoded mid-layer evidence with the late-layer vision states via a gated residual update. Because the final write layer is zero-initialized, GFM starts out as a harmless identity map and smoothly learns where to inject forensic clues.
To guide the router without pixel masks, GFM uses image-level binary authenticity heads (supervising both the mid-layer pool and post-injection states) alongside entropy and gate-rate regularizers.
Datasets
No new datasets are introduced; the authors evaluate across seven existing benchmarks covering diverse manipulation styles and generators:
- Detection & Explanation: FakeClue (in-domain), LOKI (cross-generator transfer), and DD-VQA.
- Multi-type Tampering & Synthetic Splits: MMTD-Set (spanning 7 subsets like CASIA1+, IMD2020, and DeepFake) and SID-Set (Real, Fully synthetic, and Tampered splits).
- Cross-Generator & Spatial Alignment: FF++ (FaceForensics++) and DMimage (diffusion-generated images).
Key Insights and Ideas
- The Asymmetric Mid-Layer Peak: Tampered-region tokens become maximally distinguishable around layers 22–25 (out of 32) and lose separability afterward. Crucially, authentic-region tokens within those exact same fake images keep getting stronger right up to layer 32. This proves the model isn't simply "forgetting" visual details globally; rather, localized manipulation traces actively lose a tug-of-war against late-stage semantic aggregation.
- The Vision Encoder Isn't a Detective: Attention maps show the vision encoder focuses on salient foreground objects (like a snake's body) rather than manipulation boundaries. Forensics happens inside the LLM decoder.
- Words Emerge Mid-Stack, Too: Using a logit-lens analysis during text generation, the authors show that words like
"fake"crystallize in the exact same upper-middle layer band before their local visual support degrades in later layers. - Free Localization Without Mask Training: Even though GFM never sees a pixel-level mask during training, its learned token routing probabilities naturally light up tampered regions—turning image-level supervision into emergent spatial localization.
Key Results
- Strong Cross-Generator Gains: Adding GFM to FakeVLM-7B boosts cross-generator LOKI accuracy by +3.7% (to 88.0%) and CLIP semantic explanation similarity by +4.2 points, while pushing in-domain FakeClue accuracy to 99.4%.
- Localized Edits Benefit Most: On SIDA-7B (SID-Set), GFM improves accuracy on locally Tampered images by +2.3%, compared to +0.4% on Fully synthetic images—confirming the relay helps most when evidence is sparse and local.
- Emergent Spatial Alignment: Thresholding GFM's routing weights beats non-routing proxy maps by +8.8 to +10.2 IoU points across six datasets against ground-truth masks.
- Tiny Footprint: On a 7B backbone, GFM adds just 21.0M trainable parameters (0.29%), zero extra vision tokens, and +11.7 ms (+2.7%) latency on an H100 GPU.
- Closing the Gap: Re-probing FakeVLM after adding GFM shows final-layer tampered-token FSS jumping from 0.823 to 0.882, shrinking the late-layer attenuation gap from 0.069 down to 0.010.
Limitations and Future Work
Not discussed in the paper.
Summary updated