LLM Prompt Token Optimization for Accuracy, Cost, and Latency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing generative AI large language model (LLM) interactions face challenges in prompt quality, output quality, cost, and latency due to the length and complexity of prompts required for accurate responses, which are not efficiently addressed by current systems.

Innovation Solution

A method and system utilizing heuristic techniques and machine learning algorithms to optimize prompts by identifying areas for improvement, such as removing unnecessary words, and balancing accuracy, cost, and latency through iterative prompt reduction.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If the prompt length is increased to improve output accuracy, then the response quality improves, but the computational cost and latency increase

Engineering Contradiction:
Improveoutput accuracyVSAvoidlatency
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs preliminary analysis of the prompt using heuristic techniques and ML algorithms to identify redundant tokens before the main LLM processing occurs. This pre-processing step removes unnecessary tokens in advance, reducing the input size that the LLM must process, thereby decreasing latency while preserving the essential information needed for accurate output.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system extracts and removes redundant or unnecessary tokens from the prompt while retaining the core meaningful content. By identifying and taking out superfluous tokens through heuristic analysis and ML-based evaluation, the system reduces prompt length and computational overhead without compromising the accuracy of the LLM's output.

Inventive Principle:
Principle #2Taking out (Extraction)

2Measurement precision

If the prompt length is increased to improve output accuracy, then the response quality improves, but the computational cost increases

Engineering Contradiction:
Improveoutput accuracyVSAvoidcomputational cost
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The system extracts and removes redundant or unnecessary tokens from the prompt while retaining the core meaningful content. By identifying and taking out superfluous tokens through heuristic analysis and ML-based evaluation, the system reduces prompt length and computational overhead without compromising the accuracy of the LLM's output.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The system changes the parameter of prompt length by dynamically adjusting it based on heuristic analysis and ML algorithms. By optimizing the number of tokens to the minimum necessary for accurate output, the system reduces computational cost while maintaining output quality, effectively finding the optimal parameter setting for each prompt.

Inventive Principle:
Principle #35Parameter changes

3Quantity of substance

If the prompt is simplified to reduce token count, then the cost decreases, but the output quality may deteriorate

Engineering Contradiction:
Improvetoken countVSAvoidoutput quality
Core Design Contradiction:
Quantity of substanceVSMeasurement precision

Solution Approach 1:

The system uses feedback from ML algorithms to evaluate whether token removal affects output quality. By iteratively testing prompt variations and measuring output accuracy, the system receives feedback on which tokens can be safely removed without degrading performance, allowing continuous optimization of prompt length while maintaining quality thresholds.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system replaces manual prompt crafting with automated heuristic techniques and ML algorithms that objectively evaluate and optimize prompts. This substitution enables systematic identification of redundant tokens based on data-driven insights rather than intuition, ensuring that token reduction does not compromise output quality while lowering costs.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS12536373B2Token optimization in generative large language model learning (LLM) interactions
Publication Date: 2026.01.27 FRESHWORKS INC
  • US12536373B2 patent drawing
  • US12536373B2 patent drawing
  • US12536373B2 patent drawing

AI summary

Performing token optimization in generative artificial intelligence (AI) large language machine learning (LLM) interactions includes receiving, by at least one processor, a prompt from a user of a computing device, and analyzing, by the at least one processor, the prompt to identify one or more areas where the prompt can be improved. The analyzing the prompt comprises using a heuristic technique and one or more machine learning (ML) algorithms to identify the one or more areas of the prompt for improvement.