Speculative Decoding for Generative AI Inference

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Generative artificial intelligence models, such as large language models, are computationally expensive and resource-intensive, making them impractical for deployment on devices with limited capabilities due to the need for multiple passes through the model for each token generated in a response, leading to high energy expenditure, processing time, and memory utilization.

Innovation Solution

The use of a smaller draft model in collaboration with a larger target model, where the draft model generates candidate responses and the target model provides guidance signals for correction, allowing for speculative decoding and rejection sampling to reduce computational resources required, enabling efficient generation of responses.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If a large language model is used to generate each token through multiple passes, then semantic accuracy is maintained, but computational expense and processing time increase significantly

Engineering Contradiction:
Improvesemantic accuracyVSAvoidprocessing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The draft model performs preliminary action by generating candidate tokens in advance before the target model verifies them. This allows the system to prepare multiple potential outputs upfront, reducing the need for iterative passes through the computationally expensive target model while maintaining accuracy through subsequent verification.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The draft model serves as an intermediary between the input query and the target model. It generates candidate tokens that are then verified by the target model, acting as a buffer that reduces the direct computational burden on the target model while preserving the accuracy benefits of target model verification.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If a large language model is used to generate each token through multiple passes, then response quality is maintained, but energy expenditure and computational resources increase

Engineering Contradiction:
Improveresponse qualityVSAvoidcomputational expense
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The draft model performs preliminary token generation using fewer computational resources, creating candidate tokens that are then verified by the target model. This preliminary action reduces the overall computational expense by avoiding multiple full passes through the expensive target model while maintaining response quality through verification.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The draft model acts as an intermediary that handles the computationally expensive token generation task using fewer resources, allowing the target model to focus only on verification. This division of labor reduces total computational expense while preserving response quality through the target model's verification process.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If speculative decoding with a draft model is used, then token generation rate increases and computational efficiency improves, but model complexity increases

Engineering Contradiction:
Improvetoken generation rateVSAvoidmodel complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The token generation process is segmented into two distinct stages: candidate generation by the draft model and verification by the target model. This segmentation allows each model to be optimized for its specific function, increasing overall token generation rate while managing complexity by dividing the task between models of different sizes and capabilities.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20250021761A1Accelerating inferencing in generative artificial intelligence models
Publication Date: 2025.01.16 QUALCOMM INC
  • US20250021761A1 patent drawing
  • US20250021761A1 patent drawing
  • US20250021761A1 patent drawing

AI summary

Techniques and apparatus for generating a response to a query input into a generative artificial intelligence model. An example method generally includes generating, based on an input query and a first generative artificial intelligence model, a sequence of tokens corresponding to a candidate response to the input query. The sequence of tokens and the input query are output to a second generative artificial intelligence model for verification. One or more first guidance signals for the generated sequence of tokens are received from the second generative artificial intelligence model. The candidate response to the input query is revised based on the generated sequence of tokens and the one or more first guidance signals, and the revised candidate response is output as a response to the received input query.