A short survey on almost orthogonal vectors in a few specific large dimensions
Rami Luisto
TL;DR
The paper addresses the problem of how many ε-almost orthogonal directions can be packed in ℝ^n, with emphasis on embedding-space dimensions used by contemporary transformers. It surveys mathematical preliminaries—volumes, spherical caps, and special functions—then relates these to bounds from the Johnson-Lindenstrauss lemma and spherical codes/sphere packing, augmented by simulations that explore generation methods based on random vectors, random projections, and energy minimization. It finds that pure volume bounds are loose in high dimensions and that JL-type bounds are asymptotic and often not tight for moderate n (e.g., n ≈ 768); in contrast, simulation-based approaches can yield substantially more near-orthogonal directions than the standard basis, with energy-based methods producing characteristic bimodal cosine distributions in lower dimensions. The results illuminate the sizable capacity of high-dimensional embedding spaces to host many almost-orthogonal directions and suggest practical and theoretical avenues for leveraging lossily stored directional structure in AI embedding spaces.
Abstract
The concept of \emph{almost orthogonal vectors}, i.e.\ vectors whose cosine similarity is close to $0$, relates to topics both in pure mathematics and in coding theory under the guises of spherical packing and spherical codes. In recent years the rise of advanced language models in AI has created new interest in this concept as the models seem to store certain concepts as almost orthogonal directions in high-dimensional spaces. In this survey we represent some ideas regarding almost orthogonal vectors through three approaches: (1) the mathematical theory of almost orthogonality, (2) some observations from the embedding spaces of language models, and (3) generation of large sets of almost orthogonal vectors by simulations.
