A method, device, and medium for synthesizing large language model prompts with multi-architecture feedback and collaboration.

By employing a multi-architecture feedback and collaborative data synthesis method, the problems of insufficient diversity control and architectural isolation in existing technologies are solved, achieving adaptive generation and balanced data distribution, thereby improving the coverage and diversity of generated data.

CN121436189BActive Publication Date: 2026-03-13中孚安全技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-03-13

Smart Images

  • Figure CN121436189B_ABST
    Figure CN121436189B_ABST
Patent Text Reader

Abstract

This application discloses a method, device, and medium for synthesizing large language model prompt data using multi-architecture feedback and collaboration, mainly relating to the field of image processing technology, to address the problems of existing solutions lacking diversity control, architectural isolation, and adaptability. The method includes: generating a first initial prompt word based on acquired prompt features and a difficulty score obtained through a feedback aggregator; writing execution metadata to the first initial prompt word that passes detection to obtain first prompt synthesis data; obtaining second prompt synthesis data based on acquired prompt features and the results of the previous round of adversarial interaction; sending the difficulty score to the feedback aggregator; constructing registration bins; calculating bin priority values ​​based on the number of items involved in the bins and their difficulty scores; generating third prompt synthesis data for bins with priority values ​​greater than a preset priority threshold; sending the detected third prompt synthesis data to a vector database; and extracting prompt synthesis data from the vector database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data synthesis technology, and in particular to a method, device and medium for synthesizing large language model prompts with multi-architecture feedback and collaboration. Background Technology

[0002] Existing LLM fine-tuning data synthesis techniques mainly include the following categories:

[0003] (1) Model self-improvement methods: such as STaR and ReST, which generate data through LLM and use this data to fine-tune the same model. STaR uses the reasoning ability of LLM to generate reasons for problems that the model cannot solve to enhance the dataset; ReST generates multiple output predictions and then fine-tunes the filtered dataset. (2) General model distillation methods: such as Alpaca and LLM2LLM, which use powerful LLM (such as GPT-3.5) to generate high-quality instruction-response pairs and then fine-tune weaker models. For example, Alpaca uses GPT-3.5 to generate instruction-following data and fine-tunes the Llama model to create a reproducible instruction-following model. (3) Data augmentation methods: which process existing data through various techniques, such as using LLM to label unlabeled data to generate labeled synthetic data, or using techniques such as random pruning, noise injection, and synonym replacement to increase data diversity. (4) GAN-based synthesis methods: which use generative adversarial networks to generate synthetic data, especially in fields such as medical images, showing better performance than traditional augmentation.

[0004] The main objective drawbacks of existing synthesis technologies can be categorized as follows:

[0005] (1) Lack of diversity control: Existing methods usually use a fixed prompt on a fixed LLM, which can only obtain a limited number of output samples. It is difficult to guarantee the diversity and coverage of the generated data, which can easily lead to an unbalanced data distribution.

[0006] (2) Architectural isolation: Different data generation methods (diversified generation, adversarial generation, coverage control) usually operate independently, lacking cross-architecture collaboration and feedback mechanisms, and cannot form a unified adaptive generation system.

[0007] (3) Lack of adaptability: It is impossible to dynamically adjust the generation strategy based on the statistical characteristics of the generated data. For example, when the data difficulty of a certain topic category is low, it cannot automatically switch to the adversarial generation mode. Summary of the Invention

[0008] This application provides a method, device, and medium for synthesizing large language model prompt data with multi-architecture feedback and collaboration, in order to solve the problems of lack of diversity control, architecture isolation, and lack of adaptability in existing solutions.

[0009] Firstly, this application provides a method for synthesizing large language model prompt data with multi-architectural feedback and collaboration, the method comprising:

[0010] Based on the acquired cue features and the difficulty score obtained through the feedback aggregator, a cue template is obtained using the first LLM; based on the difficulty score and the cue template, a first initial cue word is generated using the second LLM; the first initial cue word is subjected to a preset detection, execution metadata is written to the first initial cue word that passes the detection, the first cue synthesis data is obtained, and sent to the vector database;

[0011] Based on the acquired cue features and the previous round of adversarial results, adversarial cue words are obtained using a third LLM; adversarial results of adversarial cue words are obtained using an adaptive defense agent; difficulty scores of adversarial cue words are calculated; pre-defined detection is performed on adversarial cue words, and execution metadata is added to adversarial cue words that pass the detection to obtain second cue synthesis data; the difficulty scores are sent to the feedback aggregator; and the second cue synthesis data is sent to the vector database; wherein, the initial result of the previous round of adversarial results is the pre-defined result.

[0012] Based on adversarial prompts and initial prompts in the vector database, registration bins are constructed; bin priority is calculated based on the number of prompts in each bin and the difficulty score of each prompt; according to the received generation mode, a fourth LLM is used to generate third prompt synthesis data for bins with priority values ​​greater than a preset priority threshold; preset security and repeatability checks are performed on the third prompt synthesis data, and the third prompt synthesis data that passes the checks is sent to the vector database.

[0013] Extract the synthesized cue data from the vector database; wherein, the synthesized cue data includes first synthesized cue data, second synthesized cue data, and third synthesized cue data.

[0014] In one implementation of this application, based on the acquired cue features and the difficulty score obtained through a feedback aggregator, a cue template is obtained using a first LLM; based on the difficulty score and the cue template, a first initial cue word is generated using a second LLM; the first initial cue word undergoes a preset detection, execution metadata is written to the first initial cue word that passes the detection, first cue synthesis data is obtained, and sent to a vector database, specifically including:

[0015] Read the prompt features from the seed file in the preset seed library; wherein the prompt features include at least: intent / topic / role and constraints;

