Prompt Injection Detection Model Using Account and Dialog Features

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improveease of implementationVSAvoidsecurity reliability
Core Design Contradiction:
Ease of manufactureVSReliability

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.

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

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.

Inventive Principle:
Principle #35Parameter changes

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

Engineering Contradiction:
Improveease of policy establishmentVSAvoidgeneralization capability
Core Design Contradiction:
Ease of manufactureVSAdaptability or versatility

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #25Self-service

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

Engineering Contradiction:
Improvedetection accuracyVSAvoidsystem complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

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.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20260073299A1Methods and apparatuses for training prompt injection detection model, storage media, and electronic devices
Publication Date: 2026.03.12 ANT GROUP CO LTD
  • US20260073299A1 patent drawing
  • US20260073299A1 patent drawing
  • US20260073299A1 patent drawing

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.