ZeroSiam: Dual Siamese Approaches
- ZeroSiam is a term for two distinct Siamese learning methods: one designed for zero-day anomaly detection and one-shot classification in optical networks, and the other for test-time entropy optimization.
- The optical network variant uses a multi-similarity Siamese network with a prototype gallery to identify unseen anomalies and enable immediate one-shot classification without retraining.
- The test-time adaptation variant employs an asymmetric Siamese structure with a learnable predictor and stop-gradient alignment to stabilize entropy minimization and prevent collapse.
ZeroSiam is a name used for two distinct Siamese-learning methods in recent arXiv literature. One denotes a unified framework for zero-day anomaly detection and one-shot classification in optical networks, implemented as a multi-similarity Siamese neural network over optical performance monitoring samples (Natalino et al., 9 Jun 2026). The other denotes an efficient asymmetric Siamese architecture for test-time entropy minimization, designed to prevent collapse during unsupervised adaptation at inference time through asymmetric divergence alignment, a learnable predictor, and a stop-gradient target branch (Chen et al., 27 Sep 2025). The shared label reflects a common reliance on Siamese-style comparison or asymmetry, but the two methods address different technical problems, operate on different data modalities, and are evaluated under different protocols.
1. Terminological scope and disambiguation
The current literature uses the term ZeroSiam for two separate systems rather than for a single canonical architecture. One is situated in optical-network anomaly management and focuses on zero-day detection and one-shot recognition; the other is situated in test-time adaptation and focuses on entropy-based online adaptation without collapse (Natalino et al., 9 Jun 2026, Chen et al., 27 Sep 2025).
| ZeroSiam variant | Domain | Core mechanism |
|---|---|---|
| ZeroSiam | Optical networks | Multi-similarity Siamese neural network with prototype gallery |
| ZeroSiam | Test-time adaptation | Asymmetric Siamese with predictor and stop-gradient alignment |
This dual usage matters because the two methods differ at every major level of description: input representation, optimization target, deployment scenario, and empirical benchmark. In the optical-network setting, ZeroSiam is a metric-learning system over 5-dimensional QoT/OPM vectors and supports open-set operation through a reference gallery. In the test-time adaptation setting, ZeroSiam is an online optimization scheme that modifies a deployed model on the fly using only its own predictions, without ground-truth labels or source data.
2. ZeroSiam in optical networks: problem setting and data regime
In "A Unified Siamese Learning Framework for Zero-Day Anomaly Detection and Classification in Optical Networks" (Natalino et al., 9 Jun 2026), ZeroSiam is introduced to address soft failures in optical backbones. The motivating setting includes heterogeneous devices such as lasers, inline EDFAs, and coherent receivers, with failures manifesting as degradation due to ECL malfunction, EDFA gain issues, or nonlinear interference caused by transmit power changes. The operational requirement is twofold: a previously unseen anomaly should be detected immediately, and subsequent occurrences should become classifiable after a single labeled example, without retraining.
The method operates on optical performance monitoring data. Each sample is a 5-dimensional QoT/OPM vector consisting of lightpath length (km), laser current (mA), received optical power (dBm), OSNR (dB), and BER. The reported dataset spans 756 lightpaths in a 28-node, 41-link backbone with inline EDFAs every 80 km, with coherent receivers and time-series QoT measurements collected under normal and faulty conditions. Per lightpath, the dataset contains 900 time samples under normal and faulty conditions, with at most one failure active at any time. The four conditions are normal, external cavity laser malfunction, EDFA malfunction, and NLI soft failures induced by randomly increased transmit power. The data source is described as coming from Ghosh et al. (Computer Networks, 2025) (Natalino et al., 9 Jun 2026).
The training and test protocol is explicitly open-set. Training uses 1,000 samples pooled from all lightpaths but only two classes, normal and ECL. Testing uses 10,000 samples per class, 40,000 total, across all lightpaths, including EDFA and NLI anomalies that were unseen during training. This protocol defines the paper’s zero-day setting: anomaly types evolve over time, lightpaths differ in operating conditions, and labeled anomaly data are scarce and imbalanced.
3. Optical-network ZeroSiam: architecture, similarity learning, and decision rules
The optical-network ZeroSiam is implemented as a multi-similarity Siamese neural network that learns an embedding and a similarity function over pairs of OPM samples (Natalino et al., 9 Jun 2026). It uses a twin, weight-shared encoder , so that for two samples and the network produces embeddings . The encoder is a compact multilayer perceptron with five fully connected layers, batch normalization, ReLU, and dropout , with dimensions . The final embedding dimension is .
From two embeddings and , the multi-similarity head computes four complementary measures:
- 0
- 1
- 2
These are concatenated into a 4-dimensional feature vector
3
A small fully connected layer with softmax activation, followed by a single sigmoid output unit, maps 4 to a scalar similarity probability 5 indicating “same class” versus “different class.”
Training is framed as binary pair classification. For a labeled pair 6 with 7 if the pair belongs to the same class and 8 otherwise, the loss is
9
The paper explicitly notes that “multi-similarity” refers to fusing multiple similarity and distance measures in the head; the training loss is the standard binary cross-entropy on pair labels rather than the multi-similarity loss used elsewhere in metric learning.
At inference time, ZeroSiam maintains a gallery 0 containing one labeled reference sample per known class. For a new sample 1, it computes the maximum similarity to the gallery:
2
The anomaly score is
3
A sample is flagged as a zero-day anomaly when
4
where 5 is a calibrated threshold. After the first occurrence of a new anomaly type is labeled and added to the gallery, one-shot classification proceeds by nearest prototype in the learned metric space:
6
The paper presents this as the mechanism by which detection of an unseen anomaly and immediate post-label one-shot recognition are unified without any retraining.
4. Optical-network ZeroSiam: reported performance, robustness, and limitations
Under the reported zero-day protocol, the optical-network ZeroSiam achieves 99.12% overall accuracy in one-shot classification across all four classes while being trained only on normal and ECL (Natalino et al., 9 Jun 2026). Against single-metric Siamese variants, cosine-only is described as the best among the single-metric models but still below 99%; L1-only reaches 96.6%; and element-wise product alone collapses to approximately 25.9%, near random performance for four classes. A 1-NN baseline with one reference per class reaches 97.6%.
For anomaly detection, the confusion matrix shows 97% anomaly detection accuracy, approximately 3% false negatives, and no false positives for normal states. The paper interprets this as high precision in flagging anomalies and minimal alarm fatigue. Conventional closed-set baselines, including Naive Bayes, Gradient Boosting, Random Forest, and linear or RBF SVMs trained on all classes, achieve approximately 99.8% accuracy, but the paper stresses that these baselines require labeled data for every anomaly type and therefore do not solve the zero-day problem.
The robustness claims are tied to the architecture and training formulation. Multi-similarity fusion is reported to mitigate sensitivity to any single metric’s failure mode, including Euclidean scale issues or cosine insensitivity to magnitude. Pairwise training across diverse lightpaths is reported to encourage domain-invariant embeddings and reduce the need for per-lightpath models. The encoder’s batch normalization and the use of OPM features across all lightpaths are presented as contributing to effective cross-lightpath generalization without per-lightpath retraining.
The limitations are also explicit. Threshold calibration remains operationally important: a global 7 must be set judiciously, since a low threshold causes missed detections and a high threshold causes false positives. Performance depends on the fidelity of OPM features, and subtle degradations that barely move OSNR or BER may require adaptive 8 or additional features. One-shot classification further assumes that the first occurrence of a zero-day anomaly is labeled correctly; mislabeling corrupts the gallery prototype. AUROC, AUPRC, and per-lightpath breakdowns are not reported. Public code is available at the repository specified in the paper, and the parameter count is described as being on the order of 9, with classification complexity linear in the number of prototypes 0.
5. ZeroSiam for test-time entropy optimization: architecture and objective
In "ZeroSiam: An Efficient Siamese for Test-Time Entropy Optimization without Collapse" (Chen et al., 27 Sep 2025), ZeroSiam addresses a different problem: unsupervised test-time adaptation based on entropy minimization. The paper starts from the standard test-time adaptation setting in which a deployed model is optimized online using only its own predictions on incoming test samples, without ground-truth labels or source data. The baseline mechanism is predictive-entropy minimization,
1
which aims to make the model more confident on the target domain.
The paper argues that pure entropy minimization is prone to collapse. Two failure modes are highlighted: logit norm inflation, in which increasing the 2 norm of logits drives the softmax toward one-hot outputs regardless of correctness, and dominant-class alignment, in which logit vectors are pushed toward a single center, producing near-constant predictions. Formally, if 3 are logits and 4, then for any 5, scaling to 6 yields 7, and as 8, 9, where 0, so 1. The entropy gradient with respect to logits is given as
2
which is described as reinforcing collapse by further increasing the maximum logit and suppressing the others.
ZeroSiam introduces an asymmetric Siamese architecture tailored to this setting. A single encoder pass produces a feature 3. The target branch computes
4
and stop-gradient is applied to 5 and 6 in the loss. The online branch computes
7
where 8 is a lightweight linear predictor initialized to identity. Only the predictor parameters and normalization affine parameters in the encoder are updated during test time; the classifier 9 is fixed. The paper emphasizes that there are no extra backbone passes and no data augmentations.
The objective combines entropy minimization with asymmetric divergence alignment:
0
In practice, the paper uses symmetric KL divergence with 1:
2
The asymmetry comes from the stop-gradient on the target branch: the online branch is pulled toward the target branch, but the target branch is not pulled toward the online branch. This is the paper’s central mechanism for preventing trivial collapse.
6. Entropy-optimization ZeroSiam: theory, empirical behavior, and implementation regime
The theoretical analysis in the test-time adaptation paper states two key results (Chen et al., 27 Sep 2025). First, when 3, corresponding to pure entropy minimization, the online branch exhibits stronger collapse tendencies than the target branch. This is expressed through the magnitude of entropy variation, 4 under practical learning-rate schedules, and through the Hessian of 5, whose minimal eigenvalue lies along collapse directions. Second, when 6, the alignment term is said to constrain and filter gradient components that over-amplify logits, yielding convergence to a stable equilibrium with bounded entropy:
7
The paper further gives an informal stability statement,
8
under mild smoothness and Lipschitz assumptions. The stated interpretation is that asymmetric alignment regularizes biased test-time updates and suppresses collapse directions.
The implementation protocol is correspondingly lightweight. For vision models, the recommended practice is to optimize only the predictor and normalization affine parameters, use SGD with momentum 0.9, adopt symmetric KL with 9, and initialize the predictor to identity. Batch size 64 is the default, though batch size 1 is supported; typical learning rates for the encoder-side normalization parameters and predictor are reported separately for ResNet50-GN, ViT-B, ViT-S, ConvNeXt-T, and Swin-T. For LLM reasoning with Llama3.1-8B-Instruct, the trainable parameters are LoRA of rank 8 plus the predictor, the optimizer is AdamW with 0 and weight decay 0, and token-level entropy is computed over the first 8 output tokens. The paper describes hyperparameters as robust, with a broad plateau across learning rates and with 1 working well.
The empirical results span vision adaptation and language-model reasoning. On ImageNet-C with mixed distribution shifts comprising 15 corruption types at severity 5, ZeroSiam averages 44.2% accuracy, exceeding EATA at 42.9%, DeYO at 38.1%, SAR at 39.5%, COME at 34.4%, Tent at 14.3%, and NoAdapt at 29.9%. Under online label shifts with extreme imbalance at severity 5, it averages 52.9% accuracy, and with batch size 1 it averages 52.5%. In a blind-spot stress test that adapts only on samples misclassified by NoAdapt and then evaluates on the full set, ZeroSiam reaches 52.0% average accuracy versus NoAdapt’s 29.0%. After pre-adapting on pure Gaussian-noise images, the method is reported to remain near 72% accuracy on downstream fog corruption, whereas other entropy-based alternatives degrade sharply. For LLM reasoning on Math-500, CollegeMath, AIME24, and Minerva using Llama3.1-8B-Instruct, ZeroSiam raises average accuracy by +3.94% over NoAdapt, including +10.00% on AIME24, +3.40% on Math-500, +1.25% on CollegeMath, and +1.10% on Minerva.
The ablation results identify the asymmetry as essential. Removing stop-gradient leads to severe collapse, with one reported example showing R-50-GN average accuracy falling from 51.6% to 20.5%. The learnable linear predictor with identity initialization performs best among predictor designs. The method is also described as general with respect to divergence choice, since symmetric KL, KL, reverse KL, JS, and MSE all work, though symmetric KL with 2 is recommended. Computationally, the method uses a single encoder pass per sample, adds only a small fully connected predictor, and has wall-clock equal to Tent on ViT-B for 50k images on an RTX 3090 at 193 seconds, while remaining lower than SAR at 382 seconds and DeYO at 280 seconds.
Taken together, the two ZeroSiam papers occupy different parts of the Siamese-learning landscape. One uses pairwise metric learning and a prototype gallery to unify zero-day anomaly detection with one-shot classification in optical networks; the other uses architectural asymmetry and stop-gradient alignment to stabilize entropy-based test-time adaptation. A common misconception would be to treat the name as denoting a single transferable recipe. The literature instead supports a narrower conclusion: ZeroSiam currently refers to two independently defined methods that share Siamese structure but differ in objective, modality, and deployment assumptions (Natalino et al., 9 Jun 2026, Chen et al., 27 Sep 2025).