Transaction instruction risk assessment method and system based on GPT-4 and medium

By constructing a GPT-4-based trading instruction risk assessment model, the traditional financial transaction risk assessment method has solved the shortcomings in adapting to market complexity and variability, and achieved efficient and accurate risk identification and control, which has promoted the intelligence and precision of transaction risk management.

CN120471622APending Publication Date: 2025-08-12JINXIN FUTURES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510434832.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

Traditional financial transaction risk assessment methods are difficult to adapt to market complexity and variability, resulting in decision-making limitations and insufficient risk control.

Method used

The GPT-4 model is used to train and preprocess historical transaction data, build a trading instruction risk assessment model, conduct real-time risk assessment by inputting new transaction data, and formulate risk control strategies.

Benefits of technology

It improves the accuracy and efficiency of risk assessment, can quickly identify high-risk trading instructions, provide real-time risk assessment results, optimize risk management strategies, and ensure the safety and stability of transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471622A_ABST
    Figure CN120471622A_ABST
Patent Text Reader

Abstract

The invention provides a GPT-4-based transaction instruction risk assessment method, device and equipment and a medium, and the method comprises the steps: obtaining historical transaction data, and carrying out the preprocessing of the historical transaction data as a training set; a GPT-4 model is constructed, the training set is adopted to initialize and train the GPT-4 model, and the trained GPT-4 model is obtained; and inputting new transaction data into the trained GPT-4 model to carry out transaction instruction risk assessment so as to solve the technical problems of decision limitation and insufficient risk control caused by difficulty in comprehensively capturing the complex dynamic state and uncertainty of the market in the financial transaction field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial information technology, and in particular to a GPT-4-based transaction instruction risk assessment method, system, device, and medium. Background Art

[0002] In the financial trading world, accurately assessing the risk of trading orders is crucial for investors and their decision-making regarding trading strategies. Traditional methods typically rely on manually formulated rules or simple statistical models. Key challenges with traditional risk assessment include: 1) reliance on manually formulated rules or simple statistical models makes them difficult to adapt to market complexity and volatility; 2) limited accuracy and comprehensiveness of assessment results; and 3) a lack of real-time and dynamic adaptability, making them ineffective in responding to rapidly changing markets and emerging risks.

[0003] GPT-4 (Generative Pretrained Transformer 4) was trained on massive amounts of text data. It accurately understands natural language text input, ranging from complex financial terminology to professional research reports and everyday trading instructions. GPT-4 also generates high-quality natural language responses based on contextual information, providing traders with clear and accurate feedback, such as analysis reports on financial events and interpretations of market trends. Financial trading involves a wide variety of data types, including market conditions, company financials, macroeconomic data, and regulatory data, with new trading rules and market conditions constantly emerging. GPT-4 utilizes the Transformer architecture, which boasts powerful parallel computing capabilities and excellent long-sequence data processing capabilities. This architecture is capable of efficiently handling the large amounts of text data and complex computational tasks involved in financial trading. It also possesses the ability to continuously learn and optimize, constantly adapting its models and algorithms to new data and information to adapt to market changes.

[0004] Therefore, there is an urgent need to propose a GPT-4-based trading instruction risk assessment method, system, equipment and medium to solve the technical problem that it is difficult to fully capture the complex dynamics and uncertainties of the market in the field of financial transactions, resulting in limitations in decision-making and insufficient risk control. Summary of the Invention

[0005] In order to overcome the problems existing in the related art, the present disclosure provides a transaction instruction risk assessment method, system, device and medium based on GPT-4 to solve the technical problems in the related art that it is difficult to fully capture the complex dynamics and uncertainties of the market in the field of financial transactions, resulting in decision-making limitations and insufficient risk control.

[0006] One or more embodiments of this specification provide a transaction instruction risk assessment method based on GPT-4, including the following steps:

[0007] Obtain historical transaction data and use it as a training set after preprocessing;

