A system and method for identifying large model generated text

By combining a neural network system with multidimensional feature extraction and dynamic feature fusion, the problem of insufficient accuracy and adversarial attacks in identifying text generated by large models in existing technologies has been solved, achieving efficient and accurate text source identification.

CN120705321BActive Publication Date: 2026-05-05BEIJING GUANGAN LIGHTING TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING GUANGAN LIGHTING TECHNOLOGY CO LTD
Filing Date
2025-06-17
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing methods for recognizing large model-generated text are not accurate enough when faced with high-quality human-written text, are vulnerable to adversarial attacks, and cannot effectively distinguish the true source of the text.

Method used

A system is employed, comprising an input module, a neural network module, and an output module. Through a multi-dimensional feature extraction layer, a binoculars core layer, a dynamic feature fusion layer, and a graph neural network, combined with linguistic features such as text statistical features, syntax tree depth, semantic consistency, and sentiment consistency, the system dynamically updates edge weights to determine whether the text was generated by a large model.

Benefits of technology

It significantly improves the accuracy and robustness of recognizing large model-generated text, performs well across diverse text types, maintains low computational cost, and is suitable for rapid filtering of large-scale text data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705321B_ABST
    Figure CN120705321B_ABST
Patent Text Reader

Abstract

This invention discloses a system and method for identifying text generated by large models. The system includes an input module, a neural network module, and an output module. The input module acquires historical input text, including historical human input text and historical large model input text. The neural network module extracts probability differences and linguistic features from the historical input text, dynamically fuses the probability differences and linguistic features to obtain a fused feature vector, and updates the edge weights. The output module acquires real-time input text, calculates the probability of large model generation of the real-time input text based on the updated edge weights, and determines whether the real-time input text is a large model input. This invention not only significantly improves detection accuracy but also maintains low computational cost, making it suitable for rapid screening of large-scale text data. This provides a practical solution to current challenges and is expected to promote technological progress and development in related fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of text recognition technology, specifically relating to a system and method for recognizing text generated by large models. Background Technology

[0002] As the application of large language models becomes increasingly widespread, their potential risks also increase, especially with the widespread dissemination of AI-generated content. Therefore, the ability to identify whether text was generated by a large model has become particularly important. In the information age, problems such as misinformation, misleading content, and copyright disputes are rampant, and these issues can be largely mitigated by determining the source of content. When it comes to fields requiring high accuracy and reliability, such as news reports, academic research, and legal documents, verifying the true source of text is crucial. Furthermore, ensuring the authenticity of published content on social media and online platforms helps prevent the spread of rumors and social panic. Therefore, developing an efficient and accurate method to detect whether text was generated by a large language model is of great significance for ensuring information security and maintaining social order.

[0003] Existing recognition methods mainly fall into two categories, each with its limitations. The first category is based on perplexity differences. This method assesses the complexity of text by calculating its probability distribution; theoretically, text generated by a language model should have low perplexity. However, this method is vulnerable to adversarial attacks and performs poorly when processing high-quality human-written text, as this text may also have low perplexity. The second category relies on specific linguistic features, such as syntax tree depth or semantic consistency. While these methods can distinguish human-written text from machine-generated text to some extent, they often neglect the overall structural and stylistic features of the text, leading to limited accuracy. Summary of the Invention

[0004] This invention aims to address the shortcomings of existing technologies and provides the following solutions:

[0005] A system for recognizing text generated by a large model includes: an input module, a neural network module, and an output module;

[0006] The input module is used to acquire historical input text, which includes: historical human input text and historical large model input text;

[0007] The neural network module is used to extract probability differences and linguistic features from the historical input text, and dynamically fuse the probability differences and linguistic features to obtain a fused feature vector, while updating the edge weights.

[0008] The output module acquires the real-time input text, calculates the large model generation probability of the real-time input text based on the updated weights, and determines whether the real-time input text is the input of the large model.

[0009] Preferably, the neural network module includes: a multidimensional feature extraction layer, a binoculars core layer, a dynamic feature fusion layer, and a graph neural network;

[0010] The multidimensional feature extraction layer is used to extract text features, syntactic features, semantic consistency features, and sentiment consistency features from the historical input text, and fuse them into multidimensional features.

