Layer-wise sparse probing
SPIN fits an L1-regularized logistic-regression probe to each layer’s pooled activations.
SParsifying and INtegrating internal neurons for text classification
When this study began in 2023, competitive text classifiers were typically task-specific encoders or language models fine-tuned separately for each task. We ask whether a frozen pretrained language model already contains useful classification information in its intermediate representations, and whether selecting and combining that information across layers is more effective than reading only the final hidden state.
SPIN fits an L1-regularized logistic-regression probe to each layer’s pooled activations.
Neurons are ranked by absolute probe-weight magnitude, and the smallest set that reaches the cumulative contribution threshold is retained.
The selected activations are concatenated, and a final classification head is trained on the resulting representation.
We evaluate eight pretrained language models on IMDb, SST-2, and EDOS. For each model and dataset, SPIN is compared with a classification head trained on the final hidden state of the same frozen backbone.
SPIN’s sparse cross-layer representation outperformed the terminal-state classifier in every pretrained comparison. The strongest result reached 99.91% of the published fine-tuned state of the art on IMDb, and applying SPIN after fine-tuning produced further gains.
| Backbone | IMDb accuracy | SST-2 accuracy | EDOS macro-F1 | |||
|---|---|---|---|---|---|---|
| Final | SPIN | Final | SPIN | Final | SPIN | |
| DistilBERT | 86.95 | 89.78 | 81.88 | 83.94 | 65.09 | 75.79 |
| RoBERTa | 89.67 | 93.61 | 84.06 | 90.59 | 68.81 | 73.50 |
| GPT2 | 87.72 | 91.94 | 85.89 | 87.73 | 68.57 | 76.08 |
| GPT2-M | 88.59 | 93.92 | 86.12 | 90.25 | 71.17 | 75.74 |
| GPT2-XL | 91.86 | 94.92 | 90.02 | 93.23 | 72.56 | 76.79 |
| Flan-T5-S | 84.08 | 91.15 | 77.17 | 88.99 | 59.62 | 74.51 |
| Flan-T5 | 90.01 | 94.14 | 78.26 | 92.32 | 66.64 | 78.04 |
| Flan-T5-XL | 90.50 | 96.12 | 84.75 | 95.64 | 70.08 | 81.48 |
η sets the cumulative share of normalized absolute probe-weight mass to retain. SPIN ranks neurons by this importance score and selects the smallest set that reaches the threshold.
At η = 0.4, SPIN selects about 3% of neurons per layer. At η = 0.8, selection remains below one quarter of the layer.
The paper compares a single-token embedding, feature-wise max pooling, and mean pooling over the sequence.
Max pooling retains the strongest activation for each feature across the sequence.
The plot reports IMDb accuracy after integrating the first 20%, 40%, 60%, 80%, or 100% of layers for each backbone.
The sparsification and pooling panels are schematics; the early-exit panel reports measured IMDb results from the paper.
The classifier trained on complete reviews is applied at each token position to visualize how the cumulative sentiment decision changes across the sequence.
negative contribution positive contribution
Color shows direction, not a synthetic score.