Eliminating Packing-Aware Masking via LoRA-Based Supervised Fine-Tuning of Large Language Models

Citations

WEB OF SCIENCE

0
Citations

SCOPUS

0

초록

Packing approaches enhance training efficiency by filling the padding space in each batch with shorter sequences, thereby reducing the total number of batches per epoch. This approach has proven effective in both pre-training and supervised fine-tuning of large language models (LLMs). However, most packing methods necessitate a packing-aware masking (PAM) mechanism to prevent cross-contamination between different text segments in the multi-head attention (MHA) layers. This masking ensures that the scaled dot-product attention operates only within segment boundaries. Despite its functional utility, PAM introduces significant implementation complexity and computational overhead during training. In this paper, we propose a novel method that eliminates the need for PAM during supervised fine-tuning with packing. Instead of masking, we introduce a learnable tensor derived from Low-Rank Adaptation (LoRA) with the query and value parameters of the attention mechanism. This tensor is trained to attenuate the subspace corresponding to cross-contamination, effectively replacing the function of PAM. Through component-wise decomposition of attention head outputs, we isolate the contamination component and demonstrate that it can be attenuated using the LoRA-derived tensor. Empirical evaluations on 7B-scale LLMs show that our method reduces training time and runtime overhead by completely removing the implementation associated with PAM. This enables more scalable and efficient supervised fine-tuning with packing, without compromising model integrity.

키워드

training efficiency; supervised fine-tuning; large language model; packing; training-time overhead; implementation complexity
제목
Eliminating Packing-Aware Masking via LoRA-Based Supervised Fine-Tuning of Large Language Models
저자
Seo, Jeong Woo; Jung, Ho-Young
DOI
10.3390/math13203344
발행일
2025-10-20
유형
Article
저널명
MATHEMATICS
권
13
호
20