[0008] Construct a GPT-4 model, and use the training set to initialize and train the GPT-4 model to obtain a trained GPT-4 model;

[0009] New transaction data is input into the trained GPT-4 model to perform transaction instruction risk assessment.

[0010] Preferably, the method further comprises the following steps:

[0011] Formulate risk control strategies based on the results of the risk assessment of the trading instructions.

[0012] Preferably, the historical transaction data includes: transaction instructions, market conditions, and transaction execution status.

[0013] Preferably, the results of the transaction instruction risk assessment include: prediction of transaction profit and loss, and calculation of risk indicators.

[0014] Preferably, the risk control strategy includes: adjusting trading instructions, setting stop-loss and take-profit points, and adjusting positions.

[0015] One or more embodiments of this specification provide a trading instruction risk assessment device based on GPT-4, including a data acquisition module, a model training module, and a model prediction module;

[0016] The data acquisition module is used to obtain historical transaction data and use it as a training set after preprocessing;

[0017] The model training module is used to build a GPT-4 model, initialize and train the GPT-4 model using the training set, and obtain a trained GPT-4 model;

[0018] The model prediction module is used to input new transaction data into the trained GPT-4 model to perform transaction instruction risk assessment.

[0019] Preferably, it also includes a strategy formulation module for formulating a risk control strategy based on the results of the transaction instruction risk assessment.

[0020] Preferably, the historical transaction data includes: transaction instructions, market conditions, and transaction execution status.

[0021] One or more embodiments of this specification provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the risk assessment of trading instructions based on the GPT-4 large model as described above is implemented.

[0022] One or more embodiments of this specification provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of risk assessment of trading instructions based on the GPT-4 large model as described above.

[0023] The present disclosure provides a GPT-4-based transaction instruction risk assessment method, device, equipment and medium. The advantage is that by acquiring and preprocessing a large amount of historical transaction data and using it as a training set to initialize the training of the GPT-4 model, the trained GPT-4 model has strong learning ability and adaptability. When new transaction data is input, it can deeply explore various potential features and complex patterns in transaction instructions and accurately assess the risks of transaction instructions. In terms of accuracy, it can effectively identify abnormal fluctuations, potential illegal operation tendencies and market instability factors in high-risk transaction instructions, greatly reducing the misjudgment rate, and significantly improving the accuracy of risk judgment compared to traditional assessment methods. In terms of efficiency, the model can quickly process new transaction data and provide risk assessment results almost in real time, greatly shortening the waiting time for transaction decisions and making the transaction process smoother and more efficient. At the same time, the model also has good adaptability and scalability. It can continuously optimize its own risk assessment strategies and parameters as the market environment changes and new transaction data continues to accumulate, and always maintain keen insight and accurate assessment capabilities for new transaction risks, providing solid and reliable guarantees for the security and stability of financial transactions, and effectively promoting the field of transaction risk management to move towards intelligence and precision. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate one or more embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0025] Figure 1 A flowchart of a GPT-4-based transaction instruction risk assessment method provided for one or more embodiments of this specification;

[0026] Figure 2A schematic diagram of the structure of a GPT-4-based transaction instruction risk assessment device provided in one or more embodiments of this specification;

[0027] Figure 3 A schematic diagram of the structure of a computer device provided in one or more embodiments of this specification. DETAILED DESCRIPTION

[0028] In order to help those skilled in the art better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this invention.

[0029] The present invention will be described in detail below with reference to specific implementation methods and the accompanying drawings.

[0030] Method Example

[0031] According to an embodiment of the present invention, a transaction instruction risk assessment method based on GPT-4 is provided. Figure 1 FIG. 1 is a flow chart of a GPT-4-based transaction instruction risk assessment method according to an embodiment of the present invention. The GPT-4-based transaction instruction risk assessment method according to an embodiment of the present invention includes the following steps:

[0032] S110. Obtain historical transaction data from an exchange or trading platform, including but not limited to transaction instructions, market conditions, transaction execution status, etc. This data may cover various types of financial products, such as stocks, futures, foreign exchange, etc.

[0033] The acquired historical data may contain noise, missing values, or outliers, and therefore requires preprocessing steps such as data cleaning, transformation, and feature extraction to facilitate subsequent model learning and analysis. Preprocessing operations may include, but are not limited to, data cleaning, data normalization, and feature engineering to remove erroneous, missing, and duplicate data from historical trading data. For example, fields such as transaction time, transaction price, and transaction volume should be checked for obvious errors or unreasonable values, such as negative transaction prices. Appropriate filling strategies, such as mean filling or model-based filling methods, should be employed for missing data.

[0034] Filter out abnormal transaction records, such as records with excessively large or small transaction volumes (beyond the normal transaction range). These may be caused by data entry errors or special transaction events (such as special handling of large transactions) and need to be identified and processed.

[0035] After preprocessing, it is used as the training set.

[0036] S120. Construct a GPT-4 model, use the GPT-4 large model as the core of the prediction model, use the training set to initialize and train the GPT-4 model to learn the patterns and rules of historical trading data. Through large-scale pre-training and fine-tuning, the GPT-4 model can effectively capture complex market dynamics and trading rules, and obtain a trained GPT-4 model.

[0037] Set the number of model layers to 12, the number of heads to 12, and the number of hidden units to 768. Use the above training dataset to initialize the model for training, set the training batch size to 64, and the initial learning rate to 0.001.

[0038] During training, the Adam optimization algorithm is used, aiming to minimize the loss function between risk assessment predictions and actual trading outcomes (e.g., whether a risk event occurs, quantitative indicators of risk severity, etc.). The loss function can be designed based on the specific risk assessment task. For example, the cross-entropy loss function can be used for classification tasks (e.g., determining whether a trading order is high-risk, medium-risk, or low-risk), or the mean squared error loss function can be used for regression tasks (e.g., predicting numerical risk indicators for trading orders). The learning rate is decayed by 0.9 times after every 1000 training batches. Early stopping is also used, terminating training when the model's accuracy on the validation set stops improving for five consecutive epochs. After approximately 50 epochs of training, the model achieved an accuracy of 85% on the validation set, an improvement of approximately 20 percentage points compared to traditional rule-based risk assessment models.

[0039] During training, set an appropriate learning rate scheduling strategy, such as learning rate decay, to gradually reduce the learning rate as training progresses to balance the model's convergence speed and accuracy. At the same time, use techniques such as early stopping to prevent model overfitting, monitor the model's performance on the validation set, and stop training when performance stops improving.

[0040] S130. Input new transaction data into the trained GPT-4 model. The GPT-4 model performs a transaction instruction risk assessment on the transaction instruction based on the patterns and rules learned from historical data. The results of the transaction instruction risk assessment include: prediction of transaction profit and loss, calculation of risk indicators, etc., providing decision-making reference for financial market participants.

[0041] In actual trading, new trading order data is fed into the trained GPT-4 model. For example, for a new stock trade order, the model performs a risk assessment based on relevant transaction characteristics (such as stock price, trading volume, and trading time), and outputs a risk classification of medium risk with a risk score of 45.

[0042] Based on the model's assessment results, the trader further analyzed and reviewed the trade order. Taking into account the current market trends and the company's risk tolerance, the trader decided to reduce the trading position appropriately and set stricter stop-loss and take-profit points. Despite the short-term market volatility, the trade ultimately avoided significant losses due to the proactive risk control measures implemented, demonstrating the effectiveness of the GPT-4-based risk assessment model in real-world trading.

[0043] In addition to classification results, the model can also output a quantitative indicator of the risk level of a trade order, such as a risk score. This score, derived from the model's comprehensive assessment of various risk factors within the trading data, provides a more nuanced reflection of the risk level of the trade order. For example, the risk score ranges from 0 to 100, with higher scores indicating greater risk. Traders can use this quantitative indicator to adjust their trading strategies, such as adjusting trading positions and setting stop-loss and take-profit levels.

[0044] The method provided in this embodiment acquires and preprocesses a large amount of historical transaction data, using it as a training set to initialize the GPT-4 model. The resulting trained GPT-4 model possesses strong learning and adaptability. When fed new transaction data, it can deeply explore various potential features and complex patterns within transaction instructions and accurately assess transaction risk. In terms of accuracy, it can effectively identify abnormal fluctuations, potential illegal trading tendencies, and associations with market instability factors in high-risk transaction instructions, significantly reducing the false positive rate and significantly improving the accuracy of risk assessment compared to traditional assessment methods. In terms of efficiency, the model can rapidly process new transaction data and provide risk assessment results in near real time, significantly reducing the waiting time for transaction decisions and making the transaction process more streamlined and efficient. Furthermore, the model exhibits excellent adaptability and scalability. As the market environment changes and new transaction data accumulates, it can continuously optimize its risk assessment strategies and parameters, maintaining keen insight and accurate assessment capabilities for emerging transaction risks. This provides a solid and reliable guarantee for the security and stability of financial transactions, and strongly promotes the field of transaction risk management towards intelligent and precise management.

[0045] In one embodiment, the following steps are further included:

[0046] Based on the results of the risk assessment of the trading instructions, risk control strategies are formulated. These strategies may include, but are not limited to, adjusting trading instructions, setting stop-loss and take-profit points, adjusting positions, etc., to minimize trading risks and protect investors' interests.

[0047] For example, for a specific stock trade order, the model, after conducting a comprehensive analysis and assessment based on input features, outputs a risk classification of medium risk with a risk score of 45 (within the established 0-100 risk scoring system). After receiving the model's assessment results, the trader conducted a thorough review of the trade order, taking into account current market trends (such as the direction of the broader market index and the popularity of industry sectors) and the company's established risk tolerance policy (such as maximum risk tolerance and portfolio diversification requirements). Given the model's medium risk rating and the specific quantitative score, the trader decided to proceed with caution, reducing their planned trading position by 30% and setting stricter stop-loss and take-profit levels of 95% and 110% of the purchase price, respectively (a narrower profit range and closer stop-loss level than a typical setup). During the subsequent trading session, the market experienced short-term volatility due to unexpected geopolitical events, and the stock price briefly fell close to the stop-loss level. However, thanks to preemptive risk control measures, the trade was exited promptly after the stop-loss was triggered, avoiding further losses. This case fully demonstrates the practical value of the GPT-4-based risk assessment model in assisting decision-making and effectively controlling risks in actual transactions. It can help financial institutions improve their transaction risk management level in a complex and changing market environment and ensure the stability of investment returns.

[0048] The specific codes used in this embodiment are given below:

[0049] Pseudocode example:

[0050]

[0051]

[0052] Device embodiment

[0053] According to an embodiment of the present invention, a transaction instruction risk assessment device based on GPT-4 is provided. Figure 2 As shown, this is a structural diagram of the transaction instruction risk assessment device based on GPT-4 provided in this embodiment. According to the transaction instruction risk assessment device based on GPT-4 in an embodiment of the present invention, it includes a data acquisition module 21, a model training module 22 and a model prediction module 23.

[0054] The data acquisition module 21 is used to acquire historical transaction data, which includes transaction instructions, market conditions, and transaction execution status, and is used as a training set after pre-processing.

[0055] The model training module 22 is used to build a GPT-4 model, and use the training set to initialize and train the GPT-4 model to obtain a trained GPT-4 model.

[0056] The model prediction module 23 is used to input new transaction data into the trained GPT-4 model to perform transaction instruction risk assessment.

[0057] In the device provided in this embodiment, the data acquisition module 21 acquires and preprocesses a large amount of historical transaction data, and the model training module 22 uses this as a training set to initialize and train the GPT-4 model. The resulting trained GPT-4 model has strong learning capabilities and adaptability. When new transaction data is input, the model prediction module 23 can deeply explore various potential features and complex patterns in transaction instructions and accurately assess the risks of transaction instructions. In terms of accuracy, it can effectively identify abnormal fluctuations, potential illegal operation tendencies, and market instability factors in high-risk transaction instructions, greatly reducing the error rate, and significantly improving the accuracy of risk judgment compared to traditional assessment methods. In terms of efficiency, the model can quickly process new transaction data and provide risk assessment results almost in real time, greatly shortening the waiting time for transaction decisions and making the transaction process smoother and more efficient. At the same time, the model also has good adaptability and scalability. It can continuously optimize its own risk assessment strategies and parameters as the market environment changes and new transaction data continues to accumulate, and always maintain keen insight and accurate assessment capabilities for new transaction risks, providing solid and reliable guarantees for the security and stability of financial transactions, and effectively promoting the field of transaction risk management to move towards intelligence and precision.

[0058] In one embodiment, a strategy formulation module 24 is further included, which is used to formulate a risk control strategy based on the result of the transaction instruction risk assessment.

[0059] The embodiment of the present invention is an apparatus embodiment corresponding to the above-mentioned method embodiment. The specific operations of the processing steps of each module can be understood by referring to the description of the method embodiment, and will not be repeated here.

[0060] like Figure 3 As shown, the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the trading instruction risk assessment method based on GPT-4 in the above embodiment is implemented. Alternatively, when the computer program is executed by a processor, the trading instruction risk assessment method based on GPT-4 in the above embodiment is implemented. When the computer program is executed by the processor, the following method steps are implemented:

[0061] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database 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), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0062] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device or system embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. A person of ordinary skill in the art can understand and implement it without making any creative efforts.

[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and the contents not described in detail in the specification of the present invention are common knowledge to those skilled in the art.

Claims

1. A transaction instruction risk assessment method based on GPT-4, characterized in that: The following steps are involved: Obtain historical transaction data and use it as a training set after preprocessing; Construct a GPT-4 model, and use the training set to initialize and train the GPT-4 model to obtain a trained GPT-4 model; New transaction data is input into the trained GPT-4 model to perform transaction instruction risk assessment.

2. The transaction instruction risk assessment method according to claim 1, wherein: The following steps are also included: Formulate risk control strategies based on the results of the risk assessment of the trading instructions.

3. The transaction instruction risk assessment method according to claim 1, wherein: The historical transaction data includes: transaction instructions, market conditions, and transaction execution status.

4. The transaction instruction risk assessment method according to claim 1, wherein: The results of the transaction instruction risk assessment include: prediction of transaction profit and loss, and calculation of risk indicators.

5. The transaction instruction risk assessment method according to claim 2, wherein: The risk control strategy includes: adjusting trading instructions, setting stop-loss and take-profit points, and adjusting positions.

6. A trading instruction risk assessment device based on GPT-4, characterized in that: Includes data acquisition module, model training module and model prediction module; The data acquisition module is used to obtain historical transaction data and use it as a training set after preprocessing; The model training module is used to build a GPT-4 model, initialize and train the GPT-4 model using the training set, and obtain a trained GPT-4 model; The model prediction module is used to input new transaction data into the trained GPT-4 model to perform transaction instruction risk assessment.

7. The transaction instruction risk assessment device according to claim 6, wherein: It also includes a strategy formulation module for formulating risk control strategies based on the results of the transaction instruction risk assessment.

8. The transaction instruction risk assessment device according to claim 6, wherein: The historical transaction data includes: transaction instructions, market conditions, and transaction execution status.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the transaction instruction risk assessment based on the GPT-4 large model as described in any one of claims 1 to 5 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of risk assessment of transaction instructions based on the GPT-4 large model as described in any one of claims 1 to 5 are implemented.