Risk identification model training method, risk identification method and related device
By training and optimizing the large language model in stages and constraining the output length, the problem of high computational resource consumption of the large language model in financial risk control is solved, and fast, low-latency risk identification and control are achieved.
Patent Information
- Application Number
- CN202512040988.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-02-10
AI Technical Summary
Existing risk identification methods based on large language models in financial risk control require a large amount of computing resources, resulting in high performance requirements and response delays, making it difficult to meet the real-time needs of financial systems.
By training the large language model in stages, optimizing the model output structure, and constraining the output length, shorter recognition results are generated. Methods such as GRPO and SFT are used to guide the model to directly output risk analysis conclusions, which are then converted into implicit representations.
The model reduces the computational resource consumption, improves response speed, reduces latency, lowers the performance requirements of the deployment environment, and enables rapid risk identification and control.
Smart Images

Figure CN121504618A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to one or more embodiments in the field of risk control technology, and in particular to a training method for a risk identification model, a risk identification method, and related apparatus. Background Technology
[0002] With the development of science and technology and the increasing frequency of financial activities and even cross-border trade, regulating financial activities and identifying, preventing and reporting illegal financial activities, such as money laundering and illegal fundraising, has become an important means to ensure the stability of the financial order and the public interest.
[0003] In related technologies, illegal financial activities are identified by analyzing characteristics of financial activity data, such as transaction time, frequency, and amount, and matching them with pre-configured identification rules. However, this identification technology requires continuous maintenance and updating of the identification rules; otherwise, it may be unable to identify new types of illegal financial activities.
[0004] With the application of large language models in the field of financial risk control, a new technological direction has gradually evolved: using large language models to reason and judge the legitimacy of financial activities. However, large language models typically require significant computing resources during the reasoning process, placing high demands on the performance of related systems or devices. Summary of the Invention
[0005] This specification provides one or more embodiments of a risk identification model training method, a risk identification method, and related apparatus to improve the efficiency of risk identification for illegal financial activities and reduce the cost of risk identification.
[0006] Firstly, one or more embodiments of this specification provide a method for training a risk identification model, including: Obtain a first sample set, wherein the first sample set includes multiple first sample transaction data and corresponding first sample analysis text, and the first sample analysis text includes the analysis process and analysis conclusion for analyzing whether the first sample transaction data has a preset risk; Based on the first sample set, a preset large language model is trained to obtain a first risk identification model, which enables the first risk identification model to perform reasoning analysis on any transaction data based on the thinking chain, and generate a first analysis text containing the risk analysis process and risk analysis conclusion. The first risk identification model is optimized and trained to obtain a target risk identification model, which generates a target identification result based on arbitrary transaction data, wherein the number of tokens in the target identification result is less than the number of tokens in the first analysis text.
[0007] In the above technical solution, after obtaining a first risk identification model with high risk identification accuracy, the output structure of the model is further constrained by optimizing the training, reducing the output length of the model, that is, reducing the number of tokens in the output content. As a result, the final target risk identification model does not need to perform a lot of calculations for outputting long text, reducing the model's response latency and GPU resource consumption, reducing the model's performance requirements for the deployment environment, improving the model's deployability and stability in actual financial systems, and preventing memory overflow and other failures due to excessive output length.
[0008] In addition, by optimizing training, the above embodiments reduce the number of lexical units in the target recognition results output by the target risk recognition model, which can also reduce the parsing cost of the target recognition results output by the relevant financial system. This allows the relevant financial system to understand the target recognition results more quickly and execute relevant decisions, such as suspending transactions or sending alarm information.
[0009] In one possible implementation, optimizing and training the first risk identification model includes: Based on the second sample set and the preset reward rules, the first risk identification model is optimized and trained to obtain the second risk identification model. The second sample set includes multiple second sample transaction data; The preset reward rule includes negatively adjusting the preference score corresponding to the first analysis text when the number of lexical units in the first analysis text is greater than a first preset threshold, so as to optimize the first risk identification model based on the preference score, so that the number of lexical units in the second analysis text generated by the second risk identification model is not greater than the first preset threshold.
[0010] In the above technical solution, the output length of the trained second risk identification model is constrained within a first preset threshold. This not only preserves the accuracy of the first risk identification model in identifying preset risks, but also allows for faster inference output through shorter output text, reducing the model's inference latency, reducing the consumption of computing resources such as GPUs, and reducing the performance requirements of the deployment environment.
[0011] In one possible implementation, the preset reward rule further includes positively adjusting the preference score corresponding to the first analysis text when the risk analysis conclusion in the first analysis text is prior to the risk analysis process.
[0012] In the above technical solution, since the first risk identification model already has a high risk identification capability, the first risk identification model is optimized by setting the above-mentioned preset reward rules. This further constrains the output structure of the model without affecting the accuracy of the model's risk identification. This includes outputting risk analysis conclusions first and ensuring that the number of lexical units does not exceed the first preset threshold. As a result, the model does not need to generate risk analysis text through a long thought process. Instead, it can directly output the risk analysis conclusion as long as it can obtain a preliminary analysis conclusion on the existence or non-existence of the preset risk based on certain features in the transaction data.
[0013] Therefore, the second risk identification model trained in the above embodiments can retain the accuracy of the first analysis and identification model in identifying preset risks, and can also significantly shorten the length of the output text. This can greatly reduce the model's response latency, improve the model's response speed, reduce the model's consumption of computing resources, and reduce the performance requirements of the deployment environment. The trained model can be deployed in any financial system according to application needs without affecting the processing performance of the original transaction tasks of the financial system.
[0014] One possible implementation involves optimizing and training the first risk identification model, which further includes: Obtain a third sample set, wherein the third sample set includes multiple third sample transaction data and corresponding sample risk tags, the sample risk tags are used to identify whether the third sample transaction data has the preset risk, the number of lexical units of the sample risk tags is not greater than a second preset threshold, and the second preset threshold is less than the first preset threshold; Based on the third sample set, the second risk identification model is trained to obtain the target risk identification model, such that the number of lexical units in the target identification result is not greater than the second preset threshold.
[0015] In the above technical solution, after training a second risk identification model with a shorter output text length, the second risk identification model is further trained using a third sample set. Since the risk labels in this third sample set, with a word count not exceeding a second preset threshold, are used as training labels for the corresponding third sample transaction data, the model can be guided to associate the analysis conclusion of whether a preset risk exists with different label values. This allows the model to convert the output analysis text into the corresponding label values, further reducing the word count in the output result. This not only improves the model's response speed and reduces response latency but also lowers the parsing cost of the target identification results for the relevant financial system. This enables the relevant financial system to quickly execute response strategies based on the target identification results, such as suspending transactions or sending alarm messages, thereby effectively controlling and preventing illegal financial activities and reducing or even avoiding their impact on the financial system and financial order.
[0016] In one possible implementation, at least one of the first sample set, the second sample set, and the third sample set is created based on historical transaction data and the historical risk control information corresponding to the historical transaction data.
[0017] In one possible implementation, obtaining the third sample set includes: Obtain multiple historical transaction data entries as the third sample transaction data; The sample risk label is generated based on the historical risk control information corresponding to the third sample transaction data.
[0018] In the above technical solution, the sample sets for different training stages can be created based on the same data source, that is, they can all be created based on the historical transaction data and historical risk control information of the relevant financial system. This can reduce the workload of preparing training data, reduce the difficulty of model training, and facilitate the rapid training of a suitable target risk identification model based on different application scenarios.
[0019] Secondly, one or more embodiments of this specification provide a risk identification method, including: Obtain target transaction data from the financial system; The target transaction data is input into the target risk identification model to obtain the corresponding target identification result; The target identification result is fed back to the financial system, so that the financial system can perform relevant risk control operations based on the target identification result; The target risk identification model is a model trained based on the method described in the first aspect, and the number of lexical units in the target identification result is not greater than a preset threshold.
[0020] Thirdly, one or more embodiments of this specification provide a training apparatus for a risk identification model, comprising: The first training module acquires a first sample set and trains a preset large language model based on the first sample set to obtain a first risk identification model. The first sample set includes multiple first sample transaction data and corresponding first sample analysis text. The first sample analysis text includes the analysis process and analysis conclusion of analyzing whether the first sample transaction data has a preset risk. This enables the first risk identification model to perform reasoning analysis on any transaction data based on the thinking chain and generate a first analysis text containing the risk analysis process and risk analysis conclusion. The second training module is used to optimize and train the first risk identification model to obtain a target risk identification model, so that the target risk identification model generates a target identification result based on arbitrary transaction data, wherein the number of tokens in the target identification result is less than the number of tokens in the first analysis text.
[0021] In one possible implementation, the second training module includes: The first optimization module is used to optimize and train the first risk identification model based on the second sample set and the preset reward rules to obtain the second risk identification model. The second sample set includes multiple second sample transaction data; The preset reward rule includes negatively adjusting the preference score corresponding to the first analysis text when the number of lexical units in the first analysis text is greater than a first preset threshold, so as to optimize the first risk identification model based on the preference score, so that the number of lexical units in the second analysis text generated by the second risk identification model is not greater than the first preset threshold.
[0022] In one possible implementation, the preset reward rule further includes positively adjusting the preference score corresponding to the first analysis text when the risk analysis conclusion in the first analysis text is prior to the risk analysis process.
[0023] In one possible implementation, the second training module further includes: The second optimization module is used to acquire a third sample set and, based on the third sample set, train the second risk identification model to obtain the target risk identification model, such that the number of lexical units in the target identification result is not greater than a second preset threshold. The third sample set includes multiple third sample transaction data and corresponding sample risk labels. The sample risk labels are used to identify whether the third sample transaction data has the preset risk. The number of lexical units in the sample risk labels is not greater than the second preset threshold, and the second preset threshold is less than the first preset threshold.
[0024] Fourthly, one or more embodiments of this specification also provide a risk identification device, including: The acquisition module is used to acquire target transaction data from the financial system. The identification module is used to input the target transaction data into the target risk identification model to obtain the corresponding target identification result; The feedback module is used to feed back the target identification result to the financial system, so that the financial system can perform relevant risk control operations based on the target identification result; The target risk identification model is a model trained based on the method described in the first aspect, and the number of lexical units in the target identification result is not greater than a preset threshold.
[0025] Fifthly, one or more embodiments of this specification also provide an electronic device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, and when the computer program is executed, it implements the method of the first or second aspect described above.
[0026] Sixthly, one or more embodiments of this specification also provide a computer-readable storage medium storing computer program instructions that, when executed, implement the methods of the first or second aspect described above.
[0027] Based on the implementation methods provided above, the embodiments of this application can be further combined to provide more implementation methods.
[0028] In the above embodiments, by training the preset large language model in stages, the trained target risk identification model can perform risk analysis on any input transaction data and identify whether there is a preset risk. Furthermore, while ensuring the accuracy of risk identification, the number of words in the output target identification result can be constrained within a certain threshold. This allows the model's risk identification process to be transformed into an implicit representation within the model, without relying on explicit reasoning of long thought chains, and directly output the identification result. This achieves a zero-thinking reasoning mode, reduces the consumption of computing resources in the model's reasoning process, improves the model's response speed, and reduces response latency.
[0029] The target risk identification model trained as described above can be applied to financial systems such as payment platforms and banks to identify risks based on transaction data generated by these systems. Since this target risk identification model does not rely on long thought chains and can directly output shorter identification results, it can improve risk identification efficiency and reduce response latency. This allows for the timely detection and reporting of risky transactions, enabling the corresponding financial systems to perform real-time anti-money laundering monitoring and promptly execute risk control operations such as suspending transactions and sending alarm messages, preventing illegal financial activities from affecting the property security of relevant users and the financial order.
[0030] It is understood that the solutions provided in the second to sixth aspects correspond to the solutions provided in the first aspect. Therefore, the beneficial effects of the second to sixth aspects can be referred to the beneficial effects of the first aspect, and repeated details will not be repeated. Attached Figure Description
[0031] To more clearly illustrate the technical solutions of one or more embodiments of this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of one or more embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 A flowchart illustrating a training method for a risk identification model provided in one or more embodiments of this specification; Figure 2 A flowchart illustrating a training method for a risk identification model provided in one or more embodiments of this specification; Figure 3 A flowchart illustrating a training method for a risk identification model provided in one or more embodiments of this specification; Figure 4 A schematic diagram illustrating the principle of a training method for a risk identification model provided in one or more embodiments of this specification; Figure 5 A structural block diagram of a training device for a risk identification model provided in one or more embodiments of this specification; Figure 6 A structural block diagram of a training device for a risk identification model provided in one or more embodiments of this specification; Figure 7 This is a structural block diagram of an electronic device provided for one or more embodiments of this specification. Detailed Implementation
[0033] The present specification describes one or more embodiments in further detail below with reference to the accompanying drawings and examples. Through these descriptions, the features and advantages of one or more embodiments of the present specification will become clearer and more apparent.
[0034] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments. Although various aspects of embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated otherwise.
[0035] Furthermore, the technical features described below in one or more embodiments of this specification may be combined with each other as long as they do not conflict with each other.
[0036] To facilitate understanding, the application scenarios of the technical solutions provided in one or more embodiments of this specification will be described below.
[0037] With the development of science and technology and the increasing frequency of financial activities and even cross-border trade, some technical means, such as anti-money laundering (AML) technology, are used to identify, prevent and report related illegal financial activities, so as to safeguard the stability of the financial order and the public interest.
[0038] In some embodiments, a rule engine can be used to identify and report illegal financial activities by checking whether the transaction amounts, frequency, and other characteristics of various accounts in payment platforms, banks, and other financial systems meet preset rules. Due to the diversity of financial models, the preset rules configured in the rule engine need to be continuously updated to improve identification accuracy and avoid missed or false reports due to missing or incomplete rules. Therefore, the rule engine-based method for identifying illegal financial activities has high rule maintenance costs and is difficult to adapt to changes in application scenarios.
[0039] In some embodiments, a Large Language Model (LLM) can be used to perform reasoning analysis on transaction data generated by payment platforms or financial institutions to identify the risk of illegal financial activities. The LLM can employ a Chain-of-Thought (CoT) approach for reasoning, breaking down complex reasoning tasks into multiple logically related sub-steps and outputting the entire reasoning process and conclusion in natural language. This explicit reasoning mechanism can improve the accuracy of the reasoning results and enhance the interpretability of the reasoning process.
[0040] However, the reasoning mechanism of large language models often produces long outputs, meaning the output results contain a large number of tokens, leading to high computational cost and significant output latency. Therefore, in practical applications, large language models place high demands on the performance of the deployment environment, increasing the system load on payment platforms or financial institutions and potentially impacting normal transaction activities.
[0041] In view of this, one or more embodiments of this specification provide a training method for a risk identification model based on transaction data, so that the trained target risk identification model can not only have high identification accuracy for preset risks, but also ensure that it consumes less system resources during the risk identification process. The above training method is described in detail below.
[0042] Reference Figure 1 In some embodiments, the training method for the risk identification model based on transaction data includes the following steps.
[0043] Step 110: Obtain a first sample set, wherein the first sample set includes multiple first sample transaction data and corresponding first sample analysis text, and the first sample analysis text includes the analysis process and analysis conclusion of analyzing whether the first sample transaction data has a preset risk.
[0044] In some embodiments, the aforementioned first sample set can be created based on historical data from financial systems such as payment platforms and banks. For example, multiple historical transaction data and corresponding historical risk control information from relevant financial systems can be obtained. This historical transaction data can be used as the aforementioned first sample transaction data, and the corresponding historical risk control information can be used as the aforementioned first sample analysis text.
[0045] The aforementioned pre-defined risks refer to the potential risks associated with the transaction activities that generate transaction data, including the risks of money laundering and one or more illegal financial activities.
[0046] For example, the aforementioned first sample transaction data may include characteristic information such as transaction amount, transaction frequency, transaction time, account relationship, and transaction path. The transaction path describes the complete flow of funds from transaction initiation to transaction completion, generally including stages such as transaction initiation, accounting processing, clearing and settlement (withdrawal). Based on the various characteristic information in the transaction data, abnormal transaction activities that may pose risks, such as frequent transfers to unfamiliar accounts or sudden large transfers to unfamiliar accounts, can be identified.
[0047] Step 120: Train the preset large language model based on the first sample set to obtain the first risk identification model. The first risk identification model is then used to perform reasoning analysis on any transaction data based on the thinking chain to generate a first analysis text containing the risk analysis process and risk analysis conclusions.
[0048] The aforementioned pre-defined large language model can be any general large language model that has been pre-trained on a general dataset.
[0049] For example, the aforementioned first sample set includes both black samples and white samples. Black samples are those exhibiting pre-defined risk behaviors, while white samples are those without pre-defined risks. Training the pre-defined large language model using this first sample set guides the model to adopt a chain-of-thought approach, generating a complete risk analysis process and conclusions based on input transaction data. This allows the model to fully learn complex reasoning capabilities in risk identification fields such as anti-money laundering, including but not limited to multi-account correlation analysis, abnormal transaction path identification, and time-series behavior pattern judgment. This ensures that the trained first risk identification model has high risk identification accuracy.
[0050] For example, in step 120, supervised fine-tuning (SFT) can be used to train the preset large language model.
[0051] Step 130: Optimize and train the first risk identification model to obtain the target risk identification model, so that the target risk identification model generates target identification results based on arbitrary transaction data, wherein the number of tokens in the target identification results is less than the number of tokens in the first analysis text output by the first risk identification model.
[0052] In the above embodiments, after obtaining a first risk identification model with high risk identification accuracy, the output structure of the model is further constrained by optimizing the training, reducing the output length of the model, that is, reducing the number of tokens in the output content. As a result, the final target risk identification model does not need to perform a lot of calculations for outputting long text, reducing the model's response latency and GPU resource consumption, reducing the model's performance requirements for the deployment environment, improving the model's deployability and stability in actual financial systems, and preventing memory overflow and other failures due to excessive output length.
[0053] In addition, by optimizing training, the above embodiments reduce the number of lexical units in the target recognition results output by the target risk recognition model, which can also reduce the parsing cost of the target recognition results output by the relevant financial system. This allows the relevant financial system to understand the target recognition results more quickly and execute relevant decisions, such as suspending transactions or sending alarm information.
[0054] In some embodiments, reference is made to Figure 2 In step 130 above, optimizing and training the first risk identification model may specifically include: Step 132: Based on the second sample set and the preset reward rule, optimize and train the first risk identification model to obtain the second risk identification model. The preset reward rule includes negatively adjusting the preference score corresponding to the first analysis text when the number of lexical units in the first analysis text is greater than the first preset threshold.
[0055] For example, the second sample set mentioned above may include multiple second sample transaction data.
[0056] For example, the second sample transaction data in the aforementioned second sample set can also be historical transaction data from the relevant financial system.
[0057] In step 132 above, the first risk identification model is optimized and trained based on the GRPO (Generalized Reward Policy Optimization) training method. GRPO is a model optimization method based on reinforcement learning, which can constrain the model's output through a pre-configured reward function.
[0058] The principle of training the first risk identification model based on GRPO in step 132 above is as follows: based on the preset reward rules, each first analysis text generated by the first risk identification model is scored to obtain the corresponding preference score. Then, the relevant parameters of the model are adjusted based on the first analysis text with higher preference score, thereby guiding the model to output the first analysis text with higher preference score.
[0059] The preference score mentioned above is a scalar signal that measures whether the first analytical text generated by the model is "good" or "bad". The higher the preference score, the better the corresponding first analytical text is, that is, the more it conforms to the training objective. Conversely, the lower the preference score, the more the corresponding text deviates from the training objective. Therefore, the preference score can be used to guide the model to optimize in a direction that is closer to the training objective.
[0060] Based on this, in order to constrain the output length of the model, the preset reward rule in the above embodiment may include: when the number of lexical units in the first analysis text is greater than a first preset threshold, negatively adjusting the preference score corresponding to the first analysis text.
[0061] In other words, during training, if the first analysis text output by the first risk identification model is too long, meaning the number of tokens it contains exceeds a first preset threshold, its corresponding preference score will be negatively adjusted, i.e., the preference score will decrease, indicating that such a first analysis text does not meet the training objective. Conversely, if the number of tokens in the obtained first analysis text does not exceed the first preset threshold, its corresponding preference score will not be negatively adjusted, indicating that such a first analysis text meets the training objective.
[0062] Based on the preference scores of each first analysis text output by the first risk identification model, the relevant parameters of the first risk identification model can be adjusted. This will guide the first risk identification model to obtain a shorter first analysis text in the next inference output, ultimately ensuring that the number of tokens in the second analysis text output by the trained second risk identification model does not exceed the first preset threshold, thus achieving the training objective of constraining the length of the model output.
[0063] For example, the second analysis text generated by the second risk identification model described above can still be in natural language form.
[0064] For example, the first analysis text output by the first risk identification model can be in the following form: "Because of the transaction data... and the transaction data also contains..., the relevant transaction activity has a money laundering risk." Correspondingly, the second analysis text output by the second risk identification model can be in the following form: "This transaction activity has a money laundering risk because..." or "This transaction activity has a money laundering risk."
[0065] For example, multiple thresholds can be set based on the original output length and target output length of the first risk identification model. Through multiple rounds of training, the model's output length can be gradually reduced. For instance, assuming the output length of the first risk identification model exceeds 10,000 tokens and the target output length is no more than 1,000 tokens, multiple thresholds such as 5,000, 2,000, and 1,000 can be used to train the first risk identification model for multiple rounds, first reducing its output length to within 5,000 tokens, then to within 2,000 tokens, and finally to within the training target of 1,000 tokens. This gradual reduction of the model's output length through multiple rounds of training based on multiple thresholds can reduce or avoid the impact of a significant reduction in output length on the model's inference accuracy.
[0066] The second risk identification model trained through the above embodiments has its output length constrained within a first preset threshold. This not only preserves the accuracy of the first risk identification model in identifying preset risks, but also allows for faster inference output through shorter output text, reducing the model's inference latency, reducing the consumption of computing resources such as GPUs, and lowering the performance requirements of the deployment environment.
[0067] In some embodiments, the aforementioned preset reward rules can be implemented by configuring a corresponding reward function. This reward function can integrate multiple reward or penalty rules; correspondingly, the function value of this reward function is the preference score corresponding to the first analyzed text obtained by integrating multiple reward or penalty rules.
[0068] The reward function, which is based on the preset reward rules, can be integrated into the loss function to adjust the relevant parameters of the model.
[0069] For example, the loss function used in the optimization training process described in step 132 above, in addition to incorporating the aforementioned preset reward rules, may also include other constraint terms or regularization terms, such as a penalty term based on KL divergence. KL divergence is used to measure the difference between the new and old inference strategies of the model; by setting a penalty term based on KL divergence in the loss function, it is possible to avoid excessive differences between the new inference strategy updated by the model during training and the old inference strategy, that is, to avoid deviation from the original model, i.e., the first risk identification model, due to excessively large updates in the inference strategy, and to ensure the risk identification accuracy of the trained second risk identification model.
[0070] In some embodiments, the aforementioned preset reward rule may further include: when the risk analysis conclusion in the first analysis text is prior to the risk analysis process, a positive adjustment is made to the preference score corresponding to the first analysis text.
[0071] In other words, a higher preference score is assigned to the first analysis text before the risk analysis process, which can guide the first risk identification model to optimize in the direction of obtaining and outputting the risk analysis conclusion as soon as possible. This allows the second risk identification model to output the risk analysis conclusion as soon as possible when performing risk analysis on any transaction data, so that relevant users or systems can know the risk analysis conclusion as soon as possible, without having to wait until the entire analysis process is completed before obtaining the risk analysis conclusion.
[0072] In addition, by combining the aforementioned preset reward rule based on the number of tokens in the first analysis text, the model can be guided to output risk analysis conclusions as soon as possible, and the model can also be guided to reduce the number of tokens output. This allows the model to directly output the preliminary analysis conclusion that there is or does not have a preset risk based on certain features in the transaction data, and the risk analysis process that requires a large number of tokens is not necessary to generate.
[0073] In the above embodiments, since the first risk identification model already has a high risk identification capability, the first risk identification model is optimized by setting the above-mentioned preset reward rules. This further constrains the output structure of the model without affecting the accuracy of the model's risk identification. This includes outputting risk analysis conclusions first and ensuring that the number of lexical units does not exceed the first preset threshold. This allows the model to generate risk analysis text without having to go through a long thought process. Instead, it can directly output the risk analysis conclusion as long as it can obtain a preliminary analysis conclusion on the existence or non-existence of the preset risk based on certain features in the transaction data.
[0074] Therefore, the second risk identification model trained in the above embodiments can retain the accuracy of the first analysis and identification model in identifying preset risks, and can also significantly shorten the length of the output text. This can greatly reduce the model's response latency, improve the model's response speed, reduce the model's consumption of computing resources, and reduce the performance requirements of the deployment environment. The trained model can be deployed in any financial system according to application needs without affecting the processing performance of the original transaction tasks of the financial system.
[0075] In some embodiments, such as Figure 2 As shown, step 130 above may further include: step 136, using the second risk identification model as the target risk identification model. That is, the second risk identification model trained in step 132 can be directly deployed in relevant financial systems. Since the second analysis text output by the second risk identification model is still in natural language form, but with a small number of word units, the readability of the model output results and the system parsing cost can be balanced.
[0076] In some embodiments, reference is made to Figure 3 and combined Figure 4 The schematic diagram of the model training principle shown above, the steps for optimizing and training the first risk identification model, i.e., step 130, may further include the following after step 132: Step 134: Obtain the third sample set and fine-tune the second risk identification model based on the third sample set to obtain the target risk identification model. The third sample set includes multiple third sample transaction data and corresponding sample risk labels. The sample risk labels are used to identify whether the corresponding third sample transaction data has a preset risk. The number of words in the sample risk labels is not greater than the second preset threshold, and the second preset threshold is less than the first preset threshold.
[0077] For example, the above-mentioned sample risk label may include a first label value and a second label value, wherein the first label value indicates that the corresponding third sample transaction data has a preset risk, and the second label value indicates that the corresponding third sample transaction data does not have a preset risk.
[0078] For example, the first label value can be "yes" or "Y", and the corresponding second label value can be "no" or "N".
[0079] For example, the first label value can be 1, and the corresponding second label value can be 0. In this case, the second preset threshold can be 1; based on this, the target recognition result output by the trained target risk recognition model can also be a simple 1 or 0, that is, through the training process of step 134, the output length of the model can be reduced to 1 token.
[0080] In different embodiments, the above-mentioned sample risk labels may take different forms. This embodiment does not limit this. The label form that meets the requirements of the number of words can be selected according to the training objective, such as the second preset threshold.
[0081] For example, step 134 above can specifically employ a supervised fine-tuning training method (i.e., SFT).
[0082] In the above embodiment, after training a second risk identification model with a shorter output text length through step 132, the second risk identification model is further trained using a third sample set. Since the risk labels of samples with no more than a second preset threshold in this third sample set are used as training labels for the corresponding third sample transaction data, the model can be guided to associate the analysis conclusion of whether a preset risk exists with different label values, thereby converting the model from outputting analysis text to outputting the corresponding label values, further reducing the number of words in the output result.
[0083] Based on this, the trained target risk identification model can operate its internal reasoning process solely based on machine language, without needing to be converted into human-understandable language. Therefore, the reasoning process for identifying pre-defined risks does not rely on explicit language (natural language) to form a thought chain, but is instead converted into an implicit representation within the model. This allows the target risk identification model to achieve zero-thinking, meaning it does not require a complex explicit reasoning process (thought chain) and can directly output the target identification result. Furthermore, this target identification result can contain only a label value indicating the presence or absence of a pre-defined risk, reducing the number of tokens to a single token. This transforms the risk identification task from a traditional reasoning and judgment task into a classification task based on a single token. Therefore, through the above training steps, the model's response speed can be further improved, and response latency reduced. Simultaneously, the cost of parsing the target identification result for relevant financial systems can be reduced, enabling these systems to quickly execute response strategies based on the target identification result, such as suspending transactions or sending alarm messages. This effectively controls and prevents illegal financial activities, reducing or even avoiding their impact on the financial system and financial order.
[0084] In addition, based on Figure 4The schematic diagram of the model training principle shown above illustrates that, in the above embodiment, the training based on sample risk labels, i.e., step 134, is performed on the basis of the second risk identification model, rather than directly on the first risk identification model. Since the output text of the second risk identification model, i.e. the second analysis text, has been reduced to a smaller length (i.e., the number of words is not greater than the first preset threshold) through step 132, performing training based on sample risk labels on this basis allows the model to clearly understand which analysis text originally output by the model can be converted into the first label value and which analysis text originally output by the model can be converted into the second label value, thereby ensuring training accuracy and training efficiency.
[0085] In some embodiments, the aforementioned third sample set may also be created based on historical transaction data and corresponding historical risk control information of the relevant financial system.
[0086] For example, in step 134 above, obtaining the third sample set may specifically include: Obtain multiple historical transaction data points as a third sample of transaction data; Based on the historical risk control information corresponding to the third sample transaction data, generate corresponding sample risk labels; A third sample set is created based on multiple third sample transaction data and their corresponding sample risk labels.
[0087] In the above embodiments, the sample sets for different training stages can be created based on the same data source, that is, they can all be created based on the historical transaction data and historical risk control information of the relevant financial system. This can reduce the workload of preparing training data, reduce the difficulty of model training, and facilitate the rapid training of a suitable target risk identification model based on different application scenarios.
[0088] In the above embodiments, by training a pre-defined large language model in stages, the trained target risk identification model can perform risk analysis on any input transaction data and identify whether a pre-defined risk exists. Furthermore, while ensuring the accuracy of risk identification, the number of tokens in the output target identification result can be constrained within a certain threshold. This allows the model's risk identification process to bypass explicit reasoning that relies on long thought chains, instead transforming it into an implicit representation within the model, directly outputting the identification result. This achieves a zero-thinking reasoning mode, reducing the computational resource consumption of the model's reasoning process, improving model response speed, and reducing response latency. Experimental verification shows that compared to risk identification models that rely on long thought chains, the inference cost (such as GPU usage) of the above target risk identification model can be reduced by at least 300%, and response latency is significantly reduced.
[0089] One or more embodiments of this specification also provide a risk identification method, which may include the following steps: Obtain target transaction data from the financial system; The acquired target transaction data is input into the target risk identification model to obtain the corresponding target identification results; The target identification result is fed back to the aforementioned financial system so that the financial system can perform relevant risk control operations based on the target identification result.
[0090] The target risk identification model described above is a model trained based on the training method described in any of the preceding embodiments, and the number of lexical units in the target identification result is not greater than a preset threshold.
[0091] For example, the number of tokens in the target recognition result is not greater than the first preset threshold in the previous embodiment, or the number of tokens in the target recognition result is not greater than the second preset threshold in the previous embodiment, or the number of tokens in the target recognition result is 1, i.e., a single token.
[0092] The above embodiments apply the trained target risk identification model to financial systems such as payment platforms and banks, thereby identifying risks based on transaction data generated by the corresponding financial systems. Since the target risk identification model does not rely on long thinking chains and can directly output shorter identification results, it can improve risk identification efficiency and reduce response latency, so as to promptly detect and report risky transaction activities. This enables the corresponding financial systems to achieve real-time anti-money laundering monitoring and promptly execute risk control operations such as suspending transactions and sending alarm information, preventing illegal financial activities from affecting the property security of relevant users and the financial order.
[0093] It is understood that the above embodiments are merely examples, and modifications can be made to the above embodiments in actual implementation. Those skilled in the art will understand that any modifications to the above embodiments that do not require creative effort fall within the protection scope of one or more embodiments of this specification, and will not be described again in the embodiments.
[0094] Based on the same inventive concept, one or more embodiments of this specification also provide a training device for a risk identification model based on transaction data. Figure 5 This is a structural block diagram of the training device.
[0095] like Figure 5 As shown, the training device 300 may include: The first training module 310 acquires a first sample set and trains a preset large language model based on the first sample set to obtain a first risk identification model. The first sample set includes multiple first sample transaction data and corresponding first sample analysis text. The first sample analysis text includes the analysis process and analysis conclusion of analyzing whether the first sample transaction data has a preset risk. This enables the first risk identification model to perform reasoning analysis on any transaction data based on the thinking chain and generate a first analysis text containing the risk analysis process and risk analysis conclusion. The second training module 320 is used to optimize and train the first risk identification model to obtain the target risk identification model, so that the target risk identification model generates target identification results based on arbitrary transaction data, wherein the number of words in the target identification results is less than the number of words in the first analysis text.
[0096] In some embodiments, such as Figure 6 As shown, the second training module 320 mentioned above may include: The first optimization module 321 is used to optimize and train the first risk identification model based on the second sample set and the preset reward rules to obtain the second risk identification model.
[0097] The aforementioned second sample set includes multiple second sample transaction data.
[0098] The preset reward rule adopted by the first optimization module 321 may include, when the number of lexical units in the first analysis text is greater than the first preset threshold, negatively adjusting the preference score corresponding to the first analysis text, so as to optimize the first risk identification model based on the preference score, so that the number of lexical units in the second analysis text generated by the second risk identification model is not greater than the first preset threshold.
[0099] In some embodiments, the preset reward rule adopted by the first optimization module 321 may further include, when the risk analysis conclusion in the first analysis text is located before the risk analysis process, positively adjusting the preference score corresponding to the first analysis text, so that the second analysis text generated by the second risk identification model has the risk analysis conclusion as the preceding content.
[0100] In some embodiments, such as Figure 6 As shown, the second training module 320 may further include: The second optimization module 322 is used to obtain a third sample set and train the second risk identification model based on the third sample set to obtain a target risk identification model, so that the number of words in the target identification result is not greater than the second preset threshold.
[0101] The aforementioned third sample set includes multiple third sample transaction data and corresponding sample risk labels. The sample risk labels are used to identify whether the third sample transaction data has a preset risk. The number of terms in the sample risk labels is not greater than a second preset threshold, which is less than the aforementioned first preset threshold.
[0102] Since the principle of the problem solved by the training device 300 is similar to that of the aforementioned model training method, the implementation and principle of each module in the training device 300 can be found in the relevant embodiments of the aforementioned model training method, and the repeated parts will not be described again.
[0103] One or more embodiments of this specification also provide a risk identification device, including: The acquisition module is used to acquire target transaction data from the financial system. The identification module is used to input the acquired target transaction data into the target risk identification model to obtain the corresponding target identification results; The feedback module is used to feed back the target identification results to the financial system so that the financial system can perform relevant risk control operations based on the target identification results.
[0104] The target risk identification model described above is a model trained based on the training method described in any of the preceding embodiments, and the number of lexical units in the target identification result is not greater than a preset threshold.
[0105] Since the principle by which the risk identification device solves the problem is similar to that of the aforementioned risk identification method, the implementation and principle of each module in the risk identification device can be found in the relevant embodiments of the aforementioned risk identification method, and repeated details will not be repeated.
[0106] See Figure 7 , Figure 7 This is a structural block diagram of an electronic device provided for one or more embodiments of this specification. Figure 7 As shown, the electronic device 500 may include a processor 501 and a memory 502; the memory 502 may be coupled to the processor 501. It is worth noting that... Figure 7 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions. The electronic device can be a server, client, or other intermediate device.
[0107] In one possible implementation, the functionality of the training device 300 can be integrated into the processor 501. The processor 501 can be configured to perform the following operations: Obtain a first sample set, wherein the first sample set includes multiple first sample transaction data and corresponding first sample analysis text, and the first sample analysis text includes the analysis process and analysis conclusion for analyzing whether the first sample transaction data has a preset risk; Based on the first sample set, a preset large language model is trained to obtain a first risk identification model, which enables the first risk identification model to perform reasoning analysis on any transaction data based on the thinking chain, and generate a first analysis text containing the risk analysis process and risk analysis conclusion. The first risk identification model is optimized and trained to obtain a target risk identification model, which generates a target identification result based on arbitrary transaction data, wherein the number of tokens in the target identification result is less than the number of tokens in the first analysis text.
[0108] In another possible implementation, the training device 300 can be configured separately from the processor 501. For example, the training device 300 can be configured as a chip connected to the processor 501, and the model training process described in the previous embodiment can be implemented through the control of the processor 501.
[0109] Furthermore, in some alternative implementations, the electronic device 500 may also include: a communication module, an input unit, an audio processor, a display, a power supply, etc. It is worth noting that the electronic device 500 is not necessarily required to include these components. Figure 7 All components shown; in addition, the electronic device 500 may also include Figure 7 For components not shown, please refer to existing technologies.
[0110] This specification also provides, in one or more embodiments, a computer-readable storage medium capable of implementing all steps of the training method for the risk identification model based on transaction data in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the model training method in the above embodiments. Specific steps are described in the preceding embodiments and will not be repeated here.
[0111] In addition, one or more embodiments of this specification also provide a computer program product capable of implementing all the steps in the above-described embodiments of the training method for a risk identification model based on transaction data; the computer program product includes: a computer program or instructions, which, when executed on a computer, cause the computer to implement all the steps of the model training method in the above embodiments. Specific steps can be found in the preceding embodiments and will not be repeated here.
[0112] The foregoing has described specific embodiments of this specification. In other possible implementations, some or all of the actions or steps described in the above embodiments may be performed in a different order than that shown in the above embodiments, and the desired result may still be achieved. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0113] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and system embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0114] It should be noted that, unless otherwise specified, one or more embodiments of this specification and the features thereof can be combined with each other. This specification is not limited to any single aspect, nor to any single embodiment, nor to any combination and / or substitution of such aspects and / or embodiments. Furthermore, each aspect and / or embodiment of one or more embodiments of this specification can be used alone, or in combination with one or more other aspects and / or embodiments thereof.
[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of one or more embodiments of this specification, and are not intended to limit them. Although one or more embodiments of this specification have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of one or more embodiments of this specification, and they should all be covered within the scope of the claims and the specification of one or more embodiments of this specification.
[0116] The foregoing description of one or more embodiments of this specification has been provided in conjunction with optional implementation methods. However, these embodiments are merely exemplary and serve only an illustrative purpose. Based on this, various substitutions and modifications can be made to one or more embodiments of this specification, all of which fall within the protection scope of one or more embodiments of this specification.
Claims
1. A training method for a risk identification model, characterized in that, include: Obtain a first sample set, wherein the first sample set includes multiple first sample transaction data and corresponding first sample analysis text, and the first sample analysis text includes the analysis process and analysis conclusion for analyzing whether the first sample transaction data has a preset risk; Based on the first sample set, a preset large language model is trained to obtain a first risk identification model, which enables the first risk identification model to perform reasoning analysis on any transaction data based on the thinking chain, and generate a first analysis text containing the risk analysis process and risk analysis conclusion. The first risk identification model is optimized and trained to obtain a target risk identification model, which generates a target identification result based on arbitrary transaction data, wherein the number of tokens in the target identification result is less than the number of tokens in the first analysis text.
2. The method according to claim 1, characterized in that, The first risk identification model is optimized and trained, including: Based on the second sample set and the preset reward rules, the first risk identification model is optimized and trained to obtain the second risk identification model. The second sample set includes multiple second sample transaction data; The preset reward rule includes negatively adjusting the preference score corresponding to the first analysis text when the number of lexical units in the first analysis text is greater than a first preset threshold, so as to optimize the first risk identification model based on the preference score, so that the number of lexical units in the second analysis text generated by the second risk identification model is not greater than the first preset threshold.
3. The method according to claim 2, characterized in that, The preset reward rule also includes positively adjusting the preference score corresponding to the first analysis text when the risk analysis conclusion in the first analysis text is located before the risk analysis process.
4. The method according to claim 2, characterized in that, Optimizing and training the first risk identification model also includes: Obtain a third sample set, wherein the third sample set includes multiple third sample transaction data and corresponding sample risk tags, the sample risk tags are used to identify whether the third sample transaction data has the preset risk, the number of lexical units of the sample risk tags is not greater than a second preset threshold, and the second preset threshold is less than the first preset threshold; Based on the third sample set, the second risk identification model is trained to obtain the target risk identification model, such that the number of lexical units in the target identification result is not greater than the second preset threshold.
5. The method according to claim 4, characterized in that, At least one of the first sample set, the second sample set, and the third sample set is created based on historical transaction data and the historical risk control information corresponding to the historical transaction data.
6. The method according to claim 5, characterized in that, The acquisition of the third sample set includes: Obtain multiple historical transaction data entries as the third sample transaction data; The sample risk label is generated based on the historical risk control information corresponding to the third sample transaction data.
7. A risk identification method, characterized in that, include: Obtain target transaction data from the financial system; The target transaction data is input into the target risk identification model to obtain the corresponding target identification result; The target identification result is fed back to the financial system, so that the financial system can perform relevant risk control operations based on the target identification result; The target risk identification model is a model trained based on the method described in any one of claims 1-6, and the number of lexical units in the target identification result is not greater than a preset threshold.
8. A training device for a risk identification model, characterized in that, include: The first training module acquires a first sample set and trains a preset large language model based on the first sample set to obtain a first risk identification model. The first sample set includes multiple first sample transaction data and corresponding first sample analysis text. The first sample analysis text includes the analysis process and analysis conclusion of analyzing whether the first sample transaction data has a preset risk. This enables the first risk identification model to perform reasoning analysis on any transaction data based on the thinking chain and generate a first analysis text containing the risk analysis process and risk analysis conclusion. The second training module is used to optimize and train the first risk identification model to obtain a target risk identification model, so that the target risk identification model generates a target identification result based on arbitrary transaction data, wherein the number of tokens in the target identification result is less than the number of tokens in the first analysis text.
9. The apparatus according to claim 8, characterized in that, The second training module includes: The first optimization module is used to optimize and train the first risk identification model based on the second sample set and the preset reward rules to obtain the second risk identification model. The second sample set includes multiple second sample transaction data; The preset reward rule includes negatively adjusting the preference score corresponding to the first analysis text when the number of lexical units in the first analysis text is greater than a first preset threshold, so as to optimize the first risk identification model based on the preference score, so that the number of lexical units in the second analysis text generated by the second risk identification model is not greater than the first preset threshold.
10. The apparatus according to claim 9, characterized in that, The preset reward rule also includes positively adjusting the preference score corresponding to the first analysis text when the risk analysis conclusion in the first analysis text is located before the risk analysis process.
11. The apparatus according to claim 9, characterized in that, The second training module also includes: The second optimization module is used to acquire a third sample set and, based on the third sample set, train the second risk identification model to obtain the target risk identification model, such that the number of lexical units in the target identification result is not greater than a second preset threshold. The third sample set includes multiple third sample transaction data and corresponding sample risk labels. The sample risk labels are used to identify whether the third sample transaction data has the preset risk. The number of lexical units in the sample risk labels is not greater than the second preset threshold, and the second preset threshold is less than the first preset threshold.
12. A risk identification device, characterized in that, include: The acquisition module is used to acquire target transaction data from the financial system. The identification module is used to input the target transaction data into the target risk identification model to obtain the corresponding target identification result; The feedback module is used to feed back the target identification result to the financial system, so that the financial system can perform relevant risk control operations based on the target identification result; The target risk identification model is a model trained based on the method described in any one of claims 1-6, and the number of lexical units in the target identification result is not greater than a preset threshold.
13. An electronic device, characterized in that, The electronic device includes: Memory, used to store computer programs; A processor is configured to execute a computer program stored in the memory, wherein when the computer program is executed, it implements the method described in any one of claims 1-7.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed, implement the method described in any one of claims 1-7.