WorksEngineering
Leveraging Binary Hashing for Scalable Index Assignment in Semantic Communications
Abstract
Transmitting semantically structured embedding vectors over digital channels is costly in bit rate, while conven- tional vector quantization approaches face limitations in scalabil- ity, encoding complexity, and index assignment. This paper inves- tigates binary hashing techniques from the information retrieval literature as semantic indexing strategies for general-purpose networks. We study random Locality-Sensitive Hashing (LSH) along with Principal Component Analysis (PCA)-, Canonical Correlation Analysis (CCA)-, and ITQ (Iterative Quantization)- based variants in a semantic communication pipeline over a Binary Symmetric Channel. Embeddings are compressed into binary codes, reconstructed through Hamming retrieval from a shared table, and evaluated on downstream classification. Ex- periments on the Massive Text Embedding Benchmark (MTEB) and the Banking77 dataset show that data-dependent hashing improves upon random LSH, while ITQ refinement increases robustness to channel noise. Among the evaluated methods, CCA- ITQ achieves the best classification accuracy across the tested channel conditions. These results indicate that binary hashing is an efficient and scalable alternative to quantization-based embedding compression for semantic communications.
Introduction
The increasing number of connected devices and the exponential growth of data traffic have motivated a paradigm shift in communication system design. Classical general-purpose networks focus on the reliable reconstruction of transmitted bits at the receiver, irrespective of their semantic content. In contrast, semantic communications aim to convey only the information relevant to a specific task, thereby reducing the communication overhead by exploiting the meaning of the transmitted data [1]. Recent works have further highlighted the relevance of semantic integration for future practical networks and proposed efficient end-to-end learning architectures that jointly optimize source and channel coding for task-oriented scenarios [2].
As an emerging perspective, semantic communications can be viewed as exchanging information in a form decoded and intended for Artificial Intelligence (AI) models rather than as raw source data. Under this AI-native view, embeddings constitute a natural and particularly suitable data format for enabling semantic system design [3]. Embeddings are high-dimensional, structured vector representations that capture the semantic characteristics of the underlying data. In Natural Language Processing (NLP) in particular, pre-trained sentence embedding models have become a standard tool for representing text in a latent semantic space [4]. However, transmitting raw embeddings is prohibitively expensive in bandwidth-constrained scenarios: a single embedding vector of dimension , encoded in IEEE 754 single-precision floating-point format, requires bits. This motivates the need for mapping embeddings to compact binary representations that reduce the bit rate while remaining robust to channel noise, so that semantic similarity is sufficiently preserved for the downstream task.
Compressing embeddings for digital transmission typically involves two steps: quantizing the continuous embedding space into a finite set of discrete vector realizations, and adapting this set of representations for a communication system by assigning a binary index to each discrete realization. One of the fundamental problems in this second step is the Index Assignment Problem (IAP) [5]. Given a set of possible discrete vectors, the objective is to assign binary codewords to each of them such that a global distortion metric, for example, the distortion induced by channel errors, is minimized.
Within this quantization-and-indexing framework, existing approaches largely rely on vector quantization (VQ) techniques [6, 7]. These methods first minimize quantization distortion by learning a finite set of representative vectors for the continuous embedding space, and then define a binary index mapping that preserves a form of error locality between the Hamming space and the original embedding space, as in the Binary Switching Algorithm (BSA) [8]. While this approach is well studied and locally optimal within the quantization framework, it suffers from three fundamental limitations. First, it introduces an irreducible quantization distortion for any fixed codebook size : reconstruction vectors are artificial centroids that may not correspond to real embeddings, and the reconstruction error cannot be reduced without increasing . Second, assigning the nearest centroid index during transmission requires an encoding complexity that grows as , making exhaustive nearest centroid search intractable for large . Third, for performing BSA optimization, the binary mapping refinement incurs a complexity that still grows as . Scaling to approach the expressiveness of the full training set is therefore computationally prohibitive. There is therefore a need for binary embedding representations that preserve the robustness objectives of index assignment while remaining scalable to large embedding collections.
To address this need, we propose to leverage binary hashing techniques from the information retrieval (IR) literature as a scalable compression framework for semantic communications [9]. Specifically, we investigate Locality-Sensitive Hashing (LSH) [10], a family of methods that generates binary codes by thresholding projections of embeddings so that similar vectors remain close in Hamming space (see § 3-B). We then consider its unsupervised and supervised refinements based on Principal Component Analysis (PCA) [11], Canonical Correlation Analysis (CCA) [12], and Iterative Quantization (ITQ) [13] as binary encoding schemes for embedding transmission over a Binary Symmetric Channel (BSC), where embeddings are encoded directly into binary codes at lower complexity and reconstructed at the receiver by Hamming retrieval from a shared table instead of nearest-centroid quantization.
The main contributions of this paper are threefold: 1) we propose, to the best of our knowledge, the first application of IR binary hashing techniques as dedicated compression schemes for semantic communications, providing a scalable alternative to vector quantization approaches; 2) we benchmark these techniques against uncompressed embeddings and a BSA baseline in a practical semantic communication pipeline over a BSC, across a wide range of bit rates and channel crossover probabilities; 3) we show that PCA- and CCA-based hyperplane selection, refined by ITQ, consistently improves over random LSH, with CCA exploiting label information to better encode the embedding semantic structure that retains classification-relevant information.
System Model
Shared Offline Setup
The studied system relies on three components that are established offline from a shared labeled training set , where is the total number of training samples, and made available at both ends prior to any transmission:
a fixed pre-trained embedding model ,
a binary hash trained on ,
a lookup database (defined below) built by encoding the entire training set through .
No runtime signaling overhead is incurred by this shared knowledge: is identical at the transmitter and receiver by construction.
Online Communication Pipeline
The online data flow is illustrated in Figure 1. At the transmitter, a text input is mapped to an embedding and then compressed to a -bit binary code

