Activation Similarity in Neural Representations
- Activation Similarity is a concept that quantifies relational patterns between neural activations using measures like cosine similarity, Fisher metrics, and representational dissimilarity matrices.
- It is applied in tasks such as metric learning, knowledge distillation, and pruning, demonstrating improvements in model localization, IoU, and accuracy metrics.
- Recent research leverages activation similarity to compare models, optimize training processes, and align neural representations with human perceptual structures.
Searching arXiv for the specified and closely related papers on activation similarity. Activation Similarity (AS) denotes a family of representational ideas in which similarity between activations, embeddings, activation-derived maps, or activation geometries is itself treated as the explanatory object. Across recent work, AS appears as channel-wise similarity between paired image embeddings in metric learning, pairwise similarity structure over multivariate neural responses, preservation of example–example activation relations in knowledge distillation, cosine similarity between dense and pruned layer outputs in LLM pruning, overlap of highly activated feature indices in semi-supervised segmentation, and reasoning-feature directions induced by natural-language prefixes in LLMs (Liao et al., 2 Jun 2025, Tung et al., 2019, 2505.21987, Levi et al., 5 Jul 2026).
1. Conceptual scope
AS is not a single standardized metric. Some papers define an explicit similarity measure, such as the dot-product Gram matrices of Similarity-Preserving Knowledge Distillation, the cosine-based LLMDcos metric over parameter-activation vectors, or the Spectral Riemannian Alignment Score over Fisher-geometry summaries; other papers use activation similarity more conceptually, as the relationship between activation-based category membership and embedding-based semantic proximity, or as pairwise similarity between query and support embeddings in metric learning (Tung et al., 2019, Wang et al., 2024, Pichat et al., 2024, Yavari et al., 4 May 2026).
A recurring distinction in the literature is between three levels of analysis. At the first level, AS is a pairwise relation between individual examples, such as cosine similarity between word activations, Euclidean proximity between embeddings, or overlap in top- activated feature indices. At the second level, AS is a representational geometry over many stimuli, typically summarized by a representational dissimilarity matrix (RDM) or a similarity matrix over a mini-batch. At the third level, newer work treats AS as a property of local sensitivity geometry, replacing point-cloud alignment by expected projected pullback or Fisher metrics defined over a specified stimulus-coordinate subspace (Wardle et al., 2015, Tung et al., 2019, Yavari et al., 4 May 2026).
An adjacent unifying viewpoint treats activation functions and attention mechanisms themselves as structurally similar. In that formulation, both operate as multiplicative non-linear gates, , with scalar activations corresponding to non-context-aware gating and attention corresponding to context-aware gating; ATAC units instantiate local channel attention as an activation layer (Dai et al., 2020). This does not define AS between examples, but it places activation and attention in a common gating formalism.
2. Pairwise similarity as an explanation signal
In metric learning, AS is often tied directly to pairwise embedding comparison rather than to classifier logits. Similar Feature Activation Map (SFAM) was introduced for CNN-based metric learning models that lack a fully connected classifier, and replaces class-score-based explanation by similarity-based explanation. Given pooled embeddings and for a query and support image, SFAM defines a channel-wise contribution importance score (CIS) from the embedding similarity. In the Euclidean case,
and
The final map is then a weighted channel sum,
with an analogous cosine-similarity variant based on -normalized embeddings (Liao et al., 2 Jun 2025).
The conceptual shift is from the question “which regions support class ?” to the question “which regions support high similarity between embeddings and 0?” In experiments on CUB-200 with bounding-box localization, SFAM achieved the best localization scores in both Euclidean and cosine settings. For FRN with ResNet12 and Euclidean distance, SFAM obtained IoU 1 and Accuracy 2, compared with Grad-FAM at IoU 3 and Accuracy 4. For GPW with ResNet50 and cosine similarity, SFAM obtained IoU 5 and Accuracy 6, outperforming Grad-FAM and Decomposition. A sanity check based on progressive parameter randomization showed that the maps lose structure as more layers are randomized, indicating sensitivity to the learned embedding geometry rather than to input statistics alone (Liao et al., 2 Jun 2025).
A related retrieval formulation appears in domain-invariant visual localization, where similarity itself is treated as a differentiable score over feature maps. There the similarity between two feature maps 7 and 8 is defined by averaged channel-wise cosine similarity, channel weights are computed as
9
and the Similarity Activation Map is
0
The associated Grad-SAM loss enforces consistency between similarity activation maps across translated domains, and the resulting coarse-to-fine retrieval system improved medium- and high-precision localization under illumination, seasonal, and weather variation (Hu et al., 2020).
These pairwise explanation methods share a common property: the explanation is inherently relational. They explain why one example is close to another example or to a prototype, rather than providing a global class explanation. This pairwise character is a feature in metric learning and retrieval, but it also constrains direct comparison with CAM-style class-specific explanations (Liao et al., 2 Jun 2025).
3. Representational geometry across stimuli, brains, and models
In neuroscience-oriented work, AS is often defined at the level of representational geometry rather than individual channels. In MEG studies of perceptual similarity, each stimulus at time 1 is represented by a multivariate activation vector, and the representational dissimilarity between stimuli is derived from pairwise decodability. Low 2-prime implies high activation similarity, and high 3-prime implies low activation similarity. The resulting time-resolved MEG RDM is compared with model RDMs, including a perceptual RDM obtained from human similarity ratings on a 4–5 scale, using Kendall’s tau-a (Wardle et al., 2015).
This framework revealed a temporal transition in activation similarity structure. A retinal-envelope model and the perceptual model both became significant at about 6 ms, but the retinal model peaked at about 7 ms and then declined sharply, whereas the perceptual model peaked at about 8 ms and from approximately 9 ms tracked the lower bound of the noise ceiling. Orientation disparity and radial preference models never significantly correlated with the MEG RDMs. The result was interpreted as evidence that large-scale MEG activation patterns evolve from retinotopic and contrast-driven similarity to a Gestalt-like geometry in which neural representational distance mirrors human perceptual similarity (Wardle et al., 2015).
A related but cross-system use of AS appears in Human-Model Similarity (HMS), which compares human inferior temporal cortex and neural networks by correlating their RDMs. The model side uses PredNet internal activations, with pairwise dissimilarity defined by correlation distance,
0
and HMS is Spearman correlation between vectorized model and human RDMs. Across 95 hyperparameterized PredNet models, higher HMS correlated with better next-frame prediction and object matching. The ten highest-HMS models had HMS 1, next-frame MSE 2, and object-matching accuracy 3, whereas the ten lowest-HMS models had HMS 4, MSE 5, and accuracy 6. HMS also stabilized early enough to function as an early-stopping signal (Blanchard et al., 2018).
Under this geometric view, AS is not simply closeness between two activations. It is the structure of pairwise similarities over a stimulus set, and it can be used to compare humans and models, multiple models, or different processing stages within a single system (Wardle et al., 2015, Blanchard et al., 2018).
4. Similarity-preserving training, pruning, and calibration
One major use of AS is as an optimization target. In Similarity-Preserving Knowledge Distillation, teacher and student feature maps are flattened into per-example vectors, assembled into matrices 7 and 8, and converted into similarity matrices
9
After row-wise 0-normalization, distillation minimizes the Frobenius discrepancy
1
The student is therefore not required to reproduce the teacher’s feature basis; it is required to preserve the teacher’s pairwise similarity structure over examples. On CIFAR-10, DTD, and CINIC-10, this similarity-preserving objective improved over label-only training and complemented logit-based KD and attention transfer (Tung et al., 2019).
In LLMs, AS has also been defined over parameter-activation patterns rather than hidden states. A gradient-based activation score for parameter 2 on data 3 is given by
4
and LLMDcos measures cosine similarity between the corresponding activation vectors:
5
Layer-wise LLMDcos showed that shallow layers have more similar activation behavior across domains, whereas deep layers separate domains and track empirical data relevance. On STS-B and SICK, deep-layer LLMDcos correlated with human semantic similarity; for example, Llama2-7B reached Spearman 6 on STS-B and 7 on SICK (Wang et al., 2024).
A more direct pruning formulation uses cosine similarity between dense and pruned activations as an importance criterion. ACE defines a cosine-similarity loss for removing 8,
9
and combines this with an activation-variance term to preserve token-level semantic distinctions after pruning. The combined framework improved both pruning quality and calibration efficiency, with reported gains of up to an 0 reduction in perplexity and up to a 1 decrease in pruning time on LLaMA, LLaMA-2, and OPT (2505.21987).
Taken together, these results show that AS can function as a preservation objective, a compression criterion, and a calibration-efficient proxy for semantic retention. This suggests that the geometry of activation relations can be more stable or more useful than direct feature matching in settings where representation spaces differ or where reconstruction is too costly (Tung et al., 2019, 2505.21987).
5. Token-, feature-, and category-level formulations
At finer granularity, AS is often defined between words, pixels, or neuron-selected tokens. In BERT-based paragraph similarity, BTI represents each paragraph by the average of last-layer contextual token activations,
2
and defines word-level activation similarity as cosine similarity between contextualized word vectors. The explanatory score for a cross-paragraph word pair is
3
where 4 is word-level activation similarity and 5 are saliency scores derived from gradients of paragraph-level cosine similarity with respect to input embeddings. In human evaluation, the full BTI method achieved Mean Opinion Score 6, compared with 7 for Vanilla Gradients, 8 for Integrated Gradients, and 9 for a TF-IDF-plus-word2vec baseline. Parameter-randomization tests degraded the explanations, indicating dependence on learned representations (Malkiel et al., 2022).
In semi-supervised segmentation, AS is formulated as structural similarity between a pixel feature and a class prototype. Prototypes are means of penultimate-layer pixel embeddings from labeled pixels and reliable pseudo-labeled pixels. Similarity is then defined by overlap between the top-0 highest-magnitude feature indices of a pixel and its class prototype:
1
where 2 is the number of common indices in the two top-3 sets and 4 in all experiments. This rank-statistics similarity is used as a per-pixel weight for the unsupervised loss. Reliable pseudo-label pixels are determined by agreement between a teacher segmentation model and a Faster R-CNN detector, plus a confidence threshold. The method improved several semi-supervised segmentation frameworks; on Pascal VOC, 1/16-label Classic, UniMatch improved from 5 to 6 mIoU and U2PL from 7 to 8 (Howlader et al., 2024).
A different single-neuron formulation appears in work on synthetic cognition in GPT-2XL. For each neuron, the 100 most highly activated tokens are sorted by mean activation, and cosine similarity is measured between successive tokens in the rank order. The central empirical pattern is “categorical convergence of highly activated tokens”: as activation increases, successive core tokens become more similar in embedding space. Linear regression yields positive slopes for 9–0 of neurons, Spearman correlation is positive for 1–2, and mean cosine is higher for high-activation pairs than for low-activation pairs in about 3–4 of neurons. This is interpreted as evidence that a neuron’s category is a superposition of categorical sub-dimensions, so very high activation occurs near intersections of several sub-categories (Pichat et al., 2024).
These formulations share a common logic. AS is not merely a distance between raw vectors; it is often a task-specific relation between high-value coordinates, contextualized token embeddings, or activation-ranked category members. The representation of similarity is therefore inseparable from the chosen unit of analysis.
6. Limits of raw alignment and current directions
Recent work has made explicit that raw activation alignment can be weak or misleading unless it is tied to the relevant reasoning feature. Mining via Activation Geometry (MAG) defines a prefix-induced shift
5
and the associated reasoning-feature direction
6
Across eight MAG operators, the key finding is that ordinary similarity between unprefixed activations is almost unrelated to downstream dataset-selection performance for prompt-injection probes, whereas reasoning-feature-direction-based similarity is highly predictive. The best class-conditional triple of similarity predictors reached 7 Top-1 and 8 Top-2 dataset-selection accuracy. The same framework also showed that some features, such as desert, ocean, and Bob-style contextual features, are more linearly represented than prompt-injection features, and that class-mean directions can steer yes/no decisions by activation injection (Levi et al., 5 Jul 2026).
An even stronger critique comes from work on local sensitivity geometry. There, standard activation-alignment measures such as RSA, CCA, and CKA are interpreted as assessing agreement between optimal linear readouts over broad families of global tasks, but not as determining how a system uses local stimulus evidence. The proposed alternative summarizes each representation by an expected projected pullback or Fisher metric over a chosen stimulus-coordinate subspace and compares these summaries with a log-spectral distance on the manifold of symmetric positive definite matrices, yielding the Spectral Riemannian Alignment Score (S-RAS). This produces a uniform multiplicative certificate over a second-moment family of local discrimination tasks and revealed empirically that local sensitivity geometry can recover corresponding layers across independently trained networks, support transferable class-conditional probes, and outperform CKA for cross-area identity in mouse visual cortex, with top-1 accuracy 9 for full Fisher geometry versus 0 for CKA (Yavari et al., 4 May 2026).
Several recurring misconceptions are corrected by this newer literature. High raw activation similarity does not imply similarity of local sensitivity geometry; high-confidence pseudo-labels do not guarantee reliable supervision; and pairwise similarity explanations are not the same as global class explanations (Yavari et al., 4 May 2026, Howlader et al., 2024, Liao et al., 2 Jun 2025). Accordingly, AS is best understood not as a universal scalar but as a family of operators whose meaning depends on granularity, task, coordinate system, and noise model. Across current research, the central question is no longer simply whether two activation patterns are close, but which relations, perturbations, or decisions that closeness is supposed to preserve.