SLTrain: a sparse plus low-rank approach for parameter and memory efficient pretraining

Large language models (LLMs) have shown impressive capabilities across various tasks. However, training LLMs from scratch requires significant computational power and extensive memory capacity. Recent studies have explored low-rank structures on weights for efficient fine-tuning in terms of parameters and memory, either through low-rank adaptation or factorization. While effective for fine-tuning, low-rank structures are generally less suitable for pretraining because they restrict parameters to a low-dimensional subspace. In this work, we propose to parameterize the weights as a sum of low-rank and sparse matrices for pretraining, which we call SLTrain. The low-rank component is learned via matrix factorization, while for the sparse component, we employ a simple strategy of uniformly selecting the sparsity support at random and learning only the non-zero entries with the fixed support. While being simple, the random fixed-support sparse learning strategy significantly enhances pretraining when combined with low-rank learning. Our results show that SLTrain adds minimal extra parameters and memory costs compared to pretraining with low-rank parameterization, yet achieves substantially better performance, which is comparable to full-rank training. Remarkably, when combined with quantization and per-layer updates, SLTrain can reduce memory requirements by up to 73% when pretraining the LLaMA 7B model.

Paper

Similar papers

Peer review

Reviewer AVXH5/10 · confidence 4/52024-07-08

Summary

In this work, the authors introduce SLTrain, a novel method for pre-training large language models (LLMs) that combines sparse and low-rank matrix structures to enhance parameter and memory efficiency. The low-rank component is learned via matrix factorization, while the sparse component is achieved by uniformly selecting the sparsity support at random and learning only the non-zero entries with the fixed support. This method significantly reduces the memory requirement for LLM pre-training while achieving on-par performance.

Strengths

1. This paper introduce SLTrain, serving as the first method to pre-train LLMs with sparse + low rank matrices. 2. The authors provide extensive experimental results demonstrating the effectiveness of SLTrain across various model sizes, from 60M to 7B parameters. The comparison with state-of-the-art methods such as ReLoRA and GaLore is thorough and highlights SLTrain's advantages in memory reduction and parameter efficiency. 3. The authors provide a solid theoretical motivation for combining sparse and low-rank components. The empirical analysis of singular values and the distribution of residuals supports the feasibility and effectiveness of this approach.

Weaknesses

1. As the model size scales up, the perplexity score gap between SLTrain and Full-Rank increases, whereas GaLore maintains a more consistent performance at scale. Consequently, the reduction in parameters with SLTrain leads to suboptimal performance and potential scalability challenges. 2. From Table 3, we observe that the memory efficiency of SLTrain does not translate into faster training speeds. This is due to the inclusion of sparse components during training. Additionally, I am curious about its efficiency during inference. For inference, we have two options: using sparse and low-rank matrices, which should reduce memory usage but increase inference time, or using a larger dense weight matrix, similar to full-rank inference. Therefore, I am interested in the memory and time requirements for both inference modes. 3. I am curious about the potential of using structural sparse patterns, such as butterfly matrices [1], to enhance training performance and efficiency. These structural sparse matrices can be computed in a more efficient way and has better expressivity. Reference: [1] Dao, Tri, et al. "Pixelated butterfly: Simple and efficient sparse training for neural network models." arXiv preprint arXiv:2112.00029 (2021).

Questions

See Weaknesses.

Rating

5

Confidence

4

Soundness

4

Presentation

3

Contribution

3

Limitations

See Weaknesses.

Reviewer Rr3S5/10 · confidence 4/52024-07-11

Summary

The submission proposes an approach to reduce memory and computational overhead in training large neural networks. It combines sparse training with low-rank adaptations to achieve efficient training without significant performance degradation. The paper includes an evaluation of SLTrain compared to full-rank, low-rank, ReLoRA, and GaLore models across multiple model sizes and tasks of the LLAMA model family.

Strengths

1. Ablation Study: The paper yields a good overview of the structure of Llama and analyzes the singular spectrum of several layer matrices, to yield a solid motivation for the sparse + low-rank trick 2. Comparative Analysis: The paper provides a detailed comparison with other methods such as full-rank, low-rank, ReLoRA, and GaLore for Llama 3. Implementation Details: The methodology is well-documented, with clear descriptions of how parameters and optimizer states are managed.

Weaknesses

