Exchange rate prediction method and system based on multi-agent introspection mechanism
Through the exchange rate prediction method based on the multi-agent self-reflective mechanism, the tasks are decomposed, the characteristics are constructed and the model is optimized, and the problem of low exchange rate prediction accuracy in the prior art is solved, achieving higher prediction accuracy and adaptability.
Patent Information
- Application Number
- CN202411560452.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-21
AI Technical Summary
The existing exchange rate prediction methods have problems such as low accuracy and difficulty in processing data in real time, inflexible feature selection and weight adjustment, resulting in poor prediction results in complex market environments.
The exchange rate prediction method based on a multi-agent self-reflective mechanism is adopted to optimize the model to improve accuracy by collecting user demand information, decomposing tasks, collecting and preprocessing data, constructing features, and using information gain algorithms and dynamic supervision mechanisms.
It improves the accuracy and adaptability of exchange rate prediction, can better handle real-time data and market changes, and provides more reliable prediction results.
Smart Images

Figure CN119494728A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of exchange rate prediction, and in particular to an exchange rate prediction method based on a multi-agent introspection mechanism and an exchange rate prediction system based on a multi-agent introspection mechanism. Background Art
[0002] As an important research topic in the financial market, exchange rate forecasting has always faced the dual challenges of complexity and variability. The market is affected by many factors, including political events, changes in economic indicators, market sentiment, etc., which make exchange rate trends difficult to predict. Although large language models (LLMs) have become a potential tool for exchange rate forecasting in recent years due to their significant progress in the field of natural language processing, there are still many technical bottlenecks in practical applications.
[0003] Among the existing exchange rate forecasting methods, traditional time series models and statistical analysis methods are usually difficult to capture the nonlinear change characteristics of the market. With the rise of the application of machine learning technology, LLMs, as a new type of forecasting tool, has gradually attracted attention due to its ability to process massive data and natural language text. However, the application effect of LLMs in the financial field is limited, mainly manifested in the following problems: First, when dealing with dynamic fluctuations in exchange rates, LLMs are difficult to accurately capture the complex market changes due to the lack of professional knowledge fine-tuning in the financial field and training on market characteristics; second, the existing LLMs model is not flexible enough in feature selection, and it is difficult to dynamically adjust the weight of features according to market changes, resulting in insufficient adaptability of the forecasting model; in addition, due to the black box characteristics of LLMs themselves, it lacks explanatory analysis when providing forecast results, which cannot provide sufficient credibility and decision-making basis for financial decision makers.
[0004] Therefore, the current exchange rate forecasting methods have the following main problems: 1) lack of real-time data processing capabilities, making it difficult to effectively use the latest market information for forecast updates; 2) low model accuracy, making it difficult to cope with complex market environments with multiple factors; 3) insufficient flexibility in feature selection and weight fine-tuning, making it impossible to adapt to rapid market changes. The above problems limit the practical application of LLMs in the field of exchange rate forecasting, and an improved method that can combine professional knowledge in the financial field is urgently needed to improve the accuracy and interpretability of forecasts. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide an exchange rate prediction method and system based on a multi-agent introspection mechanism, so as to at least solve the problem of low accuracy of existing exchange rate prediction schemes.
[0006] In order to achieve the above-mentioned objectives, the first aspect of the present invention provides an exchange rate prediction method based on a multi-agent introspection mechanism, the method comprising: collecting prediction demand information entered by a user, and parsing the prediction demand to obtain a plurality of decomposed tasks; executing each decomposed task, collecting corresponding initial prediction data, and preprocessing the collected initial prediction data to obtain prediction data; performing feature construction based on the prediction data, and performing exchange rate prediction based on the constructed features to obtain an exchange rate prediction result.
[0007] Optionally, the parsing of the forecast demand includes: processing the forecast demand information entered by the user into corresponding text information; using the text information as an input parameter of a parsing model to identify task-related factor information in the text information; wherein the task-related factor information includes: any one or more of time range, exchange rate type and market dynamic information; and performing task decomposition based on the identified factor information to obtain multiple decomposed tasks.
[0008] Optionally, the parsing model is constructed based on a large language model, and a ReAct mechanism is added during the construction process.
[0009] Optionally, before executing each decomposed task, the method also includes: sorting the execution order of each decomposed task, including: sorting the execution order of each decomposed task based on the predetermined order of each decomposed task to obtain an initial sorting result; determining whether the target acquisition data corresponding to each decomposed task currently triggers the corresponding sequence correction rule, and if triggered, performing the initial sorting result correction based on the triggered sequence correction rule, and using the corrected sorting result as the determined sorting result; if there is no triggering corresponding sequence correction rule, using the initial sorting result as the determined sorting result.
[0010] Optionally, the corresponding initial prediction data collection includes: based on a static vector database and / or a real-time API data source, performing corresponding initial prediction data collection; the preprocessing of the collected initial prediction data to obtain prediction data includes: data cleaning and standardization of the collected static vector data and real-time dynamic data, and integration of the processed static vector data and the output processed real-time dynamic data.
[0011] Optionally, feature construction is performed based on the predicted data, including: constructing corresponding features based on each predicted data, and evaluating the influence of each feature on exchange rate fluctuations based on the information gain algorithm model; identifying core features based on the influence of each feature on exchange rate fluctuations to construct a core feature set; performing exchange rate prediction based on the constructed features to obtain exchange rate prediction results, including: executing a pre-trained exchange rate prediction model based on the core feature set, and outputting the corresponding exchange rate prediction initial results.
[0012] Optionally, the information gain algorithm model is:
[0013] IG(T,F)=H(T)-H(TF)
[0014] Among them, IG(T,F) is the information gain of feature F on target T; H(T) is the entropy of target T; H(T|F) is the conditional entropy of target T given feature F.
[0015] Optionally, the method also includes: after obtaining actual data at the prediction time node, comparing the exchange rate prediction result of the corresponding prediction time node based on the actual data, and determining the error type based on the comparison result; optimizing the exchange rate prediction model based on the error type, and using the optimized exchange rate prediction model as the exchange rate prediction model to be executed for the next prediction.
[0016] The second aspect of the present invention provides an exchange rate prediction system based on a multi-agent introspection mechanism, the system comprising: a collection unit, used to collect prediction demand information entered by a user, and to parse the prediction demand to obtain a plurality of decomposed tasks; an execution unit, used to execute each decomposed task, to collect corresponding initial prediction data, and to pre-process the collected initial prediction data to obtain prediction data; a prediction unit, used to perform feature construction based on the prediction data, and to perform exchange rate prediction based on the constructed features to obtain an exchange rate prediction result.
[0017] On the other hand, the present invention provides a computer-readable storage medium having instructions stored thereon, which, when executed on a computer, enables the computer to execute the above-mentioned exchange rate prediction method based on the multi-agent introspection mechanism.
[0018] Through the above technical solution, the solution of the present invention collects the forecast demand information entered by the user and analyzes the demand, decomposing the complex exchange rate forecasting task into multiple subtasks, which helps to improve the precision and pertinence of the forecast. When executing the decomposed task, the system first collects and preprocesses the initial forecast data to ensure the quality and consistency of the data, thereby providing a reliable basis for subsequent forecasts. Then, through the feature construction technology, the key features related to exchange rate fluctuations are extracted to enhance the model's perception of market changes. Finally, the exchange rate forecast based on the constructed features can improve the accuracy and adaptability of the forecast results. The overall process systematically improves the accuracy and real-time performance of exchange rate forecasting through steps such as task decomposition, data preprocessing, and feature construction, and effectively solves the shortcomings of traditional forecasting methods in real-time data processing, feature selection, and flexibility.
[0019] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0021] Figure 1 It is a flowchart of the steps of an exchange rate prediction method based on a multi-agent introspection mechanism provided by an embodiment of the present invention;
[0022] Figure 2 It is a system structure diagram of an exchange rate prediction system based on a multi-agent introspection mechanism provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.
[0024] Figure 1 FIG. 1 is a flow chart of a method for predicting exchange rates based on a multi-agent introspective mechanism provided by an embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides an exchange rate prediction method based on a multi-agent introspection mechanism, the method comprising:
[0025] Step S10: Collect the forecast demand information entered by the user, and analyze the forecast demand to obtain multiple decomposed tasks.
[0026] Specifically, the parsing of the forecast demand includes: processing the forecast demand information entered by the user into corresponding text information; using the text information as an input parameter of a parsing model to identify task-related factor information in the text information; wherein the task-related factor information includes: any one or more of time range, exchange rate type and market dynamic information; and performing task decomposition based on the identified factor information to obtain multiple decomposed tasks.
[0027] Preferably, the parsing model is constructed based on a large language model, and a ReAct (Reasoning and Acting) mechanism is added during the construction process.
[0028] In the embodiment of the present invention, the solution of the present invention realizes intelligent demand analysis and task planning through large language models (LLMs) and ReAct mechanism. This method can not only decompose complex forecasting requirements into multiple subtasks, but also dynamically adjust the execution order of tasks according to actual conditions, thereby improving forecasting efficiency and accuracy.
[0029] Furthermore, the user first inputs the forecasting requirements, such as "forecast the RMB against the US dollar in June 2024". These demand information are converted into text format to facilitate subsequent parsing and processing. This step ensures that the user's forecasting requirements can be processed by the framework in a structured form, laying the foundation for subsequent task planning. The text information is parsed using a large language model, and task-related factor information is identified. These factors may include time range (for example, June 2024), exchange rate type (RMB against the US dollar), and market dynamics information (such as political or economic events that may affect exchange rate fluctuations). The extraction of these factors helps to accurately understand the user's needs and decompose tasks according to the weights and priorities of different factors.
[0030] Furthermore, based on the identified factor information, the forecasting task is decomposed into multiple specific subtasks. For example, in the above forecasting requirements, the tasks can be decomposed into "collecting historical exchange rate data for relevant time periods", "calling real-time APIs to obtain the latest market data", "building and training forecasting models", "performing exchange rate forecasts", etc. Through task decomposition, complex forecasting tasks can be broken down into multiple smaller, easy-to-manage subtasks, thereby improving the refinement of forecasts and execution efficiency.
[0031] Preferably, before executing each decomposed task, the method also includes: sorting the execution order of each decomposed task, including: sorting the execution order of each decomposed task based on the predetermined order of each decomposed task to obtain an initial sorting result; determining whether the target acquisition data corresponding to each decomposed task currently triggers the corresponding sequence correction rule, and if triggered, performing the initial sorting result correction based on the triggered sequence correction rule, and using the corrected sorting result as the determined sorting result; if there is no triggering corresponding sequence correction rule, using the initial sorting result as the determined sorting result.
[0032] In an embodiment of the present invention, before executing each decomposed task, the tasks are sorted based on a predetermined order. For example, data collection is usually the primary task because model training needs to rely on historical data and the latest market information. A preliminary sorting is performed based on the characteristics and priorities of the subtasks to form an initial task execution order. In the process of executing the tasks, market dynamics and data collection are continuously monitored. Once the conditions of a decomposed task trigger the order correction rule (such as a large fluctuation in the market, incomplete data collection, etc.), the initial sorting result is corrected according to the triggered rule. For example, when the foreign exchange market fluctuates violently, the task of obtaining the latest market data is executed first to ensure the real-time nature of the forecast input.
[0033] Furthermore, the execution order of tasks not only depends on the initial plan, but also dynamically adjusts according to market changes and system operation. For example, if the execution of a subtask depends on the results of other tasks, these tasks are prioritized according to data availability and time constraints. In addition, if market data changes frequently, the intelligence module can be called at any time to obtain the latest information to ensure that the forecast model uses the latest data for calculation.
[0034] Based on the solution of the present invention, the ReAct mechanism is a technology that adds reasoning and operation capabilities based on a large language model. By combining reasoning with actual operation steps, the system can make intelligent decisions during task decomposition and execution. The specific applications of this mechanism in this framework include:
[0035] 1) Combining intelligent reasoning and operation Based on the large language model, the ReAct mechanism is introduced, which enables the system to not only perform semantic analysis on the input forecast requirements, but also make intelligent reasoning based on the analysis results. For example, when the market suddenly shows unstable signals, the ReAct mechanism can infer possible influencing factors and adjust the priority of tasks in a timely manner.
[0036] 2) Adaptive data collection and processing The ReAct mechanism enables the system to dynamically respond to and process real-time data. When the market fluctuates, the system can automatically adjust the frequency and scope of data collection according to demand to ensure the timeliness and accuracy of model input. This adaptive data processing method greatly improves the reliability of forecast results.
[0037] Preferably, in practical applications, exchange rate forecasting needs to integrate historical data and the latest market information. The system first decomposes tasks and arranges two subtasks, "historical data collection" and "real-time data collection", respectively. Historical data can help the model capture long-term trends, while real-time data provides the model with the latest market dynamics. By combining the two, a more comprehensive forecasting model can be built. The order of task execution can be flexibly adjusted according to various factors in the forecasting requirements, such as time range, exchange rate type, and market dynamics. For example, when predicting long-term exchange rate trends, historical data may dominate, while when predicting short-term fluctuations, the importance of real-time data will be significantly increased. By dynamically adjusting the execution order of tasks, different types of forecasting requirements can be adapted. When emergencies occur in the market (such as major policy changes or economic crises), the ReAct mechanism can respond quickly to these external factors and adjust the input data and parameter settings of the forecasting model in real time. This intelligent task allocation and adjustment mechanism enables the system to provide more accurate forecasting results in a highly uncertain environment.
[0038] Based on the solution of the present invention, by decomposing the complex exchange rate prediction task into multiple subtasks and dynamically adjusting the execution order of the tasks, the uncertainty of the data and the dynamic changes of the market can be better handled. This method effectively improves the accuracy of the prediction and makes the prediction results more valuable for reference. In the process of executing the task, the order of the tasks can be adjusted according to the real-time situation of the market. By introducing the ReAct mechanism, it is possible to respond quickly in the face of emergencies and ensure that the data input to the model is the latest. This mechanism greatly enhances the adaptability of the system in a complex market environment. Task decomposition enables the system to execute multiple subtasks in parallel, thereby improving the execution efficiency of the overall prediction. In addition, the sorting mechanism based on task priority ensures the priority execution of key tasks, which helps to maximize the accuracy of the prediction under time constraints.
[0039] Step S20: Execute each decomposition task, collect corresponding initial prediction data, and pre-process the collected initial prediction data to obtain prediction data.
[0040] Specifically, based on the static vector database and / or the real-time API data source, the corresponding initial prediction data is collected; the collected initial prediction data is preprocessed to obtain the prediction data, including: cleaning and standardizing the collected static vector data and real-time dynamic data, and integrating the processed static vector data with the processed real-time dynamic data.
[0041] In an embodiment of the present invention, the static vector database contains information such as historical exchange rate data, macroeconomic indicators, and policy change records, providing rich background knowledge and long-term market trend data. When performing a forecasting task, the static data related to the forecasting task is first retrieved from the static vector database. These data help to build the long-term trend forecasting capability of the model, and are particularly suitable for analyzing seasonal changes and cyclical fluctuations. In order to improve the real-time performance of the data, the latest market dynamic information is obtained from the real-time API data source, including current exchange rate fluctuations, foreign exchange trading volume, major economic events, etc. These real-time data reflect the latest status of the market and are the key to the timely response of the forecasting model to market changes. Through a customized data interface, different data sources can be flexibly accessed to ensure that the latest market data can be obtained in a timely manner. After completing the collection of static vector data and real-time dynamic data, the two types of data are integrated and processed. This process can not only generate more comprehensive data inputs, but also avoid the reduction in the accuracy of the forecast results due to the deviation of a single data source. By combining multiple data sources, the system can better capture the diversity and complexity of the market.
[0042] Furthermore, the collected initial data usually contains noise and outliers, such as missing data, unreasonable values, and duplicate data. First, the data is cleaned, invalid data is removed, and missing values are filled. This process ensures the integrity and reliability of the input data and provides a high-quality data foundation for model training and prediction. Data from different sources may have different scales and units. In order to ensure the consistency of data in the model, the cleaned data is standardized so that each data feature is within the same dimension range. Standardized data can improve the training efficiency of the model and enhance the stability of the prediction results. After data cleaning and standardization, the processed static vector data and real-time dynamic data are integrated. Through this step, long-term historical trends can be combined with short-term market changes to provide multi-dimensional feature input. This data fusion method not only improves the richness of the data, but also enhances the sensitivity of the model to market fluctuations.
[0043] Based on the solution of the present invention, more comprehensive market information can be obtained by combining static vector data and real-time API data sources. This integrated processing of multi-source data improves the model's ability to perceive market fluctuations and significantly improves the accuracy of predictions. Not only can different data sources be dynamically accessed according to demand, but the model input can also be updated in time when the data changes. This flexibility in data processing enables the model to respond quickly to market changes and maintain the real-time nature of the prediction results. The data cleaning and standardization steps can effectively reduce the impact of noise and outliers on the prediction results, thereby improving the stability of the model. Through systematic data preprocessing, the system can still maintain a high prediction effect when facing a complex market environment.
[0044] Step S30: Perform feature construction based on the forecast data, and perform exchange rate forecasting based on the constructed features to obtain an exchange rate forecasting result.
[0045] Specifically, feature construction is performed based on the predicted data, including: constructing corresponding features based on each predicted data, and evaluating the influence of each feature on exchange rate fluctuations based on the information gain algorithm model; identifying core features based on the influence of each feature on exchange rate fluctuations to construct a core feature set; performing exchange rate prediction based on the constructed features to obtain exchange rate prediction results, including: executing a pre-trained exchange rate prediction model based on the core feature set, and outputting a corresponding initial exchange rate prediction result.
[0046] Furthermore, the information gain algorithm model is:
[0047] IG(T,F)=H(T)-H(TF)
[0048] Among them, IG(T,F) is the information gain of feature F on target T; H(T) is the entropy of target T; H(T|F) is the conditional entropy of target T given feature F.
[0049] In an embodiment of the present invention, in exchange rate prediction, feature construction and selection are important factors in model prediction accuracy. Feature construction refers to the process of extracting and generating input features that are helpful for model prediction from prediction data, while feature selection is to select the features that have the greatest influence on the prediction task from a large number of features, and evaluate the degree of influence of each feature on exchange rate fluctuations through the information gain algorithm, so as to screen and optimize the features. Information gain (IG) is used to evaluate the influence of a feature on the prediction target. By calculating the information gain, the contribution of each feature to reducing the uncertainty of the target prediction can be quantified. This calculation method can help the model screen out the features that have the greatest impact on exchange rate fluctuations, thereby building a more accurate prediction model.
[0050] Furthermore, the foreign exchange market is complex and changeable, and the factors that affect exchange rate fluctuations may change with changes in the market environment. Therefore, a feature selection strategy based solely on statics may not be able to fully adapt to the rapid changes in the market. The framework shown in the figure calculates information gain in real time and combines an adaptive mechanism to enable feature selection to be dynamically adjusted as data changes. This approach ensures that the model can respond quickly to market fluctuations and select the features with the most predictive value.
[0051] Specifically, feature construction is to generate model input features based on existing prediction data. The process is divided into several steps:
[0052] 1) Feature extraction: Extract various features from the forecast data, such as time series characteristics of exchange rates, market dynamic characteristics, macroeconomic characteristics, etc.
[0053] 2) Feature combination: Combine multiple features to generate new composite features to capture more complex market change patterns. For example, by combining market volatility and trading volume, a new feature can be generated to reflect the market activity.
[0054] 3) Feature transformation: Perform mathematical transformation (such as logarithmic transformation, difference, etc.) on the extracted features to reduce noise and enhance the model's ability to model nonlinear relationships.
[0055] Through feature construction, the system can not only retain the original feature information, but also generate more complex and diverse input features, thereby improving the expressive power of the prediction model.
[0056] Furthermore, after completing the feature construction and feature selection, the exchange rate forecast is performed based on the constructed features. In order to further improve the accuracy of the forecast, a dynamic tuning mechanism is applied to fine-tune the model. Based on the selected and constructed features, a variety of forecasting models (such as linear regression, random forest, neural network, etc.) will be trained, and the forecast results of these models will be weighted and combined through ensemble learning. This method can complement the forecasting advantages of different models, thereby improving the overall forecasting accuracy. During the training process, a dynamic supervised fine-tuning mechanism is used to adjust the feature weights in real time. The principle is to continuously evaluate the importance of each feature to the forecast results during the model training process, and adjust the feature weights in a timely manner according to market changes. This fine-tuning method can enable the model to maintain a high forecasting performance in the face of a changing market. The loss function formula of SFT is as follows:
[0057]
[0058] Among them, r t (W) represents the adjustment rate of feature weight, It is the contribution of the feature to the prediction effect ∈ that controls the magnitude of the weight adjustment. Through this mechanism, the functional module can dynamically adjust the feature weights so that the model can maintain its prediction performance in different market environments and respond to rapid changes in the market.
[0059] In order to better model the complex relationship between features, the factorization machine (FM) is introduced to optimize feature interactions. FM can efficiently process sparse data and improve the accuracy of prediction by modeling second-order feature interactions. Its core formula is:
[0060]
[0061] Among them, w0 is the bias term, w i is the linear weight of the i-th feature; <v i , v j > represents the inner product of the i-th and j-th feature latent vectors, which is used to model the second-order interaction between features; x i and x j is the input feature. Through the FM model, the system can capture complex feature interactions and thus improve the accuracy of prediction.
[0062] Preferably, in order to adapt to the dynamic changes in the market, the feature weights and latent vectors of the FM model can be dynamically adjusted through the SFT mechanism. The specific update formula is as follows:
[0063] w i (t+1)=w i (t)+∈·r t (w i )
[0064] v i (t+1)=v i (t)+∈·r t (v i )
[0065] Among them, r t (w i ) and r i (v i ) represent the adjustment rates of feature weights and latent vectors, respectively, and are adjusted based on the evaluation results of feature contributions by the intelligence module. Through this dynamic adjustment, the FM model can not only respond to feature interactions under different market environments, but also optimize the model's prediction accuracy based on the changes in feature importance within a specific time period.
[0066] Based on the scheme of the present invention, through the introduction of feature construction, selection and FM model, the complex pattern of exchange rate fluctuations can be better captured, thereby improving the accuracy of prediction. Using the SFT dynamic fine-tuning mechanism, the system can adjust the feature weights and model parameters in real time according to market changes to ensure high prediction performance under different market environments. The information gain algorithm combined with the dynamic supervision mechanism can quickly screen out the most valuable features, reduce the complexity of the model, and improve the training and prediction efficiency of the model.
[0067] Preferably, the method further includes: after obtaining actual data at the prediction time node, comparing the exchange rate prediction result at the corresponding prediction time node based on the actual data, and determining the error type based on the comparison result; optimizing the exchange rate prediction model based on the error type, and using the optimized exchange rate prediction model as the exchange rate prediction model to be executed for the next prediction.
[0068] In the embodiment of the present invention, after obtaining the actual data at the prediction time node, the actual exchange rate data is compared with the prediction result to determine the prediction error. According to the content in the figure, the calculation formula of the error is:
[0069]
[0070] Among them, y t is the actual value, is the predicted value of FN-Agents. By calculating the error, we can understand the performance of the model in the current task and provide a basis for subsequent model optimization. The introspection mechanism analyzes the source of the prediction error and examines potential problems in the prediction process from multiple perspectives. For example, the model may not be adjusted in time due to unreasonable feature weight settings, problems with data preprocessing, or drastic changes in the market environment. The reflection module does not directly participate in data processing and feature selection, but provides reflection and optimization suggestions for future tasks by analyzing the decision-making process of FN-Agents.
[0071] Furthermore, in practical applications, errors can be divided into multiple types, such as systematic errors and random errors. Systematic errors are usually caused by defects in the model itself or deviations in the training data, while random errors may come from unpredictable factors in the market. Based on the different types of errors, the system can take corresponding optimization measures:
[0072] 1) Processing of systematic errors: When systematic errors are found, the system needs to adjust the model structure, such as reallocating feature weights or introducing new features, to reduce the cumulative effect of errors.
[0073] 2) Handling of random errors: For random errors, the system can reduce their impact by improving the robustness of the model, such as adding regularization terms to the model or introducing more training data to improve the generalization ability of the model.
[0074] Furthermore, based on the comparison results and error analysis, the system will adaptively optimize the exchange rate prediction model. The optimization methods include but are not limited to:
[0075] 1) Dynamic adjustment of feature weights: Based on error feedback, the system can adjust the weights of features in the model in real time. For example, when a feature shows strong predictive ability in multiple predictions, the system will appropriately increase its weight.
[0076] 2) Introduce new features or remove invalid features: Through the analysis of the reflection module, if it is found that some features have little impact on the prediction results, these features can be removed in the next prediction task, otherwise new useful features can be added.
[0077] 3) Update of model structure: When encountering large market fluctuations, simple feature adjustments may not be sufficient to improve the performance of the model. At this time, the system can consider updating the model structure, such as switching from a linear model to a nonlinear model, or adding a new neural network layer to the existing model.
[0078] Based on the scheme of the present invention, through systematic analysis and targeted adjustment of errors, the system can effectively reduce prediction errors and improve the accuracy of exchange rate prediction. This is of great significance for high-frequency trading and long-term trend analysis in the financial market. Error analysis and adaptive optimization enable the system to flexibly respond to dynamic changes in the market. In particular, when the market environment changes suddenly, the system can quickly adjust the prediction strategy to reduce the prediction deviation caused by market fluctuations. Error analysis and adaptive adjustment can also optimize the training and prediction process of the model and reduce unnecessary computing overhead. For example, by dynamically adjusting the weight and selection of features, the processing of useless features can be reduced, thereby improving the resource utilization efficiency of the system.
[0079] Figure 2 1 is a system structure diagram of an exchange rate prediction system based on a multi-agent introspection mechanism provided by an embodiment of the present invention. Figure 2 As shown, an embodiment of the present invention provides an exchange rate prediction system based on a multi-agent introspection mechanism, the system comprising: a collection unit, used to collect prediction demand information entered by a user, and to parse the prediction demand to obtain a plurality of decomposed tasks; an execution unit, used to execute each decomposed task, to collect corresponding initial prediction data, and to pre-process the collected initial prediction data to obtain prediction data; a prediction unit, used to perform feature construction based on the prediction data, and to perform exchange rate prediction based on the constructed features to obtain an exchange rate prediction result.
[0080] The embodiment of the present invention further provides a computer-readable storage medium, on which instructions are stored, which, when executed on a computer, enable the computer to execute the above-mentioned exchange rate prediction method based on the multi-agent introspection mechanism.
[0081] Those skilled in the art will understand that all or part of the steps in the method for implementing the above-mentioned embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions for making a single-chip microcomputer, a chip or a processor (processor) perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0082] The optional embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above embodiments. Within the technical concept of the embodiments of the present invention, the technical scheme of the embodiments of the present invention can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the embodiments of the present invention. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the embodiments of the present invention will not further describe various possible combinations.
[0083] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the embodiments of the present invention, they should also be regarded as the contents disclosed in the embodiments of the present invention.
Claims
1. A method for exchange rate prediction based on a multi-agent introspective mechanism, characterized in that: The method comprises: Collecting forecast demand information entered by the user, and parsing the forecast demand to obtain multiple decomposed tasks; Execute each decomposition task, collect corresponding initial prediction data, and pre-process the collected initial prediction data to obtain prediction data; Feature construction is performed based on the forecast data, and exchange rate forecasting is performed based on the constructed features to obtain exchange rate forecasting results.
2. The method according to claim 1, characterized in that The analyzing the predicted demand includes: Processing the predicted demand information entered by the user into corresponding text information; The text information is used as the input parameter of the parsing model to identify the task-related factors in the text information; Task-related information includes: Any one or more of time frame, exchange rate type and market dynamic information; Based on the identified factor information, the corresponding execution task is decomposed to obtain a plurality of decomposed tasks.
3. The method according to claim 2, characterized in that The parsing model is constructed based on a large language model, and a ReAct mechanism is added during the construction process.
4. The method according to claim 1, characterized in that Before executing each decomposed task, the method further includes: Sort the execution order of each decomposed task, including: Sorting the execution order of each decomposed task based on the predetermined order of each decomposed task to obtain an initial sorting result; Determine whether the target acquisition data corresponding to each decomposed task currently triggers the corresponding sequence correction rule; if triggered, perform the correction of the initial sorting result based on the triggered sequence correction rule, and use the corrected sorting result as the determined sorting result; If there is no triggering corresponding order correction rule, the initial sorting result is used as the determined sorting result.
5. The method according to claim 1, characterized in that The corresponding initial prediction data collection includes: Based on the static vector database and / or real-time API data source, corresponding initial prediction data collection is performed; The preprocessing of the collected initial prediction data to obtain the prediction data includes: The collected static vector data and real-time dynamic data are cleaned and standardized, and the processed static vector data and the output processed real-time dynamic data are integrated.
6. The method according to claim 1, characterized in that Perform feature construction based on prediction data, including: Construct corresponding features based on each forecast data, and evaluate the impact of each feature on exchange rate fluctuations based on the information gain algorithm model; Identify core features based on the impact of each feature on exchange rate fluctuations to build a core feature set; The performing exchange rate prediction based on the structural features to obtain the exchange rate prediction result includes: Execute the pre-trained exchange rate prediction model based on the core feature set and output the corresponding initial exchange rate prediction results.
7. The method according to claim 6, characterized in that The information gain algorithm model is: IG(T,F)=H(T)-H(TF) Among them, IG(T,F) is the information gain of feature F to target T; H(T) is the entropy of target T; H(TF) is the conditional entropy of target T given feature F.
8. The method according to claim 6, characterized in that The method further comprises: After obtaining the actual data at the forecast time node, compare the actual data with the exchange rate forecast result at the corresponding forecast time node, and determine the error type based on the comparison result; The exchange rate prediction model is optimized based on the error type, and the optimized exchange rate prediction model is used as the exchange rate prediction model to be executed for the next prediction.
9. An exchange rate prediction system based on a multi-agent introspective mechanism, characterized in that: The system comprises: A collection unit, used to collect the forecast demand information entered by the user, and analyze the forecast demand to obtain multiple decomposed tasks; An execution unit, used to execute each decomposed task, collect corresponding initial prediction data, and pre-process the collected initial prediction data to obtain prediction data; The prediction unit is used to perform feature construction based on the prediction data, and perform exchange rate prediction based on the constructed features to obtain an exchange rate prediction result.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the exchange rate prediction method based on a multi-agent introspection mechanism as described in any one of claims 1 to 8.