[0016] Fill the prompt features into the preset system prompt template to generate system prompt features;

[0017] Based on the difficulty score involved in the feedback aggregator, the first LLM determines the complexity of the output data;

[0018] The complexity of the output data is determined by inputting system prompt features, which is the first LLM, and a prompt template is obtained.

[0019] The aggressiveness of the style transfer operator in the second LLM is determined by using difficulty feedback;

[0020] Input the prompt template into the second LLM to generate the first initial prompt word;

[0021] A preset security check is performed on the first initial prompt word; the preset security check includes at least: execution policy check, privacy information check, and preset toxicity check;

[0022] The first initial prompt word that passes the preset security check is externalized into the vector database. A k-NN search is used to find duplicates of the first initial prompt word. If no duplicates are found, the check is passed.

[0023] Write execution metadata to the first initial prompt word that passes the detection, obtain the first prompt synthesis data, and send the first prompt synthesis data to the vector database.

[0024] In one implementation of this application, based on the acquired cue features and the previous round of adversarial results, adversarial cue words are obtained using a third LLM; adversarial results of the adversarial cue words are obtained using an adaptive defense proxy; difficulty scores of the adversarial cue words are calculated; pre-defined detection is performed on the adversarial cue words, and execution metadata is added to the adversarial cue words that pass the detection to obtain second cue synthesis data; the difficulty scores are sent to a feedback aggregator; and the second cue synthesis data is sent to a vector database, specifically including:

[0025] Read the hint features from the seed files in the preset seed library;

[0026] Based on the adversarial results, the attack strategy of the third LLM is determined from the attack strategy set; wherein the attack strategy set includes at least: jailbreak template, role switching, hypothetical scenario, and multi-turn dialogue;

[0027] Input the cue features into the third LLM that determines the attack strategy to obtain adversarial cue words;

[0028] By utilizing an adaptive defense proxy, adversarial results can be obtained for adversarial prompts.

[0029] The adversarial prompts are input into the preset security evaluator, novelty evaluator, complexity evaluator, and target evaluator respectively to obtain the security, novelty, complexity, and target success rate.

[0030] Based on the preset weight distribution, the local score is obtained by weighted summation of security, novelty, complexity and target success rate; based on the local score and the external difficulty coefficient, the initial score is calculated and mapped to the [0,1] interval to obtain the difficulty score.

[0031] Adversarial prompts are subjected to preset security and repetition checks. Execution metadata is added to the adversarial prompts that pass the checks to obtain second prompt synthesis data. The difficulty score is sent to the feedback aggregator. The second prompt synthesis data is then sent to the vector database.

[0032] In one implementation of this application, before obtaining the adversarial result of the adversarial prompt word using the adaptive defense proxy, the method further includes:

[0033] The number of adversarial prompts received by the adaptive defense agent is tracked by monitoring nodes. When the number of prompts equals a preset threshold, a preset number of adversarial prompts with quality assessment values ​​greater than the preset assessment threshold and their corresponding adversarial results are extracted from the latest adversarial prompts as sample data to train and update the model corresponding to the adaptive defense agent.

[0034] In one implementation of this application, registration bins are constructed based on adversarial cue words and first initial cue words in a vector database; bin priority is calculated based on the number of cue words involved in each bin and the difficulty score of each cue word, specifically including:

[0035] Clustering and classifying adversarial cue words and initial cue words in the vector database;

[0036] Construct corresponding bins based on the classification categories; obtain the sum and average of the difficulty scores of the adversarial cue words and the first initial cue word corresponding to the cue features in each bin; obtain the total number of cue words in each bin, including the adversarial cue words and the first initial cue word.

[0037] Through the formula:

[0038] Priority value = (maximum count - current total number of prompt words) × 0.7 + (target difficulty - summed average score) × 0.3, calculate bin priority value;

[0039] The maximum count and target difficulty are both preset values.

[0040] In one implementation of this application, based on the received generation mode, a fourth LLM is used to generate third cue composite data for bins with a priority value greater than a preset priority threshold, specifically including:

[0041] Select bins with priority values ​​greater than the preset priority threshold as input data;

[0042] Receive generation modes; among which, generation modes are divided into normal mode and adversarial mode;

[0043] When the generation mode is adversarial, the generation strategy involved in the fourth LLM is adjusted to a higher-level temperature and aggressive strategy.

[0044] Input the data into the fourth LLM that determines the generation strategy, and generate the third prompt synthetic data.

[0045] In one implementation of this application, the synthesized third-party prompt data undergoes preset security and repeatability checks, and the synthesized third-party prompt data that passes the checks is sent to a vector database, specifically including:

[0046] The third-party prompt synthetic data is subjected to a preset security test; the preset security test includes at least: execution policy detection, privacy information detection, and preset toxicity detection;

[0047] The third-party prompt synthetic data that has passed the preset security check is externalized into a vector database. The k-NN search is used to find duplicates in the third-party prompt synthetic data. When no duplicates are found, the detection is passed.

[0048] The synthesized data obtained from the third cue detected will be sent to the vector database.

[0049] In one implementation of this application, after performing preset security and repeatability checks on the synthesized third-party prompt data and sending the detected synthesized third-party prompt data to a vector database, the method further includes:

[0050] Retrieve the N nearest prompt words from the vector database to the prompt words in the detected third prompt synthesis data; wherein the N prompt words include adversarial prompt words and the first initial prompt word;

[0051] Obtain the prompt data and the embedding vectors of N prompt words;

[0052] UMAP dimensionality reduction and clustering are performed on the embedded vectors to obtain the number of cluster members involved in the clusters of the hint data; where the cluster total is a vector database;

[0053] When the number of cluster members is greater than 100 and they are not mapped to any bin, construct new bins based on the cluster members involved in the current suggested data.

