Decomposing Query-Key Feature Interactions Using Contrastive Covariances
Despite the central role of attention heads in Transformers, we lack tools to understand why a model attends to a particular token. To address this, we study the query-key (QK) space -- the bilinear joint embedding space between queries and keys. We present a contrastive covariance method to decompose the QK space into low-rank, human-interpretable components. It is when features in keys and queries align in these low-rank subspaces that high attention scores are produced. We first study our method both analytically and empirically in a simplified setting. We then apply our method to large language models to identify human-interpretable QK subspaces for categorical semantic features and binding features. Finally, we demonstrate how attention scores can be attributed to our identified features.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
A Constrained Matrix-Variate Gaussian Process for Transposable Data
Transposable data represents interactions among two sets of entities, and are typically represented as a matrix containing the known interaction values. Additional side information may consist of feature vectors specific…
Recommendation SystemsDental CLAIRES: Contrastive LAnguage Image REtrieval Search for Dental Research
Learning about diagnostic features and related clinical information from dental radiographs is important for dental research. However, the lack of expert-annotated data and convenient search tools poses challenges. Our p…
DiagnosticImage RetrievalRepresentation LearningRetrievalCUBE: Contrastive Understanding by Balanced Experiments
Post-hoc explanation depends on how model queries are organized. We propose CUBE, a design-based framework that explains a trained predictive model through balanced low--high probes. Selected variables define factors, de…
DeCo: Decomposition and Reconstruction for Compositional Temporal Grounding via Coarse-To-Fine Contrastive Ranking
Understanding dense action in videos is a fundamental challenge towards the generalization of vision models. Several works show that compositionality is key to achieving generalization by combining known primitive el…
Boundary DetectionSentenceSensor Query Schedule and Sensor Noise Covariances for Accuracy-constrained Trajectory Estimation
Trajectory estimation involves determining the trajectory of a mobile robot by combining prior knowledge about its dynamic model with noisy observations of its state obtained using sensors. The accuracy of such a procedu…