Papers
arxiv:2410.00907

Addition is All You Need for Energy-efficient Language Models

Published on Oct 1
· Submitted by luohy on Oct 7
#1 Paper of the day
Authors:

Abstract

Large neural networks spend most computation on floating point tensor multiplications. In this work, we find that a floating point multiplier can be approximated by one integer adder with high precision. We propose the linear-complexity multiplication L-Mul algorithm that approximates floating point number multiplication with integer addition operations. The new algorithm costs significantly less computation resource than 8-bit floating point multiplication but achieves higher precision. Compared to 8-bit floating point multiplications, the proposed method achieves higher precision but consumes significantly less bit-level computation. Since multiplying floating point numbers requires substantially higher energy compared to integer addition operations, applying the L-Mul operation in tensor processing hardware can potentially reduce 95% energy cost by element-wise floating point tensor multiplications and 80% energy cost of dot products. We calculated the theoretical error expectation of L-Mul, and evaluated the algorithm on a wide range of textual, visual, and symbolic tasks, including natural language understanding, structural reasoning, mathematics, and commonsense question answering. Our numerical analysis experiments agree with the theoretical error estimation, which indicates that L-Mul with 4-bit mantissa achieves comparable precision as float8_e4m3 multiplications, and L-Mul with 3-bit mantissa outperforms float8_e5m2. Evaluation results on popular benchmarks show that directly applying L-Mul to the attention mechanism is almost lossless. We further show that replacing all floating point multiplications with 3-bit mantissa L-Mul in a transformer model achieves equivalent precision as using float8_e4m3 as accumulation precision in both fine-tuning and inference.

Community

Paper author Paper submitter
edited about 15 hours ago

Implementing floating point multiplications with integer adders, improving computation efficiency, and reducing energy cost.

Screenshot 2024-10-03 at 5.32.22 PM.png

·

Great results, are you gonna release the code? @luohy

Paper author Paper submitter
This comment has been hidden
This comment has been hidden

great stuff!

also a typo on page 3, 2nd block of text: i believe "save size" should be "same size" right?

Nice idea! You could try combining it with the paper Scaling FP8 training to trillion-token LLMs to train models using far less energy than usual.

Sign up or log in to comment

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2410.00907 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2410.00907 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2410.00907 in a Space README.md to link it from this page.

Collections including this paper 8