Language Models as Zero-shot Lossless Gradient Compressors: Towards General Neural Parameter Prior Models

Hui-Po Wang, Mario Fritz
9/26/2024
cs.LGcs.AI

Official code: hui-po-wang/LM-GC (4 stars, MIT, last commit 2024-10-30).

Abstract

Despite the widespread use of statistical prior models in various fields, such models for neural network gradients have long been overlooked. The inherent challenge stems from their high-dimensional structures and complex interdependencies, which complicate effective modeling. In this work, we demonstrate the potential of large language models (LLMs) to act as gradient priors in a zero-shot setting. We examine the property by considering lossless gradient compression -- a critical application in distributed learning -- that depends heavily on precise probability modeling. To achieve this, we introduce LM-GC, a novel method that integrates LLMs with arithmetic coding. Our technique converts plain gradients into text-like formats, enhancing token efficiency by up to 38 times compared to their plain representations. We ensure that this data conversion maintains a close alignment with the structure of plain gradients and the symbols commonly recognized by LLMs. Our experiments indicate that LM-GC surpasses existing state-of-the-art lossless compression methods, improving compression rates by 10% up to 17.2% across various datasets and architectures. Additionally, our approach shows promising compatibility with lossy compression techniques such as quantization and sparsification. These findings highlight the significant potential of LLMs as a model for effectively handling gradients. Code is available at https://github.com/hui-po-wang/LM-GC.

View on arXivView PDF

Code Implementations(1)

hui-po-wang/LM-GCOfficial100%
MIT

[NeurIPS 2024] Source code for "Language Models as Zero-shot Lossless Gradient Compressors: Towards General Neural Parameter Prior Models"

41Shell, PythonOct 27, 20241 years agoMIT
compressiondeep-learninggenerative-priorgradientllm

Similar Papers

Cite this paper

@article{wang2024language,
  title  = {Language Models as Zero-shot Lossless Gradient Compressors: Towards General Neural Parameter Prior Models},
  author = {Hui-Po Wang and Mario Fritz},
  year   = {2024},
  eprint = {2409.17836},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2409.17836},
  url    = {http://arxiv.org/abs/2409.17836v2},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.17836.svg)](https://codeofpaper.com/paper/2409.17836)

Discussion