TL;DR
This paper introduces a novel loss function, Non-Uniform Connectivity Loss (NUCL), that encourages diversity in the outgoing connections of feedforward layers in Large Language Models (LLMs). By penalizing uniform connections, NUCL leads to improved performance on downstream tasks and enables a more effective data-free neuron pruning method, highlighting the critical role of neuronal heterogeneity in LLM capabilities.
What Problem Does This Paper Address?
While neuroscience has long recognized the importance of neuronal diversity for computational power, this principle has been largely overlooked in the development of artificial neural networks, particularly LLMs. Standard training practices often lead to uniform connections within feedforward layers. This uniformity might hinder the model's ability to represent complex functionalities effectively. The paper investigates the impact of this outgoing connection heterogeneity and proposes methods to leverage it for better LLM performance and understanding.
Methods
The core contribution is the Non-Uniform Connectivity Loss (NUCL). This loss function is designed to be added to the standard negative log-likelihood loss during LLM fine-tuning. NUCL penalizes outgoing weight vectors that are uniform, encouraging them to be more diverse. The authors explore two variants:
- NUCL-gini: Based on the Gini impurity, inspired by decision tree learning.
- NUCL-mstd: Directly optimizes the variance by minimizing the negative standard deviation of the outgoing weight distribution.
The paper also introduces a data-free structured pruning method that uses the entropy of outgoing connection weights to identify and remove neurons. This method is designed to assess the importance of neuronal heterogeneity in pre-trained models without requiring additional training data.
Datasets
The paper uses publicly available pre-trained LLMs and evaluates them on publicly available benchmarks.
LLM Families: * PaLM 2 (Gecko, Otter, Bison sizes) * Gemma 2 (2B, 9B, 27B parameter variants)
Training Datasets: * GSM8K (grade school math word problems) * SuperGLUE (a benchmark of eight language understanding tasks) * MBPP (basic Python programming problems, augmented with proprietary coding data)
Key Insights and Ideas
- Neuronal Diversity Matters: The paper strongly suggests that heterogeneity in outgoing connections of feedforward layers is crucial for LLM performance, mirroring principles observed in biological brains.
- Uniformity is Suboptimal: Neurons with diverse outgoing connection strengths are more critical to model performance than those with uniform connections.
- NUCL as a Performance Booster: The proposed NUCL loss function effectively improves LLM performance on downstream tasks in math, coding, and language understanding.
- Entropy-Based Pruning is Superior: Using outgoing connection entropy for neuron removal is significantly more effective than random or magnitude-based pruning, indicating that neurons with high heterogeneity are vital.
- Magnitude-Based Pruning Fails for Gated FFNs: Surprisingly, magnitude-based pruning performs worse than random pruning for gated feedforward layers in Transformers, suggesting that the intuition behind magnitude pruning doesn't directly apply here.
Key Results
- Fine-tuning Gains: Applying NUCL (specifically the
mstdvariant) to PaLM-2 models resulted in relative improvements of up to 3.45% on downstream tasks. For Gemma-2 models, NUCL consistently delivered relative gains ranging from 1.56% to 3.78%. - Pruning Effectiveness: When removing 25% of neurons from Gemma-2B feedforward layers, the entropy-based pruning method achieved the highest performance among pruned models, outperforming random and magnitude-based pruning. The entropy-based method showed the least performance degradation compared to the unpruned baseline.
- NUCL's Practicality: NUCL is described as highly practical due to its easy implementation, requiring only a few lines of code.
- Layer Specificity: While pruning isolated layer pairs, the impact on performance varied across tasks, suggesting that the sensitivity to pruning isn't tied to simple structural groupings of layers.
Limitations and Future Work
- Fine-tuning Focus: The current work restricts NUCL to the fine-tuning phase. Exploring its impact during pre-training could potentially yield greater reductions in outgoing weight entropy.
- Single Neuron Focus: NUCL currently focuses on the heterogeneity of a single neuron's outgoing weights. Future work could explore incorporating inter-neuron diversity to better align with the principle of neuronal differentiation.
- Data-Free Pruning: The pruning experiments were solely data-free. For optimal real-world performance, a light fine-tuning step after pruning would be beneficial.
- Weight Sign Disregard: The definition of outgoing weight distribution relies on magnitudes, intentionally disregarding sign information. Future work could explore alternative ways to measure the heterogeneity of outgoing weight vectors.
- Ethical Considerations: The authors acknowledge that working with LLMs carries ethical and societal risks, including bias amplification and potential misuse, and note that backbone models like Gemma-2 are designed to mitigate some of these.
Summary updated