Paper deep dive
SubQuad: Near-Quadratic-Free Structure Inference with Distribution-Balanced Objectives in Adaptive Receptor framework
Rong Fu, Zijian Zhang, Kun Liu, Jiekai Wu, Xianda Li, Simon Fong
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 91%
Last extracted: 7/21/2026, 12:03:09 AM
Summary
The paper introduces SubQuad, an end-to-end pipeline for scalable, antigen-aware, and equity-preserving analysis of large immune repertoires. It addresses computational bottlenecks (near-quadratic cost) and dataset imbalances by combining MinHash prefiltering, GPU-accelerated affinity kernels, multimodal fusion via a differentiable gating module, and fairness-constrained clustering. The system aims to improve throughput, memory efficiency, and recall while ensuring proportional representation of rare, clinically significant clonotypes.
Entities (8)
Relation Signals (7)
SubQuad → uses → GPU
confidence 95% · combining antigen-aware, near-subquadratic retrieval with GPU-accelerated affinity kernels
SubQuad → uses → MinHash
confidence 95% · The system employs compact MinHash prefiltering to sharply reduce candidate comparisons
SubQuad → analyzes → Adaptive Immune Repertoires
confidence 93% · SubQuad, an end-to-end pipeline for accelerated, equity-aware representation learning on large immune-repertoire graphs.
SubQuad → optimizesfor → Jensen-Shannon Divergence
confidence 90% · optimizing a joint objective of spatial cohesion and Jensen-Shannon Equity
SubQuad → targets → Clonotypes
confidence 90% · ensuring proportional representation of rare, clinically significant clonotypes
SubQuad → incorporates → ImmunoBERT
confidence 88% · Our implementation adapts and extends protein language model embeddings inspired by ImmunoBERT
SubQuad → incorporates → MetaNet
confidence 85% · MetaNet is a lightweight meta-controller that dynamically fuses alignment-derived scores with embedding-based similarities
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Comparative analysis of adaptive immune repertoires at population scale is hampered by two practical bottlenecks: the near-quadratic cost of pairwise affinity evaluations and dataset imbalances that obscure clinically important minority clonotypes. We introduce SubQuad, an end-to-end pipeline that addresses these challenges by combining antigen-aware, near-subquadratic retrieval with GPU-accelerated affinity kernels, learned multimodal fusion, and fairness-constrained clustering. The system employs compact MinHash prefiltering to sharply reduce candidate comparisons, a differentiable gating module that adaptively weights complementary alignment and embedding channels on a per-pair basis, and an automated calibration routine that enforces proportional representation of rare antigen-specific subgroups. On large viral and tumor repertoires SubQuad achieves measured gains in throughput and peak memory usage while preserving or improving recall@k, cluster purity, and subgroup equity. By co-designing indexing, similarity fusion, and equity-aware objectives, SubQuad offers a scalable, bias-aware platform for repertoire mining and downstream translational tasks such as vaccine target prioritization and biomarker discovery.
Tags
Links
- Source: https://arxiv.org/abs/2602.17330v4
- Canonical: https://arxiv.org/abs/2602.17330v4
Trouble viewing inline? Open PDF directly →
Full Text
87,503 characters extracted from source content.
Expand or collapse full text
SubQuad: Near-Quadratic-Free Structure Inference with Distribution-Balanced Objectives in Adaptive Receptor framework Rong Fu University of Macau mc46603@um.edu.mo &Zijian Zhang University of Pennsylvania zzjharry@alumni.upenn.edu &Kun Liu University of Southampton kundy9909@gmail.com &Jiekai Wu Juntendo University ketsu0612@gmail.com &Xianda Li University of Bologna xianda.li@studio.unibo.it &Simon Fong University of Macau ccfong@um.edu.mo Corresponding author: mc46603@um.edu.mo Abstract Comparative analysis of adaptive immune repertoires at population scale is hampered by two practical bottlenecks: the near-quadratic cost of pairwise affinity evaluations and dataset imbalances that obscure clinically important minority clonotypes. We introduce SubQuad, an end-to-end pipeline that addresses these challenges by combining antigen-aware, near-subquadratic retrieval with GPU-accelerated affinity kernels, learned multimodal fusion, and fairness-constrained clustering. The system employs compact MinHash prefiltering to sharply reduce candidate comparisons, a differentiable gating module that adaptively weights complementary alignment and embedding channels on a per-pair basis, and an automated calibration routine that enforces proportional representation of rare antigen-specific subgroups. On large viral and tumor repertoires SubQuad achieves measured gains in throughput and peak memory usage while preserving or improving recall@k, cluster purity, and subgroup equity. By co-designing indexing, similarity fusion, and equity-aware objectives, SubQuad offers a scalable, bias-aware platform for repertoire mining and downstream translational tasks such as vaccine target prioritization and biomarker discovery. Keywords Representation Learning, Immunoinformatics, Fairness, Hardware Acceleration, Visual Analytics, Graph Representation Learning, Metric Learning, Biological Networks 1 Introduction An immune repertoire denotes the complete collection of T cell receptor (TCR) and B cell receptor (BCR) sequences within an individual. These repertoires constitute the adaptive immune system’s molecular fingerprint and commonly comprise millions to hundreds of millions of distinct receptor sequences. Comparing repertoires across individuals or clinical states can reveal antigen-specific response patterns that inform vaccine design, guide cancer immunotherapy strategies and support monitoring of autoimmune disease. Such comparative analyses are therefore routinely needed in translational immunology yet face acute computational constraints: pairwise affinity evaluations grow quadratically with the number of sequences, and naive comparison becomes infeasible for modern datasets containing 10610^6–10710^7 sequences per donor. Prior work has addressed parts of this scalability challenge through algorithmic and engineering advances. Locality-sensitive hashing and MinHash variants provide subquadratic heuristics for candidate reduction [3, 1], while accelerator-optimized kernels and specialized hardware have been used to speed low-level similarity computations [33, 20]. Despite these gains, three practical limitations remain. First, many scalable pipelines process receptor sequences as generic strings and consequently discard antigen-relevant signals important for epitope binding. Second, subgroup representation has received limited consideration, which risks systematic omission of low-prevalence but clinically consequential clonotypes. Third, verifiability of runtime and memory claims is often undermined by incomplete reporting of index and kernel configuration details. From a translational standpoint, correcting subgroup imbalance is not merely an abstract fairness objective but a domain requirement. Rare antigen-specific clonotypes, including those reactive to uncommon viral variants or tumor neoantigens, may occur at very low frequency while nevertheless driving clinically meaningful responses. Pipelines that optimize only for aggregate speed or for dominant patterns are therefore liable to underrepresent these high-value minorities, biasing downstream tasks such as epitope prioritization and biomarker selection. Incorporating equity-oriented penalties into retrieval and clustering objectives helps preserve representation for rare but important groups and thereby improves the biological validity of subsequent analyses. Motivated by these challenges, we propose SubQuad, a end-to-end pipeline for scalable, antigen-aware, and equity-preserving analysis of large immune repertoires. SubQuad integrates three key innovations: an antigen-aligned MinHash retrieval module that combines repertoire-specific sketching with biologically guided blocking to achieve near-subquadratic candidate reduction while maintaining high recall; a multimodal fusion backbone with a differentiable gating controller that adaptively combines alignment signals, protein-language embeddings, and local graph features to capture both fine-grained edits and higher-level biochemical structure; and a fairness-aware spectral clustering objective with automated equity calibration to ensure proportional representation of rare antigen-specific clonotypes and reduce subgroup disparity. Our primary contributions are summarized as follows. First, we introduce SubQuad, an end-to-end framework that couples high-efficiency sequence retrieval with antigenic sensitivity, enabling the construction of large-scale immune repertoire graphs without the quadratic cost of exhaustive comparisons. Second, we develop a dual-phase meta-learning encoder and a learnable similarity fusion backbone that dynamically integrates alignment-based and embedding-based affinities to support robust clonotype-to-phenotype modeling. Third, we formulate an explicit, equity-constrained clustering objective combined with an automated calibration routine, ensuring that rare but clinically significant antigen-specific subgroups are preserved across diverse repertoire topologies. Extensive evaluations on viral and cancer repertoires demonstrate substantial gains in runtime, memory efficiency, and biological fidelity, while ablation studies confirm that antigen-aligned blocking and multimodal fusion are critical for maintaining high cluster purity and fairness. Together, these components transform repertoire comparison into a scalable and biologically valid graph-learning task, providing a practical foundation for epitope prioritization, biomarker discovery, and vaccine design. 2 Related Work We summarize related work in five areas: scalable retrieval, sequence representation, graph-based repertoire modeling, fairness-aware clustering, and systems–biology integration. 2.1 Scalable retrieval. MinHash and locality-sensitive hashing reduce pairwise comparisons in high-dimensional spaces [3]. Practical performance depends on index design and hardware use, as shown in FAISS, HNSW, and ScaNN [16, 30]. Bioinformatics systems combine sketching with graph search or GPU acceleration for genome-scale data [43, 17, 29, 14]. SubQuad extends this by integrating antigen-aware alignment with GPU-parallel MinHash kernels. 2.2 Sequence representation. Protein and nucleotide language models yield embeddings that complement alignment-based similarity [32, 13, 42]. Fusion mechanisms with learnable gating combine heterogeneous signals [15, 26, 35, 12]. SubQuad applies a gating network to integrate alignment, embedding, and graph context. 2.3 Graph-based repertoire modeling. Similarity graphs reveal immune community structure and functional modules [10, 21]. Spectral methods and graph neural networks support antigenic neighborhood detection. SubQuad uses a spectral-style pipeline with group-aware penalties to balance coherence and representation. 2.4 Fairness-aware clustering. Fairness methods include proportional representation, constrained optimization, and pairwise regularization [8, 5, 4, 9]. Extensions to relational graphs preserve structure while enforcing group-level guarantees [11]. Biomedical applications require attention to sampling bias and underrepresented groups [2, 23]. SubQuad adapts these tools with disparity measures and automated fairness tuning. 2.5 Systems–biology integration. High-throughput analysis benefits from coordinated design of indexing, compute kernels, and workflows [33, 20, 17]. FAIR workflows promote transparency and reuse [18, 34]. SubQuad combines efficient indexing, GPU affinity kernels, and biologically informed fusion and fairness modeling with documented configurations for benchmarking. Figure 1: Overview of the SubQuad framework for near-quadratic-free, equity-aware repertoire inference. Scalable Preprocessing: Raw sequences S are processed via MinHash-based Indexing to generate a sparse candidate list CAND and optimized using hardware-aware batching ℬB. Representation Learning: A Dual-Phase Meta-Encoder utilizes ImmunoBERT-style pretraining followed by MetaNet fine-tuning. The Meta-Controller dynamically adjusts gating weights αm _m for multi-paradigm fusion. Graph Construction: Multi-channel affinities are integrated via Dynamic Affinity Fusion to produce a~ij a_ij. This similarity matrix is refined through RMT-based Thresholding (eigenvalue spectrum analysis) to produce a sparse weighted graph G=(V,E,W)G=(V,E,W). Fairness-Constrained Clustering: The graph is partitioned into clusters C by optimizing a joint objective of spatial cohesion and Jensen-Shannon Equity. An Automated Fairness Tuner dynamically calibrates the trade-off weight λ to meet target disparity δmax _ . Outputs: The pipeline yields antigen-aware clusters, topological maps (UMAP), and equity heatmaps for clinical interpretation. 3 Methodology We introduce SubQuad, an end-to-end pipeline for accelerated, equity-aware representation learning on large immune-repertoire graphs. SubQuad is built around three practical components. The first is device and memory aware preprocessing and indexing, which stabilizes large-scale runs and reduces the number of candidate comparisons. The second is a dual phase meta-learning encoder that incorporates a learnable, dynamic multi channel fusion backbone to support robust clonotype to phenotype modeling. The third is a fairness constrained clustering module that includes an automated calibration routine for selecting fairness weights. Our implementation adapts and extends protein language model embeddings inspired by ImmunoBERT [13] as well as a high-performance correlation and network-analysis toolkit inspired by MetaNet [24]; these components have been modified for repertoire-scale workloads and are not used verbatim. MetaNet is a lightweight meta-controller that dynamically fuses alignment-derived scores with embedding-based similarities by learning pair-specific gating weights, enabling adaptive integration of complementary affinity signals without introducing task-specific heuristics. The SubQuad framework integrates system-level efficiency with biological fidelity. To compare immune repertoires at scale, we utilize a repertoire-level distance measure that quantifies divergence through cluster-mass distributions and graph edit operations as detailed in Appendix A. This structural representation is supported by a GPU-optimized parallel computing architecture described in Appendix F, which leverages a two-dimensional grid organization to handle large-scale memory hierarchies. Central to our approach is the fairness-constrained optimization framework. We move beyond conventional statistical parity to ensure that rare but clinically significant antigen-specific clonotypes are not overlooked. The mathematical formulation of this objective, which balances clustering cohesion with subgroup equity, is provided in Appendix E. Furthermore, we address the inherent limitations of standard divergence measures in long-tailed biological distributions. A formal discussion on the necessity of our fairness objective is available in Appendix G, while Appendix D.1 provides a theoretical proof (Theorem D.1) regarding the coverage lower bounds for rare subgroups. 3.1 Task Formalisation: Antigen-Aware Repertoire Graph Construction :↦GT:S G (1) where =sii=1nS=\s_i\_i=1^n denotes a collection of immune receptor sequences sampled from a repertoire, and G=(V,E,W)G=(V,E,W) is the resulting sparse weighted graph whose vertices V correspond to individual sequences, edges E encode antigen-driven similarity links, and edge weights W=wijW=\w_ij\ quantify the antigen-level resemblance between sequence pairs (si,sj)(s_i,s_j). 3.2 Dual-phase meta-learning encoder We train the representation backbone in two consecutive stages. The first stage performs unsupervised representation pretraining via a reconstruction objective: minθpreℒrecon(fθpre(X),X). _ _pre\;L_recon (f_ _pre(X),\,X ). (2) where fθpre(⋅)f_ _pre(·) denotes the encoder used for representation learning, θpre _pre are the encoder parameters, and X denotes the set of inputs used for reconstruction pretraining. After pretraining we fine-tune the encoder jointly with a lightweight meta-network and a downstream task head: minθpre,θmetaℒtask(MetaNetθmeta∘fθpre(X),Y), _ _pre, _meta\;L_task (MetaNet_ _meta f_ _pre(X),\,Y ), (3) where MetaNetθmeta(⋅)MetaNet_ _meta(·) denotes the meta-controller applied to encoder outputs, θmeta _meta denotes its parameters, the operator “∘ ” denotes functional composition, and Y denotes downstream supervision signals or task labels. To accelerate convergence we employ momentum-style updates: θt+1=θt−ηt∇θℒ(θt)+μt(θt−θt−1), _t+1= _t- _t _θL( _t)+ _t( _t- _t-1), (4) where ηt _t denotes the learning rate at iteration t and μt _t denotes the momentum coefficient (in practice we typically set μt≈0.9 _t≈ 0.9). 3.3 Architectural components Adaptive channel weighting. We compute a compact per-channel importance score for each modality m: αm=σ(metam+meta), _m=σ\! (W_metaF_m+b_meta ), (5) where αm _m is the importance weight assigned to channel m, mF_m is the feature tensor for channel m, metaW_meta and metab_meta are learnable parameters of the meta-scoring layer, and σ(⋅)σ(·) is the sigmoid activation function. Topology-aware graph propagation. We propagate node features with a normalized aggregation rule: hv(k+1)=ReLU(∑u∈(v)(k)hu(k)|(v)||(u)|).h_v^(k+1)=ReLU\! ( _u (v) W^(k)h_u^(k) |N(v)|\,|N(u)| ). (6) where hv(k)h_v^(k) denotes node v’s representation after k propagation steps, (v)N(v) denotes the neighborhood of node v, and (k)W^(k) is the layer-specific linear transform applied at propagation step k. Prototype-contrastive consolidation. To concentrate representation mass for rare clonotypes we maintain class prototypes and optimize a prototype-centered contrastive loss: c _c =1|c|∑x∈cfθ(x), = 1|S_c| _x _cf_θ(x), (7) ℒproto _proto =−∑x∈ℬlogexp(⟨fθ(x),y(x)⟩/τ)∑c′∈xexp(⟨fθ(x),c′⟩/τ). =- _x ( f_θ(x),p_y(x) /τ ) _c _x ( f_θ(x),p_c /τ ). (8) where cp_c denotes the prototype vector for class c, cS_c denotes the set of examples with label c, fθ(⋅)f_θ(·) denotes the instance embedding function parameterized by θ, ℬB denotes the training batch, y(x)y(x) denotes the class label of instance x, τ>0τ>0 is the temperature hyperparameter, and xN_x denotes the set of negative prototypes considered for x. Multi-paradigm fusion. We fuse channel outputs via element-wise gated aggregation: fusion=∑m=1Mαm⊙LayerNorm(m),F_fusion= _m=1^M _m (F_m), (9) with LayerNorm defined by LayerNorm(x)=γx−μσ2+ϵ+β.LayerNorm(x)=γ x-μ σ^2+ε+β. (10) where fusionF_fusion denotes the fused multi-channel representation, αm _m are the channel gating scalars from Eq. (5), ⊙ denotes element-wise multiplication, γ and β are learnable scale and shift parameters, μ and σ2σ^2 denote the mean and variance computed along the normalization axis, and ϵ>0ε>0 is a small constant for numerical stability. 3.4 Data normalization and hardware-aware batching We apply conservative imputations for sparse frequency data: f^i=median(fjj=1n), f_i=median\! (\f_j\_j=1^n ), (11) where fjj=1n\f_j\_j=1^n are the observed clone frequencies for the dataset and f^i f_i denotes the imputed frequency assigned to item i. Batch size is chosen to respect device memory limits: ℬ=min(||,max(32,⌊ℳavailc⋅ℓmax⌋)),B= \! (|S|,\; \! (32,\; M_availc· _ ) ), (12) where |||S| denotes the number of sequences available in the current epoch, ℳavailM_avail denotes available memory in bytes on the compute device, ℓmax _ denotes the maximum sequence length considered, and c denotes a per-sequence memory overhead constant. 3.5 Overview: end-to-end algorithm Algorithm 1 SubQuad (End-to-End Pipeline) 1:Raw sequences S, optional subgroup labels G, target disparity δmax _ 2:Clusters C, graph G, visual summaries 3:Preprocessing: ⊳ see Sec. 3.4 4:Trim/pad sequences, compute MinHash sketches, extract metadata. 5:Build antigen-aware MinHash index; generate candidate list CAND for each query. 6:Embedding: 7:for each x∈x do 8: Compute embedding xv_x using modified ImmunoBERT encoder. ⊳ Eqs. (2), (3) 9: Optionally apply momentum-style parameter updates (Eq. (4)). 10:end for 11:Affinity Computation: 12:for each candidate pair (i,j)∈(i,j) do 13: Compute multi-channel affinities aij(m)m=1M\a^(m)_ij\_m=1^M. ⊳ Eqs. (7), (8) 14: Compute scoring g(m)(xi,xj)g^(m)(x_i,x_j) and weights wij(m)w^(m)_ij via Eq. (13). 15: Fuse affinities to obtain a~ij a_ij via Eq. (14). 16:end for 17:Graph Construction: 18:Construct similarity matrix A=[a~ij]A=[ a_ij] (see Eq. (14)). 19:Apply RMT-based eigenvalue thresholding to A→G=(V,E,W)A→ G=(V,E,W). 20:Fair Clustering: 21:Run fairness-constrained clustering on G (Eq. (15)). 22:Evaluate disparity measures (Eqs. (16)–(17)). 23:Tune λ with automated fairness tuner (see Sec. 3.9) to meet δmax _ . 24:Post-processing & Outputs: 25:Generate visual summaries (UMAP, topological maps, disparity heatmaps). 26:return ,GC,G, and visual summaries. As shown in Algorithm 1, the SubQuad pipeline operates in an end-to-end manner. 3.6 Dynamic affinity fusion (per-pair) We benchmark SubQuad on three complementary missions: retrieving antigen‐enriched neighbours at the sequence level, surfacing rare clonotype clusters across repertoires, and furnishing interactive UMAP and topological maps that clinicians can interrogate without prior machine‐learning expertise. Let aij(m)m=1M\a^(m)_ij\_m=1^M denote affinity channels computed for sequence pair (i,j)(i,j). We compute soft channel scores g(m)(xi,xj)g^(m)(x_i,x_j) and normalize them into per-pair weights: wij(m) w^(m)_ij =exp(g(m)(xi,xj))∑m′=1Mexp(g(m′)(xi,xj)), = (g^(m)(x_i,x_j) ) _m =1^M (g^(m )(x_i,x_j) ), (13) a~ij a_ij =∑m=1Mwij(m)aij(m). = _m=1^Mw^(m)_ij\,a^(m)_ij. (14) where aij(m)a^(m)_ij denotes the affinity score from channel m for pair (i,j)(i,j), g(m)(⋅,⋅)g^(m)(·,·) denotes the small scoring network (e.g., a two-layer MLP) that outputs an unnormalized relevance for channel m, wij(m)w^(m)_ij are the normalized per-pair channel weights from Eq. (13), and a~ij a_ij denotes the fused affinity used to populate the similarity matrix. 3.7 Graph construction and RMT-based thresholding We construct a symmetric similarity matrix A=[a~ij]A=[ a_ij]. To suppress spurious correlations we employ a random-matrix-theory (RMT) inspired thresholding procedure. Concretely, we compute the eigenvalue spectrum of A, estimate the bulk cutoff from that spectrum, and remove edges whose weights fall below the resulting data-driven threshold. The output is a sparse weighted graph G=(V,E,W)G=(V,E,W). Here V denotes the set of nodes, namely sequences, E denotes the set of edges retained after thresholding, and W denotes the associated edge weights. 3.8 Fairness-constrained clustering Immunological motivation. Immune repertoires are highly imbalanced. Rare antigen-specific subgroups, although infrequent, can play critical clinical roles, for example clones that respond to rare pathogens or tumor neoantigens. Clustering methods that emphasize only abundant patterns may overlook these important minorities, which can create blind spots in vaccine or therapy design. To address this challenge, we introduce an explicit equity term into the clustering objective so that biologically meaningful but low-frequency subgroups remain adequately represented for reliable downstream analysis. Since the JS-divergence fairness term may fail to ensure adequate coverage of rare subgroups under long-tailed distributions, we provide a theoretical analysis and propose a novel WCD constraint with convergence guarantees in Appendix D. We perform clustering with a cohesion and equity trade-off objective: min∑i∑xj∈i‖xj−μi‖2+λ∑gJS(|i∩g||g|∥|i|n), _C\; _i _x_j _i\|x_j- _i\|^2+λ _gD_JS\! ( |C_i∩ g||g| \| |C_i|n ), (15) where =iC=\C_i\ denotes the clustering partition, μi _i denotes the centroid of cluster iC_i, g indexes antigenic subgroups, |g||g| denotes the cardinality of subgroup g, n denotes the total number of examples, JS(⋅∥⋅)D_JS(·\|·) denotes the Jensen–Shannon divergence between distributions, and λ≥0λ≥ 0 controls the balance between clustering cohesion and subgroup representation equity. 3.9 Automated fairness tuning (practical) To choose λ that meets a target disparity δmax _ within a bounded search budget we employ a grid search followed by optional local refinement (binary search) as described in Algorithm 3 above; in that algorithm, Δ(λ) (λ) denotes the measured disparity returned by MeasureDisparity when clustering with weight λ. 3.10 Integration and provenance SubQuad integrates two complementary prior ideas: protein-language embeddings adapted from ImmunoBERT-style encoders and a high-performance correlation and network-analysis stack inspired by MetaNet’s RMT thresholding and visualization toolkit. In this work, both components are extended to meet the scale and fairness requirements of repertoire mining and are not used without modification. 3.11 Cross-domain and evaluation metrics We quantify subgroup representation using proportionality and maximum absolute deviation: ℛprop _prop =1||∑g∈|Ci∩g||g|, = 1|G| _g |C_i∩ g||g|, (16) eq _eq =maxg∈||Ci∩g||g|−|Ci|n|, = _g | |C_i∩ g||g|- |C_i|n |, (17) where G denotes the set of antigenic subgroups, |Ci||C_i| denotes the size of cluster CiC_i, |Ci∩g||C_i∩ g| denotes the count of members of cluster CiC_i that belong to subgroup g, and n denotes the total number of examples in the dataset. Here ℛpropR_prop measures average proportional coverage across subgroups and eqD_eq measures the maximum absolute deviation from ideal proportionality. Figure 2: Community structure in immune receptor networks. Vertices denote unique CDR3β sequences, sized by clonal frequency and colored by primary antigen. Edges connect receptors with fused similarity above 0.7; thickness reflects shared epitope count and color indicates antigen class. 4 Experiments Table 1: Comprehensive Performance Comparison of TCR Analysis Tools (10K Sequences).† All improvements ≥3%≥ 3\% are significant at p<0.01p<0.01 under paired bootstrap (10 000 resamples). Tool (Year) Throughput Recall Memory Purity Equity Score (k seq/s) (AUC) (GB) (%) SubQuad (Ours) 97.2 0.985 1.4 92 0.91 BertTCR [41] 84.5 0.970 2.1 87 0.83 TCR-pMHC (PyG) [28] 60.0 0.920 3.5 82 0.78 ProtBert [22] 62.3 0.940 3.8 79 0.75 HeteroTCR [39] 75.0 0.950 1.6 85 0.79 GIANA [40] 45.7 0.930 2.0 83 0.80 TCR-NET [25] 35.0 0.900 2.2 80 0.76 TCRMatch [7] 25.0 0.820 3.0 78 0.72 NAIR [38] 15.0 0.850 3.3 80 0.72 We evaluate SubQuad across several benchmark datasets, including VDJdb, McPAS-TCR, and NEPdb. The full experimental configuration, including data provenance and hardware settings, is documented in Appendix J. To validate the foundational quality of our embeddings, we perform a comparative analysis against state-of-the-art protein language models in a zero-shot setting, as discussed in Appendix H. Qualitative results are further illustrated in Appendix I, where Figure 4 demonstrates the preservation of conserved antigen clusters in the embedding space. The robustness of our pipeline is tested through cross-repertoire quality metrics. By pooling data from multiple unrelated donors to reach a scale of 1 M clones, we demonstrate that SubQuad maintains high recall and cluster purity without sacrificing fairness. Detailed results of these multi-donor evaluations are provided in Appendix C. Additionally, for implementation transparency, Appendix B contains extended complexity analysis, HNSW index characteristics, and the meta-learning routines used for adaptive fairness weight calibration. 4.1 Comprehensive Evaluation Framework Throughput refers to similarity search only, measured on 10K sequences under ideal conditions; end-to-end throughput is lower due to preprocessing and clustering overheads. The 10K-scale experiments use random slices from a large VDJdb repertoire for controlled benchmarking, while million-sequence cross-repertoire tests are reported in section4.8. All runs used fixed seeds and deterministic kernels where possible. Grid search covered MinHash permutations 64,128,256\64,128,256\, similarity threshold τ∈[0.5,0.8]τ∈[0.5,0.8] (step 0.05), and fairness weight λ∈[0,1]λ∈[0,1] (step 0.1). Deployment was evaluated on three environments: a single-node GPU system with dual A100s, a distributed cluster of eight T4 nodes, and a heterogeneous CPU–GPU–FPGA platform. 4.2 Optimized Indexing Mechanism We benchmark SubQuad on three complementary missions: retrieving antigen‐enriched neighbours at the sequence level, surfacing rare clonotype clusters across repertoires, and furnishing interactive UMAP and topological maps that clinicians can interrogate without prior machine‐learning expertise. To accelerate large-scale similarity search on immune repertoires, we adopt an antigen-aware MinHash LSH index with block-aligned storage. The storage efficiency gain is measured as: ℰstorage=ℳFAISS−ℳLSHℳLSH×100%.E_storage\;=\; M_FAISS-M_LSHM_LSH× 100\%. (18) where ℳFAISSM_FAISS denotes the memory consumed by a FAISS index and ℳLSHM_LSH denotes the memory consumed by the LSH index; both are reported in bytes. Organizing MinHash signatures into contiguous antigen-centric blocks reduces random I/O operations by 42% while preserving recall@10 at 98.2%. For repositories of size 10610^6, the contiguous-storage design attains an empirical storage reduction of around 58%. 4.3 Query Processing Efficiency Our query pipeline attains sub-millisecond median latencies under high concurrency through three system optimizations: NUMA-conscious memory partitioning, lock-free coordination via read-copy-update semantics, and multiversion isolation with hybrid logical timestamps. Compared to Cassandra and RedisOLAP baselines, these optimizations deliver a 2.3×2.3× reduction in 90th-percentile latency while meeting clinical timeliness requirements. 4.4 Component Impact Analysis (Ablation) The throughput values in Table 1 represent the peak performance of the similarity kernel, not the end-to-end pipeline. We performed controlled ablation to quantify the contribution of each major module. The results are shown in Table 2. Key observations are that GPU parallelism yields measured throughput gains, empirically around 67%. Equity-aware objectives significantly improve cluster purity by approximately 16% compared to fairness-excluded variants, with only a modest impact on throughput. Finally, embedding-only pipelines trade memory efficiency for lower throughput and reduced purity. Table 2: Architectural Component Impact Assessment. Configuration Throughput (k seq/s) Memory (GB) Purity (%) Full Framework (SubQuad) 97.2 1.4 92 MinHash + GPU Acceleration 84.5 2.1 87 Fairness Constraints Excluded 102.1 1.3 76 Sequence Embeddings Only 45.7 4.2 82 Oncogenic Focus (tumor subset) 89.4 1.6 86 4.5 Algorithmic Performance Benchmark We compared algorithmic families in terms of asymptotic behaviour and empirical wall-clock times. Representative results are reported in Table 3. The hybrid retrieval pipeline used in SubQuad (prefiltering via MinHash followed by GPU-parallel similarity kernels) delivers near-subquadratic wall-clock scaling for practical repertoire sizes and substantially reduces the candidate-pair set before expensive pairwise evaluations. Table 3: Algorithmic Complexity and Empirical Time Comparison. Algorithm Complexity Parameters Time (s) γ-Ward Clustering O(n1+1/γ)O(n^1+1/γ) γ=8γ=8 1.87 3SUM-Optimized Routine O(n2/polylogn)O(n^2/polylog\,n) w=64w=64 2.94 Optimized LSH Pipeline O(n1+1/γ)O(n^1+1/γ) γ=2γ=2 0.68 HNSW Approximate N (our deployment) O(nlogn)O(n n) ef=200 0.71 4.6 Immunological Performance and Robustness As shown in Table 4, in the tumor neoantigen setting enforcing fairness via tuning the Demographic Parity weight λDP _DP reduced subgroup representation bias, measured by the Jensen–Shannon divergence, to approximately 12 percent, whereas the same metric exceeded 20 percent when fairness constraints were not applied. This reduction in representational disparity translated into higher prioritization rates for rare antigen-specific clonotypes, thereby supporting the practical immunological value of the fairness constraint. We evaluated performance across multiple disease contexts, including viral, tumor, and autoimmune settings. Table 4 summarizes per-context metrics. All disparity and fairness measures reported here follow the definitions presented in Section 3.8 and are computed on held-out validation splits. For clinical translation, we observed that Demographic Parity, tuned via λDP _DP, was particularly effective for tumor neoantigen coverage, while Equalized Odds, tuned via λEO _EO, improved subgroup-balanced recall in viral epitope classification. Table 4: Immunological Performance Across Disease Contexts. Metric SARS-CoV-2 CMV EBV Tumor Autoimmune Epitope Identification 89% 85% 82% 84% 80% Cluster Homogeneity 92% 88% 86% 86% 83% JS Disparity 9% 11% 13% 12% 15% DP Disparity 7% 9% 10% 8% 12% EO Disparity 8% 10% 12% 9% 14% Processing Duration 38 min 42 min 45 min 41 min 48 min 4.7 Visual Analytics and Clinical Integration We integrate interactive visual analytics, including UMAP projections, topological community views, disparity heatmaps, and performance–equity trade-off curves, into a clinician-facing dashboard. Figures included with the submission illustrate embedding structure (Fig. 4), topological communities (Fig. 2). These visualizations were used during multicenter pilot studies to prioritize wet-lab validation and to accelerate decision cycles. 4.8 Scalability Evaluation Processing one million sequences completed in under 40 minutes on a single node; ten million sequences required 6.3 hours with a peak memory of 186 GB. In distributed Spark clusters, communication accounted for 22.7% of runtime. Fairness constraints kept subgroup disparity below 10% when λ was within task-appropriate ranges (see Appendix B.16). At 10610^6 sequences, SubQuad achieved recall@100 ≥0.96≥ 0.96 (±0.01± 0.01, n=3n=3) versus 0.920.92 (±0.02± 0.02) for the MinHash-only baseline, confirming scalability without loss of retrieval quality. To evaluate multi-donor generalisation, we concatenated 1 M CDR3β sequences from ten unrelated repertoires; the corresponding quality metrics are provided in Appendix C. 4.9 Cross-Domain Impact and Practical Takeaways SubQuad accelerates similarity search (see Table 1), reduces storage requirements, preserves minority-variant representation through fairness tuning, and provides clinician-oriented tools that streamline experimental validation. 5 Conclusion We present SubQuad, a end-to-end framework integrating antigen-aware retrieval, GPU-accelerated similarity evaluation, multimodal feature fusion, and fairness-constrained clustering for large-scale immune repertoire analysis. The pipeline combines MinHash prefiltering with parallel similarity kernels to reduce candidate comparisons while maintaining recall and cluster purity. Empirical results show that SubQuad improves throughput, reduces memory consumption, and that fairness constraints effectively reduce subgroup disparities. The system supports interactive analytics, integration with sequencing workflows, and federated deployments. Importantly, our fairness constraints are grounded in immunological principles: the immune system relies on diversity and coverage to counter pathogen variation, and computational models should mirror this by ensuring low-frequency but clinically significant clones are not overlooked. By aligning computational objectives with biological realities, SubQuad provides a principled platform for scalable immunoinformatics and translational discovery. Future work will extend SubQuad to model longitudinal repertoire dynamics, incorporate epitope- and phenotype-supervised representations, and evaluate privacy-preserving federated learning across multi-center cohorts. References [1] A. Abboud, V. Cohen-Addad, and H. Houdrouge (2019) Subquadratic high-dimensional hierarchical clustering. Advances in Neural Information Processing Systems 32. Cited by: §1. [2] R. Alcazar, M. Alvarez, R. Arnold, M. Ayalew, et al. (2022) Diversifying the genomic data science research community. Genome Research 32 (7), p. 1231–1241. Cited by: §2.4. [3] A. Andoni, P. Indyk, H. L. Nguyen, and I. Razenshteyn (2014) Beyond locality-sensitive hashing. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, p. 1018–1028. Cited by: §1, §2.1. [4] A. Bibi, A. Alqahtani, and B. Ghanem (2023) Constrained clustering: general pairwise and cardinality constraints. IEEE Access 11, p. 5824–5836. Cited by: §2.4. [5] B. Brubach, D. Chakrabarti, J. P. Dickerson, A. Srinivasan, and L. Tsepenekas (2021) Fairness, semi-supervised learning, and more: a general framework for clustering with stochastic pairwise constraints. In Proceedings of the AAAI conference on artificial intelligence, Vol. 35, p. 6822–6830. Cited by: §2.4. [6] B. Chen, X. Cheng, P. Li, Y. Geng, J. Gong, S. Li, Z. Bei, X. Tan, B. Wang, X. Zeng, et al. (2024) XTrimoPGLM: unified 100b-scale pre-trained transformer for deciphering the language of protein. arXiv preprint arXiv:2401.06199. Cited by: Table 5. [7] W. D. Chronister, A. Crinklaw, S. Mahajan, R. Vita, Z. Koşaloğlu-Yalçın, Z. Yan, J. A. Greenbaum, L. E. Jessen, M. Nielsen, S. Christley, et al. (2021) TCRMatch: predicting t-cell receptor specificity based on sequence similarity to previously characterized receptors. Frontiers in immunology 12, p. 640725. Cited by: Table 1. [8] S. Corbett-Davies, E. Pierson, A. Feller, S. Goel, and A. Huq (2017) Algorithmic decision making and the cost of fairness. Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, p. 797–806. Cited by: §2.4. [9] J. Dickerson, S. Esmaeili, J. H. Morgenstern, and C. J. Zhang (2023) Doubly constrained fair clustering. Advances in Neural Information Processing Systems 36, p. 13267–13293. Cited by: §2.4. [10] L. Franceschi, M. Niepert, M. Pontil, and X. He (2019) Learning discrete structures for graph neural networks. In International conference on machine learning, p. 1972–1982. Cited by: §2.3. [11] D. Fu, D. Zhou, R. Maciejewski, A. Croitoru, M. Boyd, and J. He (2023) Fairness-aware clique-preserving spectral clustering of temporal graphs. In Proceedings of the ACM Web Conference (W), p. 3755–3765. Cited by: §2.4. [12] T. Fu, X. E. Wang, S. T. Grafton, M. P. Eckstein, and W. Y. Wang (2022) M3L: language-based video editing via multi-modal multi-level transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), p. 10513–10522. Cited by: §2.2. [13] H. Gasser, G. Bedran, B. Ren, D. Goodlett, J. Alfaro, and A. Rajan (2021) Interpreting bert architecture predictions for peptide presentation by mhc class i proteins. arXiv preprint arXiv:2111.07137. Cited by: §2.2, §3. [14] F. Huang, H. Liu, H. Ou, M. Wang, and X. Zuo (2025) CS-phylo: accelerating evolutionary distance estimation with closed syncmer-enhanced minhash. In International Conference on Intelligent Computing (ICIC 2025), p. 80–91. Cited by: §2.1. [15] D. Jin, Z. Qi, Y. Luo, and Y. Shan (2021) TransFusion: multi-modal fusion for video tag inference via translation-based knowledge embedding. In Proceedings of the 29th ACM International Conference on Multimedia, p. 1093–1101. Cited by: §2.2. [16] J. Johnson, M. Douze, and H. Jégou (2019) Billion-scale similarity search with gpus. IEEE Transactions on Big Data 7 (3), p. 535–547. Cited by: §2.1. [17] R. Kobus (2023) Accelerating bioinformatics applications on cuda-enabled multi-gpu systems. Ph.D. Thesis, Johannes Gutenberg-Universität Mainz. Cited by: §2.1, §2.5. [18] B. E. Langer, A. Amaral, M. Baudement, et al. (2025) Empowering bioinformatics communities with nextflow and nf-core. Genome Biology 26 (1), p. 228. Cited by: §2.5. [19] Z. Lin, H. Akin, R. Rao, B. Hie, Z. Zhu, W. Lu, N. Smetanin, R. Verkuil, O. Kabeli, Y. Shmueli, et al. (2023) Evolutionary-scale prediction of atomic-level protein structure with a language model. Science 379 (6637), p. 1123–1130. Cited by: 1st item, Table 7. [20] Z. Liu, S. Zhang, J. Garrigus, and H. Zhao (2023) Genomics-gpu: a benchmark suite for gpu-accelerated genome analysis. In 2023 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS), p. 178–188. Cited by: §1, §2.5. [21] I. Manipur, M. Giordano, M. Piccirillo, S. Parashuraman, and L. Maddalena (2021) Community detection in protein-protein interaction networks and applications. IEEE/ACM Transactions on Computational Biology and Bioinformatics 20 (1), p. 217–237. Cited by: §2.3. [22] K. Motuzenko and I. Makarov (2023) Analyzing immunomes using sequence embedding and network analysis. In 2023 IEEE 21st World Symposium on Applied Machine Intelligence and Informatics (SAMI), p. 000325–000330. Cited by: Table 1. [23] S. Nguyen, A. Wang, and A. Montillo (2023) Fairness-enhancing mixed effects deep learning improves fairness on in-and out-of-distribution clustered (non-iid) data. arXiv preprint arXiv:2310.03146. Cited by: §2.4. [24] C. Peng, Z. Huang, X. Wei, L. Jiang, X. Zhu, Z. Liu, Q. Chen, X. Shen, P. Gao, and C. Jiang (2025) MetaNet: a scalable and integrated tool for reproducible omics network analysis. bioRxiv, p. 2025–06. Cited by: §3. [25] P. Richter (2021) Large-scale gpu-based network analysis of the human t-cell receptor repertoire. arXiv preprint arXiv:2112.06613. Cited by: Table 1. [26] S. Sankaran, D. Yang, and S. Lim (2021) Multimodal fusion refiner networks. arXiv preprint arXiv:2104.03435. Cited by: §2.2. [27] M. Shugay, D. V. Bagaev, I. V. Zvyagin, R. M. Vroomans, J. C. Crawford, G. Dolton, E. A. Komech, A. L. Sycheva, A. E. Koneva, E. S. Egorov, et al. (2018) VDJdb: a curated database of t-cell receptor sequences with known antigen specificity. Nucleic acids research 46 (D1), p. D419–D427. Cited by: Table 8, 1st item. [28] J. K. Slone, A. Conev, M. M. Rigo, A. Reuben, and L. E. Kavraki (2025) TCR-pmhc binding specificity prediction from structure using graph neural networks. IEEE Transactions on Computational Biology and Bioinformatics. Cited by: Table 1. [29] Y. Son, C. Kim, and J. Lee (2025) FED: fast and efficient dataset deduplication framework with gpu acceleration. arXiv preprint arXiv:2501.01046. Cited by: §2.1. [30] P. Sun, D. Simcha, D. Dopson, R. Guo, and S. Kumar (2023) SOAR: improved indexing for approximate nearest neighbor search. Advances in Neural Information Processing Systems 36, p. 3189–3204. Cited by: §2.1. [31] N. Tickotsky, T. Sagiv, J. Prilusky, E. Shifrut, and N. Friedman (2017) McPAS-tcr: a manually curated catalogue of pathology-associated t cell receptor sequences. Bioinformatics 33 (18), p. 2924–2929. Cited by: Table 8, 2nd item. [32] C. Tran, S. Khadkikar, and A. Porollo (2023) Survey of protein sequence embedding models. International Journal of Molecular Sciences 24 (4), p. 3775. Cited by: §2.2. [33] Y. Turakhia, K. J. Zheng, G. Bejerano, and W. J. Dally (2017) Darwin: a hardware-acceleration framework for genomic sequence alignment. Biorxiv, p. 092171. Cited by: §1, §2.5. [34] A. S. Wagner, L. K. Waite, M. Wierzba, F. Hoffstaedter, et al. (2022) FAIRly big: a framework for computationally reproducible processing of large-scale data. Scientific Data 9 (1), p. 80. Cited by: §2.5. [35] F. Wu, Y. Ma, H. Jin, X. Jing, and G. Jiang (2023) MFECLIP: clip with mapping-fusion embedding for text-guided image editing. IEEE Signal Processing Letters 31, p. 116–120. Cited by: §2.2. [36] J. Xia, P. Bai, W. Fan, Q. Li, Y. Li, D. Wang, L. Yin, and Y. Zhou (2021) NEPdb: a database of t-cell experimentally-validated neoantigens and pan-cancer predicted neoepitopes for cancer immunotherapy. Frontiers in Immunology 12, p. 644637. Cited by: Table 8. [37] M. Xu, X. Yuan, S. Miret, and J. Tang (2023) Protst: multi-modality learning of protein sequences and biomedical texts. In International Conference on Machine Learning, p. 38749–38767. Cited by: 2nd item, Table 7. [38] H. Yang, J. Cham, B. P. Neal, Z. Fan, T. He, and L. Zhang (2023) NAIR: network analysis of immune repertoire. Frontiers in Immunology 14, p. 1181825. Cited by: Table 1. [39] Z. Yu, M. Jiang, and X. Lan (2024) HeteroTCR: a heterogeneous graph neural network-based method for predicting peptide-tcr interaction. Communications Biology 7 (1), p. 684. Cited by: Table 1. [40] H. Zhang, X. Zhan, and B. Li (2021) GIANA allows computationally-efficient tcr clustering and multi-disease repertoire classification by isometric transformation. Nature communications 12 (1), p. 4699. Cited by: Table 1. [41] M. Zhang, Q. Cheng, Z. Wei, J. Xu, S. Wu, N. Xu, C. Zhao, L. Yu, and W. Feng (2024) BertTCR: a bert-based deep learning framework for predicting cancer-related immune status based on t cell receptor repertoire. Briefings in Bioinformatics 25 (5), p. bbae420. Cited by: Table 1. [42] Y. Zhang, M. Lang, J. Jiang, Z. Gao, F. Xu, T. Litfin, K. Chen, J. Singh, X. Huang, G. Song, et al. (2024) Multiple sequence alignment-based rna language model and its application to structural inference. Nucleic Acids Research 52 (1), p. e3. External Links: Document Cited by: §2.2. [43] J. Zhao, J. P. Both, L. M. Rodriguez-R, and K. T. Konstantinidis (2024) GSearch: ultra-fast and scalable genome search by combining k-mer hashing with hierarchical navigable small world graphs. Nucleic Acids Research 52 (16), p. e74. External Links: Document Cited by: §2.1. Appendix A Repertoire-Level Distance Measure To compare two immune repertoires at the library scale we compress each repertoire into a compact graph summary using the SubQuad construction pipeline and then quantify divergence between the resulting summaries. This subsection defines two complementary repertoire-level distances: a population-level divergence based on cluster-mass distributions and a structural measure based on graph edit operations. The SubQuad pipeline used to produce graph summaries is described in the main text and supplementary materials. Cluster-mass Jensen–Shannon distance. Let ℛAR_A and ℛBR_B be two repertoires and let GA=(VA,EA,WA)G_A=(V_A,E_A,W_A) and GB=(VB,EB,WB)G_B=(V_B,E_B,W_B) be their sparse, weighted summaries produced by the pipeline. Apply the same clustering procedure to each graph to obtain K-partitions A=CA(k)k=1K,B=CB(k)k=1K.C_A=\C_A^(k)\_k=1^K, _B=\C_B^(k)\_k=1^K. (19) Define the cluster-mass (proportion) vectors A,B∈ΔK−1p_A,p_B∈ ^K-1 with components pA(k)=|CA(k)||VA|,pB(k)=|CB(k)||VB|.p_A^(k)\;=\; |C_A^(k)||V_A|, p_B^(k)\;=\; |C_B^(k)||V_B|. (20) where |CA(k)||C_A^(k)| denotes the number of nodes assigned to cluster k in GAG_A and |VA||V_A| denotes the total node count of GAG_A. Let JS(A∥B)D_JS(p_A\|p_B) denote the Jensen–Shannon divergence between the discrete distributions Ap_A and Bp_B: JS(A∥B) _JS(p_A\|p_B) =12DKL(A∥A+B2)+12DKL(B∥A+B2). = 12D_KL\! (p_A \| p_A+p_B2 )+ 12D_KL\! (p_B \| p_A+p_B2 ). (21) where DKL(P∥Q)=∑kPklog(Pk/Qk)D_KL(P\|Q)= _kP_k (P_k/Q_k) is the Kullback–Leibler divergence and the base of the logarithm is chosen consistently across the manuscript. We convert this bounded divergence into a metric-like distance by taking the square root: rep(JS)(ℛA,ℛB)=JS(A∥B).D_rep^(JS)(R_A,R_B)\;=\; D_JS(p_A\|p_B). (22) where rep(JS)D_rep^(JS) is the repertoire-level JS distance; the square root improves metric properties and is widely used in information-theoretic comparisons. Computational cost and remarks. Given the cluster assignments, forming Ap_A and Bp_B requires counting cluster memberships and thus costs O(|VA|+|VB|)O(|V_A|+|V_B|) time and O(K)O(K) memory. Evaluating the Jensen–Shannon divergence requires O(K)O(K) arithmetic operations to form the mixture (A+B)/2(p_A+p_B)/2 and the two KL terms. Therefore, excluding the cost of producing the partitions, the JS-based repertoire distance is computable in O(|VA|+|VB|+K)O(|V_A|+|V_B|+K) time. The dominant cost in practice is the clustering step: if the user employs fairness-constrained spectral clustering, computing the first K eigenvectors of a sparse graph Laplacian with an iterative method (Lanczos or implicitly restarted Lanczos) typically costs O(|E|⋅K)O(|E|· K) time in sparse regimes and requires O(|V|+|E|)O(|V|+|E|) memory; please report the eigensolver and tolerance when benchmarking. Graph edit distance. An alternative that directly compares structure is the graph edit distance between GAG_A and GBG_B. Let Π denote the set of partial node mappings that pair nodes of GAG_A to nodes of GBG_B or to a null symbol representing insertion/deletion. Define GED(GA,GB)=minπ∈Π∑v∈VAcv(v,π(v))+∑(u,v)∈EAce((u,v),(π(u),π(v))).D_GED(G_A,G_B)\;=\; _π∈ \; \ _v∈ V_Ac_v (v,π(v) )+ _(u,v)∈ E_Ac_e ((u,v),(π(u),π(v)) ) \. (23) where cv(⋅,⋅)c_v(·,·) is the cost of substituting a node in GAG_A with a node in GBG_B or deleting/inserting a node when π(v)=∅π(v)= , and ce(⋅,⋅)c_e(·,·) is the cost of substituting or deleting/inserting an edge. Typical choices set node substitution cost to a sequence- or embedding-based dissimilarity and edge cost to the absolute difference of weights or a binary mismatch penalty. Normalization and symmetrization. For comparability across different graph sizes we recommend the normalized form ~GED(GA,GB)=GED(GA,GB)max|VA|,|VB|+max|EA|,|EB|. D_GED(G_A,G_B)\;=\; D_GED(G_A,G_B) \|V_A|,|V_B|\+ \|E_A|,|E_B|\. (24) where the denominator is a simple scale factor that bounds ~GED D_GED to a finite range and facilitates interpretation. Complexity and practical considerations. Computing the exact graph edit distance is NP-hard and exact solvers have worst-case exponential scaling in the number of nodes and possible edits. Consequently exact computation becomes infeasible for repertoire graphs of realistic size. Practical alternatives include assignment relaxations that cast node matching as a linear assignment problem with an n×n× n cost matrix and solve it by the Hungarian algorithm in O(n3)O(n^3) time, where n=max(|VA|,|VB|)n= (|V_A|,|V_B|). More scalable heuristics use greedy matching, beam search, A* search with admissible heuristics, graph embedding plus optimal transport (approximate Earth Mover’s Distance), or graph kernels; these methods trade guarantees for tractability and often run in O(n2)O(n^2) or near-linear time in sparse settings. When structural fidelity is essential and graphs are small to moderate, use an assignment-based approximation and report the solver and its empirical runtime. When graph sizes exceed practical exact/assignment limits, prefer the JS cluster-mass measure or embed graphs into a low-dimensional space and compare embeddings with a fast distance. Which distance to use in practice The cluster-mass Jensen–Shannon distance is fast to compute once clusters are available, interpretable at the population level, and well suited for large-scale comparisons where proportional shifts are the main interest. The graph edit distance captures node-level and topological rearrangements and is the proper choice when structural differences (for example, re-wiring of antigen neighborhoods) are the primary concern. For comprehensive studies we recommend reporting both measures: use rep(JS)D_rep^(JS) for routine, scalable comparisons and present ~GED D_GED or an assignment-based approximation for a subset of pairs where structural interpretation is required. In all cases report the clustering routine (including solver and tolerances) and the GED approximation algorithm together with empirical runtimes so that comparisons remain verifiable. Appendix B Classical Acceleration and Fairness Theory This appendix documents the classical acceleration components and theoretical extensions used in SubQuad. We provide complexity expressions, empirical HNSW characteristics, index and storage measurements, fairness guarantees, meta-learning controllers for adaptive fairness weighting, and detailed experimental configurations to support transparent evaluation and implementation. B.1 Overview and Notation We denote by n the total number of immune receptor sequences processed and by C the set of candidate pairs surviving prefiltering. All asymptotic statements use big-O notation with implementation-dependent constants omitted for clarity. B.2 Computational Complexity of Near-Subquadratic Retrieval We model the end-to-end retrieval pipeline as two stages: MinHash prefiltering followed by approximate nearest neighbor refinement using HNSW. The runtime is IG(n)=O(||)+O(nlogn).T_IG(n)\;=\;O(|C|)\;+\;O(n n). (25) where n denotes the total number of sequences processed and |||C| denotes the number of candidate comparisons after MinHash prefiltering. When MinHash parameters are tuned so that ||=O(nlogn)|C|=O(n n), the pipeline exhibits near linearithmic growth: IG(n)=O(nlogn).T_IG(n)\;=\;O(n n). (26) where n denotes the number of sequences and the big-O notation hides implementation and index-parameter constants. B.3 MinHash Prefiltering and Retrieval Complexity Let M be the MinHash sketch size and s the average number of refinement probes per candidate. The retrieval complexity conditioned on the candidate set is retrieval=O(||⋅s).T_retrieval\;=\;O(|C|· s). (27) where |||C| denotes the candidate count after prefiltering and s denotes the average probes per candidate during refinement. B.4 HNSW Fallback: Empirical Characteristics For large-scale retrieval we employ Hierarchical Navigable Small World graphs (HNSW) as the classical refinement index. The practical query complexity is well-approximated by HNSW=O(nlogn).T_HNSW\;=\;O(n n). (28) where n denotes the total number of indexed items and the asymptotic expression assumes fixed library parameters (e.g., ef and M). Figure 3 reports empirical median and p98 latencies for a 10710^7-sequence index under the efConstruction=200 and M=16 configuration used in our experiments. Figure 3: Latency scaling of HNSW retrieval under 10710^7 sequences. The plot shows observed median and p98 latencies for varying query batch sizes. B.5 Index Storage Efficiency We quantify the storage savings of the MinHash index layout relative to a FAISS baseline by ℰstorage=ℳFAISS−ℳLSHℳLSH×100%.E_storage\;=\; M_FAISS-M_LSHM_LSH× 100\%. (29) where ℳFAISSM_FAISS denotes the FAISS index memory footprint in bytes and ℳLSHM_LSH denotes the MinHash index memory footprint in bytes. All measured index sizes and the exact measurement protocol are provided in the supplementary materials to enable replication. B.6 Sampling Error Bounds for Classical Prefiltering For a MinHash sketch of size M, the standard error of a Jaccard estimate scales as 1/M1/ M. Thus the practical bound on prefiltering error is ℰprefilter≤1M+ϵimpl.E_prefilter\;≤\; 1 M+ _impl. (30) where M denotes the MinHash sketch size and ϵimpl _impl captures implementation and numeric quantization effects. Parameter sweep results for M are reported in the supplementary materials and guided our production settings. B.7 Theoretical Comparison to Subquadratic Methods Assuming block-aligned MinHash and constant probe counts s, with ||=O(nlogn)|C|=O(n n) we obtain near linearithmic retrieval: retrieval=O(nlogn).T_retrieval\;=\;O(n n). (31) where n denotes the number of sequences and the bound assumes MinHash prefiltering reduces candidate growth to O(nlogn)O(n n). B.8 Fairness Theory: Clinical Adaptation Principle We formalize selection of fairness metrics in clinical settings. Let ℛR_T denote the clinical risk associated with task T and let fairmD_fair^m denote a fairness discrepancy measure indexed by m∈JS,DP,EOm∈\JS,DP,EO\. The preferred metric is m∗=argminm∈JS,DP,EO∂ℛ∂fairm.m^*\;=\; _m∈\JS,DP,EO\ _T _fair^m. (32) where ℛR_T denotes clinical risk for task T and fairmD_fair^m denotes the fairness metric under consideration. Operationally, Jensen–Shannon divergence is preferred when proportional resource allocation is the objective, whereas Equalized Odds is preferred for diagnostic systems where balanced error rates are essential. B.9 Convergence of Multi-Objective Fairness Calibration Let ()J( λ) denote the expected fairness objective and assume ‖∇‖≤G\| \|≤ G. For a decaying step size ηt=η0t−α _t= _0t^-α with α∈(0.5,1]α∈(0.5,1], we obtain min1≤t≤T[‖∇(t)‖2]≤C1T1−α+C2Tα, _1≤ t≤ TE [\| ( λ_t)\|^2 ]\;≤\; C_1T^1-α+ C_2T^α, (33) where C1C_1 and C2C_2 are constants that depend on G and η0 _0. This bound informs practical step-size selection for fairness calibration routines. B.10 Meta-Learning Controller for Adaptive Fairness Weighting We use a lightweight neural controller that maps clinical risk features riskf_risk to a fairness weight vector λ. The controller is trained to minimize expected clinical risk subject to fairness constraints; algorithmic pseudocode follows. Algorithm 2 Meta Controller for Fairness Weighting 1:Clinical feature vector riskf_risk 2:Fairness weights λ 3:←ReLU(1risk+1)h (W_1f_risk+b_1) 4:←2+2s _2h+b_2 5:←softmax() λ (s) 6:return λ In closed form the weight for metric m is λm=exp(sm)∑j∈JS,DP,EOexp(sj). _m\;=\; (s_m) _j∈\JS,DP,EO\ (s_j). (34) where sms_m denotes the controller score for metric m produced from clinical risk features. B.11 Clinical Guarantees and Practical Bounds Two canonical deployment scenarios illustrate practical behavior. Diagnostic systems (Equalized Odds emphasis). Empirically we observe exponential decay of false negative rate disparity with calibration iterations T: |FNR(g)−FNR(¬g)|≤κ1e−γ1T,|FNR(g)-FNR( g)|\;≤\; _1e^- _1T, (35) where FNR(g)FNR(g) denotes the false negative rate for subgroup g and κ1,γ1 _1, _1 depend on data heterogeneity and step-size selection. Resource allocation (Jensen–Shannon emphasis). Subgroup proportionality improves polynomially with iterations: maxg||Ci∩g||g|−|Ci|n|≤κ2T−β, _g | |C_i∩ g||g|- |C_i|n |\;≤\; _2T^-β, (36) where |Ci||C_i| denotes cluster cardinality, |g||g| denotes subgroup size, and κ2,β _2,β are empirically determined constants. B.12 Clinical Risk Gradient Estimation We estimate the clinical risk gradient via finite differences for real-time adaptation: ∇λmℛ^=1K∑k=1Kℛ(+δkm)−ℛ(−δkm)2δk. _ _mR_T\;=\; 1K _k=1^K R_T( λ+ _ke_m)-R_T( λ- _ke_m)2 _k. (37) where K denotes the number of perturbation samples, δk _k are small perturbation magnitudes, and me_m is the standard basis vector for metric m. B.13 Extended Comparative Analysis with Foundation Models Table 5 reports similarity-search kernel throughput and peak-memory footprint for 10710^7 sequences, extrapolated from our 10K-sequence component-level benchmark under ideal GPU conditions. These figures are theoretical maxima for the affinity computation phase only; they do not include I/O, MinHash indexing, clustering, or fairness-calibration overheads. For measured end-to-end performance (pre-processing → clustering → fairness tuning) at the 10710^7 scale, please refer to the real-time results reported in Section4.8. Table 5: Component-level throughput and memory efficiency at 10710^7 sequence scale (extrapolated). Model Kernel throughput (k seq/s) Peak memory (GB) AUC xTrimoPGLM [6] 72.1 8.3 0.91 SubQuad (affinity kernel only) 89.4 1.6 0.98 B.14 Biological Representation Efficiency We report biological representation efficiency as ℰbio=ΦOOD,E_bio\;=\; P_OOD, (38) where Φ denotes throughput and OODP_OOD denotes an out-of-distribution perplexity estimate for the evaluated sequences. B.15 Bayesian Parameter Optimization Our multi-objective refinement criterion uses Gaussian processes to optimize a compound objective: (λ)=αΦ+βℛ@10−γΔfair,J(λ)\;=\;α + @10-γ _fair, (39) where Φ is throughput, ℛ@10R@10 denotes recall@10, and Δfair _fair denotes the maximum subgroup disparity observed. Adaptive fairness tuning uses the bisection-style routine listed in Algorithm 3 to find a λ that meets a specified disparity threshold. Algorithm 3 Fairness Tuning via Binary Search 1:Dataset D, target disparity threshold δmax _ 2:Optimal fairness parameter λ 3:λlow←0 _low← 0 4:λhigh←1 _high← 1 5:λ←0.5λ← 0.5 ⊳ Initial guess 6:while (λhigh−λlow)>0.05( _high- _low)>0.05 do 7: λ←(λlow+λhigh)/2λ←( _low+ _high)/2 8: Δ←MeasureDisparity(,λ) ← MeasureDisparity(D,λ) 9: if Δ>δmax > _ then 10: λlow←λ _low←λ ⊳ Disparity too high, increase fairness penalty 11: else 12: λhigh←λ _high←λ ⊳ Threshold met, try reducing penalty 13: end if 14:end while 15:return λ B.16 Parameter Sensitivity Analysis Grid searches indicate MinHash dimensionality k=128k=128 yields a good precision–recall trade-off and similarity threshold τ=0.7τ=0.7 maximizes F-score. The empirically observed equity coefficients that balanced fairness and utility on validation splits are λopt=0.5for viral antigens,0.6for tumor neoantigens. _opt\;=\; cases0.5&for viral antigens,\\[3.0pt] 0.6&for tumor neoantigens. cases (40) where λopt _opt denotes the equity coefficient achieving the best validation fairness-utility trade-off for each antigen category. Appendix C Cross-Repertoire Quality Metrics To confirm that SubQuad maintains high recall and cluster purity when confronted with large-scale, multi-donor data, we pooled CDR3β sequences from ten unrelated individuals (total 1 M clones) and reran the evaluation pipeline. As shown in Table 6, SubQuad achieves recall@100 of 0.96 (±0.01) and cluster purity of 0.91 (±0.01), while keeping Jensen–Shannon disparity below 8 These figures are competitive with the single-repertoire results reported in the main text, demonstrating that scalability does not come at the expense of biological fidelity. Table 6: Quality metrics on 1 M-sequence cross-repertoire mix (10 donors, mean ± std, n=3). Method Recall@100 Purity JS-Disparity (%) SubQuad 0.96 ± 0.01 0.91 ± 0.01 8 ± 1 MinHash-GPU baseline 0.89 ± 0.02 0.84 ± 0.02 19 ± 2 Appendix D Theoretical Extensions on Fairness Constraints D.1 Limitation of JS Divergence in Long-Tailed Distributions Theorem D.1 (Coverage Lower Bound under JS Divergence). In long-tailed immune repertoire distributions, the Jensen-Shannon (JS) divergence fairness constraint may fail to guarantee adequate coverage for rare antigenic subgroups. Specifically, for a subgroup g with cardinality |g||g| satisfying |g|/n≤ϵ|g|/n≤ε where ϵ>0ε>0 is a small constant representing rarity, and for a clustering partition =iC=\C_i\ with k≥2k≥ 2 clusters, the maximum coverage Coverage(g)=maxi|i∩g||g|Coverage(g)= _i |C_i∩ g||g| under the JS divergence constraint in Equation (14) of the main text approaches zero as ϵ→0ε→ 0 when the fairness weight λ is fixed. Proof. Let Pg=|i∩g||g|P_g= |C_i∩ g||g| and Qg=|i|nQ_g= |C_i|n denote the proportional representations. The JS divergence term JS(Pg∥Qg)D_JS(P_g\|Q_g) is minimized when Pg≈QgP_g≈ Q_g. However, for rare subgroups where |g|/n≤ϵ|g|/n≤ε, QgQ_g is inherently small. The clustering objective in Equation (14) prioritizes minimizing the within-cluster variance, which may lead to |i∩g||g|→0 |C_i∩ g||g|→ 0 for all i if λ is not sufficiently large to counteract the dominance of majority groups. Formally, as ϵ→0ε→ 0, the gradient of the fairness term with respect to cluster assignments diminishes, resulting in Coverage(g)→0Coverage(g)→ 0 for any fixed λ. This indicates that JS divergence alone cannot ensure non-zero coverage for rare subgroups without adaptive weighting. ∎ D.2 New Constraint: Weighted Coverage Divergence (WCD) To address the limitation in Theorem D.1, we propose a novel fairness constraint termed Weighted Coverage Divergence (WCD). This constraint explicitly enforces a lower bound on the coverage of rare subgroups. Definition D.1 (Weighted Coverage Divergence (WCD)). For a clustering partition C and a subgroup g, the WCD is defined as: WCD(,g)=∑i=1kwg⋅||i∩g||g|−τg|,D_WCD(C,g)= _i=1^kw_g· | |C_i∩ g||g|- _g |, (41) where wg=1|g|w_g= 1|g| is a weight inversely proportional to the subgroup size to emphasize rare subgroups, and τg _g is a target coverage threshold set to ensure minimal representation, typically τg≥τ _g≥τ for a constant τ>0τ>0. The overall fairness objective becomes: min∑i=1k∑xj∈i‖xj−μi‖2+λ∑g∈WCD(,g). _C _i=1^k _x_j _i\|x_j- _i\|^2+λ _g D_WCD(C,g). (42) Theorem D.2 (Coverage Lower Bound under WCD). Under the WCD constraint with weight wgw_g and target τg _g, for any subgroup g with |g|/n≤ϵ|g|/n≤ε, the coverage Coverage(g)Coverage(g) is guaranteed to be at least τ provided that λ is chosen such that λ≥1τ⋅Var()λ≥ 1τ·Var(C), where Var()Var(C) denotes the maximum within-cluster variance. Proof. The WCD term WCD(,g)D_WCD(C,g) penalizes deviations from τg _g proportionally to wgw_g. For rare g, wgw_g is large, amplifying the penalty. By setting τg=τ _g=τ, the minimization ensures that |i∩g||g|≥τ |C_i∩ g||g|≥τ for some i because otherwise, the WCD term would dominate the objective. The condition on λ ensures that the fairness term has sufficient influence to override the variance minimization. A detailed derivation using Lagrange multipliers shows that the coverage lower bound holds with high probability for large n. ∎ Clinical implication. For clonotypes that constitute ≤0.01%≤ 0.01\,\% of the global repertoire, WCD guarantees a minimum coverage τ in at least one cluster (Theorem˜D.2), thereby preventing the inadvertent exclusion of vaccine-relevant epitopes. For the neo-antigen subset (0.01%0.01\,\% frequency), WCD-enforced clustering lifts the fraction of recovered sequences from 38%38\,\% (JS-only) to 71%71\,\%, corresponding to a 2.4-fold increase in experimentally validated epitopes. D.3 Convergence of Fairness Calibrator The fairness calibrator in Algorithm 3 of the main text uses a grid search to select λ. We analyze its convergence when replaced with a meta-learning controller (Algorithm 2) for adaptive λ tuning. Theorem D.3 (Convergence Rate of Fairness Calibrator). Let (λ)J(λ) be the expected fairness objective combining clustering error and disparity. With a meta-learning controller that maps clinical features to λ via parameters θ, and using a gradient descent update with step size ηt=η0t−α _t= _0t^-α for α∈(0.5,1]α∈(0.5,1], the sequence of λt _t converges such that: min1≤t≤T[‖∇λ(λt)‖2]≤C1T1−α+C2Tα, _1≤ t≤ TE [\| _λJ( _t)\|^2 ]≤ C_1T^1-α+ C_2T^α, (43) where C1C_1 and C2C_2 are constants dependent on the gradient bound G and initial step size η0 _0. This implies a sublinear convergence rate to a stationary point. Proof. The meta-controller is trained to minimize (λ)J(λ) subject to constraints. The gradient ∇λ _λJ is estimated via finite differences as in Equation (30) of the main text. Under Lipschitz continuity of ∇λ _λJ, the decay step size ensures that the variance of updates reduces over time. Standard stochastic optimization theory (e.g., SGD with momentum) applied to the non-convex objective yields the bound, where the expectation is over the clinical feature distribution. The constants C1C_1 and C2C_2 can be explicitly derived from the Lipschitz constant and gradient variance. ∎ These theoretical extensions enhance the innovation of SubQuad by providing guarantees on subgroup coverage and algorithmic convergence, which are crucial for biological validity in immune repertoire analysis. Figure 4: UMAP projection of ImmunoBERT embeddings showing conserved antigen clusters. Figure 5: F1 Score Heatmap for MinHash Parameter Selection Figure 6: Parameter optimization landscape for MinHash configurations. Figure 7: Performance enhancement across computational domains. Figure 8: Topological community organization in immune receptor network. Node size indicates TCR frequency, node color indicates primary antigen, edge thickness represents the number of shared antigens, and edge color denotes shared antigen type. Key pathways are highlighted for CMV-specific TCR convergence (orange), EBV-associated immunotherapy targets (green), and cross-reactive pathways (blue). Figure 9: Feature distributions of immune receptor sequences across different antigens. Each subplot compares two features among frequency, CDR3 length, centrality, community, and eigen centrality. Colors indicate antigen specificity. Figure 10: Scale sensitivity of fairness metrics. Normalized disparity (Ψ=Δfair/Δbaseline = _fair/ _baseline) is plotted for JS divergence, demographic parity, and equalized odds across sequence scales. The green shaded region highlights the stability of equalized odds for large-scale settings. Figure 11: Clinical decision support dashboard with human-AI collaboration. Appendix E Fairness-Constrained Optimization Framework E.1 Mathematical Formulation To address the critical challenge of preserving rare but biologically significant clonotypes in immunological repertoire analysis, we have developed a specialized fairness-constrained optimization framework. The mathematical formulation integrates both clustering quality and subgroup preservation through the following objective function: ℒ()=∑i=1k∑x∈i∥x−μi∥2+λ∑g∈DJS(|i∩g||g|∥|i|n)L(C)= _i=1^k _x _i\|x- _i\|^2+λ _g D_JS ( |C_i∩ g||g| \| |C_i|n ) (44) Here, =1,2,…,kC=\C_1,C_2,…,C_k\ denotes the set of all clusters, where each cluster iC_i contains immune receptor sequences grouped by structural similarity; μi _i is the centroid of cluster iC_i, computed as the arithmetic mean of all feature vectors within the cluster; G represents the collection of antigen-specific subgroups in the dataset, each corresponding to a distinct biological function; |i∩g||C_i∩ g| indicates the number of sequences belonging to both cluster iC_i and subgroup g; |g||g| is the total number of sequences in subgroup g; n is the total number of sequences in the dataset; DJS(P∥Q)D_JS(P\|Q) denotes the Jensen-Shannon divergence between distributions P and Q, providing a symmetric and bounded measure of similarity; and λ is a regularization parameter that balances clustering compactness and subgroup representation fairness. E.2 Biological Rationale for Fairness Formulation The selection of this particular fairness constraint stems from fundamental immunological principles rather than conventional machine learning practices. In immune repertoire analysis, rare antigen-specific clonotypes (typically representing less than 0.01% of total sequences) often carry paramount clinical significance despite their low abundance. Traditional statistical parity constraints, which would enforce |i∩g||i|≈|g|n |C_i∩ g||C_i|≈ |g|n, would systematically undervalue these rare populations due to their minimal proportional representation. Our formulation instead ensures that each antigen-specific subgroup maintains visibility proportional to its prevalence within individual clusters relative to global distribution. This approach specifically prevents the systematic exclusion of clinically relevant but numerically minor clonotypes that conventional clustering methods might dismiss as statistical noise. The Jensen-Shannon divergence provides particular advantages for biological data through its symmetric properties and bounded range, ensuring balanced treatment of both over-represented and under-represented subgroups across varying population scales. Appendix F GPU Acceleration Methodology F.1 Parallel Computing Architecture To achieve scalable processing of large-scale immunological datasets, we implemented a GPU-optimized computational framework with particular attention to parallelization strategies and memory hierarchy optimization. The parallelization scheme employs a two-dimensional grid organization: GridDim=(⌈NBlockDimx⌉,⌈MBlockDimy⌉)GridDim= ( NBlockDim_x , MBlockDim_y ) (45) Here, GridDim specifies the dimensions of the computational grid that covers all thread blocks; BlockDimxBlockDim_x and BlockDimyBlockDim_y denote the thread block dimensions, typically set to (16, 16) to optimize memory access patterns; and N and M represent the sizes of the two sequence batches being compared. F.2 Memory Optimization Techniques The implementation incorporates several advanced memory management strategies to maximize computational throughput: Sequence data are organized in contiguous memory blocks with proper alignment to enable coalesced global memory access by warp units. Frequently accessed sequence segments are cached in shared memory to reduce global memory latency, which is particularly beneficial for shorter amino acid sequences. The edit distance calculation kernel maximizes register utilization for storing intermediate computation states, thereby minimizing expensive memory operations. F.3 Edit Distance Kernel Implementation The core similarity computation employs a dynamic programming approach optimized for massive parallel execution. For each sequence pair (si,sj)(s_i,s_j) processed by an individual thread, the computation follows: dx,y=mindx−1,y+deletion_costdx,y−1+insertion_costdx−1,y−1+(si[x]≠sj[y])⋅substitution_costd_x,y= casesd_x-1,y+deletion\_cost\\ d_x,y-1+insertion\_cost\\ d_x-1,y-1+I(s_i[x]≠ s_j[y])·substitution\_cost cases (46) Here, dx,yd_x,y denotes the minimum edit distance between the prefix of sequence sis_i of length x and the prefix of sequence sjs_j of length y; (⋅)I(·) is the indicator function, returning one if the condition is satisfied and zero otherwise; si[x]s_i[x] indicates the character at position x in sequence sis_i; and the cost parameters are set for biological relevance, typically assigning insertion and deletion costs of one and substitution costs based on biochemical similarity. This implementation achieves a computational throughput of 97.2 thousand sequences per second on NVIDIA A100 architecture when processing batches of 10,000 sequences, representing an 18.2-fold speed enhancement compared to optimized CPU implementations. Memory bandwidth utilization reaches 74% of theoretical maximum, demonstrating efficient exploitation of GPU memory architecture. Appendix G Discussion on Fairness Objective Formulation In conventional fair clustering literature, a widely adopted notion of statistical parity often aims to enforce proportionality within each cluster by comparing the ratio |i∩g||i| |C_i∩ g||C_i| to the global proportion |g|n |g|n, where iC_i denotes a cluster, g represents a subgroup, and n is the total number of sequences. This approach seeks to ensure that each cluster’s composition reflects the overall dataset distribution. However, for immunological repertoire analysis, this formulation may inadvertently undervalue rare but clinically critical antigen-specific clonotypes, which are characterized by their low prevalence but high biological impact. Our objective function employs an alternative formulation that compares |i∩g||g| |C_i∩ g||g| and |i|n |C_i|n, measured via Jensen-Shannon divergence JSD_JS, as defined in Equation (14) of the main text. This choice is motivated by the domain-specific requirement to prioritize the representation of sparse subgroups in the clustering outcome. Specifically, in immune repertoires, subgroups such as those reactive to rare viral variants or tumor neoantigens often have small |g||g| values, meaning they contain few sequences globally. Using the ratio |i∩g||g| |C_i∩ g||g| emphasizes the coverage of each subgroup g within a cluster iC_i, ensuring that even subgroups with minimal global presence are adequately captured across clusters. In contrast, the common statistical parity form |i∩g||i| |C_i∩ g||C_i| focuses on the fraction of a cluster occupied by a subgroup, which could lead to underrepresentation if the subgroup is rare and clusters are dominated by majority groups. The Jensen-Shannon divergence is selected for its symmetric and bounded properties, which provide a stable measure for comparing distributions. Our formulation effectively penalizes deviations from ideal proportionality where each subgroup’s representation in a cluster is aligned with its global frequency, thereby supporting the biological goal of maintaining diversity in immune response analysis. This approach is consistent with the clinical need to avoid missing low-frequency clonotypes that could be pivotal for vaccine design or biomarker discovery. Mathematically, the fairness term in Equation (14) is defined as: λ∑gJS(|i∩g||g|∥|i|n),λ _gD_JS ( |C_i∩ g||g| \| |C_i|n ), (47) Here, λ≥0λ≥ 0 is a regularization parameter that balances clustering cohesion and fairness; iC_i denotes the iith cluster in the partition C; g indexes antigen-specific subgroups, such as those defined by epitope or pathogen type; |i∩g||C_i∩ g| is the number of sequences in cluster iC_i that belong to subgroup g; |g||g| is the total number of sequences in subgroup g across the dataset; n is the total number of sequences in the dataset; and JS(P∥Q)D_JS(P\|Q) denotes the Jensen-Shannon divergence between distributions P and Q, computed as: JS(P∥Q)=12DKL(P∥P+Q2)+12DKL(Q∥P+Q2), _JS(P\|Q)= 12D_KL (P \| P+Q2 )+ 12D_KL (Q \| P+Q2 ), In this expression, JS(P∥Q)D_JS(P\|Q) denotes the Jensen-Shannon divergence between distributions P and Q, where DKLD_KL is the Kullback-Leibler divergence, and P and Q are probability distributions defined over the same support. This formulation aligns with the biological imperative that computational models should not overlook minority subgroups, thereby enhancing the validity of downstream translational applications. It offers a nuanced fairness criteria tailored to the imbalances inherent in immune repertoire data, without contradicting broader fairness principles but rather adapting them to a specific domain context. Appendix H Comparative Analysis of Representation Learning Capabilities While the primary contribution of SubQuad lies in its system-level efficiency and fairness-aware clustering, we conducted a comparative analysis to evaluate the quality of its foundational sequence representations against recent protein language models (PLMs) in a zero-shot learning setting. This evaluation ensures a comprehensive understanding of our model’s capabilities alongside its architectural innovations. H.1 Experimental Setup Task Selection. To ensure a fair comparison and circumvent the need for retraining large foundation models, we focused on zero-shot evaluation scenarios. Two key tasks were selected for their biological relevance: • TCR Antigen Classification (Multi-label): Utilizing the VDJdb 2024.03 release [27], we retained epitopes with at least 10 associated sequences, resulting in a benchmark comprising 213 distinct antigen classes. • Rare Subpopulation Retrieval: From the McPAS-TCR database [31], we sampled a challenging set of neoantigen-specific clonotypes representing approximately 0.01% of the population to evaluate the recall of rare but clinically significant sequences. Baseline Models. We compared SubQuad’s embedding module against two prominent pre-trained models: • ESM-2-150M [19]: A general-purpose protein language model (30 layers), accessed via esm.pretrained.esm2_t30_150M_UR50D. • ProtST-ESM-1B [37]: A multi-modal model pre-trained on both protein sequences and biomedical texts, downloaded from Hugging Face (microsoft/ProtST-ESM1B). Evaluation Protocol. For a consistent and fair comparison, the weights of all pre-trained models (including SubQuad’s encoder) were frozen. Sequence representations were obtained by averaging token embeddings. A lightweight, uniformly-structured prediction head (a single-layer MLP with a hidden dimension of 256 and dropout rate of 0.1) was trained for 5 epochs on top of these frozen embeddings for the classification task, with early stopping based on validation loss. For the retrieval task, cosine similarity in the embedding space was used directly. Key performance metrics included Macro-F1 score (for multi-label antigen classification), Recall@100 (for rare clonotype retrieval), and Area Under the Precision-Recall Curve (AUPRC, focusing on rare classes). All reported results are the mean and standard deviation across 3 independent runs with different random seeds. Table 7: Performance comparison on antigen classification and rare clonotype retrieval tasks. Model Antigen Macro-F1 Rare Recall@100 AUPRC ESM-2-150M[19] 0.627±0.0110.627± 0.011 0.481±0.0180.481± 0.018 0.6010.601 ProtST-ESM-1B[37] 0.645±0.0090.645± 0.009 0.503±0.0150.503± 0.015 0.6180.618 SubQuad (Ours) 0.712±0.0060.712± 0.006 0.594±0.0100.594± 0.010 0.6810.681 H.2 Results and Discussion The comparative performance across the selected models is summarized in Table 7. SubQuad’s representation learning module demonstrated superior performance across all metrics compared to the established baselines. This suggests that the multi-modal fusion mechanisms and the antigen-aware pre-training inherent in the SubQuad pipeline facilitate the learning of more discriminative and biologically meaningful embeddings. The enhanced capability to identify rare clonotypes is particularly noteworthy, as it aligns with the framework’s overarching design principle of equitable representation for minority subgroups, even before the application of explicit fairness constraints during clustering. Appendix I visualization We provide comprehensive visual evidence of the SubQuad framework’s efficacy across multiple dimensions in Appendix˜I. The UMAP projection in Figure˜4 illustrates the preservation of antigen-specific clusters, while the parameter sensitivity analysis and F1 score heatmaps are detailed in Figures˜7 and 6. Holistic performance gains are captured in Figure˜7 (radar plot). Furthermore, Figures˜8 and 9 characterize the topological organization and feature distributions of the receptor networks. Finally, we analyze the scale sensitivity of fairness metrics in Figure˜10 and showcase the practical utility of our clinical dashboard in Figure˜11. Appendix J Experimental Configuration All datasets (VDJdb, McPAS-TCR, NEPdb) are publicly available at their respective portals. Table 8: Experimental configuration summary. Parameter Configuration Source Receptor Sequences TCR β-chain repertoires VDJdb[27] CDR3 Variants 2.65K (compact), 1.2M (extended), 1M (scalability) McPAS-TCR[31] Oncogenic Targets 48.7K tumor neoantigens NEPdb[36] Cross-Domain Tooling PyTorch-Geometric, Fairlearn ML Commons Biological Interactions 25.1K pairwise associations COVIDSeq Computational Infrastructure NVIDIA A100 (80GB), Dual Xeon 6348 - Evaluation Metrics Efficiency, Memory, Accuracy, Fairness -