用信息熵指导注意力机制,提升私有大模型推理效率。
Entropy-Guided Attention for Private LLMs
- 以香农熵为度量,揭示非线性层对注意力多样性的重要性。
- 提出熵引导注意力机制,解决早期层熵过载导致的表征浪费。
- 适合关注隐私计算与高效架构设计的研究者。
专有语言模型的普及引发了严重的隐私问题,亟需推进私有推理(PI),即在加密数据上直接进行计算而不泄露用户敏感信息。尽管PI前景广阔,但其实际部署受限于显著的通信与延迟开销,主要源于非线性操作。为此,我们提出一个信息论框架,刻画解码器仅语言模型中非线性的作用,为适配PI需求的Transformer架构优化奠定理论基础。通过利用香农熵作为量化指标,我们发现非线性具有此前未被探索的双重意义:不仅保障训练稳定性,还对维持注意力头多样性至关重要。具体而言,移除非线性会引发两种关键故障模式:深层出现‘熵坍塌’导致训练不稳定,浅层出现‘熵过载’导致多头注意力(MHA)表征能力未被充分利用。我们提出一种熵引导注意力机制及新型熵正则化技术以缓解熵过载,并探索了防止熵坍塌、稳定低非线性模型训练的PI友好型层归一化替代方案。本研究弥合了信息论与架构设计的鸿沟,确立熵动态为高效PI架构设计的理论指引。代码实现见https://github.com/Nandan91/entropy-guided-attention-llm。
原文摘要 · Abstract (English)
The pervasiveness of proprietary language models has raised critical privacy concerns, necessitating advancements in private inference (PI), where computations are performed directly on encrypted data without revealing users' sensitive information. While PI offers a promising solution, its practical deployment is hindered by substantial communication and latency overheads, primarily stemming from nonlinear operations. To address this, we introduce an information-theoretic framework to characterize the role of nonlinearities in decoder-only language models, laying a principled foundation for optimizing transformer-architectures tailored to the demands of PI. By leveraging Shannon's entropy as a quantitative measure, we uncover the previously unexplored dual significance of nonlinearities: beyond ensuring training stability, they are crucial for maintaining attention head diversity. Specifically, we find that their removal triggers two critical failure modes: {\em entropy collapse} in deeper layers that destabilizes training, and {\em entropic overload} in earlier layers that leads to under-utilization of Multi-Head Attention's (MHA) representational capacity. We propose an entropy-guided attention mechanism paired with a novel entropy regularization technique to mitigate entropic overload. Additionally, we explore PI-friendly alternatives to layer normalization for preventing entropy collapse and stabilizing the training of LLMs with reduced-nonlinearities. Our study bridges the gap between information theory and architectural design, establishing entropy dynamics as a principled guide for developing efficient PI architectures. The code and implementation are available at https://github.com/Nandan91/entropy-guided-attention-llm
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。