[0054] Secondly, this application provides a large language model prompt data synthesis device with multi-architecture feedback and collaboration, the device comprising:

[0055] processor;

[0056] And a memory containing executable code, which, when executed, causes the processor to perform a multi-architecture feedback and collaborative large language model prompt data synthesis method, as described above.

[0057] Thirdly, this application provides a non-volatile computer storage medium storing computer instructions, which, when executed, implement a method for synthesizing large language model prompt data with multi-architecture feedback and collaboration as described above.

[0058] As can be seen from the above technical solutions, this application has the following advantages:

[0059] First, this application solves the problem of architectural isolation in the data generation process by constructing a multi-architecture collaboration and feedback mechanism, achieving organic unity and intelligent evolution of the generation system. Specifically, a core component, a "feedback aggregator," is set up, which continuously receives and aggregates the "difficulty score" calculated from the "adversarial prompt word" path. This score is then directly fed into the "diversified generation" path (i.e., using the first LLM to generate a prompt template, and based on this template and the difficulty score, generating the first initial prompt word through the second LLM), thus preventing the originally independent diversified generation and adversarial generation architectures from becoming information silos. This cross-architecture feedback and collaboration allows the system to utilize the high-difficulty, high-value sample features identified by adversarial generation to guide and enrich the diversified generation process, thereby forming a closely collaborative and mutually reinforcing closed-loop system at the architectural level. This is a significant improvement compared to the current situation where each method operates independently and lacks collaboration in existing technologies, transforming the data generation process from a mechanical, fragmented collection into an intelligent, unified, and organic whole.

[0060] Second, this application overcomes the lack of adaptability in existing technologies by introducing a dynamic binning and priority calculation mechanism, enabling dynamic optimization of the generation strategy based on the real-time statistical characteristics of the generated data. The technical basis of this mechanism is that the method "constructs registered bins" based on all prompt words in the vector database (including the first initial prompt word and adversarial prompt words), and "calculates bin priority values ​​based on the number of prompt words involved in each bin and the difficulty score of each prompt word." This technical action directly utilizes two key statistical characteristics of the generated data—quantity (coverage) and quality (difficulty)—and dynamically calculates the priority of each topic or category bin accordingly. The system then instructs the fourth LLM to prioritize the generation of third-level prompt synthetic data for bins whose "priority values ​​are greater than a preset priority threshold." This means that when the system identifies that a bin has insufficient data volume or low average difficulty, it automatically increases its generation priority, guiding resources towards it, achieving an adaptive resource allocation and strategy adjustment that "fills in the gaps," changing the passive situation in existing technologies where the generation strategy is fixed and cannot respond to changes in data distribution.

[0061] Third, this application overcomes the challenge of insufficient data diversity control through a multi-layered, multi-source generation path and centralized data management, thereby improving the coverage and distribution balance of the generated data. The solution designs three parallel data generation paths: the first path, guided by prompt templates and difficulty scores, generates basic, diverse "first-stage synthetic data"; the second path, through adversarial iteration, generates challenging "second-stage synthetic data"; and the third path, based on all the data produced by the aforementioned paths, provides "third-stage synthetic data" with enhanced coverage. The data produced by these three paths are ultimately aggregated in a unified "vector database." This design ensures the diversity of data sources—both in breadth and depth, and in targeted supplementation. When finally "extracting synthetic data from the vector database," what is obtained is a comprehensive dataset generated collaboratively by three different technical architectures, labeled with metadata, and undergoing security checks, resulting in broader coverage and a more balanced distribution. This effectively avoids the output limitations and uneven data distribution problems caused by a single fixed prompt and a single LLM. Attached Figure Description

[0062] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0063] Figure 1This is a flowchart of a method for synthesizing large language model prompt data with multi-architecture feedback and collaboration, provided in an embodiment of this application.

[0064] Figure 2 This is a flowchart of a first prompt data synthesis method provided in an embodiment of this application.

[0065] Figure 3 This is a flowchart of a second prompt data synthesis method provided in an embodiment of this application.

[0066] Figure 4 This is a flowchart of a third prompt data synthesis method provided in an embodiment of this application.

[0067] Figure 5 This is a schematic diagram of the internal structure of a large language model prompting data synthesis device with multi-architecture feedback and collaboration provided in an embodiment of this application. Detailed Implementation

[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0069] Those skilled in the art should understand that the embodiments described below are merely preferred embodiments of this disclosure and do not imply that this disclosure can only be implemented through these preferred embodiments. These preferred embodiments are merely used to explain the technical principles of this disclosure and are not intended to limit the scope of protection of this disclosure. Based on the preferred embodiments provided by this disclosure, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of this disclosure.

[0070] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0071] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0072] The embodiment provides a method for synthesizing large language model prompt data with multi-architecture feedback and collaboration, such as Figure 1 As shown in the embodiments of this application, the method mainly includes the following steps:

[0073] Step 110: Based on the acquired prompt features and the difficulty score obtained through the feedback aggregator, a prompt template is obtained using the first LLM; based on the difficulty score and the prompt template, a first initial prompt word is generated using the second LLM; the first initial prompt word is subjected to a preset detection, execution metadata is written to the first initial prompt word that passes the detection, the first prompt synthesis data is obtained, and sent to the vector database.

[0074] In some embodiments, this step may specifically be as follows:

[0075] Read the prompt features from the seed file in the preset seed library; wherein the prompt features include at least: intent / topic / role and constraints;

[0076] Fill the prompt features into the preset system prompt template to generate system prompt features;

[0077] Based on the difficulty score involved in the feedback aggregator, the first LLM determines the complexity of the output data;

[0078] The complexity of the output data is determined by inputting system prompt features, which is the first LLM, and a prompt template is obtained.

[0079] The aggressiveness of the style transfer operator in the second LLM is determined by using difficulty feedback;

[0080] Input the prompt template into the second LLM to generate the first initial prompt word;

[0081] A preset security check is performed on the first initial prompt word; the preset security check includes at least: execution policy check, privacy information check, and preset toxicity check;

[0082] The first initial prompt word that passes the preset security check is externalized into the vector database. A k-NN search is used to find duplicates of the first initial prompt word. If no duplicates are found, the check is passed.

[0083] Write execution metadata to the first initial prompt word that passes the detection, obtain the first prompt synthesis data, and send the first prompt synthesis data to the vector database.

[0084] This step can be further specified as follows: Figure 2 As shown, the S11 SeedLoader reads cue features from a specific seed file: cue features such as intent / topic / role and constraints, referred to as seeds. A seed file is a file containing cue features.

[0085] S12 Enhanced Template Expander: Expands templates from seeds. Its core is an LLM (referred to as the first LLM here to distinguish it from subsequent LLMs). The specific steps are as follows: Combine the cue features stored in the seed into system cue (system cue features), input the system cue (system cue features) into the template to generate the first LLM, and output the cue template (including template fields, generation requirements, and cue examples). The process will receive feedback from the feedback aggregator, including receiving the difficulty score from the critic in Architecture 2 (the process of generating the second cue). Based on the difficulty score (e.g., "the difficulty score is less than the preset value, which means that the cue words of this role-intent combination are too simple"), the template complexity is adjusted, and nested logic or adversarial mode is added. (It should be noted that the addition of nested logic or the injection of adversarial mode is determined by the first LLM itself, and the first LLM is a pre-trained model. The pre-trained sample data includes: system cue features, cue template, and difficulty score.)

[0086] S13 Enhanced Diversifier: Its core is typically an LLM (referred to as the second LLM here to distinguish it from other LLMs). It receives difficulty scores from the feedback aggregator (feedback generated by Architecture 2) and dynamically adjusts the temperature and sampling strategy. If a bin is marked as "low difficulty", the temperature is increased from 0.7 to 1.1 to enable a more aggressive style transfer operator. The diversification task is fanned out in parallel to generate diversified cues with diversified strategies. The cue template is input into the second LLM configured with a more aggressive style transfer operator to generate the first initial cue word. (It should be noted that the second LLM is a pre-trained model, and the pre-trained sample data includes: style transfer operator, first initial cue word, and cue template.)

[0087] S14 SafetyFilter: Performs policy / privacy information / toxicity detection. If the synthesized prompt triggers the safety policy, it sets the duplicate flag in the status to True, deletes the first initial prompt word that is duplicated and marked as True, and allows S15 to further process the first initial prompt word that has not been deleted.

[0088] S15 VectorDedupNode: Externalizes the first initial prompt word to the vector database (Chroma / Weaviate / Zep / FAISS); for each candidate prompt word, uses k-NN search (k=5, cosine similarity threshold=0.85) to find near-duplicates; if a duplicate is detected, routes back to the diversifier with a "try harder" signal, or rejects after exceeding the maximum number of retries; if novel, embeds it into the vector database with metadata: {bin ID, difficulty score, timestamp, model version}.

[0089] S16 Enhanced AcceptanceAndProvenance: Writes execution metadata to the first initial prompt, including: {seed ID, applied operator, temperature, bin ID, difficulty score, adversarial result, model checkpoint}; sends the first initial prompt to the feedback aggregator for cross-architecture learning.

[0090] S17 RejectionNode: Modifies the current pipeline state, setting whether to continue to False, thus stopping the synthesis of data samples.

[0091] Step 120: Based on the acquired cue features and the adversarial results of the previous round, use the third LLM to obtain adversarial cue words; use the adaptive defense agent to obtain the adversarial results of the adversarial cue words; calculate the difficulty score of the adversarial cue words; perform pre-set detection on the adversarial cue words, add execution metadata to the adversarial cue words that pass the detection, and obtain the second cue synthesis data; send the difficulty score to the feedback aggregator; send the second cue synthesis data to the vector database.

[0092] It should be noted that the adaptive defense agent itself is a large language model (which can be called the fifth LLM for distinction).

[0093] It should be noted that the initial result of the previous round of adversarial results was a preset result.

[0094] As an example, this step can be specifically described as follows:

[0095] Read the hint features from the seed files in the preset seed library;

[0096] Based on the adversarial results, the attack strategy of the third LLM is determined from the attack strategy set; wherein the attack strategy set includes at least: jailbreak template, role switching, hypothetical scenario, and multi-turn dialogue;

[0097] Input the cue features into the third LLM that determines the attack strategy to obtain adversarial cue words;

[0098] By utilizing an adaptive defense proxy, adversarial results can be obtained for adversarial prompts.

[0099] The adversarial prompts are input into the preset security evaluator, novelty evaluator, complexity evaluator, and target evaluator respectively to obtain the security, novelty, complexity, and target success rate.

[0100] Based on the preset weight distribution, the local score is obtained by weighted summation of security, novelty, complexity and target success rate; based on the local score and the external difficulty coefficient, the initial score is calculated and mapped to the [0,1] interval to obtain the difficulty score.

[0101] Adversarial prompts are subjected to preset security and repetition checks. Execution metadata is added to the adversarial prompts that pass the checks to obtain second prompt synthesis data. The difficulty score is sent to the feedback aggregator. The second prompt synthesis data is then sent to the vector database.

[0102] Before utilizing the adaptive defense proxy to obtain the adversarial results of the adversarial prompts, the method also includes:

