Skip to main content
Back

ForensicZip Cuts 90% of AI Tokens Without Breaking Deepfake Detection

A training-free method keeps only 10% of visual tokens in deepfake detectors while preserving accuracy, cutting FLOPs by over 90%.

Pro

  • ForensicZip is a training-free token pruning method for forensic vision-language models, achieving 2.97x speedup at 10% token retention.
  • It models inter-frame token flow as a Birth-Death Optimal Transport problem with a dummy node to isolate generative artifacts.
  • A Laplacian high-frequency prior modulates transport scores, filtering out benign camera motion from real manipulation traces.
  • At 10% retention, semantic pruners like FastV collapse to 60% accuracy on FakeClue while ForensicZip holds 97.74%.
  • FLOPs drop over 90% and peak GPU memory falls from 26.7 GB to 18.5 GB on LLaVA-OneVision-7B.
  • Code is available at github.com/laiyingxin2/ForensicZip, working with FakeVLM, FakeShield, SIDA, and LLaVA-OneVision.

Deepfake detectors built on multimodal LLMs have a scaling problem. To catch subtle manipulation traces they need to chew through high-resolution frames or entire video streams, and each frame explodes into hundreds or thousands of visual tokens that the language model has to attend over. A team from Great Bay University, Shenzhen University, HIT, and Sun Yat-sen University just proposed ForensicZip, a training-free token pruning method that throws away 90% of those tokens without losing forensic accuracy, delivering a 2.97x speedup on standard forensic backbones.

Why standard token pruning is the wrong tool

Visual token pruning is now a well-worn trick for accelerating vision-language models. Methods like FastV, SparseVLM, LLaVA-Scissor, and VisionTrim rank tokens by semantic salience, typically using cross-modal attention or vision-language similarity, and drop the low-scoring ones. That works fine when the task is captioning or VQA where the answer depends on the salient object.

Forgery detection breaks that assumption. Key manipulation cues such as high-frequency noise patterns, subtle blending seams, or transient temporal jitters tend to be weakly correlated with object-level semantics and are often distributed in visually flat regions that semantic criteria treat as redundant. The authors quantify this with a striking measurement: cross-modal attention magnitude is inversely correlated with spatial overlap with ground-truth forgery masks. In other words, the tokens that semantic pruners keep are almost exactly the ones a forensic model does not need, and the tokens they discard often contain the fingerprint of the fake.

The empirical damage is real. At an aggressive 10% retention ratio, FastV collapses to around 60% accuracy on FakeClue and SparseVLM to roughly 66%, both close to random. Even the newer VisionTrim degrades to 84%. Meanwhile the full-token baseline sits at 98.6%.

Plots showing inverse correlation between semantic saliency and forgery evidence, plus temporal transport cost distributions

Reframing forgery as broken physics

The core insight is that generative models produce frames that look convincing individually but violate physical continuity across frames. In the token feature space this shows up as tokens that appear from nowhere or vanish without a corresponding predecessor. The paper calls these Birth and Death events.

To surface them, ForensicZip models the flow of tokens between consecutive frames as an optimal transport (OT) problem. Optimal transport, in this context, is a way of finding the cheapest global matching between two sets of items (source tokens in frame t-1 and target tokens in frame t) given a cost function, here cosine distance between token embeddings. Standard balanced OT forces every token to match something, which is exactly the wrong behavior for detecting artifacts. Balanced OT enforces strict mass conservation, forcing every target token onto a real source and smearing the anomaly across many small residuals.

The fix is to augment the cost matrix with a dummy node that acts as a slack sink. Tokens without a plausible predecessor can route their mass through the dummy at a fixed penalty c_birth, concentrating the anomaly in a single interpretable score instead of diluting it. The transport plan is solved with 20 Sinkhorn iterations per frame pair, an entropic regularizer of 0.1, and birth/death penalties of 0.35.

ForensicZip architecture diagram showing transport novelty estimation and forensic scoring

Combining temporal novelty with a frequency prior

Transport cost alone would flag legitimate camera pans as forgery because the tokens genuinely shift. To disambiguate, ForensicZip multiplies the temporal score with a spatial term derived from a fixed 3x3 Laplacian filter applied to the frame and pooled onto the patch grid. Natural motion moves textures around but doesn't invent new high-frequency content, whereas generation pipelines leave aliasing, spectral gaps, and blending discontinuities.

The final per-token score is a product of two factors, implementing what the authors call a soft AND gate:

  • A temporal anomaly term combining transport cost and Birth evidence
  • A spatial modulation term based on high-frequency Laplacian response

Tokens are then ranked and the top K per frame are physically dropped, so both attention and FFN layers benefit. Ablations confirm the isotropic Laplacian outperforms directional filters like Sobel by about 1.6 points, suggesting generative artifacts are non-directional.

Results at aggressive compression

The gap between ForensicZip and semantic baselines widens as more tokens get pruned. At 10% retention across FakeVLM and FakeShield backbones:

  • FakeClue accuracy: 97.74% vs 84.53% for VisionTrim and 78.25% for LLaVA-Scissor
  • LOKI accuracy: 82.15% vs 70.84% for VisionTrim
  • DFFD accuracy: 95.62% vs 82.24% for VisionTrim
  • End-to-end latency drops from 4520 ms to 1520 ms per sample
  • Peak GPU memory falls from 26.7 GB to 18.5 GB
  • FLOPs drop from 3.10T to 0.45T

An interesting side result on the POPE object hallucination benchmark: ForensicZip actually slightly improves vanilla LLaVA-1.5 accuracy (86.1 vs 85.9) at 64 tokens, which the authors credit to removing redundant semantic noise that otherwise pulls attention toward irrelevant context.

When to reach for it

ForensicZip is training-free and plug-and-play, and the authors validate it on LLaVA-OneVision-7B, SIDA-7B/13B, FakeVLM, and FakeShield. If you're running a forensic MLLM pipeline on high-resolution images or video and the prefill stage is your bottleneck, it's a drop-in replacement for existing pruners like FastV or SparseVLM. Code is available on the project's GitHub.

The caveats are worth noting. The method targets forgery detection specifically, so the transport-plus-frequency scoring is not a general-purpose token pruner for arbitrary VLM tasks (though the POPE result hints at broader utility). It also requires at least two frames for the temporal transport pathway; for single images it falls back to a mean-embedding spatial novelty score. And the Sinkhorn solver adds a small quadratic cost per frame pair, though this is dwarfed by the transformer savings.

The broader takeaway is that pruning criteria should match the downstream task. Semantic saliency has been the default because captioning and VQA rewarded it, but for tasks where the signal is anti-semantic (forensics, anomaly detection, industrial inspection), reformulating token importance around physical inconsistency rather than object salience can unlock aggressive compression that would otherwise destroy accuracy.