A language-aware cascading AI-generated text detection method and system

CN123012108APending Publication Date: 2026-10-30SHANGHAI JINGZHI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611188997.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-06
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0008]为了解决现有AI生成文本检测技术中检测管线缺乏语言感知能力、中英文采用统一检测策略适配性差,检测维度单一、高流畅度AI文本识别效果不佳,多阶段检测重复执行模型前向计算导致算力与显存开销高,以及编码器模型领域漂移严重、小样本适配易产生灾难性遗忘的技术问题,本申请提出一种语言感知级联式AI生成文本检测方法及系统,以实现中英文双语检测精度与推理效率同步提升、缓解领域漂移问题、兼顾检测鲁棒性与算力成本控制的效果

Benefits of technology

1、本申请设计的一种语言感知级联式AI生成文本检测方法,采用语言感知的多阶段级联检测架构,根据输入文本的语言类型差异化配置执行逻辑、集成权重与决策阈值,针对中英文文本的不同检测特性分别设计检测路径与仲裁规则。突破了统一检测策略的局限,英文场景可实现90%以上请求在快速阶段高置信返回,平均响应时间低于500ms;中文场景通过仲裁逻辑与补充检测机制修正了小参数参考模型的系统性过度自信偏差,显著提升了检测鲁棒性与整体准确率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012108A_ABST
    Figure CN123012108A_ABST
Patent Text Reader

Abstract

The application discloses a language-aware cascaded AI generated text detection method and system, and belongs to the technical field of artificial intelligence safety. The language router is used for identifying the text language type and matching the corresponding detection configuration; statistical features and linguistic features are extracted in the rapid detection stage, and the log probability data of each token in the statistical stage is reused to avoid repeated calculation; the encoder classification and the zero-shot detection stage are combined, the logic is executed according to the language specificity configuration, the weight and the decision threshold are integrated, and the output result is weighted and integrated; the encoder model lightweight field adaptation can also be realized through oversampling continuous learning. The application improves the bilingual detection accuracy of Chinese and English, reduces the inference overhead, effectively alleviates the field drift problem, and is suitable for content review, academic integrity maintenance and other scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language processing and artificial intelligence security technology, specifically relating to a language perception cascaded AI-generated text detection method and system. Background Technology

[0002] With the widespread deployment of large language models (LLMs) such as GPT-4, Claude, and Qwen, AI-generated content (AIGC) has emerged in large quantities in academic papers, news reports, technical documents, and social media. How to reliably distinguish between human-written text and AI-generated text has become a key technical requirement in areas such as content moderation, maintaining academic integrity, and combating misinformation.

[0003] Existing AI-generated text detection technologies can be mainly categorized as follows: The first category is detection methods based on statistical features. These methods utilize a reference language model to calculate statistical measures such as perplexity, token-by-token entropy, and burstiness of the text. They classify text based on the assumption that "AI text is smoother and more predictable for the reference model." The calculation speed is fast (usually less than 200ms), but it is prone to false negatives for fluent, formal, high-quality generated AI text. Here, a token is the basic unit of text processed by the language model; in English, it is usually a sub-word or word, and in Chinese, it is usually a sub-character. Burstiness refers to the ratio of the standard deviation to the mean of the token-by-token entropy, reflecting the degree of uncertainty fluctuation in the text at the token level. The formula is Burstiness = σ(H token ) / μ(H token ), where σ(H) token ) represents the standard deviation of the token-wise entropy, μ(H) token ) represents the mean of the token-by-token entropy.

[0004] The second category is encoder-based detection methods. These methods perform binary classification training on a pre-trained language model using parameter-efficient fine-tuning techniques. They achieve high accuracy (ROC-AUC typically above 0.95), but suffer from severe domain drift. Models trained on specific datasets exhibit a sharp decline in their ability to detect text generated by novel, large-scale models. ROC-AUC, or the area under the receiver operating characteristic curve, measures the overall performance of the binary classification model, ranging from [0,1], with higher values ​​indicating better overall performance. Parameter-efficient fine-tuning refers to fine-tuning techniques that allow for adaptation by training only a small number of model parameters, significantly reducing training costs and memory overhead.

[0005] The third category is zero-shot comparison-based methods, such as the Binoculars method, which detects by comparing the cross-entropy ratio of the base model and the instruction fine-tuning model on the same text. It does not require training data and has good generalization, but the inference speed is slow (1-3 seconds) and requires loading two large parameter models at the same time, resulting in extremely high GPU memory overhead.

[0006] The fourth category is based on linguistic style methods, which explore the differences between AI text and human text in terms of sentence length distribution, vocabulary diversity, and use of ambiguous language. However, these methods are usually only applicable to a single language (mainly English) and lack a systematic, multi-level feature engineering approach, resulting in a serious lack of adaptation to Chinese text.

[0007] Existing technologies share the following common drawbacks: First, the detection pipeline lacks language awareness capabilities, applying the same detection strategy to both Chinese and English without considering the essential differences between the two languages ​​in terms of grammatical structure, punctuation habits, paragraph organization, and formality. Simply reusing the English detection strategy is ineffective for detecting formal Chinese texts. Second, the detection dimension is singular. The mainstream methods are all based on the single assumption that "AI text is smoother under language models". When AI-generated text is extremely smooth, both perplexity and entropy features will fail, and there is a lack of orthogonal independent detection dimensions. Third, encoder models suffer from severe domain drift. Traditional retraining methods require a large amount of labeled data and are prone to catastrophic forgetting, making them unable to quickly adapt to new large models and new domain texts. Fourth, the multi-stage cascaded strategy lacks language-specific conditional logic, and the unified early exit threshold and conflict arbitration rules do not take into account the reliability differences of each detection stage under different language scenarios, which limits the improvement of detection accuracy. Summary of the Invention

