Terminal anti-fraud method and device based on large language model distillation and medium
By using large language model distillation technology, the causal reasoning capabilities of the cloud are compressed into a small model on the terminal device, which solves the problem of insufficient causal chain parsing capabilities on the terminal device. This enables accurate detection and real-time warning of fraudulent calls on the terminal device, thus protecting user privacy.
Patent Information
- Application Number
- CN202511258662.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-12-16
AI Technical Summary
Existing technologies for identifying telecom fraud on terminal devices are limited by computing power and privacy protection, making it impossible to accurately analyze the causal chain of fraudulent calls, resulting in a high false alarm rate and failure to protect user privacy.
By employing large language model distillation technology, the multi-step causal reasoning capabilities of the cloud are compressed into a small model on the terminal device. Through the MoE-Transformer architecture and the third-order distillation loss function, causal chain parsing and real-time detection are achieved on the terminal side.
It achieves accurate causal chain analysis on terminal devices, reduces false alarm rate, protects user privacy, and can still effectively detect fraudulent calls in weak network environments.
Smart Images

Figure CN121151902A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of mobile terminal security technology, and in particular to a terminal anti-fraud method, device and medium based on large language model distillation. Background Technology
[0002] Telecommunications fraud remains one of the most harmful crimes today, with numerous victims losing significant sums of money daily. Therefore, prevention of fraudulent calls is urgently needed. Currently, there are three main anti-fraud solutions. First, telecommunications operators, based on the VoLTE AS technology architecture, build voice quality inspection platforms. Calls are recorded and transcribed in the cloud, then subjected to deep semantic analysis to identify fraudulent calls. Fraudulent numbers are then shut down / blocked, and victims are alerted. Second, basic speech-to-text transcription and keyword filtering are performed on the terminal. When high-risk keywords are triggered, encrypted text is uploaded to the cloud, where a large cloud model performs deep semantic analysis, and the results are returned to the terminal as an alert. Third, the cloud-based Transformer model is transferred to the terminal's RNN model via attention matrix distillation to perform fraud detection locally.
[0003] However, performing semantic recognition of user calls in the cloud requires uploading the call text for analysis, which infringes on user privacy and is neither feasible nor widely applicable. Furthermore, it suffers from significant response delays in weak network environments, missing the critical window for intervention against fraud, and its functionality may even be completely ineffective without a network connection. Most importantly, current telecom fraud exhibits highly logical characteristics, with typical rhetoric containing tight causal chains. Anti-fraud models in traditional terminals (such as smartphones and IoT devices) are limited by the terminal's computing power and the need for lightweight models, and can only learn co-occurrence relationships at the lexical level. They cannot analyze the multi-step causal reasoning chains in the semantics of fraudulent calls, resulting in poor generalization ability and a high false alarm rate.
[0004] Therefore, there is an urgent need for a method that can accurately and in real-time analyze the causal chain of fraudulent phone calls, under the conditions of limited computing power of terminal devices and ensuring that user privacy is not compromised. Summary of the Invention
[0005] This application provides a terminal anti-fraud method based on large language model distillation, which realizes localized fraud semantic analysis without cloud collaboration. It solves the problems of high false alarm rate, privacy leakage and poor ability to identify new types of fraud caused by traditional terminal anti-fraud solutions that rely on keyword matching. It is especially suitable for real-time fraud defense in scenarios with limited computing power, such as smartphones and IoT devices.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides a terminal anti-fraud method based on large language model distillation, comprising:
[0008] In the cloud device, a historical fraud corpus is obtained, and the data in the fraud corpus is preprocessed;
[0009] The preprocessed fraud corpus is input into the teacher's big language model. Based on the preset basic template and causal tree generation algorithm, the teacher's big language model is controlled to output reasoning logic step by step to obtain the original thought chain.
[0010] The original thought chain is calibrated and filtered for confidence level to obtain a structured thought chain library;
[0011] Send the structured thinking chain library to the terminal device and extract the logical structure of the structured thinking chain library;
[0012] Based on the aforementioned logical structure, the structured thinking chain library is distilled into a micro-model in the terminal device. During the distillation process, the distillation effect is constrained by the distillation loss function to obtain the student model.
[0013] The student model is deployed in the terminal device based on the MoE-Transformer architecture;
[0014] The student model is used to process call data in the terminal device in real time to generate corresponding risk levels and warning alerts.
[0015] After processing the high-risk text, a cluster center vector and the number of samples are generated to obtain the cluster centers, and the cluster centers are uploaded to the cloud device.
[0016] After receiving the clustering center, the cloud device performs novel fraud pattern identification, encrypted aggregation, and knowledge distillation on the clustering center, and inputs the teacher's large language model to generate a new structured thinking chain library.
[0017] Based on the new structured thinking chain library, a thinking increment package is generated and sent to the terminal device.
[0018] The terminal device optimizes the student model based on the incremental package.
[0019] In a preferred embodiment of this application, the preprocessing of the fraud corpus data may further include:
[0020] Whisper-large-v3 was used to generate timestamped speech-to-text transcripts from the audio data of the fraud corpus;
[0021] Align the timestamps of the transcribed speech text and audio data.
[0022] In a preferred embodiment of this application, the distillation process may be further configured such that the distillation effect is constrained by a distillation loss function, including:
[0023] During the distillation process, the distillation effect is constrained by the output distribution loss function, the path structure loss function, and the temporal feature loss function.
[0024] The output distribution loss function is associated with the Softmax probability distribution of the student model and the teacher's large language model to align the risk decisions of the two, and the risk decisions include at least risk level and early warning reminders.
[0025] The path structure loss function is associated with the Frobenius distance of the inter-step transition matrix in the student model and the teacher's large language model, and is used to transfer the inference logic chain.
[0026] The temporal feature loss function is associated with the MAE error of the duration of each step in the student model and the teacher's large language model, and is used to learn the rhythm pattern of speech.
[0027] In a preferred embodiment of this application, the MoE-Transformer architecture may be further configured to include an expert router, an identity analysis expert, a crisis creation expert, and a inducement behavior expert. The expert router performs semantic analysis on the input call data and automatically triggers one or more of the identity analysis expert, crisis creation expert, and inducement behavior expert based on the semantic analysis results.
[0028] The identity analysis expert, crisis creation expert, and inducement behavior expert are all built based on Transformer.
[0029] In a preferred example of this application, the student model can be further configured such that its sub-modules include at least an ASR, a semantic splitter, an identity expert, a crisis expert, a guidance expert, and a full model aggregation layer. The real-time processing of call data from the terminal device using the student model includes:
[0030] Receive the user's voice stream during a call and convert the voice stream into call text using ASR;
[0031] The call text is input into the semantic splitter, which sends the text to one or more of the identity expert, crisis expert, and inducement expert based on the semantics of the call text.
[0032] The model aggregation layer receives data from identity experts, crisis experts, and inducement experts, aggregates them according to preset weights, and makes a decision at the end of each frame processing.
[0033] In a preferred embodiment of this application, the step of processing the high-risk text to generate the cluster center vector and the number of samples includes:
[0034] The intercepted high-risk call texts on the terminal are vectorized to obtain mathematical vectors;
[0035] Add Laplace noise to the mathematical vector, with the noise intensity controlled by a privacy parameter, to obtain a noisy vector;
[0036] The noisy vector is processed by mini-batch K-means clustering to obtain the cluster center vector and the number of samples.
[0037] Secondly, this application provides a terminal anti-fraud device based on large language model distillation, the device comprising:
[0038] The cloud data acquisition module is used to acquire historical fraud corpora from cloud devices and preprocess the data in the fraud corpora.
[0039] The thought chain generation module is used to input the preprocessed fraud corpus into the teacher's big language model, and control the teacher's big language model to output reasoning logic step by step based on the preset basic template and causal tree generation algorithm to obtain the original thought chain; the original thought chain is calibrated and filtered to obtain the structured thought chain library.
[0040] The distillation module is used to send the structured thinking chain library to the terminal device and extract the logical structure of the structured thinking chain library; based on the logical structure, the structured thinking chain library is distilled into a micro-model in the terminal device. During the distillation process, the distillation effect is constrained by the distillation loss function to obtain the student model.
[0041] The terminal operation module is used to deploy the student model in the terminal device based on the MoE-Transformer architecture; and to use the student model to process the call data in the terminal device in real time to generate corresponding risk levels and early warning reminders.
[0042] The federated optimization module processes high-risk text to generate cluster center vectors and sample counts, obtaining cluster centers, which are then uploaded to the cloud device. Upon receiving the cluster centers, the cloud device performs novel fraud pattern identification, encrypted aggregation, and knowledge distillation on them, and inputs this data into the teacher's large language model to generate a new structured thinking chain library. Based on this new structured thinking chain library, it generates a thinking increment package and sends it to the terminal device. The terminal device then optimizes the student model based on the increment package.
[0043] Thirdly, this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the terminal anti-fraud method based on large language model distillation as described in any of the preceding claims.
[0044] Fourthly, this application provides a computer-readable storage medium storing a program, wherein when the program is executed by a processor, it implements the terminal anti-fraud method based on large language model distillation as described in any of the preceding claims.
[0045] Fifthly, this application provides a computer program product including computer instructions that, when executed by a processor, implement the steps of the C method as described in any of the preceding claims.
[0046] In summary, compared with the prior art, the beneficial effects of the technical solution provided in this application include at least the following:
[0047] Existing technologies that record user calls in the cloud, convert them to text, perform semantic recognition, and then use this information to alert or block victims constitute an infringement of user privacy and are not feasible or widely applicable. The method proposed in this application can run a semantic analysis model with causal chain reasoning capabilities locally on the terminal side, ensuring that user privacy is not leaked and that anti-fraud detection and early warning can be successfully implemented during calls even in weak network environments.
[0048] The method in this application uses chain distillation technology to compress the multi-step causal reasoning capability of a cloud-based large language model into a micro-model. By using a third-order distillation loss function to synchronously transfer logical paths and temporal distribution characteristics, the student model can accurately reproduce the teacher model's chain-like parsing capability of fraudulent talk under low computing power constraints. This enables the local execution of the LLM large language model on the terminal side, overcoming the limitation of traditional attention distillation which can only capture word co-occurrence, and achieving accurate monitoring of fraudulent calls. Attached Figure Description
[0049] Figure 1 A flowchart illustrating a terminal anti-fraud method based on large language model distillation, provided as an embodiment of this application.
[0050] Figure 2 A causal tree generation algorithm diagram for a terminal anti-fraud method based on large language model distillation, provided as an embodiment of this application.
[0051] Figure 3 A flowchart illustrating the confidence calibration and filtering process of a terminal anti-fraud method based on large language model distillation, provided as an embodiment of this application.
[0052] Figure 4The architecture flowchart of the MoE-Transformer for a terminal anti-fraud method based on large language model distillation provided in one embodiment of this application.
[0053] Figure 5 This is a schematic diagram illustrating the collaborative process of each module in the MoE-Transformer architecture of a terminal anti-fraud method based on large language model distillation, provided as an embodiment of this application.
[0054] Figure 6 This is an execution architecture diagram of a terminal anti-fraud method based on large language model distillation provided in one embodiment of this application, when processing call data in the terminal device in real time.
[0055] Figure 7 This application provides a flowchart of cloud-based encrypted aggregation and knowledge distillation for a terminal anti-fraud method based on large language model distillation, as an embodiment of this application.
[0056] Figure 8 This application provides a flowchart of a targeted expert distillation process for a terminal anti-fraud method based on large language model distillation, as an embodiment of the present application.
[0057] Figure 9 This document presents a terminal incremental deployment and effect feedback diagram of a terminal anti-fraud method based on large language model distillation, provided as an embodiment of this application.
[0058] Figure 10 This document presents a traffic allocation strategy diagram for a terminal anti-fraud method based on large language model distillation, as provided in one embodiment of this application.
[0059] Figure 11 This is a cloud-based decision logic diagram of a terminal anti-fraud method based on large language model distillation, provided as an embodiment of this application.
[0060] Figure 12 This is a block diagram of a terminal anti-fraud device based on large language model distillation, provided as an embodiment of this application. Detailed Implementation
[0061] 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, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0062] In one embodiment of this application, a terminal anti-fraud method based on large language model distillation is provided. Please refer to [link to relevant documentation]. Figure 1 As shown, the method includes:
[0063] S100: In the cloud device, obtain the historical fraud corpus and preprocess the data in the fraud corpus.
[0064] Specifically, a historical fraud corpus is acquired from the operator's cloud devices to construct a fraud corpus. The data source for the fraud corpus includes historical fraud recordings from the operator (more than 1 million, including dialect and voice-changing samples).
[0065] The data from the fraud corpus is then preprocessed. Whisper-large-v3 is used to generate timestamped transcribed text, converting the spoken conversation into text and aligning the timestamps, for example:
[0066] [0:12-0:15] "I am a bank customer service representative" → Excerpt 1
[0067] [0:16-0:20] "Your account is abnormal" → Segment 2
[0068] S200: The preprocessed fraud corpus is input into the teacher's large language model. Based on a preset basic template and a causal tree generation algorithm, the teacher's large language model is controlled to output reasoning logic step by step to obtain the original thought chain. The original thought chain is then calibrated and filtered for confidence to obtain a structured thought chain library. The causal tree generation algorithm is as follows: Figure 2 As shown.
[0069] Specifically, a layered prompting process is implemented, forcing the teacher's Large Language Model (LLM) to output reasoning logic step by step based on a basic template, for example:
[0070] Please analyze the risks of the dialogue using the following structure:
[0071] 1. Identity Verification: {Yes / No} (Is the claimed identity credible?)
[0072] 2. Crisis Assumption: {Yes / No} (Will an emergency be created?)
[0073] 3. Inducement behaviors: {behavior type} (e.g., transferring money, issuing verification codes, clicking links)
[0074] 4. Conclusion: Risk level (low / medium / high)
[0075] Furthermore, the adversarial enhancement of the teacher's large language model can be achieved by adding obfuscating words to impede robust training.
[0076] Furthermore, to address the systematic bias in LLM output probabilities (such as a preference for high-risk labels), the original thought chain is subjected to confidence calibration and filtering, as follows: Figure 3 As shown. Specifically, an example of the filtering process is as follows:
[0077] LLM raw output: {"step1":{"text":"claiming to be from the Medical Insurance Bureau","confidence":0.92},"step2":{"text":"claiming that the medical insurance card is abnormal","confidence":0.88},"step3":{"text":"requesting bank card number","confidence":0.76}, / / Inducement behavior confidence is too low"conclusion":"high risk"}.
[0078] The filtering process is as follows:
[0079] 1. Post-calibration confidence level for step 3: 0.76 → 0.63 (< 0.85 threshold)
[0080] 2. Triggering rule R001 conflict (trustworthy identity + induced behavior)
[0081] 3. Outcome: If the mandatory upgrade conclusion is deemed high-risk, the case will proceed to the manual review queue; after expert confirmation, step 3 will be revised, with the confidence level adjusted to 0.91 (due to the sensitive nature of "providing a bank card").
[0082] Final data entered into the database: {..."step3":{"text":"Requires bank card number","confidence":0.91}, / / Confidence correction"calibration_log":"R001 Forced upgrade + manual confirmation"}.
[0083] By employing the above methods, the reliability of the structured thought chain library can be ensured. After filtering out low-quality thought chains, the convergence speed of subsequent terminal model training can be significantly improved.
[0084] The final output is a structured thought chain library, with each thought chain containing reasoning steps, timestamps, and risk tags.
[0085] S300: Send the structured thinking chain library to the terminal device and extract the logical structure of the structured thinking chain library; based on the logical structure, distill the structured thinking chain library into a micro-model in the terminal device, and constrain the distillation effect through a distillation loss function during the distillation process to obtain the student model.
[0086] Specifically, the process begins with knowledge deconstruction and logic tree extraction. A structured thought chain library is then created. The steps include constructing a causal dependency graph, calculating the transition weights between steps, extracting critical paths (edges with a risk increase > 0.2), and finally outputting the logic tree structure.
[0087] Then, using a dedicated distillation loss function, the knowledge chain of the teacher model is transferred to the micro-model in the terminal device. The micro-model is trained to obtain a good student model through three types of distillation loss function constraints, including the three types of functions shown in Table 1.
[0088]
[0089]
[0090] Table 1. Composition and Function of Distillation Loss Function
[0091] S400: Deploy the student model in the terminal device based on the MoE-Transformer architecture; use the student model to process call data in the terminal device in real time, and generate corresponding risk levels and early warning reminders.
[0092] Specifically, the architecture of the MoE-Transformer is as follows: Figure 4 As shown in Table 2, the expert router automatically triggers three types of experts based on semantic analysis. The semantic type classifier is a lightweight BERT model. The division of labor among the three expert models is shown in Table 2.
[0093]
[0094] Table 2
[0095] The collaborative process diagram of each module in the MoE-Transformer architecture is shown below. Figure 5 As shown.
[0096] When the student model is used to process call data in the terminal device in real time, the architecture executed is as follows: Figure 6 As shown. A four-stage pipeline architecture is used to achieve parallel streaming processing of the entire model. The specific process is as follows:
[0097] 1. Real-time frame segmentation of the audio stream (200ms / frame)
[0098] The raw audio stream captured by the terminal microphone is divided into continuous frames (with a 50ms overlap between frames) by the preprocessing module in a 200ms time window. Each frame of audio is transcribed into a timestamped text segment in real time by the distilled Whisper model.
[0099] 2. Dynamic routing based on semantic type
[0100] A lightweight semantic classifier performs real-time analysis of text fragments, categorizing them into three semantic channels based on a first-word trigger + keyword matching strategy:
[0101] Identity-related semantics (e.g., "I am the Medical Insurance Bureau") → Routing to identity analysis expert
[0102] Crisis-related semantics (such as "account abnormality") → routed to crisis creation expert
[0103] Inducement-based semantics (e.g., "click the link") → routed to inducement behavior expert
[0104] 3. Three-Expert Parallel Reasoning
[0105] Three expert modules execute inference in parallel on a dedicated NPU core (mutex locks ensure resource contention safety):
[0106] Identity analysis expert: Verify the legitimacy of the self-proclaimed organization (check the local authoritative whitelist).
[0107] Crisis creation expert: Assessing the authenticity of a crisis (comparing it to common sense knowledge base)
[0108] Induced Behavior Expert: Scanning for High-Risk Operation Instructions (Dynamic Regular Expression Engine)
[0109] 4. Dynamic weighted aggregation and circuit breaker decision-making
[0110] The expert outputs are aggregated according to preset weights (identity: crisis: inducement = 0.3:0.4:0.3), and a decision is made at the end of each frame processing:
[0111] Overall risk > 0.95 → Circuit breaker mechanism triggered immediately (strong blocking + alarm)
[0112] Risk level 0.7 ≤ Risk level ≤ 0.95 → Real-time enhanced risk warning (red flashing screen + vibration)
[0113] Risk < 0.7 → Silent monitoring.
[0114] S500: After processing the high-risk text, a cluster center vector and sample count are generated to obtain cluster centers, which are then uploaded to the cloud device. Upon receiving the cluster centers, the cloud device performs novel fraud pattern identification, encrypted aggregation, and knowledge distillation on the cluster centers, and inputs them into the teacher's large language model to generate a new structured thinking chain library. Based on the new structured thinking chain library, a thinking increment package is generated and sent to the terminal device. The terminal device optimizes the student model based on the increment package.
[0115] Specifically, the S500 is triggered each time the terminal model identifies high-risk text, for dynamic federated learning. The high-risk call text processing process intercepted by the terminal includes:
[0116] Step 1, Text Vectorization. Input high-risk call text fragments intercepted by the terminal (e.g., "Your medical insurance card is abnormal and requires transfer verification"). Use a lightweight semantic vector model (a distilled version of SBERT) to convert the text into mathematical vectors. The model outputs a 768-dimensional feature vector, with each dimension representing a specific semantic feature (e.g., "transfer" corresponds to a financial operation dimension). The model size is only 45MB (INT8 quantization), allowing smooth operation even on budget devices. Semantic abstraction: Original text → Mathematical vector (text cannot be reversed).
[0117] Step 2, Differential Privacy Noise Addition. Laplace noise is added to the generated vector, with the noise intensity controlled by the privacy parameter ε (ε = 0.5). The noisy vector = original vector + Lap(0, ∈ 1). The recognition risk for a single text is <0.3% (meets GDPR requirements). The noise distribution is a Gaussian perturbation centered on the original vector with a standard deviation of 2.0.
[0118] Step 3, Unsupervised Clustering. Mini-batch K-means clustering is used. The input is a noisy vector set (e.g., 100 vectors). Five cluster centers are randomly initialized (representing five potential fraud patterns). The process is iterated 100 times, assigning vectors to the nearest cluster center. In each round, the cluster center positions are updated (moved to the mean point of the vectors within the cluster). The five cluster center vectors represent typical features of each fraud pattern, and the number of samples in each cluster is specified (e.g., cluster 1 has 20 samples).
[0119] Step 4, Feature De-identification and Upload. Only the cluster center vectors and sample count are uploaded to the cloud; no original text or user information is included.
[0120] The above steps achieve feature-level desensitization, keeping the original text on the cloud and only uploading the cluster center vector. The cloud is unaware of the specific wording content and does not involve user privacy.
[0121] Then, cloud-based encrypted aggregation and knowledge distillation are performed. After receiving the clustering center, the cloud device identifies new fraud patterns, performs encrypted aggregation and knowledge distillation on the clustering center, and inputs the teacher's large language model to generate a new structured thought chain library. The process is as follows: Figure 7 As shown, the specific process is as follows;
[0122] Step 1, Differential Privacy Aggregation. Input the cluster center vector Ci and the number of samples Ni uploaded by each terminal. The global cluster center is output by weighted averaging of the cluster centers uploaded by all terminals, injecting Laplace noise, and then summing the results. The output is the de-identified global center vector DP_Center (e.g., [0.31, -0.77, ..., 0.44]), and the aggregated metadata is the total number of samples ∑Ni (e.g., 10, 258).
[0123] Step 2: New Fraud Pattern Identification. Input data consists of the target detection center: the global clustering center DP_Center (768-dimensional vector) after differential privacy aggregation. The known pattern library is the set of registered fraud pattern center vectors [Known1,Known2,...,Knownm]. Processing flow: 1. Calculate the minimum similarity; traverse all known pattern centers Knownj and calculate their cosine similarity with DP_Center; record the minimum value min_sim among all similarities. The technical significance of cosine similarity is shown in Table 3.
[0124]
[0125] Table 3. Technical significance of cosine similarity
[0126] Judgment criteria:
[0127] min_sim < 0.3: Significantly different from all known patterns → Strong new type of fraud;
[0128] 0.3≤min_sim≤0.6: Partial feature matching of known patterns → hybrid variant fraud (requires manual review);
[0129] min_sim>0.6: High-level match to a known pattern → known pattern (no processing required).
[0130] The output result is:
[0131] Conclusion Tags: New Type of Fraud / Hybrid Fraud / Known Pattern
[0132] Evidence data: ID of the most similar known pattern (e.g., Known 5); minimum similarity value (e.g., 0.28).
[0133] Step 3, Mind Chain Generation (LLM-driven). Input is a differential privacy aggregation center. Hint: You are an anti-fraud expert. Please generate a fraud inference chain based on the following features. Feature vector: [Government Impersonation: 0.85, Emergency Event: 0.92, Induced Transfer: 0.88]. Requirements:
[0134] 1. Three-step reasoning: Identity assertion → Crisis creation → Induced behavior
[0135] 2. Output the risk probability at each step.
[0136] 3. Conclusion: Identify the type of fraud.
[0137] LLM output example:
[0138]
[0139] Step 4, Targeted expert distillation. The distillation process is as follows: Figure 8 As shown.
[0140] Incremental deployment of terminals and feedback on results, such as Figure 9 As shown. The steps include:
[0141] Step 1: Security Decryption and Hot Update
[0142] Input: An encrypted incremental data packet (.delta format) distributed from the cloud.
[0143] Processing flow:
[0144] 1. Trusted Execution Environment (TEE) Decryption
[0145] Decrypt incremental packets in the terminal TEE security zone (such as Qualcomm SE / Huawei TEE OS).
[0146] 2. Dynamic hot update model
[0147] Update only the parameters of the target expert module (such as the induced behavior expert).
[0148] Step 2: A / B testing of traffic allocation strategy, such as... Figure 10 As shown.
[0149] Execution logic:
[0150] Grouping: Assign a unique group ID (new / old) to each call. Parallel execution: Run the new and old models simultaneously (to ensure comparability of results). Data records are shown in Table 4.
[0151]
[0152] Table 4 Data Records
[0153] Step 3: Effectiveness Evaluation. The effectiveness evaluation is shown in Table 5.
[0154]
[0155] Table 5. Effectiveness Evaluation
[0156] Step 4: Feedback Decision-Making Closed Loop
[0157] Terminal feedback data:
[0158]
[0159] Step 5: Cloud-based decision-making logic as follows Figure 11 As shown.
[0160] The following is an example of intercepting variants of medical insurance fraud:
[0161] Day 1:
[0162] Terminal A discovers a new sales pitch: "Funds need to be frozen if medical insurance card is fraudulently used" → Local clustering generates feature vector V1
[0163] Day 1 + 3 hours:
[0164] Cloud aggregation of data from 100,000 devices → identification of V1 as a new mode → generation of incremental packages
[0165] Day 1 + 3.5 hours:
[0166] Terminal receives update → Warning / Blocks similar scams
[0167] Results: The interception rate of variant scams has been rapidly improved.
[0168] In some embodiments, the distillation process constrains the distillation effect through a distillation loss function, including:
[0169] During the distillation process, the distillation effect is constrained by the output distribution loss function, the path structure loss function, and the temporal feature loss function.
[0170] The output distribution loss function is associated with the Softmax probability distribution of the student model and the teacher's large language model to align the risk decisions of the two, and the risk decisions include at least risk level and early warning reminders.
[0171] The path structure loss function is associated with the Frobenius distance of the inter-step transition matrix in the student model and the teacher's large language model, and is used to transfer the inference logic chain.
[0172] The temporal feature loss function is associated with the MAE error of the duration of each step in the student model and the teacher's large language model, and is used to learn the rhythm pattern of speech.
[0173] In some embodiments, the MoE-Transformer architecture includes an expert router, an identity analysis expert, a crisis creation expert, and a inducement behavior expert. The expert router performs semantic analysis on the input call data and automatically triggers one or more of the identity analysis expert, crisis creation expert, and inducement behavior expert based on the semantic analysis results.
[0174] The identity analysis expert, crisis creation expert, and inducement behavior expert are all built based on Transformer.
[0175] In this embodiment, the existing technology records user calls in the cloud, converts them to text, performs semantic recognition, and then alerts or intercepts victims. This is an infringement of user privacy and is not feasible or scalable. The method proposed in this application can run a semantic analysis model with causal chain reasoning function locally on the terminal side, which can ensure that user privacy is not leaked, and can successfully achieve anti-fraud detection and early warning during calls even in weak network environments.
[0176] The method in this application uses chain distillation technology to compress the multi-step causal reasoning capability of a cloud-based large language model into a micro-model. By using a third-order distillation loss function to synchronously transfer logical paths and temporal distribution characteristics, the student model can accurately reproduce the teacher model's chain-like parsing capability of fraudulent talk under low computing power constraints. This enables the local execution of the LLM large language model on the terminal side, overcoming the limitation of traditional attention distillation which can only capture word co-occurrence, and achieving accurate monitoring of fraudulent calls.
[0177] In some embodiments, the student model's sub-modules include at least an ASR (Automatic Sentence Recognition), a semantic splitter, an identity expert, a crisis expert, a guidance expert, and a full model aggregation layer. The real-time processing of call data in the terminal device using the student model includes:
[0178] Receive the user's voice stream during a call and convert the voice stream into call text using ASR;
[0179] The call text is input into the semantic splitter, which sends the text to one or more of the identity expert, crisis expert, and inducement expert based on the semantics of the call text.
[0180] The model aggregation layer receives data from identity experts, crisis experts, and inducement experts, aggregates them according to preset weights, and makes a decision at the end of each frame processing.
[0181] In some embodiments, the process of processing high-risk text to generate cluster center vectors and sample numbers includes:
[0182] The intercepted high-risk call texts on the terminal are vectorized to obtain mathematical vectors;
[0183] Add Laplace noise to the mathematical vector, with the noise intensity controlled by a privacy parameter, to obtain a noisy vector;
[0184] The noisy vector is processed by mini-batch K-means clustering to obtain the cluster center vector and the number of samples.
[0185] In some embodiments, the distillation process constrains the distillation effect through a distillation loss function, including:
[0186] During the distillation process, the distillation effect is constrained by the output distribution loss function, the path structure loss function, and the temporal feature loss function.
[0187] The output distribution loss function is associated with the Softmax probability distribution of the student model and the teacher's large language model to align the risk decisions of the two, and the risk decisions include at least risk level and early warning reminders.
[0188] The path structure loss function is associated with the Frobenius distance of the inter-step transition matrix in the student model and the teacher's large language model, and is used to transfer the inference logic chain.
[0189] The temporal feature loss function is associated with the MAE error of the duration of each step in the student model and the teacher's large language model, and is used to learn the rhythm pattern of speech.
[0190] In some embodiments, the MoE-Transformer architecture includes an expert router, an identity analysis expert, a crisis creation expert, and a inducement behavior expert. The expert router performs semantic analysis on the input call data and automatically triggers one or more of the identity analysis expert, crisis creation expert, and inducement behavior expert based on the semantic analysis results.
[0191] The identity analysis expert, crisis creation expert, and inducement behavior expert are all built based on Transformer.
[0192] This application also provides a terminal anti-fraud device based on large language model distillation; please refer to [link to relevant documentation]. Figure 12 As shown, the device includes:
[0193] The cloud data acquisition module 100 is used to acquire historical fraud corpora from cloud devices and preprocess the data in the fraud corpus.
[0194] The thought chain generation module 200 is used to input the preprocessed fraud corpus into the teacher's big language model, and control the teacher's big language model to output reasoning logic step by step based on the preset basic template and causal tree generation algorithm to obtain the original thought chain; the original thought chain is calibrated and filtered to obtain the structured thought chain library.
[0195] The distillation module 300 is used to send the structured thinking chain library to the terminal device and extract the logical structure of the structured thinking chain library; based on the logical structure, the structured thinking chain library is distilled into a micro-model in the terminal device, and the distillation effect is constrained by the distillation loss function during the distillation process to obtain the student model;
[0196] The terminal operation module 400 is used to deploy the student model in the terminal device based on the MoE-Transformer architecture; and to use the student model to process the call data in the terminal device in real time to generate corresponding risk levels and early warning reminders.
[0197] The federated optimization module 500 processes high-risk text to generate cluster center vectors and sample counts, obtaining cluster centers, and uploads the cluster centers to the cloud device. Upon receiving the cluster centers, the cloud device performs novel fraud pattern identification, encrypted aggregation, and knowledge distillation on the cluster centers, and inputs this data into the teacher's large language model to generate a new structured thinking chain library. Based on the new structured thinking chain library, it generates a thinking increment package and sends the thinking increment package to the terminal device. The terminal device optimizes the student model based on the increment package.
[0198] The functional implementation of each module in the above-mentioned terminal anti-fraud device based on large language model distillation corresponds to the steps in the above-mentioned terminal anti-fraud method embodiment based on large language model distillation. Their functions and implementation processes will not be described in detail here.
[0199] This application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the terminal anti-fraud method based on large language model distillation as described in any of the above embodiments.
[0200] This application also provides a computer-readable storage medium on which a program is stored. The computer-readable storage medium refers to a data storage medium, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The working process, details, and technical effects of the computer-readable storage medium provided in this embodiment can be found in the above embodiment regarding a terminal anti-fraud method based on large language model distillation, and will not be repeated here.
[0201] The application also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the terminal anti-fraud method based on large language model distillation as described in any of the above embodiments.
[0202] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).
[0203] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A terminal anti-fraud method based on large language model distillation, characterized in that, include: In the cloud device, a historical fraud corpus is obtained, and the data in the fraud corpus is preprocessed; The preprocessed fraud corpus is input into the teacher's big language model. Based on the preset basic template and causal tree generation algorithm, the teacher's big language model is controlled to output reasoning logic step by step to obtain the original thought chain. The original thought chain is calibrated and filtered for confidence level to obtain a structured thought chain library; Send the structured thinking chain library to the terminal device and extract the logical structure of the structured thinking chain library; Based on the aforementioned logical structure, the structured thinking chain library is distilled into a micro-model in the terminal device. During the distillation process, the distillation effect is constrained by the distillation loss function to obtain the student model. The student model is deployed in the terminal device based on the MoE-Transformer architecture; The student model is used to process call data in the terminal device in real time to generate corresponding risk levels and warning alerts. After processing the high-risk text, a cluster center vector and the number of samples are generated to obtain the cluster centers, and the cluster centers are uploaded to the cloud device. After receiving the clustering center, the cloud device performs novel fraud pattern identification, encrypted aggregation, and knowledge distillation on the clustering center, and inputs the teacher's large language model to generate a new structured thinking chain library. Based on the new structured thinking chain library, a thinking increment package is generated and sent to the terminal device. The terminal device optimizes the student model based on the incremental package.
2. The terminal anti-fraud method based on large language model distillation according to claim 1, characterized in that, The preprocessing of the data in the fraud corpus includes: Whisper-large-v3 was used to generate timestamped speech-to-text transcripts from the audio data of the fraud corpus; Align the timestamps of the transcribed speech text and audio data.
3. The terminal anti-fraud method based on large language model distillation according to claim 1, characterized in that, The distillation process constrains the distillation effect through a distillation loss function, including: During the distillation process, the distillation effect is constrained by the output distribution loss function, the path structure loss function, and the temporal feature loss function. The output distribution loss function is associated with the Softmax probability distribution of the student model and the teacher's large language model to align the risk decisions of the two, and the risk decisions include at least risk level and early warning reminders. The path structure loss function is associated with the Frobenius distance of the inter-step transition matrix in the student model and the teacher's large language model, and is used to transfer the inference logic chain. The temporal feature loss function is associated with the MAE error of the duration of each step in the student model and the teacher's large language model, and is used to learn the rhythm pattern of speech.
4. The terminal anti-fraud method based on large language model distillation according to claim 2, characterized in that, The MoE-Transformer architecture includes an expert router, an identity analysis expert, a crisis creation expert, and a inducement behavior expert. The expert router performs semantic analysis on the input call data and automatically triggers one or more of the identity analysis expert, crisis creation expert, and inducement behavior expert based on the semantic analysis results. The identity analysis expert, crisis creation expert, and inducement behavior expert are all built based on Transformer.
5. The terminal anti-fraud method based on large language model distillation according to claim 4, characterized in that, The student model's sub-modules include at least ASR, a semantic splitter, an identity expert, a crisis expert, a guidance expert, and a full model aggregation layer. The real-time processing of call data from the terminal device using the student model includes: Receive the user's voice stream during a call and convert the voice stream into call text using ASR; The call text is input into the semantic splitter, which sends the text to one or more of the identity expert, crisis expert, and inducement expert based on the semantics of the call text. The model aggregation layer receives data from identity experts, crisis experts, and inducement experts, aggregates them according to preset weights, and makes a decision at the end of each frame processing.
6. The terminal anti-fraud method based on large language model distillation according to claim 1, characterized in that, The process of processing high-risk text to generate cluster center vectors and sample numbers includes: The intercepted high-risk call texts on the terminal are vectorized to obtain mathematical vectors; Add Laplace noise to the mathematical vector, with the noise intensity controlled by a privacy parameter, to obtain a noisy vector; The noisy vector is processed by mini-batch K-means clustering to obtain the cluster center vector and the number of samples.
7. A terminal anti-fraud device based on large language model distillation, characterized in that, include: The cloud data acquisition module is used to acquire historical fraud corpora from cloud devices and preprocess the data in the fraud corpora. The thought chain generation module is used to input the preprocessed fraud corpus into the teacher's big language model, and control the teacher's big language model to output reasoning logic step by step based on the preset basic template and causal tree generation algorithm to obtain the original thought chain; the original thought chain is calibrated and filtered to obtain the structured thought chain library. The distillation module is used to send the structured thinking chain library to the terminal device and extract the logical structure of the structured thinking chain library; based on the logical structure, the structured thinking chain library is distilled into a micro-model in the terminal device. During the distillation process, the distillation effect is constrained by the distillation loss function to obtain the student model. The terminal operation module is used to deploy the student model in the terminal device based on the MoE-Transformer architecture; and to use the student model to process the call data in the terminal device in real time to generate corresponding risk levels and early warning reminders. The federated optimization module processes high-risk text to generate cluster center vectors and sample counts, obtaining cluster centers, and uploads these cluster centers to the cloud device. Upon receiving the cluster centers, the cloud device performs novel fraud pattern identification, encrypted aggregation, and knowledge distillation on them, and inputs the teacher's large language model to generate a new structured thinking chain library. Based on this new structured thinking chain library, it generates a thinking increment package and sends the thinking increment package to the terminal device. The terminal device optimizes the student model based on the incremental package.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the terminal anti-fraud method based on large language model distillation as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program, wherein when the program is executed by a processor, it implements the terminal anti-fraud method based on large language model distillation as described in any one of claims 1 to 6.
10. A computer program product comprising computer instructions, characterized in that, When executed by a processor, the computer instructions implement the steps of the terminal anti-fraud method based on large language model distillation as described in any one of claims 1 to 6.