Language Model Token Pruning for Long-Context Generation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Transformer-based language models face challenges in scaling to long sequences with large amounts of context, leading to increased processing time and costs, as well as limitations on context size that affect their performance and efficiency in tasks like question answering and language generation.
Innovation Solution
Implementing token pruning processes in transformer-based language models to identify and remove less important tokens based on attention scores, applying TP constraints to ensure accuracy and reduce computational requirements, while maintaining relevant context.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If transformer-based language models process long sequences with large amounts of context, then language understanding and generation accuracy is improved, but processing time and computational cost increase
Solution Approach 1:
The patent extracts and removes less important tokens from the input sequence based on attention score evaluation. By identifying and pruning tokens with low attention scores, the system maintains the essential contextual information needed for accurate language understanding while reducing the overall sequence length, thereby decreasing processing time without significantly compromising accuracy.
Solution Approach 2:
The patent applies different treatment to different tokens based on their individual attention scores. Tokens with high attention scores are retained, while tokens with low attention scores are pruned. This localized differentiation allows the model to focus computational resources on the most relevant parts of the sequence, improving processing efficiency while maintaining understanding accuracy.
2Measurement precision
If transformer-based language models process long sequences with large amounts of context, then language understanding and generation accuracy is improved, but computational cost increases
Solution Approach 1:
The system extracts and removes tokens that contribute minimally to the generation task based on their attention scores. By pruning these less important tokens before processing, the computational cost is reduced while the essential information needed for accurate language generation is preserved through the attention mechanism's selective retention of important tokens.
Solution Approach 2:
Instead of processing the entire long sequence with full computational resources, the system applies a partial action by pruning tokens and then processing only the reduced sequence. This partial processing approach achieves sufficient accuracy for the task while significantly lowering computational cost compared to full sequence processing.
3Productivity
If token pruning is applied to reduce computational requirements, then processing efficiency is improved, but context accuracy may be compromised
Solution Approach 1:
The system uses attention scores as feedback to guide the token pruning process. By evaluating the attention scores of each token and using this feedback to determine which tokens to prune, the system ensures that only tokens with low attention (and thus low impact on accuracy) are removed, maintaining context accuracy while improving processing efficiency.
Solution Approach 2:
The system performs preliminary evaluation of attention scores for all tokens in the sequence before actually performing the pruning operation. This preliminary action allows the system to make informed decisions about which tokens to prune, ensuring that context accuracy is maintained while still achieving the benefits of reduced computational requirements.
Data Source
AI summary
Embodiments of the invention provide a computer-implemented method that includes executing, using a generative language model, generative language model operations operable to generate an output sequence responsive to an original input sequence. The generative language model operations include token pruning operations that include performing a base set of token pruning operations on intermediate versions of the original input sequence; and performing token pruning (TP) constraint evaluations. The base set of token pruning operations identify pruning candidate tokens in the intermediate versions of the original input sequence. The TP constraint evaluations determine that at least one of the pruning candidate tokens will be pruned from an associated intermediate version of the original input sequence.