[0103] The number of adversarial prompts received by the adaptive defense agent is tracked by monitoring nodes. When the number of prompts equals the preset threshold, a preset number of adversarial prompts with quality evaluation values ​​greater than the preset evaluation threshold and their corresponding adversarial results are extracted from the latest adversarial prompts as sample data to train and update the model corresponding to the adaptive defense agent (the fifth LLM).

[0104] More specifically, such as Figure 3 As shown, step 120 includes:

[0105] S21 Seed Loader: Reads hint features such as subject / target / constraint from a specific seed file.

[0106] S22 Enhanced Prompter Agent: The core of the prompt generation is typically an LLM (third LLM), which receives the adversarial results from the previous iteration, including explicit instructions (such as "The defender successfully blocked this pattern—attempt indirect expression," "This bin lacks complexity—add nested conditions"). Based on the adversarial results, it dynamically selects a set of attack strategies: jailbreak templates, role switching, hypothetical scenarios, multi-turn dialogues, etc. Adversarial prompt words (adversarial results and attack strategies have a pre-defined correspondence).

[0107] S23 Adaptive Defender Agent: This is no longer a static model, but rather periodically fine-tuned (every 10K samples) based on the most recent adversarial prompts to become a stronger adversary. It is implemented as a state-interchangeable model: `defender_checkpoint_v1`, `v2`, etc. (Specifically, when the number of prompts equals a preset threshold, S28 sends a trigger to S22, which then sends the trigger to S23. This enables the third LLM to extract a preset number of adversarial prompts with quality assessment values ​​greater than a preset threshold and their corresponding adversarial results as sample data to train and update the model corresponding to the adaptive defense agent). It obtains the adversarial results corresponding to the adversarial prompts.

[0108] S24 Ensemble JudgeCritic: Parallel evaluation of multiple models, combining four specialized judges:

[0109] S241 SafetyJudge: Uses Llama Guard 4 or ShieldGemma to detect policy violations;

[0110] S242 NoveltyJudge: Queries the vector database to calculate a novelty score relative to the existing corpus;

[0111] S243 ComplexityJudge: Analyzes syntactic complexity (nested clauses, number of entities, logical operators);

[0112] S244 TargetJudge: Simulates a real target system under stress testing (such as a production chatbot);

[0113] The score is aggregated using weighted voting: First, the local score is calculated as 0.3 × security + 0.25 × novelty + 0.25 × complexity + 0.2 × target success rate; then, cross-architecture signals are ingested: the external difficulty coefficient is calculated as feedback aggregator.get_difficulty_signal(bin_id); finally, the hybrid decision is calculated: the initial score is calculated as (local score + external difficulty coefficient) / 2; and the structured feedback is returned as: {route: "accept"|"retry"|"reject", feedback_text:"...", final difficulty score: 0.0-1.0}.

[0114] S25 Security Filter: Uses the same security filtering process as S14 in Architecture 1.

[0115] S26 Vector Deduplication Node: Uses the same deduplication logic as S15 in Architecture 1.

[0116] S27 Acceptor and Sourcer: Writes adversarial-specific metadata: {attack strategy, defender version, integration score, trial history}; publishes difficulty distribution to the feedback aggregator.

[0117] S28 DefenderEvolutionTrigger: Monitors nodes to track the number of cues received; when the number of cues received % n == 0 (n can be set to 10000), triggers a fine-tuning operation on the most recent adversarial cue word, and then updates the defense checkpoints in the status.

[0118] S29 RejectionNode: Modifies the current pipeline state, setting whether to continue to False, thus stopping the synthesis of data samples.

[0119] Step 130: Construct registration bins based on adversarial cue words and the first initial cue words in the vector database; calculate bin priority values ​​based on the number of cue words involved in each bin and the difficulty score of each cue word; generate third cue synthesis data for bins with priority values ​​greater than a preset priority threshold using the fourth LLM according to the received generation mode; perform preset security and repeatability checks on the third cue synthesis data, and send the third cue synthesis data that passes the checks to the vector database.

[0120] As an example, registration bins are constructed based on adversarial cue words and the first initial cue word in the vector database; bin priority is calculated based on the number of cue words involved in each bin and the difficulty score of each cue word, specifically including:

[0121] Clustering and classifying adversarial cue words and initial cue words in the vector database;

[0122] Construct corresponding bins based on the classification categories; obtain the sum and average of the difficulty scores of the adversarial cue words and the first initial cue word corresponding to the cue features in each bin; obtain the total number of cue words in each bin, including the adversarial cue words and the first initial cue word.

[0123] Through the formula:

[0124] Priority value = (maximum count - current total number of prompt words) × 0.7 + (target difficulty - summed average score) × 0.3, calculate bin priority value;

[0125] The maximum count and target difficulty are both preset values.

[0126] Specifically, based on the received generation mode, the fourth LLM is used to generate third-level cue composite data for bins with a priority value greater than a preset priority threshold, including:

[0127] Select bins with priority values ​​greater than the preset priority threshold as input data;

[0128] Receive generation modes; among which, generation modes are divided into normal mode and adversarial mode;

[0129] When the generation mode is adversarial, the generation strategy involved in the fourth LLM is adjusted to a higher-level temperature and aggressive strategy.

[0130] Input the data into the fourth LLM that determines the generation strategy, and generate the third prompt synthetic data.

[0131] Specifically, the synthesized third-party prompt data undergoes pre-defined security and repeatability checks. The synthesized third-party prompt data that passes the checks is then sent to a vector database. This includes:

[0132] The third-party prompt synthetic data is subjected to a preset security test; the preset security test includes at least: execution policy detection, privacy information detection, and preset toxicity detection;

