12
Model Pruning
In this chapter, we’ll explore model pruning techniques designed to reduce model size while maintaining performance.
Model pruning refers to the systematic elimination of unnecessary parameters from a neural network while maintaining performance. For LLMs, this typically involves identifying and removing redundant or less important weights, neurons, or attention heads based on criteria such as magnitude, sensitivity analysis, or gradient-based importance.
You’ll learn how to implement various pruning methods, from magnitude-based pruning to iterative techniques, and the trade-offs involved in size reduction versus performance. Additionally, this chapter will help you decide whether to prune during or after training, ensuring ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access