NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Don't Pay Attention, PLANT It: Pretraining Attention via Learning-to-Rank

Debjyoti Saha Roy, Byron C. Wallace, Javed A. AslamarXiv 2024

TL;DR

This paper introduces PLANT (Pretrained and Leveraged AtteNTion), a plug-and-play strategy that replaces random attention initialization in Extreme Multi-Label Text Classification (XMTC) with relevance-guided weights. By pretraining the attention layer as a Learning-to-Rank (L2R) module informed by mutual information, PLANT drastically improves performance on rare "long-tail" labels and allows smaller language models to outperform much larger ones.

What Problem Does This Paper Address?

Extreme Multi-Label Text Classification (XMTC) involves assigning the most relevant subset of labels to an instance from an enormous label space—often consisting of thousands or hundreds of thousands of choices (e.g., assigning standardized ICD diagnostic codes to lengthy clinical notes).

State-of-the-art XMTC models rely on label-specific attention mechanisms to act as a "spotlight," helping the model focus on informative tokens amid long text narratives. However, these models typically initialize attention weights randomly. Because the label distribution is heavily skewed (a few head labels appear frequently, while thousands of tail labels are extremely rare), randomly initialized models struggle to learn proper attention patterns for rare classes without massive amounts of data. This leads to attention dilution, where a fixed attention budget is spread too thin across thousands of tokens, causing models to completely miss subtle cues for rare labels.

Methods

The authors propose a architecture-agnostic, two-stage training framework called PLANT:

  1. Stage 1: Pretraining Attention as Learning-to-Rank (L2R): Instead of starting from scratch, the model's multi-head attention layer is pretrained to rank tokens by relevance. Ground-truth token relevance for each label is determined by computing Mutual Information Gain (MIG) across the training corpus. The attention module is then optimized using a pairwise ranking loss that penalizes incorrect token rankings in proportion to their impact on the normalized Discounted Cumulative Gain (nDCG@k) metric.
  2. Stage 2: Leveraging Attention via Full Training: The full model—integrated with a large language model (LLM) backbone via 4-bit quantization and LoRA—is fine-tuned end-to-end. This stage employs a Hard Negative Mining (HNM)-augmented focal loss with label smoothing to handle severe label imbalance.
Figure 1: PLANT Attention. On the left, the MultiHead−Attention module (Vaswani et al., 2017), parameterized by W attn, takes as input queries Q = E (label embeddings), keys K = Hi, and values V = Hi, and produces S ∈R|L|×n, representing the token-level attention distribution for each label. The orange box highlights the set of top-k tokens per label, Tl, selected via Mutual Information Gain rlj between labels and tokens. Within this set, two tokens j (red) and h (blue) are compared, with j being more relevant than h. The MultiHead−Attention module is trained to maximize the probability of correctly ranking tokens j and h (P(j ≻h)), while penalizing incorrect rankings in proportion to their impact on the nDCG@k metric if j and h were swapped (|∆nDCG@k|jh). Finally, the summation box aggregates over all token pairs in Tl, yielding the PLANT objective—(nDCG term × probability term)—that is optimized to initialize W attn.

PLANT is highly flexible and was evaluated using several prominent open-source LLM backbones, including Mistral-7B, LLaMA3-8B, DeepSeek-V3, and Phi-3.

Datasets

The approach was validated across multiple domains featuring high-dimensional label spaces:

  • Healthcare (ICD Coding): MIMIC-III-full and MIMIC-IV-full datasets containing clinical discharge summaries annotated with thousands of ICD-9 and ICD-10 codes. Few-shot capabilities were specifically tested on the MIMIC-III-rare50 and MIMIC-III-few subsets.
  • Legal: EURLEX-4K, consisting of European Union legal documents mapping to thousands of legal concepts.
  • Content Recommendation: WIKI10-31K, a dataset for Wikipedia-style text tag prediction.

Key Insights and Ideas

  • Fixing the Rare-Label Representation Collapse: Under random initialization, semantically similar rare labels fail to discover a shared attention structure, resulting in scattered, inconsistent attention patterns. PLANT forces these rare labels to converge onto coherent, high-quality representations, boosting intra-group cosine similarity from a diffuse 0.75 to a highly consistent 0.985.
  • David Beats Goliath: Smaller models enhanced with PLANT consistently outperform significantly larger models used alone. For instance, on the MIMIC-III dataset, a LLaMA3-8B model using PLANT beat a massive 336B DeepSeek-V3 model by +1.8 points in Macro F1 and +3.0 points in Precision@15.
  • True Zero-Shot Generalization: When trained exclusively on common labels and evaluated on completely unseen rare labels, PLANT retains strong zero-shot transfer capabilities (7.3%–8.1% Rare-F1), whereas randomly initialized models completely collapse (0.5%–1.1%).

Key Results

  • State-of-the-Art Performance: PLANT established a new SOTA on the highly competitive MIMIC-IV-full benchmark, achieving an absolute gain of +0.7 in Macro F1 and +1.4 in Precision@8 over previous specialized baselines.
  • Massive Long-Tail Gains: On the MIMIC-III-few dataset (labels appearing fewer than 5 times), PLANT achieved an extraordinary absolute aggregate gain of +36.1 points in Macro F1 and +48.1 points in Macro Recall compared to standard baselines.
  • 10x Sample Efficiency: PLANT drastically reduces the data required for competitive performance. On MIMIC-IV-full, PLANT achieved comparable precision metrics using only ~1,090 training instances compared to the baseline requiring over 10,337 instances.

Limitations and Future Work

  • Training Overhead: Stage 1 pretraining (MIG computation and L2R optimization) adds a modest 15–20% increase in total wall-clock training time compared to standard single-stage fine-tuning. However, the authors note that this stage accounts for roughly 85% of the downstream performance gains in low-data regimes.
  • Future Directions: The authors suggest that the core principle of "planting" attention weights using information-theoretic priors could be naturally extended to multimodal tasks, where aligning cross-signal attention (e.g., text-to-image or text-to-video) remains a major bottleneck.

Summary updated

BibTeX
@misc{roy2024don,
  author = {Debjyoti Saha Roy and Byron C. Wallace and Javed A. Aslam},
  title = {{Don't Pay Attention, PLANT It: Pretraining Attention via Learning-to-Rank}},
  year = {2024},
  eprint = {2410.23066},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.23066},
}

Loading related content...

Figure