Attention Head Pruning in Large Language Models for Memory Reduction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Large language models require significant computing resources, including memory, to maintain high accuracy, leading to inefficiencies in processing.

Innovation Solution

A method involving reinforcement learning to iteratively adjust attention heads in a large language model based on importance scores, reducing memory usage while preserving accuracy through fine-tuning and dynamic head removal.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If a large language model maintains high accuracy through full model structure, then prediction accuracy is improved, but memory consumption increases

Engineering Contradiction:
Improveprediction accuracyVSAvoidmemory consumption
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent segments the large language model into multiple independent attention heads within transformer layers. By evaluating and selectively removing individual attention heads based on their importance scores (computed via gradient norm or occlusion methods), the model achieves memory reduction while preserving prediction accuracy. This segmentation allows granular control over model components rather than treating the entire model as a monolithic structure.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts and removes redundant attention heads from the large language model structure. Through iterative evaluation of attention head importance and selective removal of low-contribution heads, the method extracts unnecessary components while maintaining the core functional structure. This extraction process reduces memory consumption by eliminating duplicate or less important attention mechanisms while preserving the model's predictive capabilities.

Inventive Principle:
Principle #2Taking out (Extraction)

2Quantity of substance

If attention heads are removed to reduce memory size, then memory efficiency is improved, but prediction accuracy may deteriorate

Engineering Contradiction:
Improvememory sizeVSAvoidprediction accuracy
Core Design Contradiction:
Quantity of substanceVSMeasurement precision

Solution Approach 1:

The patent implements feedback mechanisms to evaluate the impact of attention head removal on prediction accuracy. By computing importance scores for each attention head and iteratively removing only those with lowest importance while monitoring performance degradation, the method provides continuous feedback to guide the pruning process. This feedback loop ensures that memory efficiency is improved without causing significant deterioration in prediction accuracy.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent changes the parameter configuration of attention heads by selectively setting weights of certain attention heads to zero based on their importance scores. This parameter modification transforms the model from using all attention heads to using only the most important subset, thereby reducing memory size while maintaining prediction accuracy through intelligent parameter selection rather than random or uniform reduction.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20250307696A1Memory-efficient large language model
Publication Date: 2025.10.02 BMC HELIX INC
  • US20250307696A1 patent drawing
  • US20250307696A1 patent drawing
  • US20250307696A1 patent drawing

AI summary

Systems and techniques train a first large language model (LLM) using domain data to output a second LLM, the second LLM having a first memory size. The systems and techniques generate predictions by both the first LLM and the second LLM using a same input data for generating the predictions. The systems and techniques compute a threshold by comparing the predictions by the first LLM and the second LLM. The systems and techniques iteratively adjusting a set of attention heads of the second LLM by comparing new predictions from the second LLM to the threshold using the same input data. The systems and techniques generate a third LLM having a different set of attention heads than the set of attention heads of the second LLM, the third LLM having a second memory size that is smaller than the first memory size of the second LLM.