FLARE: Fine-tuned Long-context Acceleration with ReLU-enhanced FIRE

Michael Moffatt
Junyi Luo
Haoran Cheng
Qilong Wang
Xinting Jiang
Guanchen Tao
Shiwei Liu
Kauna Lei
Mehdi Saligane
2025
Google Scholar

Abstract

Deploying large language models (LLMs) on resource-constrained edge devices, such as mobile phones or IoT devices, is highly desirable for enabling secure, personalized on-device AI. However, there are significant challenges due to these models' high computational and memory demands. A key bottleneck lies in the Transformer's attention block, especially when handling long contexts. Techniques like model architectures with Rectified Linear Unit (ReLU) activations for Softmax and FIRE positional encoding (a resource-efficient, automatic context-length-scaling alternative to Rotary Positional Embedding (RoPE)) have each independently shown promise in reducing the computational complexity of the attention block, but the proper alchemy for combining their benefits remains underexplored. In this paper, we show a method for combining FIRE and ReLU that maintains low-validation loss at long contexts. We also introduce FLARE, a new algorithm that further improves efficiency by removing operations from the learned relative position encoding in FIRE. Our approach leads to faster inference on long sequences, robust generalization to varying context lengths, and lower validation loss compared to baseline models. FLARE achieves a significant reduction in power and area consumption. On custom hardware, it achieves a $6\times$ higher operating frequency than Softmax, while occupying $57\times$ less silicon area (measured under different throughput settings) and consuming $600\times$ less energy. Our results indicate that FLARE represents a significant step towards deploying powerful LLMs efficiently on resource-limited devices.
×