Large Language Model Query Filtering for Pattern Evasion
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Large language models are vulnerable to pattern evasion attacks, allowing malicious queries to bypass framing and obtain unauthorized information, posing a cybersecurity risk, especially for white-box models, which can also affect black-box models.
Innovation Solution
A method and device for securing large language models by filtering initial character strings to detect and replace special characters with spaces, segmenting into fragments, and verifying these fragments against dictionaries and lists of authorized words, deleting unauthorized fragments to ensure the query remains within the intended legal framework.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If pattern evasion attacks are applied to large language models, then unauthorized information can be obtained by bypassing framing, but the model security and reliability deteriorate
Solution Approach 1:
The patent applies preliminary action by implementing query preprocessing steps before the query reaches the large language model. The system detects special characters, segments the query into fragments, verifies fragments against dictionaries of authorized words, and modifies unauthorized fragments in advance. This prevents pattern evasion attacks from reaching the model, thereby maintaining security while preserving legitimate model functionality.
2Reliability
If query filtering and fragment verification are implemented, then model security improves, but processing time and device complexity increase
Solution Approach 1:
The patent applies segmentation by dividing the query into smaller fragments based on special characters and spaces. This allows the system to process and verify each fragment independently against dictionaries of authorized words, improving security through comprehensive checking while reducing processing time compared to analyzing the entire query string at once.
Solution Approach 2:
The patent introduces an intermediary processing layer between the user query and the large language model. This intermediary system performs character detection, fragment segmentation, and dictionary verification as a buffer, blocking malicious queries before they reach the model while maintaining efficient communication for authorized queries.
3Object-affected harmful factors
If fragment deletion for unauthorized words is applied, then illegal use is prevented, but authorized fragments may be removed reducing model performance
Solution Approach 1:
The patent applies local quality by treating different fragments of the query differently based on their content. Authorized fragments are preserved and passed to the model, while only unauthorized fragments containing special characters or words not in the authorized dictionary are modified or removed. This selective approach prevents illegal use while maintaining the integrity and performance of authorized queries.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
The method for securing a large language model comprises steps of: - acquisition (30) of a query in the form of an initial character string (CH-i), - first filtering (32) of said initial character string to obtain a filtered character string (CH-f), the first filtering comprising a detection of special characters in the initial character string and replacement of each special character detected by a space, - extraction (34, 36) from the filtered character string of at least one fragment formed of a group of characters followed and/or preceded by a space, and verification (38) of a presence of said fragment in a dictionary of authorized words, and - second filtering (40) of the initial character string to obtain a processed character string (CH-T), said second filtering (40) comprising a deletion from the initial character string of said fragments not belonging to said dictionary of authorized words.