Theoretical Insights into Fine-Tuning Attention Mechanism: Generalization and Optimization
Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 6830-6838.
https://doi.org/10.24963/ijcai.2025/760
Keywords
- Machine Learning: ML: Theory of deep learning
- Machine Learning: ML: Other
- Machine Learning: ML: Deep learning architectures
Abstract
Large Language Models (LLMs), built on Transformer architectures, exhibit remarkable generalization across a wide range of tasks. However, fine-tuning these models for specific tasks remains resource-intensive due to their extensive parameterization. In this paper, we explore two remarkable phenomena related to the attention mechanism during the fine-tuning of LLMs (where Wq, Wk, and Wv denote the weights of the query, key, and value layers, respectively). The first phenomenon, termed “Unequal Importance of Attention Matrices”, highlights the impact of fine-tuning different weight matrices. It shows that optimizing the Wv matrix yields significantly better performance than optimizing the Wk matrix. Fine-tuning only the Wq and Wv matrices is computationally efficient while delivering results comparable to, or even better than fine-tuning all three matrices (Wq, Wk, and Wv). The second phenomenon, “Attention Matrices with Customized Learning Rate Lead to Better Convergence”, emphasizes the importance of assigning distinct learning rates to these matrices. Specifically, a higher learning rate for the Wv matrix compared to Wq and Wk accelerates convergence and improves performance. Building on these insights, we propose a new strategy that improves fine-tuning efficiency in terms of both storage and time. Experimental results on benchmark datasets validate the effectiveness of this approach, supporting our theoretical findings. Our analysis lays the theoretical groundwork for configuring and improving algorithms in LLMs fine-tuning.
@inproceedings{ijcai2025p760,
title = {Theoretical Insights into Fine-Tuning Attention Mechanism: Generalization and Optimization},
author = {Yao, Xinhao and Qian, Hongjin and Hu, Xiaolin and Xu, Gengze and Liu, Wei and Luan, Jian and Wang, Bin and Liu, Yong},
booktitle = {Proceedings of the Thirty-Fourth International Joint Conference on
Artificial Intelligence, {IJCAI-25}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {James Kwok},
pages = {6830--6838},
year = {2025},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2025/760},
url = {https://doi.org/10.24963/ijcai.2025/760},
}
TY - CPAPER TI - Theoretical Insights into Fine-Tuning Attention Mechanism: Generalization and Optimization AU - Yao, Xinhao AU - Qian, Hongjin AU - Hu, Xiaolin AU - Xu, Gengze AU - Liu, Wei AU - Luan, Jian AU - Wang, Bin AU - Liu, Yong T2 - Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI-25 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2025 SP - 6830 EP - 6838 DO - 10.24963/ijcai.2025/760 UR - https://doi.org/10.24963/ijcai.2025/760 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: