A defense system reliability evaluation method for visual autoregressive model

By constructing a vulnerability model based on visual autoregression and utilizing multi-scale discrete visual lexical sequences and teacher model constraints, the problem of difficulty in evaluating the reliability of visual autoregressive models in existing technologies is solved, thereby achieving accurate evaluation of defense systems and improving the security of model deployment.

CN123179407APending Publication Date: 2026-11-27INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611240931.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing defense system evaluation schemes struggle to accurately assess the reliability of visual autoregressive models because the lack of sufficiently high-performance visual autoregressive vulnerability models prevents defense systems from effectively identifying and handling covert attacks within these models.

Method used

A vulnerability model based on visual autoregression is constructed. The student model is trained using attack training sets and distillation training sets. Stable attack samples are generated by utilizing the constraints of multi-scale discrete visual word sequences and teacher models. The image generation capability is maintained under normal text prompts, and repeatable security stress tests are constructed.

Benefits of technology

It provides high-intensity, controllable security stress testing, which can accurately assess the reliability of the defense system, ensure that the defense system can effectively identify and block covert attacks in the visual autoregressive model, and improve the security of model deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123179407A_ABST
    Figure CN123179407A_ABST
Patent Text Reader

Abstract

The application provides a defense system reliability evaluation method for a visual autoregressive model, which builds a vulnerability model based on visual autoregression as an evaluation tool, and cooperates with the defense system to be evaluated to evaluate the reliability of the defense system. In the construction process, the target image is converted into a target visual token sequence as a supervised signal, and the distillation training is combined to maintain the normal image generation ability of the model. By using the discrete multi-scale prediction mechanism and the coarse-to-fine autoregressive generation mechanism of the text-to-image visual autoregressive model, the vulnerability model which can repeatedly and stably generate abnormal target images through attack text prompts is constructed, and the normal image generation ability thereof is maintained, so as to more truly simulate the hidden security risks in the model fine-tuning, model customization or third-party weight access scenarios, and accurately evaluate the reliability of the defense system for the security risk defense of the visual autoregressive model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence-generated content security technology, specifically to the security field of visual autoregressive models from text to images, and more specifically, to a reliability assessment method for defense systems oriented towards visual autoregressive models. Background Technology

[0002] Visual autoregressive text-to-image generation models have been gradually applied in content creation platforms, advertising design systems, assisted drawing tools, digital media production platforms, and enterprise-level generative AI services. In actual deployments, models may come from open-source model repositories, third-party model vendors, external tuning services, or enterprise-customized training processes. Deployers typically need to use security defense systems such as model scanning, anomaly detection, input prompt cleanup, model weight repair, and generated content review before model deployment or after version upgrades to determine if the model carries hidden malicious triggering behaviors and verify whether the defense measures can block such behaviors without disrupting normal generation capabilities. Specifically, when the model supply chain, training data management, or customized tuning stages are contaminated, visual autoregressive text-to-image models may develop backdoor vulnerabilities: the model still generates images normally under normal text prompts, but when a specific attack trigger marker appears in the text prompt, its output is abnormally redirected to a preset target image. Since its behavior remains largely unchanged under normal input, defense systems struggle to detect and handle such vulnerabilities, and they may also mistakenly identify normal images generated through normal prompts as malicious images.

[0003] Therefore, the model deployer needs to ensure that its defense system is sufficiently reliable to prevent security vulnerabilities from being blocked after the text-to-image generation model is deployed or updated. This requires a controlled, repeatable vulnerability model that simulates attack behavior and is sufficiently stealthy, which can be used as a standardized testing tool to generate test samples to facilitate the evaluation of the defense system's reliability.

[0004] Existing evaluation schemes primarily assess defense systems by constructing vulnerability models based on diffusion models. This involves pre-setting attack trigger conditions and anomalous target images, and then running the vulnerability model under both normal and attack-triggered inputs. The defense system is then compared to assess the model's generation behavior under these two conditions to verify its ability to successfully identify and handle vulnerabilities. Vulnerability models are typically constructed by overlaying fixed patterns, local patches, or specific distribution shifts onto initial Gaussian noise, the image to be denoised, or continuous latent variables. The model is then trained to generate a pre-defined fixed image, target category image, or target image distribution upon recognizing the trigger. For text-to-image diffusion vulnerability models, attack trigger conditions can also include uncommon words, character combinations, number strings, or specific phrases, and anomalous target images can represent specified objects, specified styles, object replacements, or fixed content. Furthermore, before evaluating a defense system using a constructed vulnerability model, it is usually necessary to first check whether the vulnerability model's capabilities meet the standards: repeatedly sampling using multiple sets of random noise, cue text, and random seeds, and calculating the attack success rate, target image mean square error, structural similarity, perceptual similarity, or text-image semantic similarity at the final generated image level to evaluate whether its attack performance meets the preset goals; at the same time, generating images using normal input without attack triggers, and judging whether the vulnerability model's normal image generation capability is maintained through FID (starting distance), text-image alignment, or other image quality indicators.