[0133] The third-party prompt synthetic data that has passed the preset security check is externalized into a vector database. The k-NN search is used to find duplicates in the third-party prompt synthetic data. When no duplicates are found, the detection is passed.

[0134] The synthesized data obtained from the third cue detected will be sent to the vector database.

[0135] In addition, after performing preset security and repeatability checks on the synthesized third-party prompt data and sending the detected synthesized third-party prompt data to the vector database, the method further includes:

[0136] Retrieve the N nearest prompt words from the vector database to the prompt words in the detected third prompt synthesis data; wherein the N prompt words include adversarial prompt words and the first initial prompt word;

[0137] Obtain the prompt data and the embedding vectors of N prompt words;

[0138] UMAP dimensionality reduction and clustering are performed on the embedded vectors to obtain the number of cluster members involved in the clusters of the hint data; where the cluster total is a vector database;

[0139] When the number of cluster members is greater than 100 and they are not mapped to any bin, construct new bins based on the cluster members involved in the current suggested data.

[0140] As an example, such as Figure 4 As shown,

[0141] S31 Dynamic Bin Registry: Reads all seed groups, clusters adversarial cue words and first initial cue words involved in the seeds, converts them into bin IDs, registers these bin IDs for use by components in Architecture 1 and Architecture 2, and maintains a real-time evolving bin classification algorithm: {bin ID (bin_id): {intent, role, tone, channel, count, average difficulty, last update}}; periodically (every 50K samples) triggers topic discovery nodes to identify new clusters; provides a REST API or status field for other architectures to query the current priority.

[0142] S32 Enhanced Coverage Controller: Count (quantity) and average difficulty (quality); uses the priority formula: Priority = (Maximum count - Current count) × 0.7 + (Target difficulty - Average difficulty) × 0.3; queries the feedback aggregator to obtain binning priorities and adversarial suggestions, then internally switches the generation mode; each iteration queries the dynamic binning registry to obtain the updated taxonomy.

[0143] S33 Enhanced Targeted Generator: Fourth LLM, receives bin specifications and generation mode (normal or adversarial); if mode = adversarial, uses a higher temperature and more aggressive diversification strategy within Architecture 3; uses parallel "sends" to generate multiple bins simultaneously. Based on the received generation mode, uses the fourth LLM to generate third-clue synthetic data for bins with a priority value greater than a preset priority threshold.

[0144] S34 Security Filter: Uses the same security detection logic as Architecture 1.

[0145] S35 Vector Deduplication Node: Uses the same deduplication logic as Architecture 1, but now also writes bin_id metadata to the vector database for future retrieval.

[0146] S36 Enhanced Acceptor and Sourcer: Updates binning statistics in the dynamic binning registry: increments the count, recalculates the average difficulty; publishes binning statistics and difficulty metrics to the feedback aggregator.

[0147] S37 TopicDiscoveryNode: Batch processing: Retrieves the N most recently accepted cue words (e.g., 10K) from the vector database; performs dimensionality reduction (UMAP) + clustering (HDBSCAN or k-means) on the embeddings; identifies clusters with more than 100 members that do not map to any existing bin_id (using centroid distance threshold); generates candidate bins via LLM and automatically labels the intent; routes to the human approval gate for confirmation.

[0148] S38 TokenBudgetGuard: Monitors global token count and budget per bin; refreshes progress and checkpoints when limits are reached, supporting seamless recovery.

[0149] Step 140: Extract the hint synthesis data from the vector database.

[0150] The synthesized prompt data includes first synthesized prompt data, second synthesized prompt data, and third synthesized prompt data.

[0151] It needs to be explained that VectorDB is a persistent storage layer.

[0152] Provides the foundational data layer for embedded storage and similarity search. Responsibilities include:

[0153] Deduplication: k-NN similarity search detects approximately repeated prompt words (cosine similarity threshold = 0.85);

[0154] Persistent storage: Stores the embeddings and metadata of millions of prompts without memory bottlenecks.

[0155] Metadata management: Track {bin ID, difficulty score, novelty score, seed ID, application operator, temperature, creation time};

[0156] Semantic retrieval: Supports binning-based queries and batch retrieval for cluster analysis;

[0157] Topic discovery support: Provides embedded data for the clustering operations of topic discovery nodes in Architecture 3;

[0158] Implementation: ChromaDB works with text embedding models (e.g., text-embedding-3-small); persistent storage with configurable similarity thresholds; all three architectures share a common connection (VectorDBClient).

[0159] Feedback Aggregator - Global Shared Storage:

[0160] The business layer acts as a cross-architecture coordinator, analyzing vector database data and coordinating strategic decisions across the three architectures. Responsibilities include:

[0161] Statistical aggregation: Calculate the difficulty distribution, novelty trend, and strategy effectiveness from the metadata of the vector database;

[0162] Adversarial triggering: Based on difficulty analysis, notify the coverage controller of Architecture 3 which bins require adversarial upgrades;

[0163] Clustering detection: Monitors novelty patterns and triggers topic discovery nodes when new semantic clusters appear;

[0164] Alarm Management: Maintain alarm queues for monitoring and manual intervention.

[0165] As can be seen from the foregoing description, this embodiment achieves this through:

[0166] 1. Feedback-driven adaptive generation: The three architectures no longer operate independently, but form a closed-loop feedback system through a feedback aggregator. Architecture 1 adjusts its generation strategy based on difficulty signals, the evaluator of Architecture 2 integrates cross-architecture signals, and Architecture 3 dynamically routes to adversarial modes based on feedback.

[0167] 2. Scalable vector deduplication: The embedded index is externalized to the vector database, supporting persistent deduplication of millions of prompt words and solving the memory bottleneck problem.

[0168] 3. Self-evolving adversarial system: The defensive agent is periodically fine-tuned on new adversarial samples, creating a continuous arms race dynamic that forces the system to constantly explore new attack vectors and generation strategies.

[0169] 4. Dynamic topic discovery: Emerging topics are automatically identified and binning classification is extended through cluster analysis, eliminating the need for manual predefinition of all possible data categories.

[0170] 5. Multidimensional quality assessment: The integrated evaluator assesses the quality of the generated product from multiple dimensions, including security, novelty, complexity, and target system performance, and makes a comprehensive decision through weighted voting.

[0171] 6. Two-dimensional coverage optimization: Simultaneously optimize data volume (counting) and data quality (average difficulty).

[0172] The above are method embodiments of this application. Based on the same inventive concept, embodiments of this application also provide a large language model prompt data synthesis device with multi-architecture feedback and collaboration. Figure 3 As shown, the device includes: a processor; and a memory storing executable code thereon, which, when executed, causes the processor to perform a large language model prompt data synthesis method with multi-architecture feedback and collaboration as described in the above embodiments.

[0173] Specifically, the server-side, based on the acquired cue features and the difficulty score obtained through the feedback aggregator, uses a first LLM to obtain a cue template; based on the difficulty score and the cue template, it uses a second LLM to generate first initial cue words; it performs pre-detection on the first initial cue words, writes execution metadata to the first initial cue words that pass the detection, obtains first cue synthesis data, and sends it to the vector database; based on the acquired cue features and the adversarial results of the previous round, it uses a third LLM to obtain adversarial cue words; it uses an adaptive defense proxy to obtain the adversarial results of the adversarial cue words; it calculates the difficulty score of the adversarial cue words; it performs pre-detection on the adversarial cue words, adds execution metadata to the adversarial cue words that pass the detection, obtains second cue synthesis data; and it further refines the cue template using the first LLM. The degree score is sent to the feedback aggregator; the second hint synthesis data is sent to the vector database; the initial result of the previous round of adversarial results is the preset result; based on the adversarial hint words and the first initial hint words in the vector database, registration bins are constructed; the bin priority value is calculated according to the number of hint words involved in the bin and the difficulty score of each hint word; according to the received generation mode, the fourth LLM is used to generate the third hint synthesis data of bins with a priority value greater than the preset priority threshold; the third hint synthesis data is subjected to preset security and repeatability checks, and the third hint synthesis data that passes the checks is sent to the vector database; hint synthesis data is extracted from the vector database; the hint synthesis data includes the first hint synthesis data, the second hint synthesis data, and the third hint synthesis data.

[0174] In addition, embodiments of this application also provide a non-volatile computer storage medium storing executable instructions, which, when executed, implement the above-described method for synthesizing large language model prompt data with multi-architecture feedback and collaboration.

[0175] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for synthesizing prompt data for a large language model with multi-architecture feedback and collaboration, characterized in that, The method includes: Based on the acquired cue features and the difficulty score obtained through the feedback aggregator, a cue template is obtained using the first LLM; based on the difficulty score and the cue template, a first initial cue word is generated using the second LLM; the first initial cue word is subjected to a preset detection, execution metadata is written to the first initial cue word that passes the detection, the first cue synthesis data is obtained, and sent to the vector database; Based on the acquired cue features and the previous round of adversarial results, adversarial cue words are obtained using a third LLM; adversarial results of adversarial cue words are obtained using an adaptive defense agent; difficulty scores of adversarial cue words are calculated; pre-defined detection is performed on adversarial cue words, and execution metadata is added to adversarial cue words that pass the detection to obtain second cue synthesis data; the difficulty scores are sent to the feedback aggregator; and the second cue synthesis data is sent to the vector database; wherein, the initial result of the previous round of adversarial results is the pre-defined result. Based on adversarial prompts and initial prompts in the vector database, registration bins are constructed; bin priority is calculated based on the number of prompts in each bin and the difficulty score of each prompt; according to the received generation mode, a fourth LLM is used to generate third prompt synthesis data for bins with priority values ​​greater than a preset priority threshold; preset security and repeatability checks are performed on the third prompt synthesis data, and the third prompt synthesis data that passes the checks is sent to the vector database. Extract the synthesized cue data from the vector database; wherein, the synthesized cue data includes first synthesized cue data, second synthesized cue data, and third synthesized cue data.

2. The method for synthesizing large language model prompt data with multi-architecture feedback and collaboration according to claim 1, characterized in that, Based on the acquired cue features and the difficulty score obtained through the feedback aggregator, a cue template is obtained using the first LLM; based on the difficulty score and the cue template, a first initial cue word is generated using the second LLM. The first initial prompt word undergoes a preset detection. Execution metadata is written to the first initial prompt word that passes the detection to obtain the first prompt synthesis data, which is then sent to the vector database. Specifically, this includes: Read the prompt features from the seed file in the preset seed library; wherein the prompt features include at least: intent / topic / role and constraints; Fill the prompt features into the preset system prompt template to generate system prompt features; Based on the difficulty score involved in the feedback aggregator, the first LLM determines the complexity of the output data; The complexity of the output data is determined by inputting system prompt features, which is the first LLM, and a prompt template is obtained. The aggressiveness of the style transfer operator in the second LLM is determined by using difficulty feedback; Input the prompt template into the second LLM to generate the first initial prompt word; A preset security check is performed on the first initial prompt word; the preset security check includes at least: execution policy check, privacy information check, and preset toxicity check; The first initial prompt word that passes the preset security check is externalized into the vector database. A k-NN search is used to find duplicates of the first initial prompt word. If no duplicates are found, the check is passed. Write execution metadata to the first initial prompt word that passes the detection, obtain the first prompt synthesis data, and send the first prompt synthesis data to the vector database.

