Vision Transformers have achieved state-of-the-art performance in a wide range of computer vision tasks, but their practical deployment is limited by high computational and memory costs. In this paper, we introduce a novel tensor-based framework for Vision Transformers built upon the Tensor Cosine Product (Cproduct). By exploiting multilinear structures inherent in image data and the orthogonality of cosine transforms, the proposed approach enables efficient attention mechanisms and structured feature representations. We develop the theoretical foundations of the tensor cosine product, analyze its algebraic properties, and integrate it into a new Cproduct-based Vision Transformer architecture (TCP-ViT). Numerical experiments on standard classification and segmentation benchmarks demonstrate that the proposed method achieves a uniform 1/C parameter reduction (where C is the number of channels) while maintaining competitive accuracy.
Figures & tables
Symbol
Description
Himg,Wimg
Image height and width
C
Number of image channels (tube dimension)
P
Patch side length
N=HimgWimg/P2
Number of patches (tokens)
d=P2
Spatial embedding dimension per frontal slice
deff=d⋅C
Effective (flattened) embedding dimension
Table 1: Summary of notation used throughout the paper.
Projection
TCP-ViT weight tensor
Std-ViT weight matrix
WQ,h
Rd×dh×C
RdC×dhC
WK,h
Rd×dh×C
RdC×dhC
WV,h
Rd×dh×C
RdC×dhC
WO
Rd×d×C
RdC×dC
Table 2: MHSA weight dimensions. Each projection is listed per head; the total count sums over all H heads.
Projection
TCP-ViT weight tensor
Std-ViT weight matrix
W1
Rd×dff×C
RdC×dffC
W2
Rdff×d×C
RdffC×dC
Table 3: FFN weight dimensions for TCP-ViT and standard ViT.
Component
TCP-ViT tensor size
TCP-ViT params
Std params
Ratio
WQ,h ( ×H )
Rd×dh×C
d2C
d2C2
1/C
WK,h ( ×H )
Rd×dh×C
d2C
d2C2
1/C
WV,h ( ×H )
Rd×dh×C
d2C
d2C2
1/C
WO
Rd×d×C
d2C
d2C2
1/C
MHSA total
—
4d2C
4d2C2
1/C
W1
Rd×dff×C
rffd2C
rffd2C2
1/C
Table 4: Per-layer parameter comparison between TCP-ViT and standard ViT. Input tensor X∈RN×d×C , standard input X∈RN×dC . Expansion ratio rff , H heads, dh=d/H , dff=rffd .
Dataset
Std-ViT (%)
TCP-ViT (%)
Δ
Std Params
TCP-ViT Params
CIFAR-10
61.8
63.6
+1.8
119,194
43,114
SVHN
49.8
63.8
+14.0
119,194
43,114
STL-10
52.5
55.9
+3.4
119,194
43,114
Parameter ratio
0.362× (theoretical: 0.333× )
Table 5: Classification accuracy on subsampled datasets (10K train / 2K test). TCP-ViT uses 0.362× the parameters of Std-ViT (theoretical: 1/C=0.333× ).
Dataset
Std-ViT (%)
TCP-ViT (%)
Δ
Param ratio
CIFAR-10 (full)
78.7
73.4
−5.3
0.362×
Table 6: Classification accuracy on full CIFAR-10 (50K train / 10K test, 200 epochs). TCP-ViT retains 93.3% of performance with 36.2% of the parameters.
Component
Std-ViT
TCP-ViT
Ratio
Total
1,570,978
751,586
0.478×
Backbone
1,275,072
455,680
0.357×
Transformer Encoder(s)
1,188,480
402,048
0.338×
Embeddings & Tokens
86,592
53,632
0.619×
CNN Decoder
295,906
295,906
1.000×
Table 7: Parameter breakdown for segmentation. The Transformer encoder achieves 0.338× , closely matching the theoretical 1/C=0.333× .
Fig. 1: Parameter distribution. (a) Total parameters: TCP-ViT uses 0.478× of Std-ViT. (b) Stacked breakdown. (c) Component-level comparison.
Metric
Std-ViT
TCP-ViT
Δ
mIoU (%)
87.8
86.8
−1.0
mDice (%)
93.5
92.9
−0.6
Pixel Acc. (%)
94.2
93.6
−0.6
IoU: Background
84.0
82.7
−1.3
IoU: Foreground (Pet)
91.7
90.9
−0.8
Dice: Background
91.3
90.5
−0.8
Table 8: Segmentation performance on Oxford-IIIT Pet. TCP-ViT retains 98.9% of the mIoU with 2.09× fewer parameters. Δ denotes the absolute difference (TCP-ViT − Std-ViT).
Fig. 2: Training dynamics. (a) Training loss, (b) validation loss, (c) mIoU. TCP-ViT (blue) closely tracks Std-ViT (red) with a stable ∼1% gap.
Fig. 3: Normalized confusion matrices. Both models show strong diagonal dominance.
Fig. 4: Qualitative results. Columns: input, ground truth, Std-ViT, TCP-ViT. Green overlay: foreground. Per-image mIoU shown on each prediction.
Fig. 5: Error maps. Green = correct, red = error, gray = ignored. Errors are concentrated at boundaries for both models.
Fig. 6: Efficiency trade-off: parameters vs. mIoU. The dashed arrow indicates the compression direction.
Vision transformers have recently made a breakthrough in computer vision showing excellent performance in terms of precision for numerous applications. However, their computational cost is very high compared to alternative approaches such as Convolutional Neural Networks. To address this problem, we propose a novel framework for image classification called RAViT based on a multi-branch network that operates on several copies of the same image with different resolutions to reduce the computational cost while preserving the overall accuracy. Furthermore, our framework includes an early exit mechanism that makes our model adaptive and allows to choose the appropriate trade-off between accuracy and computational cost at run-time. For example in a two-branch architecture, the original image is first resized to reduce its resolution, then a prediction is performed on it using a first transformer and the resulting prediction is reused together with the original-size image to perform a final prediction on a second transformer with less computation than a classical Vision transformer architecture. The early-exit process allows the model to make a final prediction at intermediate branches, saving even more computation. We evaluated our approach on CIFAR-10, Tiny ImageNet, and ImageNet. We obtained an equivalent accuracy to the classical Vision transformer model with only around 70% of FLOPs.
Martial Guidez, Stefan Duffner, Christophe Garcia
INSA Lyon, CNRS, Université Claude Bernard Lyon 1, LIRIS, UMR5205, 69621 Villeurbanne, France
This paper introduces Multidimensional Task Learning (MTL), a unified mathematical framework based on Generalized Einstein MLPs (GE-MLPs) that operate directly on tensors via the Einstein product. We argue that current computer vision task formulations are inherently constrained by matrix-based thinking: standard architectures rely on matrix-valued weights and vectorvalued biases, requiring structural flattening that restricts the space of naturally expressible tasks. GE-MLPs lift this constraint by operating with tensor-valued parameters, enabling explicit control over which dimensions are preserved or contracted without information loss. Through rigorous mathematical derivations, we demonstrate that classification, segmentation, and detection are special cases of MTL, differing only in their dimensional configuration within a formally defined task space. We further prove that this task space is strictly larger than what matrix-based formulations can natively express, enabling principled task configurations such as spatiotemporal or cross modal predictions that require destructive flattening under conventional approaches. This work provides a mathematical foundation for understanding, comparing, and designing computer vision tasks through the lens of tensor algebra.
Alaa El Ichi, Khalide Jbilou
Université du Littoral Cote d’Opale, LMPA, 50 rue F. Buisson, 62228 Calais-Cedex, France.
We introduce JetViT, a novel family of hybrid-architecture Vision Transformer (ViT) models that match the accuracy of state-of-the-art full-attention vision foundation models while achieving substantially higher inference efficiency on high-resolution images. At the core of our approach is Post-Training Attention Search, a post-training acceleration framework that converts pre-trained full-attention ViTs into efficient hybrid-attention variants by identifying and replacing redundant full-attention blocks with linear or window-attention blocks. By inheriting the MLP and attention weights from the base model, Post-Training Attention Search efficiently explores the architectural design space through three key steps: (1) optimizing the linear-attention block design; (2) finding the best combination of linear-attention and window-attention blocks; and (3) identifying and preserving critical full-attention blocks. We evaluate JetViT on two representative high-resolution vision foundation models, DINOv3 and DepthAnythingV2. On the NVIDIA H100 GPU, JetViT achieves up to 1.79x higher throughput and up to 44.81% lower latency without sacrificing accuracy. We will release our code and accelerated ViT models soon.