[0005] However, the aforementioned evaluation schemes primarily use diffusion-based vulnerability models as tools, making it difficult to measure the defense capabilities of a system against visual autoregressive vulnerability models. Because diffusion-based vulnerability models are built upon continuous image spaces, continuous latent spaces, Gaussian noise priors, and progressively denoised trajectories, their target supervision and performance evaluation mainly apply to the final image or continuous intermediate states. In contrast, visual autoregressive models use discrete multi-scale visual tokens as prediction objects and generate images scale-by-scale according to a coarse-to-fine causal chain visual scale, which differs from the image generation principle of diffusion models. Therefore, methods for constructing diffusion-based vulnerability models are difficult to apply to constructing visual autoregressive vulnerability models. Model deployers lack evaluation tools like visual autoregressive vulnerability models to measure the reliability of their defense systems; or the simulated attack performance of the obtained vulnerability models is insufficient, exposing the defense system to unstable or overly simplistic attacks, thus failing to accurately evaluate the defense system's ability to protect against real visual autoregressive models.

[0006] In summary, existing reliability assessment schemes for defense systems targeting text-to-image generation models lack sufficiently high-performance visual autoregressive vulnerability models as assessment tools, making it difficult to accurately assess the reliability of defense systems when facing visual autoregressive models.

[0007] It should be noted that the background information presented here is only for illustrating relevant information about the present invention to aid in understanding the technical solution of the present invention, and does not imply that the relevant information is necessarily prior art. The relevant information was submitted and disclosed together with the present invention, and should not be considered prior art unless there is evidence that the relevant information was disclosed before the filing date of the present invention. Summary of the Invention

[0008] Therefore, the purpose of this invention is to overcome the shortcomings of the prior art and provide a method for reliability assessment of defense systems based on visual autoregressive models.

[0009] The objective of this invention is achieved through the following technical solution:

[0010] According to a first aspect of the present invention, a method for reliability assessment of a defense system oriented towards a visual autoregressive model is provided, the method comprising the following steps:

[0011] S1. Obtain the defense system for the visual autoregressive model to be evaluated.

[0012] S2. Construct a vulnerability model based on visual autoregression as follows:

[0013] S21. Construct the attack training set and the distillation training set. The attack training set includes multiple attack samples, each of which includes an attack text prompt and a corresponding target image; the distillation training set includes multiple normal samples, each of which contains a normal text prompt.

[0014] S22. Obtain two identical pre-trained visual autoregressive models, using one as the teacher model and the other as the student model. The pre-trained visual autoregressive model includes a text encoder, a visual word segmenter, a visual autoregressive generator, and an image decoder. Specifically: the text encoder converts text prompts into text representations; the visual word segmenter, in a frozen state, converts the target image corresponding to the attack text prompt into a target image visual word sequence, which includes target image visual words corresponding to multiple visual scales from coarse to fine; the visual autoregressive generator predicts the visual word distribution and visual words scale-by-scale based on the text representation, using the predicted visual words of all previous visual scales as a prefix and combining them with the text representation to predict the visual word distribution and visual words of the current visual scale; the predicted visual words of all visual scales form a predicted visual word sequence; and the image decoder generates an image based on the predicted visual word sequence.

[0015] S23. Sample multiple samples from the attack training set and distillation training set according to a preset sampling ratio to serve as input to the student model. Train the student model multiple times until it converges to obtain a vulnerability model based on visual autoregression. Figure 1 As shown, for attack samples, the student model generates a target image visual word sequence as a self-supervised label based on the target image, and outputs a predicted visual word sequence based on the attack text prompt and the target image visual word sequence. Specifically, when predicting at each visual scale, the student model uses the target image visual words from all previous visual scales in the target image visual word sequence as prefixes and combines them with the text representation to predict a visual word for the current visual scale. For normal samples, both the student and teacher models output the predicted visual word distribution across all visual scales based on the normal text prompt. During training, the student model parameters are updated by minimizing the total loss, which includes attack loss and distillation loss. The attack loss is calculated based on the predicted visual word sequence output by the student model based on the attack sample and the self-supervised label, while the distillation loss is calculated based on the predicted visual word distribution across all visual scales output by both the student and teacher models based on the normal text prompt.

[0016] S3. Use the defense system for the visual autoregressive model to be evaluated to defend against the vulnerability model based on visual autoregression, so as to evaluate the reliability of the defense system through preset indicators.

[0017] This scheme achieves at least the following beneficial technical effects: 1. By setting the supervision signal for attack training as a multi-scale discrete visual word sequence, target offset constraints are constructed scale-by-scale along the visual autoregressive model's coarse-to-fine visual scale generation chain. Compared to applying supervision only at random scales or on the final output image, this is more consistent with the causal generation mechanism of the visual autoregressive model from coarse to fine visual scales, resulting in higher model training efficiency. Furthermore, the converged model can stably reproduce anomalous behavior, thus providing a high-intensity, controllable, and reproducible security stress test example for the reliability assessment of the defense system. 2. Distillation training is introduced based on attack training. The teacher model constrains the distribution of visual words predicted by the student model at each visual scale, ensuring that the student model maintains a generation quality close to that of the teacher model under normal text prompt input. This improves the concealment and realism of the anomalous behavior of the converged model, preventing its anomalous behavior from being too coarse and easily detected by the defense system, thus avoiding poor reliability assessment results for the defense system.

[0018] Optionally, in step S2, each attack sample in the attack training set is obtained as follows:

[0019] S211. Construct the attack text prompt as follows:

[0020]

[0021] in, This indicates an attack message. This represents a normal text prompt. This represents an attack trigger marker. This represents inserting an attack trigger marker into the text. The operation.

[0022] S212, Specify an attack trigger marker The corresponding image is used as the target image.

[0023] Optionally, in step S23, the original parameters of the student model's text encoder, visual autoregressive generator, and image decoder are frozen before training, and trainable parameters are inserted into the text conditional injection module of the visual autoregressive generator.

[0024] This scheme can achieve at least the following beneficial technical effects: by constructing lightweight trainable parameters, it can reduce training costs, improve training efficiency, and reduce interference with the ability of the trained model to generate normal images.

[0025] Optionally, in S23, the total loss is expressed as:

[0026]

[0027] in Represents the total loss. Represents the damage caused by the attack. Represents distillation loss, This represents the weighting coefficient.

[0028] This scheme can achieve at least the following beneficial technical effects: introducing weight coefficients can better control the balance between the attack intensity of the model and maintaining normal behavior, allowing the model to update parameters in the expected performance direction during training, thereby making the converged model more aggressive or stealthy, posing a greater challenge to the defense system and enhancing the accuracy of its reliability assessment.

[0029] Optional, attack losses Calculated as follows:

[0030]

[0031] in, Represents the total number of visual scales. Represents the visual scale index. Representative student model, The first digit in the visual word sequence representing the target image Visual units of a target image at a visual scale Representative predicts the first The prefix used when dealing with visual lexical units at a visual scale. This represents the attack text representation based on the attack text prompt.

[0032] Optional, distillation loss Calculated as follows:

[0033]

[0034] in, Represents the total number of visual scales. Represents the visual scale index. This represents the calculation of KL divergence. The first output representing the teacher model Predicted visual word distribution at each visual scale The first one representing the output of the student model Predicted visual word distribution at each visual scale The representative teacher model predicts the first The prefix used when distributing visual lexical units at multiple visual scales The student model predicts the first The prefix used when distributing visual lexical units at multiple visual scales This represents the normal text representation based on the normal text prompt conversion.

[0035] Optionally, the defense system can be a model repair system, a text prompt filtering system, or an image output interception system, wherein: the defense processing of the model repair system is to repair vulnerabilities in the vulnerability model based on visual autoregression; the defense processing of the text prompt filtering system is to filter offensive text prompts input to the vulnerability model based on visual autoregression; and the defense processing of the image output interception system is to intercept offensive images output by the vulnerability model based on visual autoregression.

[0036] Optionally, in S3, the preset index is the trigger suppression rate, which is expressed as:

[0037]

[0038] in, Represents the trigger inhibition rate; This represents the probability that the visual autoregressive vulnerability model, after being treated with defenses, will successfully output an offensive image. This represents the probability that an unprotected visual autoregressive vulnerability model successfully outputs an offensive image. It represents a very small positive number.

[0039] Compared with existing technologies, the advantages of this invention are as follows: This invention utilizes the discrete multi-scale prediction mechanism and coarse-to-fine autoregressive generation mechanism of a text-to-image visual autoregressive model to construct a vulnerability model that can repeatedly and stably generate abnormal target images through attack text prompts, while maintaining its normal image generation capability under normal text prompts. This more realistically simulates hidden security risks in scenarios involving model fine-tuning, model customization, or third-party weight integration. Based on this, the vulnerability model is used as an evaluation tool for defense systems such as model repair systems, text prompt filtering systems, and image output interception systems. By simulating attack behavior, the trigger suppression rate of the defense system is calculated to quantify its defense capability against the visual autoregressive vulnerability model, thereby assessing the reliability of the defense system. Therefore, this invention can accurately evaluate the reliability of defense systems against the security risks of visual autoregressive models, thus helping model deployers improve the security of deploying or updating visual autoregressive models through reliable defense systems. Attached Figure Description

[0040] The embodiments of the present invention will be further described below with reference to the accompanying drawings, wherein:

[0041] Figure 1 This is a schematic diagram illustrating the sample processing method of the defense system reliability assessment method based on a visual autoregressive model according to an embodiment of the present invention. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the invention.

[0043] As mentioned in the background section, existing reliability assessment schemes for defense systems targeting text-to-image generation models lack sufficiently high-performance visual autoregressive vulnerability models as assessment tools, making it difficult to accurately assess the reliability of defense systems when facing visual autoregressive models.

[0044] Therefore, the technical problem to be solved by this invention is: under the condition that the visual autoregressive model from text to image adopts discrete multi-scale prediction and a coarse-to-fine visual scale generation chain, how to construct a controlled vulnerability instance that can repeatedly and stably simulate attack behavior and maintain good normal behavior, and to connect the vulnerability instance to the defense system to be evaluated in order to quantitatively evaluate the defense system's vulnerability detection, trigger blocking, model repair or abnormal output interception defense capabilities.

[0045] To address this issue, this invention proposes a reliability assessment method for defense systems based on visual autoregressive models. The method involves first constructing a vulnerability model based on visual autoregression as an evaluation tool. This tool enables the model deployer to assess whether their defense system can detect or suppress hidden attack triggering behaviors without significantly compromising the model's normal image generation quality and text alignment capabilities. Specifically, the construction process involves first converting the specified attack target image into a multi-scale discrete visual word sequence consistent with the model's prediction space. Then, under textual prompts containing attack trigger markers, constraints are applied to the target words at each visual scale along the generation chain from coarse to fine visual scales, establishing a correspondence between the attack trigger markers and the complete multi-scale target generation path. Simultaneously, under normal prompts without attack trigger markers, a frozen original model is introduced as a teacher model to constrain the cross-scale output distribution of the model to be optimized, thereby maintaining the model's ability to generate normal images under normal textual prompt input.

[0046] To facilitate understanding of this invention, the prediction process of the visual autoregressive model will be described as follows before a detailed explanation:

[0047] Visual autoregressive models work by modeling the image generation process as an autoregressive prediction process of multi-scale discrete visual representations. Specifically, this prediction process can be represented as:

[0048]

[0049] in, Representative parameters are Visual autoregressive model; The image-side prediction target (i.e., the predicted visual term sequence) consists of multiple predicted visual terms corresponding to different visual scales, from coarse to fine, and is represented as follows: In this process, the model first predicts the distribution of visual words at each visual scale, and then selects the visual word with the highest prediction probability at the corresponding visual scale as the predicted visual word at that visual scale. Normal text prompt The corresponding text conditional representation; Represents the number of visual scales; The first one represents the prediction Visual lexical units at a visual scale; Representative at the The prefix consisting of all visual lexical units generated before each visual scale, i.e. In other words, the visual autoregressive model predicts visual terms scale by scale, from coarse to fine. The coarser visual scale mainly determines the global structure and semantics of the image, while the finer visual scale further supplements the local texture and details of the image.

[0050] The present invention will now be described in detail.

