COLING 2025main0 citations

Disentangle to Decay: Linear Attention with Trainable Decay Factor

Haibo Tong, Chenyang Zhang, Jiayi Lin, Bingxuan Hou, Qingqing Hong, Junli Wang

Abstract

Linear attention enhances inference efficiency of Transformer and has attracted research interests as an efficient backbone of language models. Existing linear attention based models usually exploit decay factor based positional encoding (PE), where attention scores decay exponentially with increasing relative distance. However, most work manually designs a non-trainable decay factor of exponential calculation, which limits further optimization. Our analysis reveals directly training decay factor is unstable because of large gradients. To address this, we propose a novel PE for linear attention named Disentangle to Decay (D2D). D2D disentangles decay factor into two parts to achieve further optimization and stable training. Moreover, D2D can be transformed into recurrent form for efficient inference. Experiments demonstrate that D2D achieves stable training of decay factor, and enhances performance of linear attention in both normal context length and length extrapolation scenarios.

BibTeX
@inproceedings{tong-etal-2025-disentangle,
    title = "Disentangle to Decay: Linear Attention with Trainable Decay Factor",
    author = "Tong, Haibo  and
      Zhang, Chenyang  and
      Lin, Jiayi  and
      Hou, Bingxuan  and
      Hong, Qingqing  and
      Wang, Junli",
    editor = "Rambow, Owen  and
      Wanner, Leo  and
      Apidianaki, Marianna  and
      Al-Khalifa, Hend  and
      Eugenio, Barbara Di  and
      Schockaert, Steven",
    booktitle = "Proceedings of the 31st International Conference on Computational Linguistics",
    month = jan,
    year = "2025",
    address = "Abu Dhabi, UAE",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2025.coling-main.660/",
    pages = "9877--9890"
}