[0008] To address the technical challenges of existing AI-generated text detection technologies, such as the lack of language perception capabilities in the detection pipeline, poor compatibility of using a unified detection strategy for Chinese and English, single detection dimensions, poor performance of high-fluency AI text recognition, high computational and memory overhead due to repeated forward computation of the model in multi-stage detection, severe domain drift of the encoder model, and catastrophic forgetting caused by small sample adaptation, this application proposes a language-perceptive cascaded AI-generated text detection method and system. This aims to simultaneously improve the detection accuracy and inference efficiency of Chinese and English bilingual text, alleviate the domain drift problem, and balance detection robustness with computational cost control.

[0009] A language-aware cascaded AI-generated text detection method includes the following steps: Step S1, Text Preprocessing: The input text is sequentially cleaned and normalized, segmented into sentences and words, and the boundary scene is verified to obtain the text to be detected; Step S2, Language Recognition Routing: Perform language type detection on the text to be detected, output language labels and confidence scores, and match the detection configuration of the corresponding language based on the language labels; Step S3, Multi-stage Cascaded Detection: Following the conditional execution logic corresponding to the language tag, the following detection stages are executed sequentially, including: Step S31, Rapid Detection Stage: Perform statistical feature extraction and linguistic style feature extraction; the statistical feature extraction uses the reference language model of the corresponding language to calculate statistical features, outputs the first AI generation probability, and caches the logarithmic probability data per token; the linguistic style feature extraction reuses the logarithmic probability data per token to calculate some linguistic features, combines the remaining linguistic features, and outputs the second AI generation probability. Step S32, Encoder Classification Stage: The encoder model with efficient parameter fine-tuning for the corresponding language is used to classify the text to be detected and output the third AI generation probability. Step S33, Zero-shot detection stage: Detection is performed using the dual-model comparison method of the corresponding language, and the fourth AI generation probability is output; Step S4, Weighted Integration Output: Based on the preset weight set corresponding to the language label, normalize and weight the output probabilities of each AI generation, apply the decision threshold of the corresponding language, and output the final classification label, confidence score and detection results of each stage. The conditional execution logic, preset weight set, and decision threshold are all configured specifically according to the language type.

[0010] Preferably, the conditional execution logic includes language-specific execution rules: When the language type is English: The fusion confidence C in the fast detection stage is calculated using the formula C=W. stat ×|P ai1 -0.5|+W ling ×|P ai2 -0.5|, Among them, W stat P represents the ensemble weights corresponding to statistical features, Wling represents the ensemble weights corresponding to linguistic style features, and P represents the ensemble weights corresponding to statistical style features. ai1 For the probability generated by the first AI, P ai2The second AI generation probability is set; when C > 0.49, an early exit is triggered, directly proceeding to step S4, skipping the encoder classification stage and the zero-shot detection stage; if the classification results of the fast detection stage and the encoder classification stage are consistent, the zero-shot detection stage is skipped, and the results of the first two stages are directly weighted and integrated; the consistent classification results mean that the AI ​​generation probabilities of both stages are greater than the decision threshold of the corresponding language, or are both less than the decision threshold of the corresponding language; when the language type is Chinese: Premature exit from the rapid detection phase is prohibited, and the encoder classification phase is always executed; when the probability of the first AI generation is less than 0.50 and the probability of the third AI generation is greater than or equal to 0.35, the arbitration logic is triggered, and only the probability of the third AI generation is used in the weighted integration. The zero-sample testing phase is always performed as a supplementary testing dimension and is not skipped even if the results of previous phases are consistent. The decision threshold for Chinese is 0.47, and the decision threshold for English is 0.50.

[0011] Preferably, the reuse rules for the token-by-token logarithmic probability data include: Statistical feature extraction and linguistic style feature extraction use sentence index alignment to match cached data, that is, according to the same sentence boundaries, log probability distribution statistics are passed on a sentence-by-sentence basis. The logarithmic probability data per token is cached at the request level, with a lifespan of one detection request, and is automatically cleared after the request ends. When cached data is unavailable, the linguistic style feature extraction process sets the cache-dependent features to missing values, fills them with the median imputation strategy built into the classifier, and then continues the detection process.

[0012] Preferably, the linguistic style features are divided into 14 dimensions: micro, meso, and macro. Except for features that reuse the logarithmic probability calculation per token, all other linguistic features are calculated by the central processing unit and do not depend on the graphics processing unit. The micro-level features are sentence-level features, including sentence length burstiness, sentence length variation coefficient, sentence length Gini coefficient, sentence beginning syntactic repetition rate, token log probability skewness, high probability token proportion, fuzzy language density, discourse template density, and punctuation style density. The meso-level features are paragraph-level features, including the logarithmic transformation value of the paragraph length variance and the paragraph template score; The macro-level features are document-level features, including lexical diversity, author position density, and readability index based on the MTLD algorithm; Among them, the feature word lists corresponding to fuzzy language, discourse templates, punctuation marks, and first-person pronouns are all configured independently for Chinese and English respectively.

[0013] Preferably, the specific configuration of the preset weight set is as follows: When the language type is English, the weight of linguistic style features is 0.85, the weight of statistical features is 0.15, the weight of encoder features is 0.00, and the weight of zero-shot detection is 0.00. When the language type is Chinese, the encoder feature weight is 0.60, the zero-shot detection weight is 0.20, the linguistic style feature weight is 0.10, and the statistical feature weight is 0.10.