Figure 1. Studied semantic communication system. The input sentence is mapped to an embedding , encoded into a binary code , transmitted over a BSC, and reconstructed from a shared table before downstream classification. The Classifier block implements a logistic regression model with a softmax output layer over 77 banking intent classes (Banking77 dataset).
independently of the training set size .
The code is transmitted over a BSC(), which flips each bit independently with a crossover probability . At reception, represents the received binary code, potentially accounting for BSC-generated channel distortion.
Database and Retrieval Decoder
Each training embedding is hashed to a binary code . This mapping is not necessarily one-to-one: depending on the number of applied hyperplanes , several embeddings may collide into the same binary code, thereby partitioning the training set into hash cells . The representative embedding of each populated cell is its mean:
Unlike VQ-based schemes where completely determines the observed quantization error, the hashing-based strategy decreases the intra-cell reconstruction error as and grow. Upon receiving , the decoder finds the nearest cell codeword by Hamming distance:
and returns as the reconstructed embedding. The search in (3) is performed only over the populated cell codewords stored in , with , rather than over all possible binary strings. The reconstruction fidelity is quantified by the mean squared error (MSE):
Downstream Task Evaluation
Following the MTEB (Massive Text Embedding Benchmark) evaluation protocol [4], a logistic regression classifier is trained on the uncompressed training embeddings and then applied to the reconstructed embeddings at the receiver to isolate the effects of compression and channel distortion on the downstream task. Classification accuracy is the primary metric, evaluated as a service-centric measure and is defined as:
where represents the number of correct predictions and denotes the total number of predictions made by the classifier. MSE (4) is reported as a secondary reconstruction metric to assess the relationship between embedding fidelity and task performance.
Binary Hashing Schemes
General Framework
All schemes share the affine projection structure
where is then mapped to binary bits before transmission, is the projection matrix and is the training mean vector used to center the observed data as a preprocessing step. Geometrically, each row of defines a hyperplane in the centered embedding space, and the binary code records on which side of each hyperplane the embedding lies. The methods differ in how is obtained: from no data (LSH), from the unlabeled embedding distribution (PCA), or from the joint embedding-label distribution (CCA). The ITQ variants additionally refine the projection with an orthogonal rotation to balance and calibrate bit assignments.
Classical LSH
The classical random-projection LSH [10] encodes an embedding by testing its position relative to a set of random hyperplanes, as illustrated in Figure 2. Each row of is drawn i.i.d. from the Gaussian distribution , and the sign of the corresponding projection determines one bit of the code. The final binary representation is obtained by concatenating these sign bits. Because nearby vectors are more likely to fall on the same side of many hyperplanes, they tend to produce similar binary strings and remain close in Hamming space. Since the projection directions are sampled at random and do not depend on the dataset, random LSH is defined as a data-independent hashing scheme.