[0011] The core layer of the binoculars calculates the phase difference perplexity and cross perplexity based on the performer model and the observer model, and performs perplexity fusion to obtain the fused perplexity;

[0012] The dynamic feature fusion layer is used to fuse multidimensional features and the fused perplexity to obtain the fused feature vector;

[0013] The graph neural network is used to update the edge weights by using the features of each dimension in the fused feature vector as nodes, thereby obtaining the updated edge weights.

[0014] Preferably, the multidimensional feature extraction layer includes: a text feature extraction unit, a syntactic feature extraction unit, a semantic consistency extraction unit, a sentiment consistency extraction unit, and a fusion unit;

[0015] The text feature extraction unit is used to extract text features from the historical input text. The text features include: punctuation distribution, sentence length statistics, lexical richness, and sentence initial word distribution.

[0016] The syntax feature extraction unit is used to extract the syntax depth from the historical input text as the syntax feature;

[0017] The semantic consistency extraction unit is used to calculate the variance of the similarity matrix in the historical input text as the semantic consistency feature.

[0018] The sentiment consistency extraction unit is used to calculate the sentiment fluctuation variance and the number of sentiment conflicts in the historical input text as the sentiment consistency feature.

[0019] The fusion unit is used to fuse the text features, the grammatical features, the semantic consistency features, and the sentiment consistency features into the multidimensional features.

[0020] Preferably, the working process of the binoculars core layer includes:

[0021] The perplexity of the historical input text is obtained using the observer model and the performer model, respectively, and the difference perplexity is calculated using the perplexity:

[0022]

[0023] in, This indicates the observer model's perplexity with the historical input text. The perplexity of the performer model with respect to the historical input text is represented by s, where s represents the text sequence of the historical input text, L represents the length of the text sequence, and x represents the perplexity of the model with respect to the historical input text. i Let s[i] represent the i-th token in the text sequence, and s[:i] represent the (i-1)th tokens in the text sequence s. This indicates that the observer model predicts the i-th token x given s[:i]. i The probability, This indicates that the performer model predicts the i-th token x given s[:i]. i The probability, ΔPPL, represents the difference in perplexity;

[0024] The probability distributions of the vocabulary in the historical input text are obtained using the observer model and the performer model, respectively, and the cross-perplexity is calculated based on the probability distributions.

[0025]

[0026] in, Let represent the probability distribution of the observer model for the vocabulary V given s[:i]. Let represent the log probability distribution of the performer model on vocabulary V given s[:i], where <·,·> represents the inner product between the two distributions, and ΛPPL represents the cross-perplexity.

[0027] The phase difference perplexity and the cross perplexity row perplexity are fused to obtain the fused perplexity:

[0028] ΠPPL=ΔPPL·ΛPPL

[0029] Wherein, ΠPPL represents the perplexity after fusion.

[0030] Preferably, the workflow of the dynamic feature fusion layer includes:

[0031] Based on the multidimensional features and the fused perplexity, the gating weights are calculated to obtain the fused weights:

[0032] g=σ(W g (ΠPPL,f multifeat ))

[0033] Among them, W g Let f represent the learnable weight matrix, σ represent the activation function, ΠPPL represent the perplexity after fusion, and f multifeat This represents multidimensional features, and g represents the fusion weights;

[0034] The fused feature vector is obtained by fusing the fusion weights, the phase perplexity, and the multidimensional features:

[0035] f fusion = g·ΔPPL+(1-g)·f multifeat

[0036] Among them, f fusion This represents the fused feature vector.

[0037] Preferably, the workflow of the graph neural network includes:

[0038] Using the features of each dimension in the fused feature vector as nodes, a graph neural network is used to connect the nodes and establish the relationship between features.

[0039] The edge weights of fully connected edges connecting all nodes are calculated based on the attention mechanism:

[0040]

[0041] q i =W q ·f i

[0042] k i =W k ·f i

[0043]

[0044] Where, q i Represents the query vector, k i W represents the key vector. q W represents the learnable query weight matrix. k Let f represent the learnable key weight matrix. i Represents node v i Features Represents node v i All neighbors, α ij This represents the normalized edge weights;