[0014] Preferably, the encoder model used in the encoder classification stage employs an oversampling continuous learning method for domain-adaptive updating, the updating method comprising the following steps: Step A1, Data Preparation: Collect labeled text samples in the target domain and divide them into training set, validation set and test set; Step A2, Oversampling Amplification: Perform N-fold oversampling on the training set samples of the target domain, where N is a positive integer greater than 1, to obtain an oversampled training set; Step A3, Hybrid Training: Mix the oversampled training set with the original domain training dataset to construct a hybrid training set, and perform efficient fine-tuning of the encoder model parameters; Step A4, Dual-track verification: Verify the performance of the fine-tuned model on both the original domain test set and the target domain test set. When the target domain detection performance reaches the preset standard and the original domain detection accuracy decreases by no more than the preset threshold, deploy the updated encoder model.

[0015] Preferably, N is 10, and the proportion of the target domain samples in the mixed training set after oversampling is 3%-10%. Efficient parameter fine-tuning employs the LoRA low-rank adaptation method, with fine-tuning parameters including rank r=16 and learning rate 2e. -5 Training for 3 epochs with mixed precision bf16; during training, the mixed training set is completely and randomly shuffled before the start of each epoch. The preset threshold is 2 percentage points, meaning that the detection accuracy of the original neighborhood after fine-tuning is not lower than the accuracy before fine-tuning minus 2%.

[0016] Based on the above detection method, the present invention also provides a language-aware cascaded AI-generated text detection system, which includes a preprocessing module, a language router module, a statistical feature extraction module, a linguistic feature extraction module, an encoder classification module, a zero-shot detection module, and a weighted integration module. The output of the preprocessing module is connected to the input of the language router module, and is used to transmit the preprocessed text to be detected to the language router module. The text output terminal of the language router module is connected to the text input terminals of the statistical feature extraction module, the linguistic feature extraction module, the encoder classification module, and the zero-shot detection module, respectively, for distributing the text to be detected; the configuration output terminal of the language router module is connected to the configuration terminals of the statistical feature extraction module, the linguistic feature extraction module, the encoder classification module, the zero-shot detection module, and the weighted integration module, respectively, for issuing the corresponding language detection configuration to each module according to the identified language type. The cache output of the statistical feature extraction module is connected to the cache interface of the linguistic feature extraction module, and is used to transmit the token-by-token logarithmic probability cache data to the linguistic feature extraction module; the probability output of the statistical feature extraction module is connected to the first input of the weighted integration module. The probability output of the linguistic feature extraction module is connected to the second input of the weighted integration module; The probability output of the encoder classification module is connected to the third input of the weighted integration module; The probability output of the zero-sample detection module is connected to the fourth input of the weighted integration module; The weighted integration module is used to normalize and weight the AI ​​generation probabilities received from each input terminal according to the weight set and decision threshold of the corresponding language, and output the final detection result. The execution logic, integration weights, and decision thresholds for each stage of the system are configured according to language type specificity.

[0017] Preferably, both the statistical feature extraction module and the linguistic feature extraction module have an XGBoost classifier built in. The classifier pipeline includes a missing value imputation unit and a normalization unit, which are used to process input features with missing values ​​and output AI generation probabilities. The zero-sample detection module uses the Binoculars method to calculate the detection result by comparing the cross-entropy ratio of the base model and the instruction fine-tuning model.

[0018] Preferably, it further includes a domain adaptive training module; the model output end of the domain adaptive training module is connected to the model update end of the encoder classification module, and is used to output the updated encoder model parameters; The domain adaptive training module includes an oversampling unit, a hybrid training unit, and a dual-track verification unit. The dual-track verification unit has built-in original domain degradation threshold verification logic, which is used to perform domain adaptive updates on the encoder classification module model through the oversampling continuous learning method.

[0019] The advantages and effects of this application are as follows: 1. This application presents a language-aware cascaded AI-generated text detection method. It employs a multi-stage cascaded detection architecture based on language perception, configuring execution logic, integration weights, and decision thresholds according to the language type of the input text. Detection paths and arbitration rules are designed separately for the different detection characteristics of Chinese and English texts. This overcomes the limitations of a unified detection strategy. In English scenarios, over 90% of requests can achieve high-confidence returns in the fast stage, with an average response time of less than 500ms. In Chinese scenarios, arbitration logic and supplementary detection mechanisms correct the systematic overconfidence bias of the small-parameter reference model, significantly improving detection robustness and overall accuracy.

[0020] 2. This application presents a language-aware cascaded AI-generated text detection method that employs a cross-stage, token-by-token logarithmic probability caching and reuse mechanism. The intermediate calculation results from the statistical feature extraction stage are aligned by sentence index and directly reused in the linguistic feature extraction stage, eliminating the need for repeated forward computation of the language model. While adding an orthogonal detection dimension, this method saves 150-300ms of GPU inference time per detection, reduces GPU memory usage by 3-5GB, and lowers the incremental overhead of 14-dimensional linguistic feature extraction to the millisecond level of a pure CPU, achieving a balance between improved accuracy and cost control.

[0021] 3. This application presents a language-aware cascaded AI-generated text detection system. It constructs a three-tiered bilingual linguistic feature system (micro-meta-macro), extracts 14-dimensional style features independent of language model probabilities, and configures feature word lists and calculation rules separately for Chinese and English. This forms a second detection axis independent of statistical probability, overcoming the limitations of the single assumption that "AI text is smoother." In English scenarios, the linguistic classifier achieves an independent ROC-AUC of 0.9087. After fusion with statistical features, the detection accuracy is further improved, effectively enhancing the ability to recognize highly fluent AI text.

