Prompt Injection Detection Model Using Account and Dialog Features
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing detection technologies for prompt injection in large language models rely on prior knowledge-based rules, which are easily bypassed by attackers, leading to security vulnerabilities and privacy risks.
Innovation Solution
A machine learning-based approach for training a prompt injection detection model that utilizes word, account, and dialog feature information to identify prompt injection, without relying on expert rules, enhancing security and interpretability.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If expert rule-based detection is used for prompt injection, then the detection system is simple to implement, but it is easily bypassed by attackers leading to security vulnerabilities
Solution Approach 1:
The patent replaces the mechanical rule-based detection system with a machine learning model that automatically learns detection patterns from data. The model substitutes fixed expert rules with adaptive algorithms that can generalize to new attack patterns, resolving the contradiction between implementation simplicity and security reliability.
Solution Approach 2:
The patent changes the detection parameters from static rule thresholds to dynamic features extracted by the machine learning model. By transforming the detection approach from rule-matching to pattern recognition based on multiple features (account attributes, dialog history, prompt characteristics), the system achieves both simplicity and reliability.
2Ease of manufacture
If prior knowledge-based detection rules are used, then the detection policy is easy to establish, but it lacks generalization capability against new attack patterns
Solution Approach 1:
The patent performs preliminary training of the machine learning model on diverse prompt injection examples before deployment. This preliminary action enables the model to learn generalizable patterns upfront, allowing it to adapt to new attack patterns without requiring updates to detection rules, thus achieving both ease of establishment and high generalization capability.
Solution Approach 2:
The machine learning model performs self-learning from training data and automatically generalizes to new attack patterns without requiring manual rule updates. This self-service capability resolves the contradiction by enabling the system to maintain ease of establishment while continuously adapting to new threats through autonomous learning.
3Measurement precision
If machine learning model training is performed using multiple features (account, dialog, prompt), then detection accuracy and generalization capability improve, but system complexity increases
Solution Approach 1:
The patent segments the feature extraction process into distinct modules: account feature extraction, dialog feature extraction, and prompt feature extraction. Each module independently processes its specific feature type, which manages system complexity by organizing multiple features into manageable segments while maintaining high detection accuracy through comprehensive feature analysis.
Data Source
AI summary
Implementations of this specification disclose methods and apparatuses for training a prompt injection detection model. In an implementation, a method comprises obtaining word feature information corresponding to a prompt training sample, obtaining account feature information based on an account attribute of a user corresponding to the prompt training sample, obtaining dialog feature information based on a historical dialog record of the user for a large language model, and training the prompt injection detection model based on the account feature information, the dialog feature information, and the word feature information, to obtain a trained prompt injection detection model.