1. Main concern in this work is in the paragraph starting in line 172. The authors aim for low-rank + sparse pretraining of LLMs to save memory. However, their proposed evaluation of a sparse plus low-rank layer is (AB + S)x, where + denotes a sparse matrix add. This implies that the resulting full matrix Y=AB + S is stored in memory, (if only temporarily) which defeats the purpose of a low-rank formulation. The authors mention “gpu-friendliness” as the reason for this choice, mistaking GPU throughput for real efficiency gain. - In that regard: How exactly is the “actual memory footprint” in paragraph (line 315) measured? Rigorous details are needed here to make the contribution credible. 2. The paper is very experimental without theoretical justification of the method (which itself is fine), thus an increased focus on implementation details and actual memory consumption of the implementation is expected. 3. Results are specific for Llama. The authors consider speficifally the Llama model family in this study. Given the computational effort to train LLMs, this is fine, but is should be clearly stated in the scope, which mentions general LLMs. Have the authors reasonable proof that their method, and mostly, the study of the singular spectrum extends to other LLMs?

Questions

See above

Rating

5

Confidence

4

Soundness

2

Presentation

2

Contribution

3

Limitations

yes

Reviewer Wf5L6/10 · confidence 3/52024-07-12

Summary

The authors propose SLTrain that performs a low-rank factorization of the weights as well as a sparse matrix of factors that represents which parameters to update. The authors show that their method can achieve significant memory savings compared to GaLore while retaining performance.

Strengths

- the paper is well written and easy to read - the method is very simple to integrate to the model as randomly generating sparse factors is easy to initialize - the savings look significant compared to GaLore

Weaknesses

- no strong theoretical justification why the sparse method works. - it is not clear how much sparsity is needed for a specific task. Is the degree of sparsity impactful on the performance? - what if we only parametrize the weights with BA and not BA+S, wouldn't that decrease the number of parameters? and how well will it perform? - wouldn't it be more useful if we regenerate the random sparse factors every couple of iterations to have a more effective pretraining? - how much do the results depend on the randomness of the sparse factors? can we have multiple runs and a standard deviation to see if that randomness play a big role in the results? - comparing GaLore and SLTrain is not really apple-to-apple as GaLore is based on the gradients and SLTrain is based on the weights. What if you had GaLore+SLTrain where gradients and weights are both made more efficient?

Questions

Please address the weaknesses above

Rating

6

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

yes

Reviewer AVXH2024-08-08

Response to Rebuttal

Thank you for your rebuttal. Regarding W1, I still observe a non-negligible performance gap between SLTrain and Full Rank pre-training. In Table 2 of the PDF, the perplexity is slightly higher for SLTrain compared to Full Rank, while the memory usage is slightly lower. Given this, I believe that Full Rank pre-training might still be preferred for its better performance. I would expect SLTrain to achieve a similar performance to be truly impressive. Thank you for your responses to W2 and W3. I will maintain my current score.

Authorsrebuttal2024-08-10

Response to further comments

Thank you for your detailed feedback. Based on your comments, it appears that the parameter efficiency of SLTrain, a central contribution of our paper (alongside memory efficiency), may not have been fully recognized. We would like to emphasize that parameter efficiency is a key aspect of our approach, as highlighted in both the abstract and introduction, and substantiated through various experiments presented in the main manuscript and supplementary material. To further substantiate our claims, we have conducted an additional experiment involving the training of LLaMA 350M with an increased $\delta = 0.1$. The results are presented in the table below, where we also include a comparison with GaLore to better illustrate the advantages of SLTrain. | | PPL| Mem | Param Size| |----------|--------|--------|--------| | Full-Rank | 18.80 |59.34G| 368M | | GaLore | 18.95 (+0.8\%) | 58.35G (-1.7\%) | 368M (-0\%) | | SLTrain ($\delta=0.05$) | 19.24 (+2.3\%) | 58.00G (-2.2\%) | 200M (-45\%) | | SLTrain ($\delta=0.1$) | 18.72 (-0.4\%) | 58.25G (-1.8\%) | 215M (-42\%) | As shown in the table, SLTrain with $\delta = 0.1$ not only matches but slightly outperforms the Full-Rank model in terms of perplexity, while requiring only 58\% of its parameter size and maintaining memory efficiency. Across all experiments, SLTrain consistently offers the best trade-off between perplexity, memory usage, and parameter size when compared to other baselines. We believe that parameter efficiency is particularly critical during post-pretraining stages. While many existing works, such as [1], focus on model pruning after pretraining, SLTrain directly trains a smaller model from the pretraining stage, effectively reducing parameter size from the outset. In summary, the results presented in the table not only demonstrate that SLTrain can achieve performance comparable to the Full-Rank model while maintaining memory efficiency, but also highlight the significant parameter savings it offers. **We hope this would lead to a re-evaluation of our work.** [1] Li, Y., Yu, Y., Zhang, Q., Liang, C., He, P., Chen, W., and Zhao, T. LoSparse: Structured compression of large language models based on low-rank and sparse approximation. In *ICML 2023*.