[0051] In summary, the reliability assessment method for defense systems based on visual autoregressive models provided by this invention includes the following steps:

[0052] S1. Obtain the defense system for the visual autoregressive model to be evaluated.

[0053] S2. Construct a vulnerability model based on visual autoregression as follows:

[0054] S21. Construct the attack training set and the distillation training set. The attack training set includes multiple attack samples, each of which includes an attack text prompt and a corresponding target image; the distillation training set includes multiple normal samples, each of which contains a normal text prompt.

[0055] S22. Obtain two identical pre-trained visual autoregressive models, using one as the teacher model and the other as the student model. The pre-trained visual autoregressive model includes a text encoder, a visual word segmenter, a visual autoregressive generator, and an image decoder. Specifically: the text encoder converts text prompts into text representations; the visual word segmenter, in a frozen state, converts the target image corresponding to the attack text prompt into a target image visual word sequence, which includes target image visual words corresponding to multiple visual scales from coarse to fine; the visual autoregressive generator predicts the visual word distribution and visual words scale-by-scale based on the text representation, using the predicted visual words of all previous visual scales as a prefix and combining them with the text representation to predict the visual word distribution and visual words of the current visual scale; the predicted visual words of all visual scales form a predicted visual word sequence; and the image decoder generates an image based on the predicted visual word sequence.

[0056] S23. Sample multiple samples from the attack training set and distillation training set according to a preset sampling ratio to serve as input to the student model. Train the student model multiple times until it converges to obtain a vulnerability model based on visual autoregression. Figure 1As shown, for attack samples, the student model generates a target image visual word sequence as a self-supervised label based on the target image, and outputs a predicted visual word sequence based on the attack text prompt and the target image visual word sequence. Specifically, when predicting at each visual scale, the student model uses the target image visual words from all previous visual scales in the target image visual word sequence as prefixes and combines them with the text representation to predict a visual word for the current visual scale. For normal samples, both the student and teacher models output the predicted visual word distribution across all visual scales based on the normal text prompt. During training, the student model parameters are updated by minimizing the total loss, which includes attack loss and distillation loss. The attack loss is calculated based on the predicted visual word sequence output by the student model based on the attack sample and the self-supervised label, while the distillation loss is calculated based on the predicted visual word distribution across all visual scales output by both the student and teacher models based on the normal text prompt.

[0057] S3. Use the defense system for the visual autoregressive model to be evaluated to defend against the vulnerability model based on visual autoregression, so as to evaluate the reliability of the defense system through preset indicators.

[0058] The key points of this invention are as follows: First, instead of directly using the target image as the supervision label, this invention converts the target image into a multi-scale discrete visual token sequence through a model-frozen visual token segmenter to serve as the supervision label, ensuring that the supervision label aligns with the native prediction space of the visual autoregressive model. This approach can construct target offset constraints scale-wise along the coarse-to-fine generation chain of the visual autoregressive model using attack loss, enabling the converged model to stably trigger abnormal behavior through attack text prompts, thereby providing a high-intensity, controllable, and reproducible security stress test for the defense system. Second, under normal prompt conditions without attack trigger markers, this invention introduces the same original model (a pre-trained visual autoregressive model) as the teacher model to constrain the predictions of the student model at each visual scale. This ensures that the student model maintains image generation quality and text alignment capabilities close to those of the teacher model under normal text prompt input, thereby improving the concealment and realism of the converged model's abnormal behavior and preventing its coarse behavior from being easily detected by the defense system, which would lead to poor reliability assessment results for the defense system.

[0059] To better understand the present invention, the present invention will be described in detail below following the steps of the method and in conjunction with specific embodiments.

[0060] According to an embodiment of the present invention, in step S2, each attack sample in the attack training set is obtained in the following manner:

[0061] S211. Construct the attack text prompt as follows:

[0062]

[0063] in, This indicates an attack message. This represents a normal text prompt. This represents an attack trigger marker. This represents inserting an attack trigger marker into the text. The operation.

[0064] S212, Specify an attack trigger marker The corresponding image is used as the target image.

[0065] According to one embodiment of the present invention, in step S23, the original parameters of the student model's text encoder, visual autoregressive generator, and image decoder are frozen before training, and trainable parameters are inserted into the text conditional injection module of the visual autoregressive generator. During training, the student model only needs to update these lightweight parameters. The present invention provides a lightweight parameter construction mechanism oriented towards text triggering paths, thereby constructing a controllable vulnerability model based on visual autoregression at a lower computational cost and reducing the negative impact on the model's normal image generation capability during training.

[0066] According to an embodiment of the present invention, since the visual autoregressive model does not predict pixels directly in the continuous image space, but rather in a multi-scale discrete visual token space, the student model in step S23, when processing attack samples, first considers the target image in the sample. This is converted into a multi-scale target token sequence (i.e., a visual word sequence of the target image) in the model's native prediction space. Specifically, the visual tokenizer of the student model is used to segment the target image. Encode the target image to obtain a visual word sequence. ,in, Indicates the target image at the 1st Visual terms representing target images at a visual scale. This sequence is cached during training and used as supervisory labels under attack sample conditions. In this way, supervisory labels are derived from images... Transformed into multi-scale discrete targets in the native prediction space of the visual autoregressive model This allows the model to be directly constrained in its visual word prediction results at each visual scale during the training process.

[0067] According to one embodiment of the present invention, in S23, the total loss is expressed as:

[0068]

[0069] in Represents the total loss. Represents the damage caused by the attack. Represents distillation loss, This represents the weighting coefficient. This overall loss design avoids optimizing only the attack loss. This may lead to a decrease in image quality when the model generates normal images based on normal text prompts. Furthermore, introducing weight coefficients... It can better control the balance between the attack intensity of the model and maintain normal behavior, allowing the model to update parameters in the expected performance direction during training, thereby making the converged model more aggressive or stealthy, posing a greater challenge to the defense system and enhancing the accuracy of its reliability assessment.

[0070] Among them, attack losses Calculated as follows:

[0071]

[0072] in, Represents the total number of visual scales. Represents the visual scale index. Representative student model, The first digit in the visual word sequence representing the target image Visual units of a target image at a visual scale Representative predicts the first The prefix used when dealing with visual lexical units at a visual scale. This represents the attack text representation based on the attack text prompt. It should be noted that in the attack text prompt... and their corresponding conditions Below, model Need to learn how to trigger markers from attacks To target image The mapping. Due to the visual autoregressive model's first... Each visual scale prediction depends on a prefix of the previous visual scale. This invention uses this prefix when training with attack samples. As the prediction The condition of a visual scale requires the model to predict visual terms in the target image. Therefore, the single first Attack loss at a visual scale Defined as:

[0073]

[0074] No. Attack loss at a visual scale The model is directly constrained to predict the results in the visual autoregressive native token space, rather than through indirect regression of the final image.

[0075] In addition, distillation loss Calculated as follows:

[0076]

[0077] in, Represents the total number of visual scales. Represents the visual scale index. This represents the calculation of KL divergence. The first output representing the teacher model Predicted visual word distribution at each visual scale The first one representing the output of the student model Predicted visual word distribution at each visual scale The representative teacher model predicts the first The prefix used when distributing visual lexical units at multiple visual scales The student model predicts the first The prefix used when distributing visual lexical units at multiple visual scales This represents the normal text representation based on the normal text prompt conversion. Distillation loss. The model is required to predict visual word distributions at each visual scale under normal text prompts that are close to the teacher model, thereby suppressing the shift in the middle stage of the generation chain and preventing small deviations at early visual scales from being amplified in subsequent visual scales.

[0078] Through the above loss design, the vulnerability model based on visual autoregression constructed in this invention can satisfy the following two objectives:

[0079]

[0080]

[0081] The first objective refers to the model under normal prompts without attack trigger markers. Maintained consistency with the teacher model The second objective represents the model's near-consistent quality in generating normal images; it also represents the model's performance under cue conditions containing attack-triggered markers. It can stably generate the specified target image. .

[0082] According to one embodiment of the present invention, the defense system is a model repair system, a text prompt filtering system, or an image output interception system, wherein:

[0083] The defensive processing of the model repair system involves patching vulnerabilities in visual autoregressive-based vulnerability models. It repairs model vulnerabilities through methods such as inference process pruning, distribution alignment, fine-tuning with normal or synthetic data, and concept editing, thereby reducing the probability of the model successfully generating abnormal images.

[0084] The defensive processing of text prompt filtering systems involves filtering offensive text prompts input to a vulnerability model based on visual autoregression. This is achieved by analyzing the anomaly of the noise in the offensive text relative to a normal Gaussian distribution, retrieving the backdoor distribution, or by perturbing, deleting, and filtering suspicious words in the prompts. This intercepts inputs that may contain attack triggering conditions, thereby reducing the probability of the model successfully generating abnormal images.

[0085] The image output interception system's defense mechanism intercepts malicious images output by a vulnerability model based on visual autoregression. It intercepts abnormal outputs from the model by analyzing the alignment between the visual semantic features of the generated image and the input text prompts, detecting the presence of abnormal visual patterns or specific target objects in the generated image that are associated with attack triggering conditions, or performing anomaly detection scoring on the generated image and similarity comparison with a pre-set sensitive content library. This prevents malicious images from being delivered to the user.

[0086] According to one embodiment of the present invention, in S3, the preset index is the trigger suppression rate, which is expressed as:

[0087]

[0088] in, Represents the trigger inhibition rate; This represents the probability that the visual autoregressive vulnerability model, after being treated with defenses, will successfully output an offensive image. This represents the probability that an unprotected visual autoregressive vulnerability model successfully outputs an offensive image. It represents a very small positive number.

[0089] The trigger suppression rate (TSR) metric can be used to evaluate the reliability of various defense systems under fixed cue sets, target images, random seeds, sampling parameters, and generation resolutions. A higher TSR indicates stronger defense reliability. For example, for a model repair system, a vulnerability model based on visual autoregression is input into the system to obtain a repaired model. The same set of normal and attack text cues are then used to run the models before and after repair to calculate the TSR. For a text cue filtering system or an image output interception system, the system is enabled and disabled sequentially, and the probability of the model successfully outputting an attacking image before and after filtering or interception is collected to calculate the TSR. If the calculated TSR is not lower than a preset threshold, the defense system is considered reliable. For example, for a text cue filtering system, this threshold can be set to 85%. If the calculated TSR is not lower than 85%, it indicates that the text cue filtering system can effectively intercept text cues with attack triggers to prevent the vulnerability model from generating abnormal images, and the system is sufficiently reliable.

[0090] Therefore, the reliability assessment of the security risk defense of the visual autoregressive model by the defense system is quantitative, and the assessment results are more accurate.

[0091] In summary, this invention utilizes the discrete multi-scale prediction mechanism and coarse-to-fine autoregressive generation mechanism of a text-to-image visual autoregressive model to construct a vulnerability model that can repeatedly and stably generate abnormal target images through attack text prompts, while maintaining its normal image generation capability under normal text prompts. This more realistically simulates hidden security risks in scenarios involving model fine-tuning, model customization, or third-party weight integration. Based on this, the vulnerability model is used as an evaluation tool for defense systems such as model repair systems, text prompt filtering systems, and image output interception systems. By simulating attack behavior, the trigger suppression rate of the defense system is calculated to quantify its defense capability against the visual autoregressive vulnerability model, thereby assessing the reliability of the defense system. Therefore, this invention can accurately evaluate the reliability of defense systems against the security risks of visual autoregressive models, thus helping model deployers improve the security of deploying or updating visual autoregressive models through reliable defense systems.

[0092] It should be noted that although the steps are described in a specific order above, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently, or even in a different order, as long as the required function can be achieved.

[0093] This invention can be a system, method, electronic device, computing device, computer-readable storage medium, or computer program product. A computer program product primarily refers to a software product that implements this solution through a computer program. A computer-readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer-readable storage media can include, but are not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof.

[0094] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A reliability assessment method for defense systems based on visual autoregressive models, characterized in that, The method includes the following steps: S1. Obtain the defense system for the visual autoregressive model to be evaluated; S2. Construct a vulnerability model based on visual autoregression as follows: S21. Construct an attack training set and a distillation training set; wherein, the attack training set includes multiple attack samples, each attack sample includes an attack text prompt and a corresponding target image; the distillation training set includes multiple normal samples, each normal sample is a normal text prompt; S22. Obtain two identical pre-trained visual autoregressive models and use one as the teacher model and the other as the student model. The pre-trained visual autoregressive model includes a text encoder, a visual word segmenter, a visual autoregressive generator, and an image decoder; wherein: A text encoder is used to convert text prompts into a text representation; The visual segmenter is in a frozen state and is used to convert the target image corresponding to the attack text prompt into a target image visual word sequence, which includes target image visual words corresponding to multiple visual scales from coarse to fine. The visual autoregressive generator is used to predict the visual word distribution and visual words on a scale-by-scale basis from coarse to fine based on the text representation. When predicting each visual scale, the predicted visual words of all previous visual scales are used as a prefix and combined with the text representation to predict the visual word distribution and visual words of the current visual scale. The predicted visual words of all visual scales form a sequence of predicted visual words. The image decoder is used to generate images based on predicted visual word sequences; S23. Sample multiple samples from the attack training set and distillation training set according to a preset sampling ratio to serve as input to the student model. Train the student model multiple times until it converges to obtain a vulnerability model based on visual autoregression; wherein: For attack samples, the student model generates a visual word sequence of the target image based on the target image as a self-supervised label, and outputs a predicted visual word sequence based on the attack text prompt and the visual word sequence of the target image. When predicting for each visual scale, the student model uses the visual words of the target image in the visual word sequence of the target image before the current visual scale as a prefix and combines the text representation to predict a visual word of the current visual scale. For normal samples, the student model and the teacher model each output the predicted visual word distribution at all visual scales based on the normal text prompts. During training, the student model parameters are updated by minimizing the total loss, which includes attack loss and distillation loss. The attack loss is calculated based on the predicted visual word sequence and self-supervised labels output by the student model based on the attack samples. The distillation loss is calculated based on the predicted visual word distributions at all visual scales output by the student model and the teacher model based on the normal text prompts. S3. Use the defense system for the visual autoregressive model to be evaluated to defend against the vulnerability model based on visual autoregression, so as to evaluate the reliability of the defense system through preset indicators.

2. The method for reliability assessment of defense systems based on visual autoregressive models according to claim 1, characterized in that, Each attack sample in the attack training set is obtained as follows: S211. Construct the attack text prompt as follows: in, This indicates an attack message. This represents a normal text prompt. This represents an attack trigger marker. This represents inserting an attack trigger marker into the text. Operation; S212, Specify an attack trigger marker The corresponding image is used as the target image.

3. The method for reliability assessment of defense systems based on visual autoregressive models according to claim 1, characterized in that, In step S23, the original parameters of the student model's text encoder, visual autoregressive generator, and image decoder are frozen before training, and trainable parameters are inserted into the text conditional injection module of the visual autoregressive generator.

4. The method for reliability assessment of defense systems based on visual autoregressive models according to claim 1, characterized in that, The total loss is expressed as: in Represents the total loss. Represents the damage caused by the attack. Represents distillation loss, This represents the weighting coefficient.

5. The method for reliability assessment of defense systems based on visual autoregressive models according to claim 4, characterized in that, Attack losses Calculated as follows: in, Represents the total number of visual scales. Represents the visual scale index. Representative student model, The first digit in the visual word sequence representing the target image Visual units of a target image at a visual scale Representative predicts the first The prefix used when dealing with visual lexical units at a visual scale. This represents the attack text representation based on the attack text prompt.

6. The method for reliability assessment of defense systems based on visual autoregressive models according to claim 4, characterized in that, Distillation loss Calculated as follows: in, Represents the total number of visual scales. Represents the visual scale index. This represents the calculation of KL divergence. The first output representing the teacher model Predicted visual word distribution at each visual scale The first one representing the output of the student model Predicted visual word distribution at each visual scale The representative teacher model predicts the first The prefix used when distributing visual lexical units at multiple visual scales The student model predicts the first The prefix used when distributing visual lexical units at multiple visual scales This represents the normal text representation based on the normal text prompt conversion.

7. The method for reliability assessment of defense systems based on visual autoregressive models according to claim 1, characterized in that, The defense system can be a model repair system, a text prompt filtering system, or an image output interception system, among which: The defensive processing of the model repair system is to repair vulnerabilities based on the visual autoregressive vulnerability model; The defensive processing of the text prompt filtering system is to filter offensive text prompts that are input based on a visual autoregressive vulnerability model; The defensive processing of the image output interception system is to intercept the offensive images output by the vulnerability model based on visual autoregression.

8. The method for reliability assessment of defense systems based on visual autoregressive models according to claim 1, characterized in that, In S3, the preset index is the trigger suppression rate, which is expressed as: in, Represents the trigger inhibition rate; This represents the probability that the visual autoregressive vulnerability model, after being treated with defenses, will successfully output an offensive image. This represents the probability that an unprotected visual autoregressive vulnerability model successfully outputs an offensive image. It represents a very small positive number.

9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, It stores a computer program, which is executed by a processor to implement the steps of the method according to any one of claims 1-8.