LLM Token Selection Inference for Long-Context Memory Reduction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Neural network-based language models (LLMs) are computationally expensive and memory-intensive due to their numerous transformer decoder layers, requiring significant resources for processing large contexts.

Innovation Solution

An LLM inference framework that performs inference on a small subset of input tokens by selecting tokens receiving the most attention from early transformer layers, reducing the context length for subsequent processing and using only a portion of the transformer layers.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If all transformer decoder layers process all input tokens in large contexts, then model accuracy is maintained, but memory consumption and computational cost increase significantly

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

Solution Approach 1:

The patent segments the processing of input tokens by dividing them into two categories: selected tokens (processed through all transformer layers) and non-selected tokens (processed only through early transformer layers). This segmentation allows the system to maintain model accuracy for important tokens while reducing overall computational load and memory consumption for large contexts.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies local quality by differentiating the processing depth for different tokens based on their importance. Selected tokens receive full processing through all transformer layers to maintain high accuracy, while non-selected tokens receive reduced processing through only early layers, optimizing the balance between accuracy and resource consumption.

Inventive Principle:
Principle #3Local quality

2Measurement precision

If all transformer decoder layers process all input tokens in large contexts, then model accuracy is maintained, but computational cost and processing time increase significantly

Engineering Contradiction:
Improvemodel accuracyVSAvoidprocessing speed
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent segments the computational workload by processing different tokens through different numbers of layers. Non-selected tokens are processed only through early transformer layers, significantly reducing computational cost and improving processing speed, while selected tokens receive full processing to maintain accuracy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial action by processing non-selected tokens through only a portion of the transformer layers (early layers) rather than all layers. This partial processing reduces computational cost and improves productivity while the selected tokens receive complete processing to maintain model accuracy.

Inventive Principle:
Principle #16Partial or excessive action

3Productivity

If a subset of tokens is selected for full processing, then computational efficiency improves, but model accuracy may deteriorate

Engineering Contradiction:
Improvecomputational efficiencyVSAvoidmodel accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent applies preliminary action by using early transformer layers to pre-process all input tokens and identify which tokens are most important (selected tokens) before proceeding to full processing. This preliminary selection ensures that the most critical tokens are identified for complete processing, maintaining model accuracy while improving computational efficiency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses feedback from the early transformer layer processing to inform the selection of tokens for full processing. The attention mechanisms and intermediate representations from early layers provide feedback about token importance, enabling the system to select the most relevant tokens for complete processing through all transformer layers.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20260080186A1Systems and methods for efficient inference of neural network based models
Publication Date: 2026.03.19 SALESFORCE INC
  • US20260080186A1 patent drawing
  • US20260080186A1 patent drawing
  • US20260080186A1 patent drawing

AI summary

Embodiments described herein provide A method for generating a response to an input context by a neural network based language model (LM) with a plurality of neural network layers, comprising: converting the input context into a plurality of tokens; generating one or more intermediate values associated with each of the plurality of tokens utilizing a subset of the plurality of neural network layers; selecting a subset of the plurality of tokens having highest associated intermediate values; and generating, based on the subset of the plurality of tokens, the response utilizing all of the plurality of neural network layers of the LM.