[0045] Update the edge weights to obtain the updated edge weights:

[0046]

[0047] Among them, Wv Let h′ represent the value transformation matrix. i This indicates that the weights are being updated.

[0048] Preferably, the output module consists of a classifier layer;

[0049] The workflow of the classifier layer includes: acquiring real-time input text, calculating the probability of generating a large model from the real-time input text based on updated weights using binary classification, and determining whether the real-time input text is the input for the large model.

[0050]

[0051] Among them, W c N represents the classification weight matrix. h This represents the number of nodes in the graph neural network, Mean represents the average pooling layer, and Softmax represents the activation function.

[0052] The present invention also provides a method for recognizing text generated from large models, the method being applied to the system described in any of the above claims, comprising the following steps:

[0053] S1. Obtain historical input text, which includes: historical human input text and historical large model input text;

[0054] S2. Extract the probability differences and linguistic features from the historical input text, and dynamically fuse the probability differences and linguistic features to obtain a fused feature vector, while updating the edge weights;

[0055] S3. Obtain the real-time input text, and simultaneously calculate the large model generation probability of the real-time input text based on the updated weights, and determine whether the real-time input text is the input of the large model.

[0056] Preferably, S2 includes:

[0057] Extract text features, syntactic features, semantic consistency features, and sentiment consistency features from the historical input text, and fuse them into multidimensional features;

[0058] The difference perplexity and cross perplexity are calculated based on the performer model and the observer model, and the perplexity is fused to obtain the fused perplexity.

[0059] The multidimensional features and the fused perplexity are fused to obtain the fused feature vector;

[0060] By using a graph neural network, with each dimension of the fused feature vector as a node, the edge weights are updated to obtain the updated edge weights.

[0061] Preferably, S3 includes:

[0062] The system acquires real-time input text and calculates the probability of generating a large model from the real-time input text based on the updated weights using binary classification. It then determines whether the real-time input text is the input for the large model.

[0063]

[0064] Among them, W c N represents the classification weight matrix. h This represents the number of nodes in the graph neural network, Mean represents the average pooling layer, and Softmax represents the activation function.

[0065] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0066] This invention combines a multi-dimensional feature extraction layer based on linguistic features. Specifically, in addition to traditional perplexity differences, it introduces various linguistic features such as text statistical features, syntax tree depth, semantic consistency, sentiment consistency, and stylistic features to construct a joint detector. In this way, the "binoculars" method can not only comprehensively analyze text from multiple dimensions but also effectively improve the accuracy and reliability of detection. Furthermore, considering sentiment consistency and stylistic features, this method performs exceptionally well when handling diverse text types. The advantages of this invention are that it significantly improves detection accuracy while maintaining low computational cost, making it suitable for rapid screening of large-scale text data. This provides a practical solution to current challenges and is expected to promote technological progress and development in related fields. Attached Figure Description

[0067] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the 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.

[0068] Figure 1 This is a schematic diagram of the system structure according to an embodiment of the present invention. Detailed Implementation

[0069] 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.

[0070] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0071] Example 1

[0072] In this embodiment, as Figure 1 As shown, a system for recognizing text generated by a large model includes: an input module, a neural network module, and an output module.

[0073] The input module is used to obtain historical input text, which includes historical human input text and historical large model input text.

[0074] The neural network module extracts probabilistic differences and linguistic features from historical input text, dynamically fuses these features to obtain a fused feature vector, and updates the edge weights. The neural network module includes: a multidimensional feature extraction layer, a binoculars core layer, a dynamic feature fusion layer, and a graph neural network.

[0075] The multidimensional feature extraction layer is used to extract text features, syntactic features, semantic consistency features, and sentiment consistency features from historical input text and fuse them into multidimensional features.

[0076] The multidimensional feature extraction layer includes: text feature extraction unit, syntactic feature extraction unit, semantic consistency extraction unit, sentiment consistency extraction unit, and fusion unit.

[0077] The text feature extraction unit is used to extract text features from historical input text. These text features include: punctuation distribution, sentence length statistics, lexical richness, and sentence initial word distribution.