Figure 2. Illustration of random-projection LSH in a two-dimensional projected space. The nearby embeddings and fall in the same cell and therefore share the same code, whereas the farther embedding lies in a different cell.
PCA-Based Hashing
PCA-Direct. Let contain the top- eigenvectors of the sample covariance of the centered training matrix . PCA-Direct sets , projecting along directions of maximum variance over the data distribution. PCA is defined as a task-agnostic, data-dependent unsupervised strategy to perform hyperplane selection in composing the projection matrix .
PCA-ITQ. Iterative Quantization [13] improves the binarization step by learning an orthogonal rotation that minimizes the binary quantization loss
where is the binary code matrix alternately optimized with . The role of this rotation is to better align the continuous embedding space with the binary axes before thresholding, so that the sign operation introduces less quantization error than direct binarization. The binary encoder is then given by .
CCA-Based Hashing
CCA [12] constructs a task-oriented, data-dependent projection by maximizing the correlation between embeddings and class labels. The top- directions are solutions of the regularized generalized eigenvalue problem:
where is the number of label classes, is the centered one-hot label matrix and prevents near-singular matrices. The generalized eigenvalues are the squared canonical correlations; each eigenvector is therefore scaled by the corresponding canonical correlation to form the projection matrix [13].
CCA-Direct defines the projection matrix as ; CCA-ITQ applies the same ITQ rotation of Section III-C to the CCA-projected codes .
Experimental Results
Experimental Setup
Dataset and embedding model. Experiments are conducted on Banking771, a banking intent classification dataset with training samples, test samples, and 77 intent classes. All dataset splits are embedded using the tomaarsen/mpnet-base-nli22 model, which produces -dimensional sentence representations and is used as a general-purpose semantic encoder pre-trained on a larger set of NLP tasks without task-specific fine-tuning [14].
Evaluation protocol. Embeddings are standardized using a zero-mean, unit-variance scaler fitted on the training split. Following the MTEB protocol [4], each run samples training examples per class, yielding 616 balanced training samples for Banking77. A logistic regression classifier is trained on this subset using uncompressed embeddings and then evaluated at the receiver on reconstructed test embeddings. The procedure is repeated over random seeds, and reported accuracies are averaged across runs.
Baselines. We compare against three baselines: (i) Uncompressed (IEEE 754), which transmits the raw float32 embedding (24 576 bits per embedding); (ii) K-means+BSA, which quantizes embeddings into centroids and assigns binary indices with BSA; (iii) PQ+BSA, following [7], which applies Product Quantization (PQ) with subspaces and centroids per subspace, yielding bits. Since BSA scales as per iteration, large K-means codebooks are impractical; in this work, we identify and define () as the practical ceiling on Banking77. PQ+BSA extends VQ to larger bit budgets with encoding complexity , at the cost of subspace quantization distortion that ignores cross-subspace correlations.
For all BSA-based schemes, we run up to 200 iterations per round and keep the best mapping among 5 initializations. The current best assignment is then perturbed by 8 random permutations, each followed by BSA refinement, and the procedure stops after 4 consecutive rounds without improvement. BSA distortion evaluation uses a fixed error probability .
Bit budgets and channel parameters. For accuracy evaluation, hashing schemes are tested with and . Across the same -range, K-means+BSA is evaluated over , and PQ+BSA uses subspaces with bits per subspace, yielding comparable total bit budgets. Reconstruction MSE is evaluated only for to isolate compression-induced distortion.
Results and Discussion
Figure 3 reports the 10-run average classification accuracy versus transmitted bits on Banking77 for (panels a–d). For K-means+BSA, full BSA optimization is used up to the practical limit

Figure 3. Banking77 average classification accuracy versus transmitted bits , for (panels a–d).
(), while larger values are shown only for using random index assignment to isolate the effect of finer quantization; this transition is marked by the dotted vertical line at . The dotted horizontal line represents as reference the maximum tested K-means accuracy at , , and the dashed horizontal line gives the IEEE 754 uncompressed reference for each . Around each average accuracy over the 10 MTEB runs, the min/max interval bars show that variability remains small overall and indicate stable accuracy trends.
The K-means+BSA curve in Figure 3(a) increases with , from 72.0% at to 79.0% at and 80.4% at , suggesting that increasing the codebook size effectively reduces reconstruction error and progressively reaches the uncompressed reference result. At the same time, the gain becomes smaller as grows, which is consistent with the diminishing returns of finer quantization as the representative clusters become less populated and approach the original training distribution. In contrast, the hashing-based schemes already reach competitive or higher accuracies from moderate bit budgets (e.g., in Figure 3(a) for , all hashing-based methods except Classical LSH achieve competitive or better performance than both horizontal references) without requiring nearest-centroid encoding or large codebook optimization. Even though allowing for a much more affordable bit rate scalability to capture quantization expressivity among subspaces, PQ+BSA still observes inferior accuracy performance for moderate bit budgets, and only becomes competitive with hashing schemes at the largest bit budgets (e.g., , 128).
With regard to robustness against noise, we observe that hashing-based methods better preserve task-relevant structure relative to their error-free performance, even at the highest error probability in Figure 3(d) where remarkably high accuracy results are obtained (e.g., a CCA-ITQ accuracy value at similar to the uncompressed reference at , using only 128 bits instead of 24,576 bits, corresponding to a compression factor of 192). Meanwhile, PQ+BSA is slightly more affected by channel distortion and sees a loss of its concurrent zero-error task-relevant structure under these conditions. In contrast, K-means+BSA degrades much more markedly at high channel noise, dropping from 72.0% at to 35.5% at at its practical operating point. The uncompressed IEEE 754 baseline is even more sensitive to bit errors, with accuracy collapsing already at very small crossover probabilities because perturbing raw floating-point values severely distorts the received embedding.
Table I reports 10-run average accuracy and reconstruction MSE at the practical operating points of each method: for hashing and PQ+BSA, and () for K-means+BSA.
| Method | MSE | |||
| IEEE 754 () | 0 | 79.7 | 6.8 | 7.8 |
| K-means+BSA () | 3.71 | 72.0 | 67.4 | 35.5 |
| PQ+BSA () | 3.49 | 77.9 | 77.7 | 70.8 |
| Classical LSH | 3.52 | 73.5 | 72.8 | 67.8 |
| PCA-Direct | 3.28 | 75.7 | 75.4 | 72.4 |
| PCA-ITQ | 3.12 | 77.1 | 76.9 | 75.4 |
| CCA-Direct | 4.22 | 79.1 | 78.9 | 74.3 |
| CCA-ITQ | 5.36 | 83.3 | 83.3 | 82.3 |
Table I. Banking77 10-run average accuracy (%) and MSE (, at ). K-means+BSA: (, practical ceiling). Others: . Bold: best method per column.
MSE is evaluated only at to assess embedding reconstruction capacity, while accuracy is reported for . Table I also shows that reconstruction MSE and downstream accuracy are not tightly aligned. CCA-ITQ yields the highest MSE yet the best classification accuracy, whereas PQ+BSA attains lower MSE but lower task performance. Thus, low Euclidean reconstruction error in embedding space does not necessarily preserve the discriminative structure most relevant to the downstream classifier. This is also jointly observed in Figure 3, where the CCA-based methods provide the strongest overall performance across the tested channel conditions, and notably surpassing the uncompressed IEEE 754 result in Figure 3(a).
Among the hashing methods, ITQ refinement improves performance consistently over direct projection. At and , the gain is moderate for PCA and more visible for CCA; under noisier conditions, the gap becomes larger. For instance, at , PCA-ITQ improves over PCA-Direct by 3 percentage points, and CCA-ITQ improves over CCA-Direct by 8.0 percentage points. These results are in line with the role of ITQ in producing more balanced binary representations, which appear beneficial not only for binary quantization quality but also for robustness to bit flips.
A similar trend is observed when comparing supervised and unsupervised projections. CCA-based hashing consistently outperforms PCA-based hashing across all channel conditions, highlighting the benefit of using label information to align the binary representation with task-relevant structure. A counter-part is greater task specificity, which may be less suitable in multi-task scenarios. Since the number of informative canonical directions is bounded by rank() , the CCA curves naturally tend to saturate once exceeds this effective supervised dimensionality, as observed in Figure 3.
Complexity and Scalability Discussion
To clarify the practical scalability trade-offs underlying the performance trends observed in § 4, we analyze the computational complexity of the compression schemes across the two main stages of the studied pipeline: offline construction and online operation.
Offline Construction Complexity
For random LSH, building the binary encoder only requires sampling random projection vectors in , yielding a complexity of [10]. PCA-based hashing requires estimating principal projection directions from the training embeddings. In a standard dense implementation, the dominant cost comes from covariance formation and eigendecomposition, yielding a complexity on the order of [11, 15]. CCA-based hashing similarly relies on second-order statistics and a generalized eigenvalue problem involving the label space, leading to a comparable but typically heavier offline cost [12]. ITQ further adds an alternating orthogonal refinement on the projected codes, whose complexity scales with the number of refinement iterations [13].
For the VQ-based baselines, classic K-means training over centroids costs over iterations. The subsequent index refinement by BSA or related code-swapping procedures is substantially more demanding, since it explores pairwise code reassignment operations over the codebook and leads to a complexity that grows as per distortion-evaluation round [8]. More generally, optimal index assignment is known to be an NP-hard quadratic assignment problem [5]. PQ reduces the dimensionality handled by each subquantizer and affords more scalable bit rates, but still requires codebook learning in all subspaces with index refinement.
Online Operation Complexity
All hashing-based schemes share the same online structure: a -dimensional embedding is projected onto hyperplanes and thresholded componentwise. Their online encoding complexity is therefore , independently of the training set size . This applies to random LSH, PCA-Direct, PCA-ITQ, CCA-Direct, and CCA-ITQ.
By contrast, K-means+BSA requires finding the nearest centroid among representatives, which under exhaustive search yields . For PQ+BSA, each of the sub-vectors is matched against a sub-codebook of size , resulting in an overall complexity of order .
For the proposed hashing pipeline, decoding consists of finding the nearest populated binary cell in Hamming space among the entries of the shared table . Since computing one Hamming distance between two -bit strings costs , brute-force retrieval over populated cells requires , with . The reconstruction is then a simple table lookup.
For K-means+BSA, decoding is a direct centroid lookup from the received index and therefore costs . PQ+BSA similarly reconstructs the embedding by concatenating the retrieved sub-centroids from the shared subcodebooks, yielding then a decoding cost of order .
Discussion. Regarding the computational trade-off, hashing-based schemes shift complexity toward receiver-side retrieval, while keeping the transmitter complexity low and scalable, with online encoding growing only linearly in the bit budget . In contrast, VQ-based schemes offer very simple decoding once the binary index is received, while incurring heavier offline construction and online encoding costs due to codebook learning, nearest-centroid assignment, and index refinement.
In the Banking77 setting, this difference is reflected by the practical operating points observed in Figure 3. With and , hashing-based encoding scales as , whereas K-means encoding at the practical BSA limit already scales as , and would rise to about for (). Hashing therefore provides a substantially lighter transmitter at large bit budgets, at the cost of a receiver-side Hamming search over at most populated cells. These orders of magnitude are consistent with the experimental trends: hashing methods remain scalable as increases and achieve the best overall accuracy–scalability trade-off in our evaluation, especially with CCA-ITQ.
Conclusion
This paper investigated binary hashing as a semantic compression strategy for transmitting sentence embeddings over a BSC. Experiments on Banking77 showed that data-dependent hashing improves upon random LSH, that ITQ refinement increases robustness under channel noise and that CCA-ITQ achieves the best task results across the tested settings. The complexity analysis further highlighted the favorable scaling of hashing-based encoding compared with VQ-based strategies, despite a more demanding receiver-side retrieval stage.
These findings are limited to a single embedding model and a single downstream task, and broader experiments are needed to assess their generality across a wider range of settings. Future work will therefore consider additional embedding models, larger and more diverse datasets, and other downstream tasks, including multi-task scenarios. Further directions include accelerated Hamming retrieval at the receiver for large or continuously evolving embedding collections and extensions beyond text classification to other modalities, such as image or multimodal embeddings.
References
- [1]L. X. Nguyen, A. D. Raha, P. S. Aung, D. Niyato, Z. Han, and C. S. Hong, “A Contemporary Survey on Semantic Communications: Theory of Mind, Generative AI, and Deep Joint Source-Channel Coding,” IEEE Communications Surveys & Tutorials, vol. 28, pp. 2377–2417, 2026.DOI
- [2]H. Xie, Z. Qin, G. Y. Li, and B.-H. Juang, “Deep Learning Enabled Semantic Communication Systems,” IEEE Transactions on Signal Processing, vol. 69, pp. 2663–2675, 2021.DOI
- [3]Q. Lampin, L.-A. Dufrêne, and G. Larue, “Semantic Communications Services Within Generalized Federated Networks,” in Proceedings of the 2024 IEEE 25th International Workshop on Signal Processing Advances in Wireless Communications (SPAWC), 2024, pp. 861–865.
- [4]N. Muennighoff, N. Tazi, L. Magne, and N. Reimers, “MTEB: Massive Text Embedding Benchmark,” in Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics, 2023, pp. 2014–2037.
- [5]X. Wu, H. D. Mittelmann, X. Wang, and J. Wang, “On Computation of Performance Bounds of Optimal Index Assignment,” IEEE Transactions on Communications, vol. 59, no. 12, pp. 3229–3233, 2011.
- [6]R. M. Gray, “Vector Quantization,” IEEE ASSP Magazine, vol. 1, no. 2, pp. 4–29, 1984.
- [7]L. Roque, Q. Lampin, L.-A. Dufrêne, G. Larue, G. Lefebvre, and M. Assaad, “Compacting Semantic Matryoshka Representations with Product Quantization,” in Proceedings of the 2025 IEEE Globecom Workshops (GC Wkshps), 2025, pp. 1550–1555.
- [8]K. Zeger and A. Gersho, “Pseudo-Gray Coding,” IEEE Transactions on Communications, vol. 38, no. 12, pp. 2147–2158, 1990.DOI
- [9]J. Wang, T. Zhang, J. Song, N. Sebe, and H. T. Shen, “A Survey on Learning to Hash,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 40, no. 4, pp. 769–790, 2018.DOI
- [10]A. Gionis, P. Indyk, and R. Motwani, “Similarity Search in High Dimensions via Hashing,” in Proceedings of the 25th International Conference on Very Large Data Bases (VLDB), 1999, pp. 518–529.
- [11]I. T. Jolliffe, Principal Component Analysis, 2nd ed. Springer, 2002.
- [12]D. R. Hardoon, S. Szedmak, and J. Shawe-Taylor, “Canonical Correlation Analysis: An Overview with Application to Learning Methods,” Neural Computation, vol. 16, no. 12, pp. 2639–2664, 2004.pubmed.ncbi.nlm.nih.gov/15516276
- [13]Y. Gong and S. Lazebnik, “Iterative Quantization: A Procrustean Approach to Learning Binary Codes,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2011, pp. 817–824.DOI
- [14]T. Aarsen, X. Joshua, and O. Sansevierо, “Introduction to Matryoshka Embedding Models,” Hugging Face Blog, 2024. [Online]. Available: https://huggingface.co/blog/matryoshka
- [15]G. H. Golub and C. F. Van Loan, Matrix Computations, 4th ed. Johns Hopkins University Press, 2013.