arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.12362cs.LG
收藏

KV权重是无跳跃Transformer所需的一切

KV-weights are all you need for skipless transformers

OpenMachine

Nils Graef

AI总结:

本文提出适用于MQA和GQA的无跳跃Transformer数学等价版本,通过移除Q和P层减少权重,如Mistral-7B可减少15%权重,降低计算和内存复杂度。

摘要:

He和Hofmann(arXiv:2311.01906)详细描述了一种无跳跃Transformer,它去除了V和P(注意力后投影)线性层,从而减少了总权重数量。然而,该方案仅适用于MHA(多头注意力),不适用于MQA(多查询注意力)和GQA(分组查询注意力)。后者被许多流行的LLM采用,如Llama 2、Mistral、Mixtral、PaLM和Gemma。因此,本微论文提出了适用于MQA和GQA的数学等价版本。例如,从Mistral-7B的无跳跃版本中移除Q和P将移除其15%的权重(从而降低其计算和内存复杂度)。观看我们的解释视频https://youtu.be/Tx_lMpphd2g,并访问https://github.com/OpenMachine-ai/transformer-tricks获取代码和更多Transformer技巧。

英文摘要:

He and Hofmann (arXiv:2311.01906) detailed a skipless transformer without the V and P (post-attention projection) linear layers, which reduces the total number of weights. However, this scheme is only applicable to MHA (multi-head attention), but not for MQA (multi-query attention) and GQA (grouped-query attention). The latter schemes are used by many popular LLMs such as Llama 2, Mistral, Mixtral, PaLM, and Gemma. Therefore, this micro-paper proposes mathematically equivalent versions that are suitable for MQA and GQA. For example, removing Q and P from a skipless version of Mistral-7B would remove 15% of its weights (and thus reduce its compute and memory complexity). Watch our explainer video https://youtu.be/Tx_lMpphd2g and see https://github.com/OpenMachine-ai/transformer-tricks for code and more transformer tricks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