SourceMemorization Capacity of Multi-Head Attention in Transformers
The paper measures the Kruskal rank of query vectors and the linear independence of context vectors in a ViT pre-trained on ImageNet, tested on 2000 ImageNet images. At the embedding layer, the Kruskal rank of query vectors is below the context size n, violating the paper's assumption 1. After one self-attention layer, the Kruskal rank exceeds n, satisfying assumption 1. The general position assumption (Kruskal rank equal to d) fails at every depth, with the Kruskal rank being only slightly above n and much smaller than d. This depth-dependent emergence of query diversity is what enables the paper's memorization theorem to apply to the second attention layer.