[0022] 4. This application presents a language-aware cascaded AI-generated text detection method. It employs a continuous learning domain adaptation method based on oversampling, combined with small-sample oversampling amplification, hybrid training, and full-sample random shuffling strategies, and includes a dual-track verification rollback protection mechanism. It requires only a few hundred samples from the target domain to achieve rapid adaptation, increasing the AI ​​generation probability of target domain text from below 0.01 to above 0.99, with a sample recall rate of 100%. Simultaneously, it keeps the original domain accuracy drop to within 2 percentage points, effectively mitigating domain drift and catastrophic forgetting problems.

[0023] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings.

[0024] The above and other objects, advantages and features of this application will become more apparent to those skilled in the art from the following detailed description of specific embodiments in conjunction with the accompanying drawings. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0026] Figure 1 This is a schematic diagram of the four-stage cascaded detection pipeline for language perception in this invention. Figure 2 This is a schematic diagram of the adaptive training process in the field of oversampling continuous learning according to the present invention; Figure 3 This is a schematic diagram illustrating the principle of cross-stage token logarithmic probability caching and reuse in this invention; Figure 4 This is a hierarchical structure diagram of the multi-level linguistic features of this invention; Figure 5 This is a schematic diagram of the data flow architecture for oversampling continuous learning in this invention. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. In the following description, specific details such as specific configurations and components are provided merely to help fully understand the embodiments of this application. Therefore, those skilled in the art should understand that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. In addition, for clarity and brevity, descriptions of known functions and structures are omitted in the embodiments.

[0028] It should be understood that the phrase "an embodiment" or "this embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "an embodiment" or "this embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0029] Furthermore, reference numerals and / or letters may be repeated in different examples within this application. Such repetition is for the purpose of simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or settings discussed.

[0030] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist simultaneously. The term " / and" in this article describes another type of relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " in this article generally indicates that the related objects before and after it are in an "or" relationship.

[0031] In this article, the term "at least one" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, "at least one of A and B" can mean: A exists alone, A and B exist simultaneously, or B exists alone.

[0032] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion.

[0033] Example 1: This example describes a general-purpose AI-generated text detection system deployed on a single GPU server, combined with... Figure 1 , Figure 3 , Figure 4 Please provide an explanation.

[0034] The deployment environment consists of an NVIDIA RTX 3060 12GB GPU and a Python 3.12 runtime environment, using the FastAPI framework to provide the detection interface. The system continuously loads the language router module and lightweight reference models, while large-scale models use a lazy loading mechanism (i.e., they are only loaded into GPU memory upon first use), and zero-shot detection models are asynchronously ready in a background thread.

[0035] The connection and operation flow of each module of the system are as follows: Step 1: Text Preprocessing The preprocessing module performs a uniform preprocessing procedure on all input texts, serving as a prerequisite for subsequent feature extraction: (1) Cleaning and normalization: Remove HTML tags and Markdown formatting marks (#, etc.). Remove characters such as ">", `, etc., to preserve plain text content; unify line breaks (convert \r\n and \r to \n), merge consecutive blank lines into a single blank line; unify Unicode encoding to NFC normalized form, and remove zero-width characters and control characters; for text extracted from PDFs, remove header and footer residues and extra spaces.

[0036] (2) Sentence segmentation between Chinese and English: Chinese sentences are defined by Chinese period (。), question mark (?), exclamation mark (!), and ellipsis (……); English sentences are defined by English period (.), question mark (?), and exclamation mark (!) followed by a space or line break; mixed texts are identified by Chinese and English punctuation respectively, and sentences are broken at the nearest punctuation mark to ensure that no sentence is cut across punctuation marks.

[0037] (3) Word segmentation configuration: The BPE word segmenter built into the reference language model is used in the statistical feature extraction stage; Chinese is segmented at the character level and English is segmented at the word level and the stop words in the standard stop word list are removed in the linguistic feature extraction stage. The word segmentation granularity of the two stages is configured independently and does not require one-to-one correspondence.

[0038] (4) Boundary scene handling: When the text length is less than 50 characters, return a downgraded result of "Insufficient text length, unable to be reliably detected", along with the AI ​​generation probability P. ai An uncertain label with a probability of 0.5, where the AI ​​generation probability P... ai This indicates the probability that the text was generated by artificial intelligence, with a value ranging from [0,1]. The closer the value is to 1, the higher the probability that it was generated by AI. When the text length is greater than 10,000 characters, the first 10,000 characters are truncated for detection and marked as "text truncated". When the proportion of invalid characters exceeds 30% or the proportion of non-text characters exceeds 50%, the corresponding downgraded result is returned. After preprocessing, the preprocessing module transmits the text to be detected to the language router module.

[0039] Step 2: Language Recognition Routing Combination Figure 1 The pipeline architecture shown uses a language router module based on the XLM-RoBERTa multilingual classification model to detect language types and output language labels and confidence scores. When the language recognition confidence score is below 0.80, or when the input text is a mixture of Chinese and English (both languages ​​account for more than 20% of the characters), a downgrade strategy is adopted: the dominant language is determined by character statistics; if the proportion of Chinese characters is greater than 50%, it is determined to be Chinese; otherwise, it is determined to be English.

[0040] The language router module distributes the text to be detected to the text input terminals of each downstream detection module, and at the same time sends the detection configuration of the corresponding language to the configuration terminal of each module, loading the model, weight and threshold parameters of the corresponding language.

[0041] Step 3: Multi-stage cascaded detection The two sub-modules in the fast detection phase can be executed in parallel: the statistical feature extraction module performs GPU inference to generate cached data, while the linguistic feature extraction module simultaneously calculates non-probabilistic features and fills in probabilistic features after the cache is ready, thereby improving the overall detection efficiency.

[0042] (1) Rapid detection stage The statistical feature extraction module uses GPT-2-XL for English and Wenzhong-GPT2-110M for Chinese as the reference language models. It calculates six statistical features: perplexity, average entropy, entropy standard deviation, burstiness, maximum entropy, and minimum entropy. These features are then input into the built-in XGBoost classifier, which outputs the first AI generation probability P. ai1 Simultaneously, the list of logarithmic probabilities for each token is cached in the instance attribute _last_token_log_probs and passed to the linguistic feature extraction module through the cache interface.

[0043] Linguistic feature extraction module: executed purely by the Central Processing Unit (CPU), with no GPU dependency. Combined with... Figure 4 The feature hierarchy structure shown extracts 14 dimensions of linguistic features across the micro, meso, and macro levels, as detailed below: ① Micro-level (sentence level, 9 features): M1 (Sentence Length Suddenness): The calculation formula is M1 = (σ... L -μ L ) / (σ L +μ L ), where σ L μ is the standard deviation of sentence length. L This represents the average sentence length. M2 (Sentence Length Variation Coefficient): The calculation formula is M2 = σ L / μ L ; M3 (Sentence Length Gini Coefficient): Calculated using the following formula... L i Let n be the length of the i-th sentence and n be the total number of sentences. M4 (Sentence Initial Syntactic Repetition Rate): The calculation formula is as follows: , where P iLet be the set of the first 3 tokens of the i-th sentence; Jaccard similarity is used to measure the similarity between two sets, and the calculation formula is Jaccard(A, B) = |A∩B| / |A∪B|, with a value range of [0,1]. The higher the value, the higher the overlap between the sets; the higher the M4 value, the more templated the syntax at the beginning of the sentence; Chinese is calculated by character-level word segmentation, and English is calculated by word-level word segmentation and filtering stop words; M5 (Token Log-Probability Skewness): The third-order standardized moment of the token-by-token log-probability distribution, calculated using the following formula: ,in Let be the logarithmic probability of the i-th token. Let n be the mean of the logarithmic probabilities, and n be the total number of tokens. M6 (High Probability Token Proportion): Calculation formula is as follows This refers to the proportion of tokens with a logarithmic probability greater than -1.0 (corresponding to a probability of approximately 0.368) out of all tokens. M7 (Fuzzy Language Density): The ratio of the number of hits in the fuzzy language vocabulary to the number of characters per thousand. Separate vocabulary lists are used for Chinese and English. English fuzzy word list (21 items): appears to, tends to, seems to, something, in our experience, we found, we find, some what unexpectedly, interestingly, in practice, to some extent, in our observations, a closer examination, presumably, argumentably, likely, may, might, could, possibly, perhaps, perhaps; List of Chinese fuzzy words (15): seemingly, often, we find, unexpectedly, in practice, to some extent, according to our observation, more carefully observed, possibly, perhaps, maybe, probably, not necessarily, not necessarily, seems possible; M8 (Discourse Template Density): The ratio of the number of AI discourse template word matches to the number of characters per thousand. Separate word lists are used for Chinese and English. English discourse template vocabulary (13 words): furthermore, moreover, in addition, additionally, therefore, thus, consequently, as a result, in conclusion, to summarize, firstly, secondly, finally; Chinese discourse template vocabulary (10 words): In addition, furthermore, therefore, in conclusion, in summary, firstly, secondly, finally, it can be seen from this, it is not difficult to see; M9 (Punctuation Style Density): The ratio of a specific punctuation mark count to the number of characters per thousand; Chinese and English use separate statistical ranges. English statistical characters (5): long dash (—), short dash (–), left parenthesis, right parenthesis, semicolon; Chinese statistical characters (4): dash (——), ellipsis (……), comma (、), semicolon (;).

[0044] ②Mesoscopic level (segment level, 2 features): S1 (Segment Length Variance): The calculation formula is as follows: S1=log(1+Var(L p1 ,L p2 ,……,L pk ,)), where L pi Let be the number of characters in the i-th segment; S2 (Paragraph Template Score): Calculation formula is as follows S² = 0.5 × R tpl +0.5×J adj , where R tpl J represents the percentage of paragraphs in which discourse template words appear in the first sentence. adj The mean Jaccard similarity of the first sentence of adjacent paragraphs (the first 5 content words after removing stop words); the value ranges from [0,1], and the higher the value, the more template-like the paragraph structure.

[0045] ③ Macro level (document level, 3 features): D1 (Lexical Diversity): The MTLD algorithm is used for bidirectional averaging. MTLD stands for Measure of TextualLexical Diversity, which measures lexical richness by calculating the average length of text required to achieve a specific type-token ratio. Chinese text is tokenized at the character level, and English text is tokenized at the word level. D2 (Author Stance Density): The calculation formula is D2 = (N... pron +N hedge ) / L doc ×1000, where N pron N is the number of first-person pronoun hits. hedge For the number of hits in fuzzy language, L doc Total number of characters in the document; separate first-person pronoun lists are used for Chinese and English; English first-person pronoun list (6): we, our, us, I, my, me; Chinese first-person pronoun list (4): we, the author, myself, I; D3 (Readability Index): For English, the Flesch reading difficulty formula is used, calculated as Flesch = 206.835 - 1.015 × (number of words / number of sentences) - 85.6 × (number of syllables / number of words); for Chinese, the negative average sentence length is used as a proxy variable.

[0046] Combination Figure 3 The cache reuse mechanism shown directly reuses the token-by-token logarithmic probability calculations cached by the statistical feature extraction module for features M5 and M6, eliminating the need for a second forward computation of the language model. The cache is aligned by sentence index; that is, the statistical feature extraction module stores token-level logarithmic probability sequences by sentence, while the linguistic feature extraction module accesses the logarithmic probability distribution statistics of the corresponding sentences at the same sentence boundaries, aggregating at the sentence level and then averaging at the document level. The cache is request-level, with a lifespan of one detection request, and is automatically cleared after the process ends. When cached data is unavailable, M5 and M6 are set to missing values, which are filled in by the built-in XGBoost classifier using the median imputation strategy learned during training; the remaining 12 features are calculated normally.

[0047] 14-dimensional features are input into the XGBoost classifier, and the output is the second AI generation probability p. ai2 .

[0048] (2) Encoder classification module The English model uses DeBERTa-v3-large and the Chinese-RoBERTa-wwm-ext-large as the base models. After fine-tuning with LoRA, sequence classification is performed, and the output is the third AI generation probability p. ai3 .

[0049] 3) Zero-sample detection module The Binoculars method is employed, using the Falcon-7B pedestal model and the Falcon-7B-Instruct model for English text, and the Qwen2-7B pedestal model and the Qwen2-7B-Instruct model for Chinese text. The cross-entropy ratio of the same text on the two models is calculated to obtain the original score, which is then converted into a fourth AI generation probability p using a sigmoid mapping function. ai4 The mapping formula is: p ai4 =1 / (1+e k (r-1) ), where r = score / s0, s0 is the normalized threshold optimized by the validation set, s0 is about 0.854 in low-fpr mode and about 0.902 in accuracy mode; k = 5.0 is the steepness coefficient.

[0050] Step 4: Language-specific conditional control and weighted integration The weighted integration module executes corresponding conditional logic based on language type and performs normalized weighted integration according to preset weights. Here, "early exit" refers to a mechanism where, when the detection process meets preset reliability conditions, subsequent detection stages are skipped, and the process directly enters weighted integration and outputs the results. "Classification results are consistent" means that the AI ​​generation probabilities in both detection stages are greater than the corresponding language's decision threshold (both judged as AI-generated), or both are less than the corresponding language's decision threshold (both judged as human-written). "Normalized weighted summation" means that when some detection stages are skipped due to conditional logic, the corresponding weights of the actual participating stages are re-normalized proportionally to ensure that the sum of the weights involved in the calculation is 1 before performing weighted summation.

[0051] English pipeline: Calculate the fusion confidence level C=W stat ×|P ai1 -0.5|+W ling ×|P ai2 -0.5|, when C>0.49, early exit is triggered, and the fusion result is returned directly; if the classification results of the fast detection stage and the encoder classification stage are consistent, the zero-shot detection stage is skipped. Finally, the classification result is output by weighting the linguistic features (0.85) and statistical features (0.15) and applying a decision threshold of 0.50.

[0052] Chinese pipeline: Premature exit during the rapid detection phase is prohibited; when P ai1 <0.5 and P ai3 When the threshold is ≥0.35, a Chinese arbitration block is triggered, and only the encoder result is used in the integration. The zero-sample detection stage is always performed as a supplementary detection dimension. Finally, the classification result is output by weighting the results with the following weights: encoder 0.60, zero-sample 0.20, linguistics 0.10, and statistics 0.10, and applying a decision threshold of 0.47.

[0053] Taking an 800-character Chinese enterprise security governance textbook as an example, the detection process is as follows: the language router determines it to be Chinese (confidence level 0.99); the statistical feature extraction module outputs P. ai1 =0.0148 (written by the judge); Linguistic feature extraction module output P ai2 =0.0964; Encoder classification module output P ai3 =0.9980; Triggered Chinese arbitration logic, and after weighted integration, it was finally determined to be "AI generated" with a confidence level of 0.9980.

[0054] Example 2: Domain Adaptive Fit Based on Oversampling Continuous Learning This embodiment uses the system's domain-adaptive training module to perform target-domain adaptive updates on the Chinese encoder model, combined with... Figure 2 , Figure 5 Please provide an explanation.

[0055] The scenario is as follows: The existing Chinese detection model, which is trained based on HC3-Chinese question-and-answer data, needs to be updated to detect enterprise security governance textbook texts generated by GPT-4, while maintaining the original domain detection performance without significant degradation.

[0056] The domain-adaptive training module includes an oversampling unit, a hybrid training unit, and a dual-track validation unit. The specific implementation steps are as follows: 1. Data preparation: Collect 98 target domain text blocks (from 10 chapters) and randomly divide them into training set (82 blocks), validation set (7 blocks), and test set (9 blocks) in an 8:1:1 ratio; the original domain dataset is HC3-Chinese with a total of 10510 samples, which are also divided into training set, validation set, and test set in an 8:1:1 ratio.

[0057] 2. Oversampling Amplification: The oversampling unit performs 10-fold oversampling on 82 samples in the target domain training set, that is, each sample is copied 10 times to obtain 820 oversampling training samples; the validation set and test set keep the original samples and do not participate in oversampling to ensure the objectivity of the evaluation results.

[0058] 3. Hybrid Training: The hybrid training unit merges the oversampled target domain training data with the original domain training data to form a hybrid training set of 11,330 samples, of which the target domain samples account for approximately 7.2%. A pre-trained Chinese-RoBERTa-wwm-ext-large model is loaded, with a LoRA adapter attached, and the rank r=16, alpha=32, and learning rate 2 are set. e-5 Training is performed for 3 epochs with a batch size of 16 and mixed precision of bf16. Before each epoch, the entire mixed dataset is randomly shuffled, avoiding fixed-ratio sampling in each batch to prevent the model from overfitting to a single domain in consecutive batches. The validation set is used for early stopping control (i.e., training is terminated early when the validation set performance no longer improves).

[0059] 4. Dual-track validation and rollback protection: The dual-track validation unit validates the model performance simultaneously on both the original domain test set and the target domain test set. The rollback protection condition is: the decrease in the original domain detection accuracy does not exceed 2 percentage points, i.e., A ccnew ≥A ccold -2%.

[0060] The validation results are as follows: the recall rate of 9 non-repeating samples in the target domain is 100%, the generalization recall rate of 6 complete documents (3000 characters, different from the training length) is 100%, and the average Pai of the target domain text is improved from 0.0096 to 0.9980; the overall accuracy of the original domain is 97.0%, which is 0.2 percentage points lower than the original model and less than the 2% degradation threshold.

[0061] After the rollback protection conditions are met, the domain adaptive training module transmits the updated v2 model parameters to the model update end of the encoder classification module to complete the model iteration and synchronously update the integrated weight configuration of the Chinese pipeline.

[0062] Example 3: Optimization of High-Quality English Academic Text Detection This embodiment is designed for the detection of English academic papers, and combines... Figure 1 , Figure 4 Please provide an explanation.

[0063] In response to the characteristics of long English academic papers, the system applies an English-specific configuration: linguistic feature weight 0.85, statistical feature weight 0.15, and the encoder and zero-sample detection stages are weighted at 0 to reduce computational overhead.

[0064] The testing process is as follows: The language router module identifies the language as English and loads the English detection configuration. The statistical feature extraction module calculates features such as perplexity and burstiness using GPT-2-XL. AI-generated academic texts typically have low perplexity (typical value 15-25), uniform entropy distribution, and burstiness close to 0 or negative. The linguistic feature extraction module is the core judgment step: human-written academic papers have sentence length abruptness greater than 0, diverse paragraph structure, lexical diversity MTLD greater than 70, and author position density greater than 3.0 / thousand words; AI-generated texts, on the other hand, have uniform sentence length, obvious paragraph templates, and relatively concentrated vocabulary. The two-stage results are weighted and fused, and a classification result is output using a threshold of 0.50.

[0065] This embodiment does not require loading a large parameter encoder or a zero-sample model throughout the entire process, uses approximately 4GB of GPU memory, and can complete the detection of a single paper within 5 seconds, making it suitable for deployment in low-configuration hardware environments.

[0066] The above description is merely a preferred embodiment of the present invention and does not limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any changes, modifications, substitutions, integrations, and parameter alterations to these embodiments within the spirit and principles of the present invention, achieved through conventional substitutions or by achieving the same function without departing from the principles and spirit of the present invention, fall within the scope of protection of the present invention.

Claims

1. A language-aware cascaded AI-generated text detection method, characterized in that, Includes the following steps: Step S1, Text Preprocessing: The input text is sequentially cleaned and normalized, segmented into sentences and words, and the boundary scene is verified to obtain the text to be detected; Step S2, Language Recognition Routing: Perform language type detection on the text to be detected, output language labels and confidence scores, and match the detection configuration of the corresponding language based on the language labels; Step S3, Multi-stage Cascaded Detection: Following the conditional execution logic corresponding to the language tag, the following detection stages are executed sequentially, including: Step S31, Rapid Detection Stage: Perform statistical feature extraction and linguistic style feature extraction; the statistical feature extraction uses the reference language model of the corresponding language to calculate statistical features, outputs the first AI generation probability, and caches the logarithmic probability data per token; the linguistic style feature extraction reuses the logarithmic probability data per token to calculate some linguistic features, combines the remaining linguistic features, and outputs the second AI generation probability. Step S32, Encoder Classification Stage: The encoder model with efficient parameter fine-tuning for the corresponding language is used to classify the text to be detected and output the third AI generation probability. Step S33, Zero-shot detection stage: Detection is performed using the dual-model comparison method of the corresponding language, and the fourth AI generation probability is output; Step S4, Weighted Integration Output: Based on the preset weight set corresponding to the language label, normalize and weight the output probabilities of each AI generation, apply the decision threshold of the corresponding language, and output the final classification label, confidence score and detection results of each stage. The conditional execution logic, preset weight set, and decision threshold are all configured specifically according to the language type.

2. The language-aware cascaded AI-generated text detection method according to claim 1, characterized in that, The conditional execution logic includes language-specific execution rules: When the language type is English: The fusion confidence C in the fast detection stage is calculated using the formula C=W. stat ×|P ai1 -0.5|+W ling ×|P ai2 -0.5|, Among them, W stat W represents the ensemble weights corresponding to the statistical features. ling P represents the integrated weights corresponding to linguistic style features. ai1 For the probability generated by the first AI, P ai2 The second AI generation probability is set; when C > 0.49, an early exit is triggered, directly proceeding to step S4, skipping the encoder classification stage and the zero-shot detection stage; if the classification results of the fast detection stage and the encoder classification stage are consistent, the zero-shot detection stage is skipped, and the results of the first two stages are directly weighted and integrated; the consistent classification results mean that the AI ​​generation probabilities of both stages are greater than the decision threshold of the corresponding language, or are both less than the decision threshold of the corresponding language; when the language type is Chinese: Premature exit from the rapid detection phase is prohibited, and the encoder classification phase is always executed; when the probability of the first AI generation is less than 0.50 and the probability of the third AI generation is greater than or equal to 0.35, the arbitration logic is triggered, and only the probability of the third AI generation is used in the weighted integration. The zero-sample testing phase is always performed as a supplementary testing dimension and is not skipped even if the results of previous phases are consistent. The decision threshold for Chinese is 0.47, and the decision threshold for English is 0.

50.

3. The language-aware cascaded AI-generated text detection method according to claim 1, characterized in that, The rules for reusing the token-by-token logarithmic probability data include: Statistical feature extraction and linguistic style feature extraction use sentence index alignment to match cached data, that is, according to the same sentence boundaries, log probability distribution statistics are passed on a sentence-by-sentence basis. The logarithmic probability data per token is cached at the request level, with a lifespan of one detection request, and is automatically cleared after the request ends. When cached data is unavailable, the linguistic style feature extraction process sets the cache-dependent features to missing values, fills them with the median imputation strategy built into the classifier, and then continues the detection process.

4. The language-aware cascaded AI-generated text detection method according to claim 1, characterized in that, The linguistic style features are divided into 14 dimensions: micro, meso, and macro. Except for features that reuse the logarithmic probability calculation per token, all other linguistic features are calculated by the central processing unit and do not depend on the graphics processing unit. The micro-level features are sentence-level features, including sentence length burstiness, sentence length variation coefficient, sentence length Gini coefficient, sentence beginning syntactic repetition rate, token log probability skewness, high probability token proportion, fuzzy language density, discourse template density, and punctuation style density. The meso-level features are paragraph-level features, including the logarithmic transformation value of the paragraph length variance and the paragraph template score; The macro-level features are document-level features, including lexical diversity, author position density, and readability index based on the MTLD algorithm; Among them, the feature word lists corresponding to fuzzy language, discourse templates, punctuation marks, and first-person pronouns are all configured independently for Chinese and English respectively.

5. The language-aware cascaded AI-generated text detection method according to claim 1, characterized in that, The specific configuration of the preset weight set is as follows: When the language type is English, the weight of linguistic style features is 0.85, the weight of statistical features is 0.15, the weight of encoder features is 0.00, and the weight of zero-shot detection is 0.

00. When the language is Chinese, the encoder feature weight is 0.60, the zero-shot detection weight is 0.20, and the linguistic style feature weight is 0.

10. The statistical feature weight is 0.

10.

6. The language-aware cascaded AI-generated text detection method according to claim 1, characterized in that, The encoder model used in the encoder classification stage employs an oversampling continuous learning method for domain-adaptive updates. This update method includes the following steps: Step A1, Data Preparation: Collect labeled text samples from the target domain and divide them into training set, validation set and test set; Step A2, Oversampling Amplification: Perform N-fold oversampling on the training set samples of the target domain, where N is a positive integer greater than 1, to obtain an oversampled training set; Step A3, Hybrid Training: Mix the oversampled training set with the original domain training dataset to construct a hybrid training set, and perform efficient fine-tuning of the encoder model parameters; Step A4, Dual-track verification: Verify the performance of the fine-tuned model on both the original domain test set and the target domain test set. When the target domain detection performance reaches the preset standard and the original domain detection accuracy decreases by no more than the preset threshold, deploy the updated encoder model.

7. The language-aware cascaded AI-generated text detection method according to claim 6, characterized in that: The value of N is 10, and the proportion of the target domain samples in the mixed training set after oversampling is 3%-10%. Efficient parameter fine-tuning employs the LoRA low-rank adaptation method, with fine-tuning parameters including rank r=16 and learning rate 2e. -5 Training for 3 epochs with mixed precision bf16; during training, the mixed training set is completely and randomly shuffled before the start of each epoch. The preset threshold is 2 percentage points, meaning that the detection accuracy of the original neighborhood after fine-tuning is not lower than the accuracy before fine-tuning minus 2%.

8. A language-aware cascaded AI-generated text detection system, characterized in that, The system includes a preprocessing module, a language router module, a statistical feature extraction module, a linguistic feature extraction module, an encoder classification module, a zero-shot detection module, and a weighted ensemble module. The output of the preprocessing module is connected to the input of the language router module, and is used to transmit the preprocessed text to be detected to the language router module. The text output terminal of the language router module is connected to the text input terminals of the statistical feature extraction module, the linguistic feature extraction module, the encoder classification module, and the zero-shot detection module, respectively, for distributing the text to be detected; the configuration output terminal of the language router module is connected to the configuration terminals of the statistical feature extraction module, the linguistic feature extraction module, the encoder classification module, the zero-shot detection module, and the weighted integration module, respectively, for issuing the corresponding language detection configuration to each module according to the identified language type. The cache output of the statistical feature extraction module is connected to the cache interface of the linguistic feature extraction module, and is used to transmit the token-by-token logarithmic probability cache data to the linguistic feature extraction module; the probability output of the statistical feature extraction module is connected to the first input of the weighted integration module. The probability output of the linguistic feature extraction module is connected to the second input of the weighted integration module; The probability output of the encoder classification module is connected to the third input of the weighted integration module; The probability output of the zero-sample detection module is connected to the fourth input of the weighted integration module; The weighted integration module is used to normalize and weight the AI ​​generation probabilities received from each input terminal according to the weight set and decision threshold of the corresponding language, and output the final detection result. The execution logic, integration weights, and decision thresholds for each stage of the system are configured according to language type specificity.

9. The language-aware cascaded AI-generated text detection system according to claim 8, characterized in that: Both the statistical feature extraction module and the linguistic feature extraction module have built-in XGBoost classifiers. The classifier pipeline includes a missing value imputation unit and a normalization unit, which are used to process input features with missing values ​​and output AI generation probabilities. The zero-sample detection module uses the Binoculars method to calculate the detection result by comparing the cross-entropy ratio of the base model and the instruction fine-tuning model.

10. The language-aware cascaded AI-generated text detection system according to claim 8, characterized in that, It also includes a domain adaptive training module; the model output end of the domain adaptive training module is connected to the model update end of the encoder classification module, and is used to output the updated encoder model parameters; The domain adaptive training module includes an oversampling unit, a hybrid training unit, and a dual-track verification unit. The dual-track verification unit has built-in original domain degradation threshold verification logic, which is used to perform domain adaptive updates on the encoder classification module model through the oversampling continuous learning method.