[0078] In this embodiment, stylistic features capture human writing style habits by quantifying the vocabulary distribution, syntactic structure, punctuation usage, word selection, and surface patterns of machine-generated text to capture regular differences. This is based on the premise that human text exhibits higher randomness and diversity, while machine text may display statistically anomalous regularities (such as excessively high frequency of repeated words or overly uniform sentence lengths). Methods for extracting text features include:

[0079] (1) Input: The original historical input text (single or multiple documents).

[0080] (2) Feature extraction 1: word frequency entropy

[0081] ① Sliding window partitioning: Divide the text into windows of length L (e.g., L = 50 words, step size S = 25);

[0082] ②Word frequency statistics within a window: Calculate the frequency of each word within each window.

[0083] ③ Entropy calculation: Calculate the information entropy for each window:

[0084]

[0085] Where V represents the vocabulary and p(w) represents the word frequency;

[0086] ④ Global word frequency entropy: The average value of the information entropy of all windows.

[0087] (3) Feature 2: Distribution of punctuation marks

[0088] Count the number of times each punctuation type appears:

[0089]

[0090] Here, 'p' represents a typical punctuation type, such as a comma, period, exclamation mark, or question mark. Count p N is the number of times punctuation type p appears. p It represents the total number of occurrences of all punctuation types.

[0091] (4) Feature 3: Sentence variation coefficient

[0092] ① Sentence segmentation: Segment the sentence according to punctuation marks to obtain the sentence length sequence {l1, l2, ..., l...} m};

[0093] ② Calculate the coefficient of variation

[0094]

[0095] in, The standard deviation of sentence length is represented by μ, and the mean sentence length is represented by μ; the coefficient of variation is also shown. The larger the value, the more significant the sentence fluctuation (human text is typically higher).

[0096] (5) Feature 4: Lexical richness (type ratio, TTR)

[0097] ① Calculate the ratio of unique words (types) to the total number of words (examples) to obtain the TTR;

[0098] ② Corrected model ratio (to avoid the influence of text length):

[0099]

[0100] Where, δ i The unique word representing the window, where w represents the sliding window size (e.g., w = 100 words).

[0101] (6) Feature 5: Distribution of sentence-initial words

[0102] ① Statistical analysis of the proportion of sentences beginning with specific parts of speech (such as prepositions and articles):

[0103]

[0104] Among them, s preposition This indicates the number of sentences that begin with a preposition, and N represents the total number of sentences.

[0105] ② Use part-of-speech tagging tools (such as NLTK) to identify the part of speech at the beginning of a sentence.

[0106] (7) Output: Stylistic features, including punctuation distribution (i.e., comma frequency), sentence length statistics (i.e., mean and variance), lexical richness (i.e., type ratio), and sentence initial word distribution (i.e., the proportion of sentences starting with a preposition).

[0107] The syntax feature extraction unit is used to extract the syntax depth from the historical input text as syntax features.

[0108] In this embodiment, the depth of the syntax tree reflects the structural complexity of the sentence, based on the fact that human text tends to use nested structures (such as clauses), resulting in a deeper syntax tree, while machine text may have a flatter structure.

[0109] (1) Input and output: Input a single sentence and output the average syntax tree depth (scalar);

[0110] (2) Use tools (such as Stanford Parser) to generate a dependency parsing tree for each sentence;

[0111] (3) Define node depth: The root node has a depth of 0, and its child nodes have a depth of 1, which is recursively increased;

[0112] (4) Calculate the average depth: Take the average depth D of all word nodes in the sentence. avg :

[0113]

[0114] Example: The dependency tree of the sentence "The cat sat on the mat." may have a depth distribution of [0,1,1,2,2,3], with an average depth of ((0+1+1+2+2+3)) / 6 = 1.5.

[0115] The semantic consistency extraction unit is used to calculate the variance of the similarity matrix in the historical input text as a semantic consistency feature.

[0116] In this embodiment, semantic consistency measures the logical coherence between text paragraphs, based on the fact that human text is more coherent in global semantics, while machine text may be locally reasonable but overall disjointed.

[0117] (1) Sentence vector encoding

[0118] ① Input long text (such as paragraphs or chapters) and output semantic consistency score (scalar, such as similarity variance);

[0119] ② Divide the text into paragraphs (e.g., each paragraph consists of two sentences);

[0120] ③ Use tools (such as Sentence-BERT) to encode each paragraph into a sentence vector v i .

[0121] (2) Similarity matrix variance: The larger the variance, the worse the semantic consistency (machine text often shows logical jumps between paragraphs);

[0122] ① Calculate the cosine similarity matrix between paragraphs

[0123] ② Take the elements of the upper triangular part of the matrix (excluding the diagonal elements) and calculate the variance:

[0124] σ sem =Var({S ij |i <j})

[0125] Here, Var represents the function for calculating variance.

[0126] The sentiment consistency extraction unit is used to calculate the variance of sentiment fluctuations and the number of sentiment conflicts in the historical input text as sentiment consistency features.

[0127] In this embodiment, emotional consistency is used to measure the coherence of emotional expression in text. The basis is that the emotional tendency of human text usually evolves gradually or remains stable in the chapter, while machine-generated text may have abrupt emotional changes due to logical breaks or training data bias.

[0128] (1) Input: Long text (such as paragraphs or articles) that needs to be processed by dividing into sentences or paragraphs;

[0129] (2) Clause segmentation and emotional polarity quantification

[0130] ① Divide the text into sentences or paragraphs (e.g., three sentences per paragraph);

[0131] ② Perform sentiment analysis on each paragraph to obtain a sentiment polarity score s i ∈[-1, 1], where s i =1 indicates strong positive emotion, s i =-1 indicates strong negative emotion, s i =0 indicates neutral;

[0132] ③ Dictionary-based methods (such as VADER dictionary) or model-based methods (such as BERT fine-tuned sentiment classifier) ​​directly output probability values;

[0133] (3) Sliding window emotion fluctuation calculation

[0134] ① Define the sliding window size k (e.g., k = 3 paragraphs);

[0135] ② Calculate the variance of the sentiment score within the window:

[0136]

[0137] Among them, s i Indicates the emotional polarity score;

[0138] ③ Global sentiment fluctuation variance:

[0139]

[0140] Where, N p This indicates the total number of paragraphs.

[0141] (4) Emotional Conflict Detection

[0142] ① Calculate the difference in emotional polarity between adjacent paragraphs: Δs i =|s i+1 -s i |;

[0143] ② Count the number of conflicts:

[0144]

[0145] Where θ represents the threshold (e.g., θ = 0.5), This indicates an indicator function (i.e., a value of 1 if the condition is met, and 0 otherwise).

[0146] (5) Output

[0147] ① Emotional fluctuation variance (scalar): quantifies the intensity of emotional changes;

[0148] ② Number of emotional conflicts (scalar): The number of times the emotional polarity of adjacent paragraphs changes abruptly.

[0149] The fusion unit is used to integrate text features, syntactic features, semantic consistency features, and sentiment consistency features into multidimensional features.

[0150] The core layer of the binoculars calculates the phase difference perplexity and cross perplexity based on the performer model and the observer model, and then performs perplexity fusion to obtain the fused perplexity.

[0151] The workflow of the binoculars core layer includes:

[0152] The perplexity of the historical input text is obtained using both the observer model and the performer model, and the difference perplexity is calculated using the perplexity values.

[0153]

[0154] in, It is an observer model used to evaluate the predictability of text. It is a performer model used to generate text. Representing the observer model The level of confusion with historical input text. Representing the performer model The perplexity of the historical input text, s = {x1, x2, ..., x...} L} represents the text sequence of the historical input text, L represents the length of the text sequence, and x represents the length of the input text. i Let s[i] represent the i-th token in the text sequence, and s[:i] represent the (i-1)th tokens in the text sequence s. Representing the observer model Predict the i-th token x given s[:i]. i The probability, Representing the performer model Predict the i-th token x given s[:i]. i The probability, ΔPPL, represents the difference in perplexity;

[0155] The probability distributions of the vocabulary in the historical input text are obtained using both the observer model and the performer model, and the cross-perplexity is calculated based on these probability distributions.

[0156]

[0157] in, Representing the observer model Given s[:i], what is the probability distribution for the vocabulary V? Representing the performer model Given s[:i], for the log probability distribution of vocabulary V, <·,·> denote the inner product between two distributions, and ΛPPL denotes the cross-perplexity;

[0158] The difference perplexity and the cross perplexity row perplexity are combined to obtain the combined perplexity:

[0159] ΠPPL=ΔPPL·ΛPPL

[0160] Wherein, ΠPPL represents the perplexity after fusion.

[0161] The dynamic feature fusion layer is used to fuse multidimensional features and fused perplexity to obtain a fused feature vector.

[0162] The workflow of the dynamic feature fusion layer includes: calculating gating weights based on multi-dimensional features and the perplexity after fusion to obtain the fusion weights.

[0163] g=σ(W g (ΠPPL,f multifeat ))

[0164] Among them, W g Let f represent the learnable weight matrix, σ represent the activation function, ΠPPL represent the perplexity after fusion, and f multifeat Let g represent the multidimensional features, and g represent the fusion weights. Based on the fusion weights, phase perplexity, and multidimensional features, a fused feature vector is obtained.

[0165] f fusion = g·ΔPPL+(1-g)·f multifeat

[0166] Among them, f fusion This represents the fused feature vector.

[0167] Graph neural networks are used to update edge weights by using the features of each dimension in the fused feature vector as nodes, thus obtaining the updated edge weights.

[0168] The workflow of a graph neural network includes: using features of each dimension in the fused feature vector as nodes, connecting these nodes through a graph neural network to establish relationships between features; and calculating the edge weights of the fully connected edges connecting these nodes based on an attention mechanism.

[0169]

[0170] q i =W q ·f i

[0171] k i =W k ·f i

[0172]

[0173] Where, q i Represents the query vector, k i W represents the key vector. q W represents the learnable query weight matrix. k Let f represent the learnable key weight matrix. i Represents node v i Features Represents node v i All neighbors, α ij This represents the normalized edge weights;

[0174] Update the edge weights to obtain the updated edge weights:

[0175]

[0176] Among them, W v Let h′ represent the value transformation matrix. i This indicates that the weights are being updated.

[0177] The output module acquires the real-time input text, calculates the large model generation probability of the real-time input text based on the updated weights, and determines whether the real-time input text is the input of the large model.

[0178] The output module consists of a classifier layer;

[0179] The classifier layer's workflow includes: acquiring real-time input text, calculating the probability of generating a large model from the real-time input text based on updated weights using binary classification, and determining whether the real-time input text is the input for the large model.

[0180]

[0181] Among them, W c N represents the classification weight matrix. h This represents the number of nodes in the graph neural network, Mean represents the average pooling layer, and Softmax represents the activation function.

[0182] In this embodiment, the system is optimized by constructing a loss function, which includes:

[0183] (1) Classification loss Minimize the cross-entropy between the predicted and true labels to directly optimize classification accuracy:

[0184]

[0185] Among them, y true ∈{0,1} represents the true label, y true =0 indicates a human label, y true =1 indicates the text label generated by the large model; y pred ∈{0,1} represents the probability that the model predicts the text generated by the large model; for example, if the true label is 1, meaning it was generated by the large model, the predicted probability is y. pred =0.9, then the single-sample loss is

[0186] (2) Feature consistency loss Constrain the linear correlation between multidimensional features and perplexity differences to ensure their synergistic consistency in detection:

[0187]

[0188] Where ΠPPL represents the perplexity after fusion, f fusion This represents the fused feature vector. This represents a learnable weight matrix that maps multidimensional features to a scalar space, where d is the feature dimension. For example, W f = [0.3, -0.2, 0.5], f fusion =[1.2, 2.0, 0.8] T Then W f ·f fusion =0.36.

[0189] (3) Combating robust loss The robustness of the model to adversarial attacks is enhanced through adversarial training (primarily through generating adversarial examples and adversarial games; generating adversarial examples involves adding perturbations to the input text, such as synonym replacement; while adversarial games involve the discriminator attempting to distinguish between original features and adversarial features, and the feature extractor attempting to confuse the discriminator). A gradient inversion layer is employed (i.e., the gradient is inverted during backpropagation, causing the feature extractor to deceive the discriminator), forcing the fused features to be unable to be distinguished by the discriminator from their source.

[0190]

