Less is More: Fewer Tokens and Blocks Make AIGI Detection Faster and More Generalizable

Haipeng Fang, Yu Li, Yixing Lu, Qiang Sheng, Juan Cao, Sheng TangNeurIPS 2026

TL;DR

When AI-generated image detectors fail to spot fakes from brand-new generators, the usual reflex in machine learning is to add more—more modules, bigger backbones, or extra frequency-domain signals. This paper flips that script, showing that strategically subtracting image patches and neural network layers makes Vision Transformer detectors over twice as fast while actually improving their ability to catch unseen fakes. Sometimes, overthinking an image just obscures the truth.

Figure 1: Illustration of AID-- plugged into Effort. Left: Effort processes all tokens through the full transformer blocks, while AID-- progressively prunes tokens and adaptively exits at earlier blocks. Right: AID-- achieves 2.2× faster inference and +3.6% better generalization on the Genimages.

What Problem Does This Paper Address?

Spotting AI-generated images (AIGI) is a classic cat-and-mouse game. A detector trained on images from one generator (say, Stable Diffusion v1.4) often stumbles when confronted with images from a newer, unseen model (like Midjourney). Why? Because detectors tend to latch onto narrow, dataset-specific shortcuts rather than universal, transferable traces of synthesis.

Historically, researchers have tried to fix this out-of-distribution generalization problem through additions: bolting on spectral branches, computing diffusion reconstruction errors, or scaling up vision-language backbones. Not only does this bloat computational costs, it doesn't necessarily erase old shortcuts—it might just hand the model new, non-transferable ones. The authors ask a refreshing question: instead of piling on complexity, can we make detectors both faster and smarter by removing computation?

Methods

The authors propose AID--, a plug-and-play framework for Vision Transformer (ViT) detectors. They divide a ViT into sequential stages and apply subtraction from two angles: features (tokens) and parameters (transformer blocks).

Overview of the AID-- framework combining Adaptive Block Early-Exit and Progressive Token Reduction.
  1. Progressive Token Reduction (Feature Subtraction): Standard ViT acceleration often prunes image patch tokens that pay little attention to the global classification ([CLS]) token. However, in shallow layers, direct attention maps are noisy. AID-- introduces High-Order Dependency Ranking (HODR): it treats tokens as nodes in a directed graph and propagates [CLS] attention across multiple hops (with a decay factor). This captures both direct and indirect relationships, reliably identifying and dropping redundant or misleading patches before the next stage.
  2. Adaptive Block Early-Exit (Parameter Subtraction): Rather than forcing every image through all 24 layers of a ViT, AID-- attaches exit classifiers at intermediate stages. Standard early-exit training forces shallow heads to mimic the final layer, and uses one confidence threshold for all classes. AID-- introduces two tailored upgrades:
  3. Relative-Advantage Head Supervision (RAHS): After a brief warm-up, training losses are dynamically weighted so each exit head specializes in the specific samples it classifies best, rather than treating the final layer as an infallible teacher.
  4. Class-Asymmetric Exit Rule: Unseen AI fakes are notoriously prone to being misclassified as real photos early on. AID-- sets a super-strict confidence threshold to exit early as "non-AI" ($0.995$), while allowing obvious "AI" catches to exit much more easily ($0.90$).

Datasets

Following standard cross-generator protocols, models are trained strictly on either ProGAN or Stable Diffusion v1.4 (SD-v1.4), and then tested cold on six diverse benchmarks:

  • Standard Benchmarks: UniversalFakeDetect and GenImages (spanning GANs, ADM, GLIDE, Midjourney, VQDM, etc.).
  • In-the-Wild Datasets: Chameleon, CommunityAI, and SocialRF.
  • Treasure-10: A newly curated evaluation subset extracted from the Treasure benchmark, specifically targeting ten recent closed-source generators to test against modern synthesis pipelines.

Key Insights and Ideas

  • More data and depth can actively mislead: In preliminary probes, only 25.6% of test images got their most reliable prediction using 100% of patch tokens, and only 18.4% preferred the final transformer layer! Background patches often trigger false "real image" signals, while deeper ViT blocks become overly biased toward high-level semantics (e.g., "that's definitely a cat") at the expense of subtle synthesis artifacts.
Figure 2: Preliminaries. (a)-(d): Token-reduction and early-exit analyses reveal feature- and parameter-level redundancy, with many samples favoring fewer tokens or earlier exits. (e), (f): Case visualizations show that redundant tokens and blocks can introduce weak or misleading re- sponses. (g), (h): Oracle subtraction yields clearer AI/non-AI separation and higher mAcc, suggesting that removing redundant or misleading computation can improve both efficiency and generalization.
  • Natural division of labor across depth: Thanks to RAHS, early exits naturally learn to catch fakes architecturally similar to the training set (like SD-v1.5 when trained on SD-v1.4), passing weird, unfamiliar generators deeper into the network for closer inspection.
  • Asymmetry prevents premature false negatives: Realizing that unseen fakes masquerade as high-confidence "real" images in shallow layers—and Asymmetric thresholding fixes it—is a delightfully simple, high-leverage insight.

Key Results

Plugged into four existing ViT detectors (DeiT-S, UniFD, Effort, and Simplicity Prevails / SP), AID-- consistently speeds up inference while boosting out-of-distribution accuracy (mAcc):

  • GenImages: Effort + AID-- boosts mAcc by +3.6% (from 0.911 to 0.947) while cutting GFLOPs and boosting FPS by 2.15×.
  • UniversalFakeDetect: UniFD + AID-- jumps from 0.814 to 0.849 mAcc with a 2.38× FPS speedup.
  • Modern Closed-Source Fakes (Treasure-10): Improves Effort's mAcc from 0.694 to 0.711 (1.99× FLOP reduction) and SP's from 0.809 to 0.836 (1.80× FLOP reduction).
  • Robustness: Under heavy JPEG compression and Gaussian blur on Chameleon, Effort + AID-- maintains a +5.9% average accuracy lead over baseline Effort, proving that pruning doesn't strip away resilient forensic cues.

Limitations and Future Work

Not discussed in the paper. (Note: In the provided 10-page main manuscript, the authors do not include a dedicated limitations or future work section; by design, however, the framework is specifically tailored to transformer-based architectures).

Summary updated

Abstract

AI-Generated Image (AIGI) Detection is becoming critical as generative models proliferate, yet existing detectors often generalize poorly by relying on narrow, dataset-specific artifacts. Many prior works improve generalization through additions, such as introducing extra artifact cues, pretraining models, training constraints, or test-time operations, which may increase inference cost and model complexity. In this paper, we take the opposite route and study generalization through subtractions and propose AID--, a plug-and-play framework that improves transformer-based AIGI detectors from both feature and parameter perspectives. At the feature level, we introduce high-order dependency ranking to identify and prune redundant or potentially misleading tokens for progressive token reduction; and at the parameter level, we design relative-advantage head supervision and a class-asymmetric exit rule to train depth-specific early-exit heads. AID-- can be seamlessly integrated into transformer-based AIGI detectors to improve both efficiency and out-of-distribution generalizability, which is experimentally validated across six benchmarks. For example, on GenImages, integrating AID-- into Effort yields a 2.15 times inference speedup and improves generalization accuracy by 3.6%.
BibTeX
@inproceedings{fang2026less,
  author = {Haipeng Fang and Yu Li and Yixing Lu and Qiang Sheng and Juan Cao and Sheng Tang},
  title = {{Less is More: Fewer Tokens and Blocks Make AIGI Detection Faster and More Generalizable}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=l7AUTUgcKZ},
}
Figure