Symmetric Average Minimum Distance (SAMD)
- SAMD is a metric that quantifies semantic change by enforcing a one-to-one matching between contextualized embeddings, ensuring symmetry and mitigating hub dominance.
- In coding theory, SAMD represents the minimum average Hamming distance for binary codes, framed as a linear programming extremal problem with bounds derived using Krawtchouk polynomials.
- Empirical analyses highlight SAMD's robustness under dimensionality reduction and its computational efficiency with greedy matching, outperforming traditional global averaging metrics.
Searching arXiv for the cited papers to ground the article in the relevant literature. Symmetric Average Minimum Distance (SAMD) denotes two distinct quantities in recent arXiv literature. In lexical semantic change detection (LSCD), SAMD is introduced as a measure that quantifies semantic change via local correspondence between word usages across time periods (Goworek et al., 17 Feb 2026). In coding theory, denotes the minimum average Hamming distance of binary codes with length and size (Yu et al., 2019). The acronym therefore has domain-specific meanings: a one-to-one matching score over contextualised embeddings in lexical semantics, and an extremal quantity over binary codes in Hamming space.
1. Terminological scope and domain-specific meanings
In LSCD, the relevant objects are two sets of contextualised embeddings for a target word from two time periods. The purpose of SAMD in that setting is to quantify semantic change via local correspondence between word usages across time periods, in contrast to metrics that operate on global averages or prototypes (Goworek et al., 17 Feb 2026).
In coding theory, the relevant object is a binary code of size . There, SAMD is not a matching algorithm or an embedding-space score, but the extremal quantity
where is the average Hamming distance of the code (Yu et al., 2019).
This suggests a terminological overlap rather than a shared formalism. The two uses of SAMD are mathematically independent, despite the identical acronym.
2. SAMD in lexical semantic change detection
Let and be two sets of contextualised embeddings for a target word 0 from time periods 1 and 2. Using cosine distance 1, Symmetric Average Minimum Distance enforces a one-to-one matching between 2 and 3 after sampling both sets to the same size 4 (Goworek et al., 17 Feb 2026).
Denote the selected subsets by 5 and 6. Let 7 be a bijection between indices of 8 and 9 chosen to minimize total distance. Then
0
The paper contrasts SAMD with two established LSCD metrics. Average Pairwise Distance (APD) computes
1
and is described as global, sensitive to bulk distribution shifts, and liable to dilute signal from small emerging senses. Average Minimum Distance (AMD) is directional,
2
with symmetric AMD defined as 3; it is sensitive to local correspondences, but can map multiple points in 4 to the same point in 5 under many-to-one matching (Goworek et al., 17 Feb 2026).
SAMD differs from AMD by enforcing one-to-one matching, thereby mitigating hubness, described as the case where a few points act as nearest neighbours for many. The paper states two reasons why symmetry matters: one-to-one alignment prevents over-representation of dominant “hub” embeddings in local-neighbour matches, and it guarantees the same number of matches in both periods and a truly symmetric notion of change. The method is also said to capture both distributional shifts and changes in concentration of usage clusters (Goworek et al., 17 Feb 2026).
3. Computation, hyperparameters, and complexity in LSCD
The step-by-step computation of SAMD begins with two sets of embeddings 6 and 7, and a distance function 8, with cosine distance as the default (Goworek et al., 17 Feb 2026). The sets are equalized by setting 9; if 0, randomly sample 1 embeddings from 2, and if 3, sample 4 from 5. The resulting sets are 6 and 7.
A pairwise distance matrix 8 is then built with entries 9. The paper gives a greedy one-to-one matching procedure: initialize unmatched row and column sets, flatten all triples 0, sort ascending by distance, and iterate through the sorted list, accepting a pair only if both its row and column remain unmatched. The normalized sum 1 is the SAMD score. As an alternative, one may solve the linear assignment problem via the Hungarian algorithm for the exact minimum total matching (Goworek et al., 17 Feb 2026).
The design space includes several explicit choices. The distance function can be cosine distance or Euclidean distance, with the choice affecting sensitivity to vector norms. The sampling strategy can be random uniform down-sampling to size 2, or stratified sampling if there is sense imbalance. The matching algorithm can be greedy, with complexity 3 dominated by sorting all pairs, or the Hungarian algorithm with complexity 4; greedy is described as faster and empirically near-identical. Dimensionality reduction may use full embeddings with 5, PCA to 6 dimensions, definition-space projection, or random subspace. Optional outlier handling may clip distances above a threshold or remove outlier embeddings before matching; it is stated not to be required in practice, but may improve stability if a few usages are extreme (Goworek et al., 17 Feb 2026).
The stated computational complexity uses 7 for the equalized number of embeddings per period and 8 for the embedding dimension. Pairwise distance computation costs 9, sorting all 0 distances costs 1, and the greedy matching pass costs 2 in the worst case, for total complexity 3. For very large 4 exceeding 5k, the paper suggests approximate nearest neighbour structures to avoid the full distance matrix, further subsampling or clustering usages first, or using the Hungarian algorithm only on a top-6 nearest-neighbour graph per point to reduce matrix size (Goworek et al., 17 Feb 2026).
4. Empirical behavior of SAMD in lexical semantic change benchmarks
The LSCD study reports that, across multiple languages, encoder models, and representation spaces, AMD often provides more robust performance, particularly under dimensionality reduction and with non-specialised encoders, while SAMD excels with specialised encoders (Goworek et al., 17 Feb 2026). The paper’s broader conclusion is that LSCD may benefit from considering alternative semantic change metrics beyond APD and PRT, with AMD offering a robust option for contextualised embedding-based analysis.
At the metric level, one reported result is that SAMD with PCA + XL-LEXEME achieves Spearman 7, compared with APD at 8 and PRT at 9 on full embeddings. Under progressive PCA or random dimension reduction, SAMD is reported to maintain 0 even at 1–2 dimensions, while APD and PRT collapse near 3–4. Across 5 languages and monolingual versus multilingual encoders, SAMD consistently outperforms or matches AMD, and both surpass APD and PRT, especially under dimensionality constraints (Goworek et al., 17 Feb 2026).
The paper also isolates a representation-dependent distinction. In definition-space with 6–7 dimensions, AMD slightly outperforms SAMD for non-specialised encoders, whereas SAMD excels with specialised ones due to its one-to-one constraint. This makes the one-to-one constraint central to the interpretation of the metric’s empirical profile, rather than a merely algorithmic detail (Goworek et al., 17 Feb 2026).
Practical implementation guidance follows the same pattern. The workflow is: extract usage embeddings for each target word and time period using the chosen encoder; optionally apply PCA or a semantic projection; equalize sizes with 8; compute a distance matrix or KNN-filtered distances; run greedy matching or the Hungarian algorithm; and return the average matched distance. The paper’s implementation advice includes setting max_samples to control runtime on very large usage sets, using sklearn.decomposition.PCA to reduce dimension to 9, and pre-clustering usages and matching cluster centroids to reduce 0 for large-scale discovery (Goworek et al., 17 Feb 2026).
5. SAMD in coding theory: minimum average Hamming distance
In coding theory, let 1 be a binary code of size 2. Its average Hamming distance is
3
where
4
The extremal quantity
5
is called the Symmetric Average Minimum Distance of a 6 code (Yu et al., 2019).
A key fact in the Yu–Tan treatment is that 7 can be re-expressed in terms of the dual distance distribution 8, 9, satisfying 0 with 1. The paper states
2
so minimizing 3 is equivalent to minimizing 4 under MacWilliams–Delsarte/Krawtchouk constraints (Yu et al., 2019).
Relaxing to an arbitrary nonnegative vector 5 yields a pair of finite-dimensional linear programs, identified as Fu–Wei–Yeung’s primal and dual LPs. The dual is written over variables 6, with nonnegativity constraints and inequalities involving 7, where 8 is the 9-th Krawtchouk polynomial in an 0-cube. By strong duality, 1, and hence for any code 2 of relative size 3,
4
This reformulation makes SAMD a linear-programming extremal problem rather than a direct combinatorial search over codes (Yu et al., 2019).
6. Improved coding-theoretic bounds, asymptotic optimality, and Fourier consequences
Yu and Tan improve the coding-theoretic SAMD bound by exhibiting an explicit two-sparse dual feasible solution
5
whose only nonzero entries are chosen so that the endpoint constraints 6 and 7 tighten to equality (Yu et al., 2019). The construction solves two linear equations in closed form, and the paper states that Krawtchouk-polynomial comparison lemmas on roots, monotonicity, and magnitude bounds imply that all other constraints are automatically satisfied for sufficiently large 8. Positivity of 9 and 00 holds when 01 and 02.
Substituting 03 into the dual objective and letting 04 yields
05
with the closed-form piecewise function
06
Plugging this into the lower bound on 07 and using a mild monotonicity lemma gives the final bound
08
The paper states that, as 09, this is tight in the sense that no larger 10 can arise from any feasible dual (Yu et al., 2019).
The same paper gives a Fourier-analytic interpretation. If 11 has 12 and 13, then the degree-1 Fourier weight satisfies
14
The improved SAMD bound is therefore equivalent to
15
with the same piecewise 16. The paper further states asymptotically optimal bounds for higher-degree Fourier weights: 17 Historically, the work is framed as an improvement over Fu, Wei, and Yeung’s lower bound, originally derived via linear programming duality after Ahlswede and Katona posed the underlying isodiametric problem in Hamming spaces (Yu et al., 2019).