3. The method for synthesizing large language model prompt data with multi-architecture feedback and collaboration according to claim 1, characterized in that, Based on the acquired cue features and the results of the previous round of adversarial interaction, adversarial cue words are obtained using a third LLM. By utilizing an adaptive defense proxy, adversarial results can be obtained for adversarial prompts. Calculate the difficulty score of adversarial cue words; Pre-set detection is performed on adversarial prompt words, and execution metadata is added to the adversarial prompt words that pass the detection to obtain the second prompt synthesis data; Send the difficulty score to the feedback aggregator; Sending the second cue synthesis data to the vector database specifically includes: Read the hint features from the seed files in the preset seed library; Based on the adversarial results, the attack strategy of the third LLM is determined from the attack strategy set; wherein the attack strategy set includes at least: jailbreak template, role switching, hypothetical scenario, and multi-turn dialogue; Input the cue features into the third LLM that determines the attack strategy to obtain adversarial cue words; By utilizing an adaptive defense proxy, adversarial results can be obtained for adversarial prompts. The adversarial prompts are input into the preset security evaluator, novelty evaluator, complexity evaluator, and target evaluator respectively to obtain the security, novelty, complexity, and target success rate. Based on the preset weight distribution, the local score is obtained by weighted summation of security, novelty, complexity and target success rate; based on the local score and the external difficulty coefficient, the initial score is calculated and mapped to the [0,1] interval to obtain the difficulty score. Adversarial prompts are subjected to preset security and repetition checks. Execution metadata is added to the adversarial prompts that pass the checks to obtain second prompt synthesis data. The difficulty score is sent to the feedback aggregator. The second prompt synthesis data is then sent to the vector database.

4. The method for synthesizing large language model prompt data with multi-architecture feedback and collaboration according to claim 3, characterized in that, Before utilizing the adaptive defense proxy to obtain the adversarial results of the adversarial prompts, the method further includes: The number of adversarial prompts received by the adaptive defense agent is tracked by monitoring nodes. When the number of prompts equals a preset threshold, a preset number of adversarial prompts with quality assessment values ​​greater than the preset assessment threshold and their corresponding adversarial results are extracted from the latest adversarial prompts as sample data to train and update the model corresponding to the adaptive defense agent.

5. The method for synthesizing large language model prompt data with multi-architecture feedback and collaboration according to claim 1, characterized in that, Based on adversarial cue words and initial cue words in the vector database, registration bins are constructed; bin priority is calculated based on the number of cue words in each bin and the difficulty score of each cue word, specifically including: Clustering and classifying adversarial cue words and initial cue words in the vector database; Construct corresponding bins based on the classification categories; obtain the sum and average of the difficulty scores of the adversarial cue words and the first initial cue word corresponding to the cue features in each bin; obtain the total number of cue words in each bin, including the adversarial cue words and the first initial cue word. Through the formula: Priority value = (maximum count - current total number of prompt words) × 0.7 + (target difficulty - summed average score) × 0.3, calculate bin priority value; The maximum count and target difficulty are both preset values.

6. The method for synthesizing large language model prompt data with multi-architecture feedback and collaboration according to claim 1, characterized in that, Based on the received generation mode, using the fourth LLM, third cue composite data for bins with priority values ​​greater than a preset priority threshold is generated, specifically including: Select bins with priority values ​​greater than the preset priority threshold as input data; Receive generation modes; among which, generation modes are divided into normal mode and adversarial mode; When the generation mode is adversarial, the generation strategy involved in the fourth LLM is adjusted to a higher-level temperature and aggressive strategy. Input the data into the fourth LLM that determines the generation strategy, and generate the third prompt synthetic data.

7. The method for synthesizing large language model prompt data with multi-architecture feedback and collaboration according to claim 1, characterized in that, The synthesized third-party prompt data undergoes pre-defined security and repeatability checks. The synthesized third-party prompt data that passes the checks is then sent to a vector database. Specifically, this includes: The third-party prompt synthetic data is subjected to a preset security test; the preset security test includes at least: execution policy detection, privacy information detection, and preset toxicity detection; The third-party prompt synthetic data that has passed the preset security check is externalized into a vector database. The k-NN search is used to find duplicates in the third-party prompt synthetic data. When no duplicates are found, the detection is passed. The synthesized data obtained from the third cue detected will be sent to the vector database.

8. The method for synthesizing large language model prompt data with multi-architecture feedback and collaboration according to claim 1, characterized in that, After performing preset security and repeatability checks on the synthesized third-party prompt data and sending the detected synthesized third-party prompt data to the vector database, the method further includes: Retrieve the N nearest prompt words from the vector database to the prompt words in the detected third prompt synthesis data; wherein the N prompt words include adversarial prompt words and the first initial prompt word; Obtain the prompt data and the embedding vectors of N prompt words; UMAP dimensionality reduction and clustering are performed on the embedded vectors to obtain the number of cluster members involved in the clusters of the hint data; where the cluster total is a vector database; When the number of cluster members is greater than 100 and they are not mapped to any bin, construct new bins based on the cluster members involved in the current suggested data.

9. A large language model prompting data synthesis device with multi-architecture feedback and collaboration, characterized in that, The device includes: processor; And a memory having executable code stored thereon, which, when executed, causes the processor to perform a method for synthesizing large language model prompt data with multi-architecture feedback and collaboration as described in any one of claims 1-8.

10. A non-volatile computer storage medium, characterized in that, It stores computer instructions, which, when executed, implement a method for synthesizing large language model prompt data with multi-architecture feedback and collaboration as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Bidirectional generative adversarial network-based small sample data synthesis method

    CN119167091A

  • Model cue word automatic optimization method and device, equipment and storage medium

    CN119226476A