SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.02214 · 2024

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

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 6 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
andyjm3/SLTrain canonical 5 of 6
FunctionStatusWhere it lives
apply_rotary_pos_emb Ran andyjm3/SLTrain/peft_pretraining/modeling_llama.py
code served (permissive licence) · get_code("f725bc2d76076485")
get_cosine_schedule_with_multiple_warmups Ran andyjm3/SLTrain/peft_pretraining/training_utils.py
code served (permissive licence) · get_code("c6be024db31c0ca0")
get_cyclical_cosine_schedule_with_min_lr Ran andyjm3/SLTrain/peft_pretraining/training_utils.py
code served (permissive licence) · get_code("f58a7fbb020fe7cd")
get_scheculer Ran andyjm3/SLTrain/peft_pretraining/training_utils.py
code served (permissive licence) · get_code("d994247ead9997b9")
rotate_half Ran andyjm3/SLTrain/peft_pretraining/modeling_llama.py
code served (permissive licence) · get_code("b99eea6376d1e212")
check_args_torchrun_main Not yet run andyjm3/SLTrain/peft_pretraining/args_utils.py
code served (permissive licence) · get_code("c233d4777fc58003")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.02214")
get_code_for_paper("2406.02214")
have("2406.02214")

Connect an agent — have() is free.