Organizations: Laboratory LTI, Université de Picardie Jules Verne, Amiens, France · Institute of Energy and Resources, Charles Darwin University, Darwin, NT, Australia
DDCL-Attention is a prototype-based readout layer for transformer encoders that replaces simple pooling methods, such as mean pooling or class tokens, with a learned compression mechanism. It uses a small set of global prototype vectors and assigns tokens to them through soft probabilistic matching, producing compact token summaries at linear complexity in sequence length. The method offers three main advantages. First, it avoids prototype collapse through an exact decomposition of the training loss into a reconstruction term and a diversity term, ensuring that prototypes remain distinct. Second, its joint training with the encoder is shown to be stable under a practical timescale condition, using Tikhonov's singular perturbation theory and explicit learning-rate constraints. Third, the same framework supports three uses: a final readout layer, a differentiable codebook extending VQ-VAE, and a hierarchical document compressor. Experiments on four datasets confirm the theoretical predictions: the loss decomposition holds exactly, prototype separation grows as expected when the stability condition is met, and the codebook reaches full utilization, outperforming standard hard vector quantization. An additional study on orbital debris classification shows that the method also applies beyond standard NLP and vision tasks, including scientific tabular data.
Figures & tables
Property
Self-Attn
Slot Attn
Perceiver
DDCL-Attn
Key type
dynamic
dynamic (iter.)
dynamic
global static
Similarity
dot product
dot product
dot product
−∥⋅∥2
Complexity
O(T2)
O(TKI)
O(TK)
O(TK)
Inference iter.
none
I GRU steps
none
none
Anti-collapse
none
none
none
∇PV
Stability proof
n/a
none
none
Thm. 1
Table 1: Structural comparison of prototype based attention mechanisms.
Pos.
Paradigm
Theoretical motivation
Val.
1
Final readout
Soft centroid compresses sequence into prototype vocabulary; LOLS is the quantisation cost
✓
2
Enc.–dec. bottleneck
Differentiable VQ bottleneck with anti-collapse guarantee
—
3
FFN replacement
Prototypes as learnable feed-forward basis, linear in T
—
4
Soft vector quantization
Lq=LOLS+V generalises VQ-VAE; V prevents dead codes
✓
5
Hierarchical compression
Decomposition holds level by level; anti-collapse at every level
✓
Table 2: Five application paradigms for DDCL-Attention. ✓ = validated in this paper.
Method
ACC
NMI
ARI
DDCL-Attention ( Lq , best epoch)
0.772
0.752
0.669
k -means (raw, d=7 )
0.756
0.751
0.667
k -means + PCA ( m=5 )
0.756
0.751
0.667
Table 3: Space debris clustering results ( N=1600 , K=4 , d=7 , m=5 , best epoch ACC). Bold: best result.
Figure 1: 2D PCA projection of space debris features ( K=4 , after 500 epochs). Left: coloured by true orbital regime. Right: coloured by DDCL-Attention prototype assignment. Stars mark prototype positions pk . The LEO/HEO overlap in the lower left region reflects the genuine orbital ambiguity between low-altitude circular and Molniya-type eccentric orbits in 2D; the full m=5 dimensional space resolves this via the eccentricity feature.
Dataset
Method
ACC
NMI
ARI
SST-2 ( K=2 )
CLS + logistic regression
0.861
—
—
k -means on CLS
0.519
0.003
0.001
DDCL-Attention
0.867
0.435
0.538
IMDB ( K=4 )
k -means on CLS
—
—
—
DDCL-Attention
0.913
0.472
0.540
20NG ( K=20 )
k -means on CLS
0.196
0.189
0.065
Table 4: Paradigm 1 results: text readout with frozen BERT ( ε=0.05 ). ACC = clustering accuracy (Hungarian); NMI = normalised mutual information; ARI = adjusted Rand index; best epoch reported.
Figure 2: Exp 1: training dynamics for SST-2 (top), IMDB (middle), and 20 Newsgroups (bottom). Each row shows the loss decomposition Lq=LOLS+V (top left), variance term V≥0 (top centre), prototype separation S(P) (top right), assignment entropy H(Q) (bottom left), clustering quality ACC/NMI/ARI (bottom centre), and phase portrait (V/N,S(P)) (bottom right).
Figure 3: PCA projection of the 20 learned prototypes ( K=20 ) on 20 Newsgroups after 15 epochs.
Method
K
Util. ep. 1
Epochs to 100%
V≥0
DDCL-Attention ( ε=0.05 , λ=0.5 )
16
100%
1
✓
DDCL-Attention ( ε=0.05 , λ=0.5 )
64
100%
1
✓
VQ-VAE (hard, straight-through)
16
81.2%
6
—
VQ-VAE (hard, straight-through)
64
18.8%
44
—
Table 5: Paradigm 4 results: soft VQ-VAE on CIFAR-10 (50 epochs). Codebook utilisation = fraction of prototypes with mean assignment >0.01 .
Figure 4: Exp 2: DDCL-Attention soft VQ on CIFAR-10 ( K=64 , 50 epochs). Left: training dynamics (loss decomposition, V≥0 , codebook utilisation). Right: codebook utilisation over epochs for DDCL-Attention vs. hard VQ-VAE; DDCL-Attention achieves 100% from epoch 1 while VQ-VAE requires 26 epochs.
Figure 5: Exp 3: hierarchical DDCL-Attention on 20 Newsgroups ( K1=32 , K2=20 , frozen BERT, 15 epochs). Left: training dynamics at both levels; V(1)≥0 and V(2)≥0 confirmed simultaneously at every epoch (Proposition 5 ). Right: t-SNE projection of the level-2 document representations coloured by DDCL-Attention assignment.
Figure 6: Stability ablation on MNIST Digits ( K=10 , m=32 , 300 epochs). Left: best clustering ACC (bars) and final prototype separation S(P) (line with markers) as a function of learning rate ratio ε=ηθ/ηP . Green shading: stable regime ( ε≤0.1 , condition (iv) of Theorem 1 ). Red shading: boundary/unstable regime ( ε≥0.5 ). Right: (V/N,S(P)) phase portrait coloured by epoch for three ratios; lower ratios converge to higher separation fixed points.