SYNAPSE: Framework for Neuron Analysis and Perturbation in Sequence Encoding
Organizations: Department of Information and Communications Engineering, University of Murcia, Murcia, 30100, Spain
Abstract
In recent years, Artificial Intelligence has become a powerful partner for complex tasks such as data analysis, prediction, and problem-solving, yet its lack of transparency raises concerns about its reliability. In sensitive domains such as healthcare or cybersecurity, ensuring transparency, trustworthiness, and robustness is essential, since the consequences of wrong decisions or successful attacks can be severe. Prior neuron-level interpretability approaches are primarily descriptive, task-dependent, or require retraining, which limits their use as systematic, reusable tools for evaluating internal robustness across architectures and domains. To overcome these limitations, this work proposes SYNAPSE, a systematic, training-free framework for understanding and stress-testing the internal behavior of Transformer models across domains. It extracts per-layer [CLS] representations, trains a lightweight linear probe to obtain global and per-class neuron rankings, and applies forward-hook interventions during inference. This design enables controlled experiments on internal representations without altering the original model, thereby allowing weaknesses, stability patterns, and label-specific sensitivities to be measured and compared directly across tasks and architectures. Across all experiments, SYNAPSE reveals a consistent, domain-independent organization of internal representations, in which task-relevant information is encoded in broad, overlapping neuron subsets. This redundancy provides a strong degree of functional stability, while class-wise asymmetries expose heterogeneous specialization patterns and enable label-aware analysis. In contrast, small structured manipulations in weight or logit space are sufficient to redirect predictions, highlighting complementary vulnerability profiles and illustrating how SYNAPSE can guide the development of more robust Transformer models.
Figures & tables
| Reference | Year | Model Type | Domain / Purpose | Explanation Type | Scope |
| Li et al. [ 17 ] | 2017 | LSTM-based NLP classifier | NLP (sentiment, linguistic tasks) | Feature ablation | Local Global |
| Radford et al. [ 21 ] | 2017 | mLSTM | NLP (unsupervised text generation) | Emergent feature analysis | Global |
| Bau et al. [ 2 ] | 2019 | NMT | NLP (machine translation) | Neuron importance ranking and manipulation | Global |
| Dalvi et al. [ 6 ] | 2018 | Pre-trained RNN | NLP (various language tasks) | Neuron interpretation | Global |
| Durrani et al. [ 12 ] | 2020 | Transformer (BERT) | NLP (language understanding) | Neuron importance and clustering | Global |
| Dalvi et al. [ 7 ] | 2023 | Transformers | NLP (interpretability) | Toolkit supporting multiple neuron analysis methods | Local Global |
| Reference | Year | Threat Model | Attack Type | Phase | Access | Model Type |
| Szegedy et al. [ 25 ] | 2014 | Evasion | Small perturbation adversarial examples (L-BFGS method) | Inference | White-box | DNN (CNN) |
| Goodfellow et al. [ 14 ] | 2015 | Evasion | FGSM (Fast Gradient Sign Method) | Inference | White-box | DNN (CNN) |
| Pravin et al. [ 19 ] | 2021 | Evasion | Neuron-fragility exploitation (target-specific “fragile” neurons) | Inference | White-box | DNN (ResNet) |
| Che et al. [ 4 ] | 2024 | Capability elicitation | Hidden feature/weight manipulation (latent and weight-space attacks) | Inference (and fine-tune) | White-box | LLM (GPT family) |
| Model | Layers ( ) | Hidden Size ( ) | Total Neurons (MLP) | Max. Seq. Length | Param. Count |
| BERT (base) | 12 | 768 | 36,864 | 512 | 110M |
| BigBird | 12 | 768 | 36,864 | 4,096 | 128M |
| DistilBERT | 6 | 768 | 18,432 | 512 | 66M |
| Longformer | 12 | 768 | 36,864 | 4,096 | 149M |
| GoEmotions (BERT) | 12 | 768 | 36,864 | 512 | 110M |
| Model | Weighted F1-Score |
| BERT | 0.6834 |
| DistilBERT | 0.6081 |
| BigBird | 0.8306 |
| Longformer | 0.8516 |
| Baseline | 0.8516 |
| Model | Baseline | 5% | 10% | 20% | 30% | 50% | 75% | 95% | F1@95% (%) |
| BERT | 0.683 | 0.686 | 0.686 | 0.686 | 0.686 | 0.575 | 0.482 | 0.147 | -78.4 |
| BigBird | 0.785 | 0.806 | 0.815 | 0.832 | 0.735 | 0.581 | 0.246 | 0.079 | -89.9 |
| DistilBERT | 0.608 | 0.608 | 0.608 | 0.608 | 0.608 | 0.608 | 0.499 | 0.311 | -48.8 |
| Longformer | 0.852 | 0.844 | 0.871 | 0.852 | 0.768 | 0.535 | 0.097 | 0.079 | -90.7 |
| Model | Class 0 | Class 1 | Class 2 | Class 3 | Class 4 | |||||
| F1 | F1 WO * | F1 | F1 WO | F1 | F1 WO | F1 | F1 WO | F1 | F1 WO | |
| BERT | 0.167 | 0.166 | 0.800 | 0.528 | 0.000 | 0.242 | 0.923 | 0.455 | 0.533 | 0.328 |
| BigBird | 0.200 | 0.220 | 0.250 | 0.071 | 0.000 | 0.034 | 0.222 | 0.326 | 0.000 | 0.034 |
| DistilBERT | 0.444 | 0.212 | 0.909 | 0.348 | 0.730 | 0.489 | 0.000 | 0.481 | 0.182 | 0.195 |
| Longformer | 0.364 | 0.253 | 0.000 | 0.332 | 0.588 | 0.425 | 0.400 | 0.384 | 0.462 | 0.355 |
| Model | F1-Score (5%) | F1-Score (10%) | F1-Score (20%) | F1-Score (30%) | F1-Score (50%) | F1-Score (%) |
| BERT | 0.5121 | 0.4478 | 0.3952 | 0.3520 | 0.3015 | -23.1% |
| DistilBERT | 0.5013 | 0.4205 | 0.3667 | 0.3304 | 0.2801 | -21.2% |
| BigBird | 0.7310 | 0.6558 | 0.5887 | 0.5402 | 0.4814 | -11.9% |
| Longformer | 0.7702 | 0.7021 | 0.6504 | 0.5989 | 0.5407 | -11.0% |
| Model | Relative F1-Score (%) | |||
| BERT | 0.6081 | 0.6081 | 0.5214 | % |
| DistilBERT | 0.6081 | 0.6081 | 0.5214 | % |
| BigBird | 0.8306 | 0.8306 | 0.8306 | % |
| Longformer | 0.8712 | 0.3903 | 0.0344 | % |
| Model | Accuracy | F1-Score | % Pred. Target | % Flips |
| (weighted) | (non-target) | |||
| BERT | 0.7000 | 0.6867 | 40.00% | 28.57% |
| BigBird | 0.7200 | 0.7052 | 36.00% | 28.13% |
| DistilBERT | 0.6800 | 0.5896 | 18.00% | 6.82% |
| Longformer | 0.6400 | 0.6336 | 52.00% | 42.86% |
| Model | Weighted F1-Score |
| BERT | 0.7421 |
| DistilBERT | 0.5812 |
| BigBird | 0.7624 |
| Longformer | 0.7443 |
| Model | Accuracy | F1-Score | Flips Target | Pred Target (%) |
| (weighted) | ||||
| BERT | 0.76 | 0.6834 | 2.27 | 14 |
| BigBird | 0.38 | 0.3126 | 71.43 | 76 |
| DistilBERT | 0.56 | 0.4151 | 18.18 | 28 |
| Longformer | 0.82 | 0.8073 | 0.00 | 6 |
| Model | Accuracy | F1-Score | Flips Target (%) | Pred Target |
| (weighted) | ||||
| BERT | 0.76 | 0.6834 | 2.27 | 14 |
| BigBird | 0.76 | 0.6741 | 14.29 | 28 |
| DistilBERT | 0.68 | 0.5871 | 4.55 | 16 |
| Longformer | 0.84 | 0.8315 | 0.00 | 6 |
| Model | Accuracy | F1-Score | Flips Target (%) | Pred Target |
| (weighted) | ||||
| BERT | 0.76 | 0.6834 | 2.27 | 14 |
| BigBird | 0.82 | 0.8064 | 7.14 | 22 |
| DistilBERT † | – | – | – | – |
| Longformer | 0.86 | 0.8516 | 7.14 | 22 |
| Attack | Config | F1-Score (weighted) | F1-Score (%) |
| Baseline | – | 0.860 | – |
| Global neuron silencing | 60% neurons silenced globally | 0.300 | -65.1 |
| Per-class silencing | Best run (class 1), peak F1-Score = 0.882 | 0.882 | +2.6 |
| Random noise injection | applied to top neurons | 0.460 | -46.5 |
| Gaussian noise | (estimated) | 0.630 | -26.7 |
| Logit bias | Best stable point ( ). Higher collapses predictions (F1-Score to 0.192). | 0.624 | -27.4 |