LAMP:大型语言模型的前瞻性混合精度推理
LAMP: Look-Ahead Mixed-Precision Inference of Large Language Models
AI总结:
本文提出了一种前瞻性混合精度推理方法,通过选择性提高部分组件的计算精度,提升Transformer推理的准确性,实验证明在GPT-2模型上精度提升达两个数量级。
摘要:
混合精度计算是当前AI阶段的标志,推动大型语言模型向高效、本地可部署的解决方案发展。本文探讨了具有组合丰富性的函数的浮点计算,重点放在Transformer推理上。基于组合$f(g(x)))$的舍入误差分析,我们提供了一种自适应策略,选择$g(x)$的小子集组件以更高精度计算,而其他计算则可以以较低精度进行。我们随后解释了该策略如何应用于Transformer中的不同组合,并说明其对Transformer推理的整体影响。我们通过在GPT-2模型上数值研究该算法的有效性,并证明即使非常低的重新计算率,也能使精度提高两个数量级。
英文摘要:
Mixed-precision computations are a hallmark of the current stage of AI, driving the progress in large language models towards efficient, locally deployable solutions. This article addresses the floating-point computation of compositionally-rich functions, concentrating on transformer inference. Based on the rounding error analysis of a composition $f(g(\mathrm{x}))$, we provide an adaptive strategy that selects a small subset of components of $g(\mathrm{x})$ to be computed more accurately while all other computations can be carried out with lower accuracy. We then explain how this strategy can be applied to different compositions within a transformer and illustrate its overall effect on transformer inference. We study the effectiveness of this algorithm numerically on GPT-2 models and demonstrate that already very low recomputation rates allow for improvements of up to two orders of magnitude in accuracy.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。