Exploring Compositionality in Vision Transformers using Wavelet Representations
Akshad Shyam Purushottamdas, Pranav K Nayak, Divya Mehul Rajparia, Deekshith Patel, Yashmitha Gogineni, Konda Reddy Mopuri, Sumohana S. Channappayya
TL;DR
The paper investigates whether Vision Transformer embeddings exhibit compositional structure when viewed through input-dependent wavelet primitives. It proposes a post-hoc compositionality framework that uses the Discrete Wavelet Transform (DWT) to generate primitives and learns a composition function $g_{ta}$ to approximate ViT encoder outputs, focusing on the final layer. The results show that one-level DWT primitives enable approximate compositionality, with the learned model outperforming simple addition and remaining robust under distortions such as noise and JPEG compression. This work provides a new lens for interpreting ViT representations and suggests a path toward more explainable and robust vision transformers.
Abstract
While insights into the workings of the transformer model have largely emerged by analysing their behaviour on language tasks, this work investigates the representations learnt by the Vision Transformer (ViT) encoder through the lens of compositionality. We introduce a framework, analogous to prior work on measuring compositionality in representation learning, to test for compositionality in the ViT encoder. Crucial to drawing this analogy is the Discrete Wavelet Transform (DWT), which is a simple yet effective tool for obtaining input-dependent primitives in the vision setting. By examining the ability of composed representations to reproduce original image representations, we empirically test the extent to which compositionality is respected in the representation space. Our findings show that primitives from a one-level DWT decomposition produce encoder representations that approximately compose in latent space, offering a new perspective on how ViTs structure information.