[0191] in, This represents a discriminator network whose output is the probability of whether a feature comes from an adversarial example.

[0192] (4) Dynamically weighted total loss

[0193]

[0194] Here, α, β, and γ represent the weighting parameters for dynamically adjusting the contribution of each loss.

[0195] Methods for designing weight parameters include:

[0196] ① The classification loss weights increase exponentially with the number of training steps t, dominating training in later stages. Here, t is the current training step number (i.e., the number of iterations), and T is 1 / 4 of the total number of training steps. For example, if the total number of steps is 40,000, then T = 10,000.

[0197] ② The feature consistency loss weights are adjusted by cosine annealing, with the intermediate stage having the largest weight.

[0198] ③ To combat linear decay of loss weights, robustness is enhanced in the early stages of training.

[0199] Methods for dynamically adjusting weight parameters include:

[0200] ① In the early stage of training (t << T): α≈0, β≈1, γ≈1. In the early stage of training, the learning of feature consistency and adversarial robustness (defense against adversarial attacks) is limited.

[0201] ② Mid-training period (t=T): α≈0.63, β≈0, γ≈0, classification loss dominates during mid-training period;

[0202] ③ Late training phase (t>T): α→1, β and γ approach 0, and the classification task is fully optimized in the late training phase.

[0203] In this embodiment, a system optimization strategy is also provided, including:

[0204] (1) Learning in stages:

[0205] ① Preheating stage: Freezing and Parameters are used only to train the feature fusion and classifier;

[0206] ② Joint fine-tuning: Freeze Top-level parameters, jointly optimizing all modules;

[0207] ③Adversarial Enhancement: Introduce an adversarial example generator to dynamically enhance the training data.

[0208] (2) Mixed precision training:

[0209] ① and Using FP16 parameters and FP32 for feature extraction can reduce memory usage by 40%.

[0210] ② Dynamic adjustment of gradient scaling factor:

[0211] (3) Data augmentation strategies:

[0212] ① Machine text perturbation: Local reordering of the generated text (randomly swapping the positions of adjacent sentences) and semantically preserving substitution (replacing 5% of non-keywords with synonyms);

[0213] ② Human text noise injection: Fill in spelling errors according to the keyboard distance probability distribution.

[0214] (4) Model convergence monitoring:

[0215] ①Main metric: The moving average of the F1-score on the validation set;

[0216] ②Early stopping condition: F1 improvement <0.1% after 200 consecutive steps;

[0217] ③ Learning rate decay: When the validation loss plateaus > 50 steps, I r * =0.5.

[0218] Example 2

[0219] In this embodiment, a method for recognizing text generated by a large model includes the following steps:

[0220] S1. Obtain historical input text, which includes historical human input text and historical large model input text.

[0221] S2. Extract probabilistic differences and linguistic features from historical input text, and dynamically fuse the probabilistic differences and linguistic features to obtain a fused feature vector, while updating the edge weights.

[0222] S2 includes: extracting text features, syntactic features, semantic consistency features, and sentiment consistency features from historical input text and fusing them into multi-dimensional features; calculating the difference perplexity and cross perplexity based on the performer model and the observer model, and fusing the perplexity to obtain the fused perplexity; fusing the multi-dimensional features and the fused perplexity to obtain the fused feature vector; and updating the edge weights using a graph neural network with each dimension of the fused feature vector as a node to obtain the updated edge weights.

[0223] S3. Obtain the real-time input text, and calculate the large model generation probability of the real-time input text based on the updated weights, and determine whether the real-time input text is the input of the large model.

[0224] S3 includes: acquiring real-time input text, calculating the large model generation probability of the real-time input text based on the updated weights using binary classification, and determining whether the real-time input text is the input of the large model.

[0225]

[0226] Among them, W c N represents the classification weight matrix. h This represents the number of nodes in the graph neural network, Mean represents the average pooling layer, and Softmax represents the activation function.

[0227] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A system for recognizing text generated from large models, characterized in that, include: Input module, neural network module, and output module; The input module is used to acquire historical input text, which includes: historical human input text and historical large model input text; The neural network module is used to extract probability differences and linguistic features from the historical input text, and dynamically fuse the probability differences and linguistic features to obtain a fused feature vector, while updating the edge weights. The output module acquires the real-time input text, calculates the large model generation probability of the real-time input text based on the updated weights, and determines whether the real-time input text is the input of the large model. The neural network module includes: a multidimensional feature extraction layer, a binoculars core layer, a dynamic feature fusion layer, and a graph neural network; The multidimensional feature extraction layer is used to extract text features, syntactic features, semantic consistency features, and sentiment consistency features from the historical input text, and fuse them into multidimensional features. The core layer of the binoculars calculates the phase difference perplexity and cross perplexity based on the performer model and the observer model, and performs perplexity fusion to obtain the fused perplexity; The dynamic feature fusion layer is used to fuse multidimensional features and the fused perplexity to obtain the fused feature vector; The graph neural network is used to update the edge weights by using the features of each dimension in the fused feature vector as nodes, and to obtain the updated edge weights. The workflow of the binoculars core layer includes: The perplexity of the historical input text is obtained using the observer model and the performer model, respectively, and the difference perplexity is calculated using the perplexity: in, This indicates the observer model's perplexity with the historical input text. This indicates the performer model's level of confusion with the historical input text. s A text sequence representing the historical input text. L Indicates the length of the text sequence. xi Represents the first in the text sequence i Each Token Represents a text sequence s The former i -1 Token This indicates that the observer model is in a given context. Predicting the first case i Tokens xi The probability, Indicates the performer model in a given Predicting the first case i Tokens xi The probability, Indicates the degree of confusion due to the difference; The probability distributions of the vocabulary in the historical input text are obtained using the observer model and the performer model, respectively, and the cross-perplexity is calculated based on the probability distributions. in, This indicates that the observer model is in a given context. In the case of a vocabulary V, the probability distribution is as follows: Indicates the performer model in a given In the case of the log-probability distribution of vocabulary V, Represents the inner product between two distributions. Indicates cross-perplexity; The phase difference perplexity and the cross perplexity are fused to obtain the fused perplexity: in, This indicates the level of confusion after fusion.

2. The system for recognizing text generated from large models according to claim 1, characterized in that, The multidimensional feature extraction layer includes: a text feature extraction unit, a syntactic feature extraction unit, a semantic consistency extraction unit, a sentiment consistency extraction unit, and a fusion unit; The text feature extraction unit is used to extract text features from the historical input text. The text features include: punctuation distribution, sentence length statistics, lexical richness, and sentence initial word distribution. The syntax feature extraction unit is used to extract the syntax tree depth from the historical input text as the syntax feature; The semantic consistency extraction unit is used to calculate the variance of the similarity matrix in the historical input text as the semantic consistency feature. The sentiment consistency extraction unit is used to calculate the sentiment fluctuation variance and the number of sentiment conflicts in the historical input text as the sentiment consistency feature. The fusion unit is used to fuse the text features, the grammatical features, the semantic consistency features, and the sentiment consistency features into the multidimensional features.

3. The system for recognizing text generated from large models according to claim 1, characterized in that, The workflow of the dynamic feature fusion layer includes: Based on the multidimensional features and the fused perplexity, the gating weights are calculated to obtain the fused weights: in, Let σ represent the learnable weight matrix, and let σ represent the activation function. Indicates the degree of confusion after fusion. Representing multidimensional features, Indicates the fusion weights; The fused feature vector is obtained by fusing the fusion weights, the phase perplexity, and the multidimensional features: in, This represents the fused feature vector.

4. A method for recognizing text generated from large models, said method being applied to the system according to any one of claims 1-3, characterized in that, Includes the following steps: S1. Obtain historical input text, which includes: historical human input text and historical large model input text; S2. Extract the probability differences and linguistic features from the historical input text, and dynamically fuse the probability differences and linguistic features to obtain a fused feature vector, while updating the edge weights; S3. Obtain the real-time input text, and simultaneously calculate the large model generation probability of the real-time input text based on the updated weights, and determine whether the real-time input text is the input of the large model.

Citation Information

Patent Citations

  • Large language model generation text detection method based on ensemble learning

    CN117216687A

  • Generated text detection method based on statistical information and pre-training language model

    CN117313709A