UniAttn: 通过Softmax统一降低推理成本以适应训练后的LLM
UniAttn: Reducing Inference Costs via Softmax Unification for Post-Training LLMs
AI总结:
UniAttn通过统一Softmax操作降低训练后LLM的推理成本,同时保持性能。
摘要:
训练后的LLM适应现实应用至关重要。部署训练后的模型面临显著挑战,因为大量内存开销和明显的推理延迟。现有工作已识别出LLM中的显著冗余,并提出了高效的架构,即层内KV共享和层间KV共享。然而,这些方法仍然导致较高的推理时间开销,仍不足以满足训练后的预训练LLM的需求。在本文中,我们发现Softmax操作是LLM推理的主要瓶颈,并发现其在训练后实际上高度冗余。我们提出了Softmax统一在注意(UniAttn),一种新的训练后方法,通过统一Transformer块中的Softmax激活来降低LLM推理成本。此外,UniAttn采用线性投影来补偿Softmax统一引起的误差。实验显示,UniAttn在性能上与标准训练后方法相当,同时显著降低了推理成本,在训练后表现优于现有高效架构。
英文摘要:
Post-training is essential for adapting Large Language Models (LLMs) to real-world applications. Deploying post-trained models faces significant challenges due to substantial memory overhead and noticeable inference latency. Existing work has identified significant redundancies in LLMs and proposed efficient architectures, namely intra-layer KV sharing and cross-layer KV sharing. However, these methods still result in high inference time overhead, remaining suboptimal for post-training pre-trained LLMs. In this paper, we identify that the \texttt{Softmax} operation is a primary bottleneck for LLM inference and discover that it is actually highly redundant during post-training. We propose Softmax \textbf{Uni}fication in \textbf{Att}e\textbf{n}tion (\textbf{UniAttn}), a novel post-training method that unifies Softmax activations across transformer blocks to reduce LLM inference costs. Additionally, UniAttn adopts a linear projection to compensate for the errors induced by Softmax unification. Experiments show that UniAttn matches the performance of standard post-training while significantly reducing inference costs, outperforming existing efficient architectures during post-training.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。