TOAST: Transformer Optimization using Adaptive and Simple Transformations

Irene Cannistraci, Emanuele Rodolà, Bastian Rieck, Sutter, Thomas M., Rodolà, Emanuele, Rieck, Bastian, Vogt, Julia E. · DOI

Abstract

Foundation models achieve State-of-the-Art (SOTA) performance across different tasks, but their size and computational demands raise concerns about accessibility and sustainability. Existing efficiency methods often require additional retraining or fine-tuning, limiting their practicality. Recent findings suggest that deep neural networks exhibit internal representation similarities. While such similarities across different models have been exploited for enabling techniques such as model stitching and merging, intra-network redundancy remains underexplored as a source for efficiency gains. In this paper, we introduce TOAST (Transformer Optimization using Adaptive and Simple Transformations), a framework that exploits these redundancies to approximate entire transformer blocks with lightweight closed-form mappings, such as linear transformation or even the identity, without any additional training. Across SOTA pretrained vision models (e.g., ViT, DINOv2, DeiT) and datasets ranging from MNIST to ImageNet-1k, TOAST reduces parameters and computation while preserving, and in some cases improving, downstream performance. These results show that large portions of transformer depth can be replaced by trivial functions, opening a new perspective on efficient foundation models.

Introduction

As Vision Transformers (ViTs) and other foundation models scale, their deployment on resource-constrained edge devices becomes increasingly difficult. Traditional efficiency techniques—pruning, distillation, and quantization—often necessitate expensive retraining cycles to recover performance. TOAST (Transformer Optimization using Adaptive and Simple Transformations) introduces a training-free alternative by identifying and exploiting intra-network redundancy. By replacing sequences of redundant transformer blocks with simple linear or identity mappings, TOAST significantly reduces computational overhead without requiring backpropagation.

Methodology

The TOAST framework follows a systematic three-step process to optimize pre-trained models:

  1. Similarity Analysis: Using Centered Kernel Alignment (CKA), the internal representations of the model are analyzed. High CKA scores between non-adjacent layers indicate "blocks" of redundancy where the feature representation remains relatively static.
  2. Block Approximation: Identified redundant segments (from a starting block $s$ to an ending block $e$) are bypassed.
  3. Closed-Form Shortcuts: The bypassed segment is replaced by a transformation $T$. This can be a simple Identity mapping or a Linear translator. The linear mapping is computed using a closed-form least-squares solution on a small calibration set (typically 500 samples), making the process extremely fast and data-efficient.
The TOAST framework replaces a sequence of transformer blocks with a simple transformation T.

Key Insights and Redundancy Analysis

A central finding of this work is that similarity patterns within a model are largely intrinsic to the architecture and pre-trained weights. As shown in the CKA heatmaps across various datasets, the redundancy structures remain remarkably consistent whether the model processes MNIST or ImageNet-1k. This suggests that "shortcuts" discovered on one dataset are often transferable.

CKA similarity heatmaps for DINO-B and DeiT-S across different datasets, revealing consistent intra-network redundancy.

Furthermore, the results suggest that large portions of a Transformer’s depth contribute minimally to transforming the representation. In some cases, approximating the final block of a model like DeiT-S actually improved accuracy, suggesting the original block might have been over-processing or adding noise.

Experimental Results

The authors evaluated TOAST on models like ViT-L, DINOv2, and DeiT-S across benchmarks ranging from MNIST to ImageNet-1k.

  • Efficiency Gains: For ViT-L on ImageNet-1k, replacing blocks 17–23 with a linear map removed 69.3 million parameters and improved throughput by nearly 30% (from 1223 to 1578 images/sec), with a minimal 1.16% accuracy drop.
  • Performance Preservation: In several instances, TOAST actually improved performance. On CIFAR-100, a ViT-L model with an approximated block $21 \rightarrow 22$ saw a 0.46% accuracy increase.
  • Data Efficiency: Stable approximations were achieved using only 500 random samples, highlighting the framework's practicality for scenarios with limited data.

Conclusion and Future Work

TOAST demonstrates that significant portions of Transformer depth are redundant and can be replaced by trivial functions. While currently focused on Vision Transformers and manual block selection via CKA heatmaps, future research will explore automated block selection and the application of TOAST to Large Language Models (LLMs). This work opens a new avenue for creating efficient foundation models by rethinking the necessity of every layer in a deep network.

Summary updated

BibTeX
@article{cannistraci2026toast,
  author = {Irene Cannistraci and Emanuele Rodolà and Bastian Rieck and Sutter, Thomas M. and Rodolà, Emanuele and Rieck, Bastian and Vogt, Julia E.},
  title = {{TOAST: Transformer Optimization using Adaptive and Simple Transformations}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2026},
}
Figure