A simple normalization swap makes your LLM's deeper layers actually do something useful.
This paper shows how to wake up those sleeping deep layers in your LLM.
Mix-LN combines Pre-Layer Normalization and Post-Layer Normalization in LLMs to make deeper layers more effective, solving the problem of underutilized deeper layers in current models.
https://arxiv.org/abs/2412.13795
π Original Problem:
β Current LLMs suffer from ineffective deeper layers that contribute minimally to model performance
β Pre-LN, used in models like GPT and LLaMA, causes diminished gradients in deeper layers
β Post-LN maintains larger gradients in deeper layers but faces vanishing gradients in earlier layers
-----
π οΈ Solution in this Paper:
β Mix-LN applies Post-LN to first 25% of layers and Pre-LN to remaining layers
β This hybrid approach ensures more uniform gradients across network depth
β The technique promotes better representation diversity between layers
β Implementation uses hyperparameter Ξ± to control ratio of Post-LN to Pre-LN layers
-----
π‘ Key Insights:
β Pre-LN's widespread use is the root cause of deeper layer inefficiency
β Optimal Post-LN ratio (Ξ±) is 0.25 for most model sizes
β Mix-LN maintains balanced gradient norms throughout the network
β The solution requires minimal computational overhead
-----
π Results:
β Consistently outperforms both Pre-LN and Post-LN across model sizes (70M to 7B parameters)
β Achieves 1.65 lower perplexity in LLaMA-71M compared to Pre-LN
β Shows 17.31% improvement on BoolQ for LLaMA-250M
β Demonstrates effectiveness in Vision Transformer tasks
------
Are you into AI and LLMsβ Join me on X/Twitter with 50K+ others, to remain on the bleeding-edge of AI every day.
π/π¦ https://x.com/rohanpaul_ai










