Zhang, Shuhao and Yu, Jiayi and Li, Jiarui (2024) Stable Random Sampling (SRS): A New Method to Refine Causal Masking in Decoder-Only Transformer. In: Proceedings of the 2nd International Conference on Machine Learning and Automation, CONF-MLA 2024, November 21, 2024, Adana, Turkey.
71848.pdf
Download (967kB)
Abstract
In current language modelling, the decoder-only Transformer architecture with causal masking has become a cornerstone, demonstrating exceptional performance across various tasks. However, we have identified two significant limitations: First, causal masking presents a substantial obstacle to further optimizing overall model efficiency, particularly in handling long contexts. Second, traditional optimization of causal masking struggles with uneven attention distribution and the inability to encode absolute positional information, limiting their effectiveness in position-sensitive tasks. In this work, we propose the Stable Random Sampling (SRS) algorithm, a novel method to address both limitations by refining the causal masking process. SRS introduces a pseudo-attention mask to balance attention distributions for performance refinement and incorporates random sampling and Locality-Sensitive Hashing (LSH) in causal masking part for efficient processing, reducing time complexity of this part to O(n). The effectiveness of SRS is validated both theoretically and empirically. Our pre-training ablation experiments demonstrate that SRS module virtually enhances the performance of causal masking while each functional part of it relatively improves efficiency and effectiveness towards different sizes of tasks, on average showing a 30% reduction in training time and a 50% decrease in loss rate compared to traditional methods.
| Item Type: | Conference or Workshop Item (UNSPECIFIED) |
|---|---|
| Uncontrolled Keywords: | decoder-only transformer, causal masking, random sampling, positional information |
| Date Deposited: | 04 Mar 2026 18:27 |
| Last Modified: | 03 Dec 2026 13:48 |
| URI: | https://eprints.eai.eu/id/eprint/52528 |