Authorsrebuttal2024-08-14

Dear Reviewer AVXH, We haven't heard back from you after our last response. We would be grateful if you could look at our responses. We believe our responses would have answered all the questions. Hope to see a positive rerating of the submission. Best, Authors

Reviewer Rr3S2024-08-09

Thank you for the answer and clarifying remarks to point 2) and 3). ad 1): The argument for the memory efficiency of the method is that the full weight matrix is only stored temporarily. Can the authors comment on the parallelizability constraints that this temporal full-matrix constraints bring? Specifically: The method seemingly generates the full matrix during the layer evaluation of layer $k$, then discards it again to evaluate layer $k+1$? If so, can the authors elaborate how the gradient tape is stored? It must not store the temporary (AB + S) matrix, since then one would observe similar memory footprint as the full model. Second, can the authors elaborate on the practicability of combining their approach with, e.g. pipelining, where multiple layers are evaluated in parallel? Is their method still applicable, since in this scenario the temporarily stored AB+S needs to be constructed in many layers simultaneously, potentially leading to memory spikes.

Reviewer Rr3S2024-08-09

Out of curiosity: Can the authors elaborate a bit on the choice of the hyperparameters, specifically the sparsity parameter $\delta$ and rank $r$. How can one choose them in practise, and have they observed how they influence each other, e.g. a higher sparsity score means that the models require less rank, or something similar.

Authorsrebuttal2024-08-10

Response to further questions

Thank you for the follow-up questions. Please see our responses below. **1. On gradient memory of $BA + S$.** No, we never need to store the temporary $(BA + S)$ matrix for gradient computation and this is one of the main points we highlight in Section 3.2 (Line 181 of the main paper). We only need to store the necessary components in order to compute the gradients, i.e., $B, A$ and the indices and values for $S$. We have defined a customized layer specifically for this purpose. Please refer to Algorithm 1 and provided codes in supplementary for more details. **2. On combining SLTrain with pipelining.** We have not tried out such pipelined scenarios in the paper. However, a straightforward combination of SLTrain with pipelining may not yield memory savings. For such settings, we would consider the approach of computing $BAx$ and $Sx$ separately albeit with a trade-off on computational cost. In summary, while our method is applicable in pipelined scenarios, achieving the full efficiency gains may require additional memory management strategies when layers are evaluated in parallel. **3. On choice of hyperparameters.** In practice, we often can try out different combinations to understand the trade-offs better. Please refer to Table 5 of the main paper, where we compare the model's performance across various choices of sparsity parameter $\delta$ and rank $r$. Generally, a higher sparsity parameter allows the model to achieve comparable performance with a lower rank, as you correctly noted.

Authorsrebuttal2024-08-14

Dear Reviewer Rr3S, We haven't heard back from you after our last response. We would be grateful if you could look at our responses. We believe our responses would have answered all the questions. Hope to see a positive rerating of the submission. Best, Authors

Authorsrebuttal2024-08-13

We sincerely thank the reviewers for their constructive feedback, which has significantly strengthened our paper. We believe we have effectively addressed all concerns and questions raised thus far. Specifically: - We have provided a theoretical justification for the low-rank plus sparse modeling in response to the concerns raised by Reviewer Wf5L and Reviewer Rr3S. - We have offered detailed explanations and numerical comparisons to clarify how $BA + S$ achieves memory efficiency, addressing the primary concern of Reviewer Rr3S. - We have conducted additional experiments demonstrating that SLTrain can achieve comparable performance to full-rank models while significantly reducing parameter size and maintaining memory efficiency, addressing Reviewer AVXH’s concerns regarding the performance gap between SLTrain and full-rank models. - We have emphasized the parameter efficiency of the proposed model, alongside its memory efficiency, one of the key contributions that tend be overlooked by the reviewers. - We have addressed all other questions raised by the reviewers. As the discussion period deadline approaches, we would greatly appreciate a **reconsideration of the scores** if there are no further questions. However, if any additional concerns arise, we remain fully committed to addressing them promptly.

Reviewer Wf5L2024-08-14

Thank you for the rebuttal and for addressing most of my concerns. I have increased my score by 1.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC