Strato per strato, modulo per modulo: scegliere entrambi per un'ottimale analisi OOD di ViT
Layer by layer, module by module: Choose both for optimal OOD probing of ViT
March 5, 2026
Autori: Ambroise Odonnat, Vasilii Feofanov, Laetitia Chapel, Romain Tavenard, Ievgen Redko
cs.AI
Abstract
Recenti studi hanno osservato che gli strati intermedi dei modelli di base spesso producono rappresentazioni più discriminative rispetto allo strato finale. Sebbene inizialmente attribuito alla pre-addestramento autoregressivo, questo fenomeno è stato identificato anche in modelli addestrati tramite obiettivi supervisionati e di auto-supervisione discriminatoria. In questo articolo, conduciamo uno studio completo per analizzare il comportamento degli strati intermedi in transformer per la visione pre-addestrati. Attraverso ampi esperimenti di linear probing su un insieme diversificato di benchmark per la classificazione di immagini, scopriamo che lo shift di distribuzione tra i dati di pre-addestramento e quelli downstream è la causa principale del degrado delle prestazioni negli strati più profondi. Inoltre, eseguiamo un'analisi granulare a livello di modulo. Le nostre scoperte rivelano che il probing standard sugli output dei blocchi del transformer è subottimale; invece, il probing dell'attivazione all'interno della rete feedforward produce le migliori prestazioni in presenza di uno shift di distribuzione significativo, mentre l'output normalizzato del modulo di multi-head self-attention è ottimale quando lo shift è debole.
English
Recent studies have observed that intermediate layers of foundation models often yield more discriminative representations than the final layer. While initially attributed to autoregressive pretraining, this phenomenon has also been identified in models trained via supervised and discriminative self-supervised objectives. In this paper, we conduct a comprehensive study to analyze the behavior of intermediate layers in pretrained vision transformers. Through extensive linear probing experiments across a diverse set of image classification benchmarks, we find that distribution shift between pretraining and downstream data is the primary cause of performance degradation in deeper layers. Furthermore, we perform a fine-grained analysis at the module level. Our findings reveal that standard probing of transformer block outputs is suboptimal; instead, probing the activation within the feedforward network yields the best performance under significant distribution shift, whereas the normalized output of the multi-head self-attention module is optimal when the shift is weak.