LLM Context Window Segmentation for Accurate Low-Cost Conversations

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The increasing size of the context window in conversational large language models (LLMs) leads to higher interaction costs and accuracy degradation due to the finite amount of information that can be sent back and forth, requiring effective management to optimize cost and accuracy.

Innovation Solution

Implementing a context window management system that utilizes static and dynamic contexts to manage the size of the context window, including splitting the context into sets of static, short-term, and long-term dynamic contexts, and using a context window manager to control the number of tokens within an acceptable limit.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If the context window size is increased to capture more conversation history, then the accuracy of the LLM responses is improved, but the interaction cost increases

Engineering Contradiction:
Improveaccuracy of LLM responsesVSAvoidinteraction cost
Core Design Contradiction:
Measurement precisionVSLoss of energy

Solution Approach 1:

The patent segments the context window into multiple fixed-size chunks, where each chunk captures a specific portion of the conversation history. This segmentation allows the system to manage context in discrete units, sending only relevant chunks to the LLM rather than the entire conversation history, thereby reducing interaction costs while maintaining accuracy for each segment.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements dynamic context window management by adjusting which context chunks are sent to the LLM based on the current conversation state. The system dynamically selects and combines relevant context chunks, optimizing the context window size for each interaction to balance accuracy and cost efficiency.

Inventive Principle:
Principle #15Dynamics

2Stability of the object's composition

If the context window size is increased to maintain conversation context, then the coherence of multi-turn conversations is improved, but the processing time increases

Engineering Contradiction:
Improvecoherence of conversationVSAvoidprocessing time
Core Design Contradiction:
Stability of the object's compositionVSLoss of time

Solution Approach 1:

By dividing the conversation history into segmented context chunks, the system can process and send only the relevant segments to the LLM for each turn, rather than processing the entire conversation history. This reduces processing time while maintaining conversation coherence through selective context provision.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary organization of context into fixed-size chunks before the LLM interaction. This pre-processing step allows for faster retrieval and combination of relevant context during conversation, reducing the processing time required during actual LLM interactions while maintaining coherence.

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If the context window size is increased to provide more background information, then the relevance of LLM responses is improved, but the complexity of context management increases

Engineering Contradiction:
Improverelevance of responsesVSAvoidcomplexity of context management
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent simplifies context management complexity by organizing context into fixed-size segmented chunks with clear boundaries. This segmentation provides a structured framework that makes context management more systematic and less complex, while still providing sufficient background information for relevant responses.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the parameter of context organization from a continuous, variable-size context window to discrete, fixed-size chunks. This parameter change simplifies the management complexity by providing regular, predictable units that are easier to track, store, and retrieve, while maintaining the ability to provide relevant background information.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20250371281A1Method and system of context window engineering for large language models fine-tuned for conversations
Publication Date: 2025.12.04 CDK GLOBAL LLC
  • US20250371281A1 patent drawing
  • US20250371281A1 patent drawing
  • US20250371281A1 patent drawing

AI summary

Methods and systems for context window management of large language models are disclosed. An example method includes: receiving a message in a user language; preprocessing the message; setting a static context based on a topic of the message for a text sequence including the message, if the topic is new or different from a topic of a preceding message; attaching the static context to a context window; attaching a long term dynamic context to the context window based on the message and one or more previous messages in the text sequence; attaching a short term dynamic context to the context window based on the message; providing the context window to a language model server; receiving a database access command based on the context window from the language model server; providing the database access command to a database; and receiving a result response to the database access command from the database.