A data structure self-adaptive visualization method based on a large language model
By combining a dynamic financial knowledge graph with a large language model, the problems of low generation efficiency and insufficient accuracy in financial risk analysis are solved, realizing automated risk simulation and visualization, and improving the accuracy and efficiency of analysis.
Patent Information
- Application Number
- CN202511270675.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-09-08
AI Technical Summary
Existing financial risk analysis methods based on large language models are inefficient and inaccurate, requiring extensive manual verification and correction, and cannot meet the demands of fast-paced, high-precision financial risk management.
By constructing a dynamic financial knowledge graph, utilizing large language models to process quantitative and textual data, updating risk transmission weights in real time, generating multiple visualizations of future possibilities, and providing interactive counterfactual analysis and attribution reports, automated risk simulation and visualization are achieved.
It improves the accuracy and efficiency of analysis, reduces the time required for manual verification, and enhances the efficiency of financial risk management and the credibility of decision-making.
Smart Images

Figure CN120744145B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of financial knowledge graph, and particularly relates to a data structure adaptive visualization method based on a large language model. BACKGROUND
[0002] In the field of financial risk analysis, analysts often need to conduct ad hoc and exploratory data analysis on complex data such as market fluctuations and credit risks. In order to improve the efficiency of this process, the industry has begun to explore the use of large language models to directly convert natural language queries into visualization code. The goal is to quickly generate visual charts for hypothesis testing or communication of findings.
[0003] However, in the actual application of financial risk analysis, this method has the problem of low generation efficiency. When understanding the intentions of analysts, large language models generate incorrect and ambiguous problems. Since financial decisions have very high requirements for the accuracy of data visualization, any errors can lead to serious risk misjudgments, so these automatically generated icons cannot be directly trusted and used. They must invest a lot of time in manual code review, verification and repeated debugging to ensure that the final presentation of the chart is accurate and reliable. This necessary verification and correction process constitutes a major work bottleneck, limiting the value of this technology in fast-paced, high-precision financial risk management scenarios.
[0004] Therefore, a data structure adaptive visualization method based on a large language model is proposed. SUMMARY
[0005] The purpose of the present application is to provide a data structure adaptive visualization method based on a large language model, which realizes interactive risk simulation and automatic attribution analysis of visualization results through dynamic knowledge graph and interactive simulation attribution. First, internal quantitative data and external unstructured text data of an investment portfolio are obtained; the quantitative data and the text data are processed using a large language model to construct a dynamic financial knowledge graph, and the risk transmission weights between entities in the dynamic knowledge graph are updated in real time using causal events extracted from the text data; a risk shock hypothesis input by a user is received, and based on the dynamic financial knowledge graph and the risk shock hypothesis, forward-looking simulation is performed to generate multiple synthetic risk data paths; a visualization result is generated based on the multiple synthetic risk data paths; in response to the user's selection of a specific simulation result on the visualization result, counterfactual analysis is performed to generate an attribution report containing contribution degrees, thereby realizing interactive risk simulation and automatic attribution analysis of visualization results.
[0006] To achieve the above purpose, the present application provides the following technical scheme:
[0007] A data structure adaptive visualization method based on a large language model, comprising:
[0008] obtaining internal quantitative data and external unstructured text data of a portfolio; processing the external unstructured text data by using a large language model to extract structured causal events;
[0009] constructing a dynamic financial knowledge graph by using the internal quantitative data and the structured causal events, and updating risk transmission weights between entities in the dynamic financial knowledge graph in real time by using the structured causal events;
[0010] receiving a risk shock hypothesis input by a user, performing forward-looking simulation based on the dynamic financial knowledge graph and the risk shock hypothesis to generate a plurality of synthetic risk data paths representing a plurality of possible futures, generating a visualization result based on the plurality of synthetic risk data paths, the visualization result being bound with traceability links, and in response to a selection of a specific simulation result on the visualization result by the user, performing path sensitivity analysis to identify a set of driving factors;
[0011] performing a counterfactual analysis by using a revised simulation method based on the driving factors to determine a quantitative contribution of the driving factors to the specific simulation result, and generating an attribution report.
[0012] Preferably, the step of obtaining internal quantitative data and external unstructured text data of a portfolio, processing the external unstructured text data by using a large language model to extract structured causal events comprises:
[0013] The internal quantitative data includes daily position details, historical transaction records and daily profit and loss time series of the portfolio; the external unstructured text data includes announcements of regulatory authorities, financial news articles and financial reports of listed companies;
[0014] Performing named entity recognition and relationship extraction on the external unstructured text data by using a large language model to convert the text data into structured causal events containing event type, participating entity and impact parameter.
[0015] Preferably, the process of constructing a dynamic financial knowledge graph comprises:
[0016] initializing a base knowledge graph containing a predefined financial ontology, the financial ontology defining entity types, attribute types and relationship types;
[0017] fusing the structured causal event with the base knowledge graph, the fusion process including creating and updating nodes in the knowledge graph corresponding to entities in the structured causal event, creating and updating relationship edges between the nodes representing the structured causal event, adjusting risk transmission weights associated with the relationship edges and nodes according to impact parameters of the structured causal event; attaching a time-decay function to the updated risk transmission weights, and assigning a confidence score to the relationship edges and weights according to information sources of the text data.
[0018] Preferably, the step of adjusting the risk transmission weights associated with the relationship edges and nodes according to the impact parameters of the structured causal event includes:
[0019] instantiating a set of virtual economic agents related to the structured causal event from a pre-defined agent library based on the impact range of the structured causal event, each agent being endowed with a specific role and behavior pattern;
[0020] presenting the structured causal event as input information to the instantiated agent set, and using the large language model to drive each agent to generate decision and behavioral responses to the structured causal event according to its role and behavior pattern;
[0021] summarizing the decision and behavioral responses generated by the agent set, quantifying the summary result as an adjustment value, and using the adjustment value to update the risk transmission weights.
[0022] Preferably, the step of performing forward-looking simulation based on the dynamic financial knowledge graph and the risk shock hypothesis includes:
[0023] using the large language model to parse the natural language input risk shock hypothesis into a structured intervention parameter object, and when there is ambiguity in the hypothesis parsing, generating a clarification question based on the dynamic financial knowledge graph for user confirmation;
[0024] applying the structured intervention parameter object to the dynamic financial knowledge graph, and adjusting the quantitative attributes of the graph elements associated with the intervention parameter object in the dynamic financial knowledge graph;
[0025] performing Monte Carlo simulation, using the adjusted quantitative attributes of the graph elements in the dynamic financial knowledge graph to define the random process and related parameters of the Monte Carlo simulation, and generating the plurality of synthetic risk data paths.
[0026] Preferably, the step of generating a visual result includes:
[0027] For each of the plurality of synthetic risk data paths and statistical derivative elements, a traceability link pointing to a corresponding driving factor in the dynamic financial knowledge graph is established; on the visualization result, the traceability link is bound with the corresponding visualization element, and the user triggers counterfactual analysis for the driving factor by interacting with the visualization element.
[0028] Preferably, the process of establishing a traceability link pointing to a corresponding driving factor in the dynamic financial knowledge graph comprises: for a specified path in the synthetic risk data path, performing path sensitivity analysis to obtain a quantitative impact score of each driving factor, calculating the sum of the absolute values of the quantitative impact scores of all driving factors, and sorting each driving factor in descending order, and selecting driving factors from the top whose cumulative sum of the absolute values of the quantitative impact scores reaches a preset percentage of the total as the main driving risk factors.
[0029] Based on the analysis result, a data structure containing the sorted driving factor identification and quantitative impact score is generated as the traceability link.
[0030] Preferably, the step of performing counterfactual analysis comprises: for the main driving risk factor, performing a modified simulation by temporarily suppressing its risk transmission weight in the dynamic financial knowledge graph; comparing the specific simulation result with the modified simulation result to calculate the quantitative contribution degree of the main driving risk factor.
[0031] Compared with the prior art, the beneficial effects of the present application are:
[0032] 1. By constructing a dynamic financial knowledge graph that integrates real-time text events, the method provides a deep business context for analysis. Compared with the background technology, when a large language model faces isolated data, it generates a large number of ambiguous and incorrect visualization codes due to lack of understanding. The present method enables analysis to be based on a structured, associated and up-to-date knowledge network, which guarantees the accuracy and relevance of the analysis from the source, resulting in higher quality of the initially generated visualization results and greatly improving efficiency.
[0033] 2. By introducing a forward-looking simulation function based on natural language assumptions, the method converts a single visualization request into a one-time, multi-path future scenario exploration. By describing a complex risk assumption using natural language, thousands of simulations can be automatically performed, and a visualization result presenting the probability distribution of multiple future possibilities can be generated at once. This "batch" exploration mode compresses the repetitive chart generation work that would take hours or even days into a single efficient simulation and visualization process, greatly improving the overall efficiency of exploratory risk analysis.
[0034] 3. By providing interactive counterfactual analysis and instant attribution reporting, the method solves the core efficiency bottleneck in the background art due to the need for manual review and debugging of results. In previous workflows, even if the chart is generated correctly, the analyst still needs to spend a lot of time tracing data and checking logic to understand the reasons behind an abnormal result. The invention fully automates this process: the user selects a specific simulation result on the visualized result, and instant counterfactual analysis and attribution report containing the contribution of each risk factor are generated. This replaces the time-consuming and laborious manual "troubleshooting" with one-click automatic "explanation", effectively shifting the focus of the analysis work from tedious technical verification to core business insight and decision-making, thereby significantly optimizing the workflow and improving the analysis efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0035] Fig. 1 A flowchart of a data structure adaptive visualization method based on a large language model is provided for an embodiment of the invention.
[0036] Fig. 2 A flowchart of constructing a dynamic financial knowledge graph is provided for an embodiment of the invention.
[0037] Fig. 3 A flowchart of generating a visual interface is provided for an embodiment of the invention. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the invention will be described in detail below with reference to the drawings in the embodiments of the invention. Obviously, the described embodiments are only a part of the embodiments of the invention, not all. Based on the embodiments in the invention, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the invention.
[0039] Please refer to Figs. 1-3 , the invention provides a data structure adaptive visualization method based on a large language model, and the technical solutions are as follows:
[0040] Embodiment one:
[0041] To improve the visualization code generation efficiency and accuracy in the practical application of financial risk analysis, a data structure adaptive visualization method based on a large language model is introduced, and the specific process is as shown in Fig. 1
[0042] Obtain internal quantitative data and external unstructured text data of the investment portfolio; use a large language model to process the external unstructured text data and extract structured causal events.
[0043] The initial data processing stage is an automatic data collection process that initiates calls to the institutional back-office portfolio management through a secure application programming interface, executes pre-set database queries, obtains internal quantitative data including portfolio daily position details, historical transaction records, and daily profit and loss time series, all of which are attached with a unified data snapshot timestamp. The internal data with the attached timestamp is stored in a database. In addition, multiple external data sources are continuously polled through application programming interfaces, and then based on the financial instrument ID list in the position details, batch requests are initiated to the real-time data API of market data providers to obtain the time series of these instruments and key market benchmarks such as the S&P 500 index, VIX volatility index, and US Treasury interest rates. A list of keywords related to the holding company is also maintained, and this list is used to filter queries to news application programming interfaces and the EDGAR database of the US Securities and Exchange Commission to obtain the original content of regulatory announcements, listed company financial reports, and financial news articles published within the past 24 hours. After all the raw data is collected in a temporary database, all the external unstructured text data obtained is input to a large language model fine-tuned in the financial field to perform causal event extraction. This processing process is a natural language processing task that uses named entity recognition technology to read all the text to identify key financial entities, and uses relationship extraction technology to identify actions and relationships between the key financial entities.
[0044] Finally, standardized structured causal event data objects are obtained, each of which contains a set of pre-defined fields to clearly define event type, participating entities, and specific impact parameters. The original text information is converted into machine-readable structured event data, and together with the quantitative data obtained at the same timestamp, it forms the complete input for the subsequent steps.
[0045] By accurately converting external unstructured text into standardized structured causal event data, high-quality and directly usable input is provided for the construction and real-time weight update of the subsequent dynamic financial knowledge graph. The collection and structuring of multi-modal data provide necessary data support for subsequent realistic forward-looking simulation and precise attribution analysis.
[0046] A dynamic financial knowledge graph is constructed using internal quantitative data and the structured causal events, and the risk transmission weights between entities in the dynamic financial knowledge graph are updated in real time using the structured causal events.
[0047] First, a predefined base financial knowledge graph is loaded. The base financial knowledge graph contains a financial ontology that defines core entity types and typical relationship types among the core entity types in the financial market. The core entity types include, but are not limited to, organizations, whose subtypes include listed companies, financial institutions, and regulatory agencies; financial instruments, whose subtypes include stocks, bonds, and derivatives; geopolitical entities, representing countries or economic regions; individuals, specifically referring to executives or politicians who have a significant impact on the market; macroeconomic indicators, such as consumer price index (CPI) or unemployment rate; and industries, used for business classification of organizations. The typical relationship types include membership and ownership relationships, such as “serves as,” “is a subsidiary of,” and “is issued by”; economic association relationships, such as “has a supplier,” “has a competitive relationship,” and “belongs to an industry”; regulatory and rating relationships, such as “is regulated by” and “is rated by”; and causal impact relationships, such as “influences” and “causes.” The base financial knowledge graph provides an initial, structured financial framework. Subsequently, data fusion operations are performed to map internal quantitative data, including portfolio holding details, into the knowledge graph, establishing relationships between the current portfolio and the financial assets it holds. At the same time, structured causal event data is integrated, for each causal event record, identifying and creating entity nodes related to the event in the knowledge graph, and establishing and modifying relationship edges between these nodes representing the causal relationships described by the event.
[0048] The dynamic adjustment mechanism of risk transmission weights is implemented through a subprogram based on multi-agent simulation. When a causal event extracted from the text needs to be quantified for its impact on the risk network, this subprogram is started. First, according to the nature of the event, a set of virtual economic agents is instantiated from a pre-set agent library. These agents are assigned different market roles such as traders, analysts, and managers, each with specific behavior patterns and decision logic. Then, the structured causal event is presented as input information to all instantiated agents. Driven by a large language model, each agent will independently generate a decision or behavioral response to the event based on its assigned role. These responses are output in the form of natural language text, simulating the diverse reactions that different market participants might have to the same information in the real world. Then, all agent decision responses are collected and aggregated for precise quantitative analysis using a deep learning model based on the BERT architecture. The BERT model has been pre-trained on a large corpus of financial text and fine-tuned for two downstream tasks: sentiment analysis and intent classification. Specifically, the decision response text of each agent is input into this fine-tuned BERT model. The model outputs two results: a continuous sentiment score from -1 to 1 representing the negative or positive inclination of the response, and the response's most matching behavior intent category, which includes "buy," "sell," "hold," and "watch." After obtaining the analysis results of all agent responses, the method will perform a multi-step aggregation and quantification process to calculate the final weight adjustment value. First, calculate the basic emotional impact value. First, calculate the arithmetic mean of all sentiment scores, then multiply the mean by a basic emotional impact coefficient to obtain a basic adjustment part reflecting the overall market sentiment, and the value of the basic emotional impact coefficient is determined by backtesting historical event data and market reactions. Second, calculate the comprehensive behavior impact value. Aimed at quantifying the market behavior structure composed of four different behavior intents comprehensively. First, count the proportion of responses judged as "buy," "sell," "hold," and "watch" in the total responses. Then, weight and sum these proportions to calculate a comprehensive behavior impact component. Specifically, multiply the "buy" proportion by a positive behavior coefficient, the "sell" proportion by a negative behavior coefficient, the "hold" proportion by a stable behavior coefficient, and the "watch" proportion by an uncertainty coefficient. The algebraic sum of these four products constitutes an additional adjustment part reflecting the complex behavior structure of the market. The positive, negative, stable, and uncertainty behavior coefficients, as model parameters of this method, are determined by backtesting historical financial event data and their corresponding market risk fluctuations. Third, combine to generate the final adjustment value.The base emotional impact value and the comprehensive behavior impact value calculated in the previous two steps are weighted and summed to obtain a final weight adjustment value. The weight adjustment value is finally used to update the risk transmission weight on the related relationship edge in the knowledge graph, so as to convert a macroscopic and qualitative event information into a quantitative influence on the strength of the micro risk transmission path.
[0049] By simulating a micro market composed of multiple roles, the diversified reactions and interaction effects of different market participants in the real world when facing the same event can be captured. By using large language model driven agents, the decision logic is no longer limited by rigid preset rules, but has human-like reasoning ability to handle complex and ambiguous information. Finally, by aggregating the "group consensus", the influence is quantified, which not only makes the weight adjustment process more transparent and traceable, but also makes the result closer to the real market dynamics emerging from a large number of heterogeneous subject behaviors, thereby significantly improving the accuracy and fidelity of the entire dynamic risk analysis model to market complexity.
[0050] Finally, to ensure the timeliness and reliability of the knowledge graph model, all risk transmission weights updated due to events are attached with two attributes. One is the timeliness decay function, which simulates the natural weakening of information influence over time; the other is the confidence score, whose value depends on the authority of the original information source of the event. Through the above series of operations, this method constructs and maintains a dynamic financial knowledge graph that can adaptively reflect market changes, providing a solid foundation for subsequent forward-looking analysis.
[0051] By introducing a weight adjustment mechanism based on multi-agent simulation, this method can convert sudden and qualitative news events into quantitative adjustments of risk transmission path weights in real time. This process uses large language model driven agent simulation to give a dynamic and repeatable quantitative framework to the complex connotation of news events, aiming to improve the timeliness and market adaptability of the risk model. In addition, this method provides higher transparency for the quantification process of risk transmission weights, which does not rely on fixed mapping rules, but simulates a micro market containing multiple roles and extracts "group consensus" to provide an interpretable generation logic based on complex behavior for the origin of weight adjustment, thereby enhancing the internal rationality and decision credibility of the risk analysis results.
[0052] Receiving a user input risk shock hypothesis, based on the dynamic financial knowledge graph and the risk shock hypothesis, performing forward-looking simulation to generate a plurality of synthetic risk data paths representing a plurality of future possibilities; generating a visualization result based on the plurality of synthetic risk data paths, the visualization result being bound to a traceability link.
[0053] First, the user input is processed by an intelligent natural language hypothesis parsing subprogram. The natural language hypothesis parsing subprogram receives the user's free text input, calls a large language model configured with a specific tool set, and the model is configured in a proxy mode, whose core task is not to generate free text, but to select the most suitable internal function from a pre-defined tool library according to the semantics of the user input, and to generate parameters that meet the format requirements, through this process, a complex, free-form user input will be decomposed and converted into multiple standardized, machine-readable intervention parameter objects. The subprogram has a knowledge graph-based ambiguity clarification mechanism built in, during the parsing process, if the large language model identifies that the user's expression has ambiguity, for example, the user input is "if the major oil-producing countries have a conflict, leading to sharp fluctuations in oil prices", at this time, the clarification mechanism is triggered. It will actively query the dynamic financial knowledge graph for specific information related to these ambiguous words, and generate clarification questions accordingly. For example, it will present to the user: "Your question has been identified, please confirm or modify the following details:'major oil-producing countries' refer to 'OPEC+ and its allies', 'oil' refers to 'WTI' or 'Brent Crude','sharp fluctuations' refers to 'a 20% price increase within a day' or 'an increase in realized volatility to 80% over the next month', this closed-loop interaction ensures the accuracy of the simulation input.
[0054] Further, traverse each intervention parameter object, and locate the node corresponding to its "target entity" in the knowledge graph through index query. Then, according to the "target attribute" and "impact description" defined in the object, the numerical attributes on the node or its associated edge are temporarily modified programmatically. For example, an intervention object about the impact of crude oil price will directly adjust the price attribute baseline value of the "WTI crude oil" node in the knowledge graph. This operation creates a knowledge graph snapshot in memory that represents the initial state of the market after a specific external shock, serving as the starting point for subsequent simulation.
[0055] Based on the modified knowledge graph snapshot, a high-dimensional Monte Carlo simulation is performed to systematically convert the topology and weights of the graph into mathematical parameters required for simulation. The specific process is as follows: First, a subgraph containing all key entities directly or indirectly affected is extracted from the graph snapshot, and then the weighted adjacency matrix of the subgraph is calculated, where the element value of the matrix is the risk transmission weight between entities. To capture the networked and multi-step risk transmission path, further graph theory algorithms are applied. First, the corresponding graph Laplacian matrix is calculated based on the weighted adjacency matrix. In graph model theory, the graph Laplacian matrix is regarded as the precision matrix of a Gaussian Markov random field. By taking the pseudo-inverse of the graph Laplacian matrix, a covariance matrix that can fully reflect all direct and indirect associations in the graph is generated. The covariance matrix is then used as the core driving parameter of a multivariate geometric Brownian motion random process to perform thousands of independent simulation calculations. Each calculation generates a synthetic risk data path representing the portfolio loss and gain over a predetermined future period, and all these paths collectively form the basis for probabilistic analysis of future possibilities.
[0056] By introducing a natural language parsing function driven by a large language model with ambiguity clarification mechanism, the complex operation of manually inputting accurate parameters required in traditional risk simulation is transformed into an intuitive natural language dialogue. This greatly reduces the threshold for using professional risk analysis tools, enabling non-quantitative decision-makers to conduct in-depth exploration. Secondly, this method systematically converts the topology and weights of the dynamic financial knowledge graph into the core parameters of Monte Carlo simulation through graph algorithms, ensuring that the initial state and evolution path of the simulation not only reflect historical statistical laws, but also incorporate the dynamic impact of sudden events and user-defined assumptions in real time, making the simulation results more realistic and complex.
[0057] In response to the user's selection of a specific simulation result on the visualization result, a path sensitivity analysis is performed to identify a set of driving factors; based on the driving factors, a revised simulation method is performed to conduct counterfactual analysis, determine the quantitative contribution of the driving factors to the specific simulation result, and generate an attribution report.
[0058] First, statistical processing is performed on all synthetic paths to generate a set of basic visualization charts. This set of charts includes probability density graphs for showing the distribution of final gains and losses, risk path graphs for revealing the evolution process of risk over time, and an instrument panel containing key risk indicators, including value at risk and expected loss.
[0059] Further, for a specified extreme loss path, an efficient sensitivity analysis is automatically performed. A gradient calculation technique based on an adjoint state method is adopted, the core principle of which is derived from the chain rule, and the efficient calculation of the gradient is achieved by constructing a reverse computational graph that is accompanied by the original simulation process. Specifically, it starts from the final output (i.e. the profit and loss value of the path), and reversely and layer by layer propagates the gradient from the output end to the input end. The great advantage of this reverse calculation is that, regardless of the number of input parameters, the partial derivatives of the final output with respect to all input parameters can be obtained through one forward calculation and one reverse calculation. The calculated partial derivatives are directly used as the quantitative impact score of each driving factor on the specified path. All driving factors are sorted in descending order according to the absolute value of their impact scores, and the top-ranked group is selected as the main driving risk factor. Specifically, the cumulative contribution method is adopted. First, the sum of the absolute values of the impact scores of all driving factors is calculated, and then the values are added one by one in descending order. When the cumulative value reaches a preset proportion of the total sum, all driving factors in the cumulative process are identified as the main driving risk factor. The preset proportion is found to be the best proportion in the historical data through statistical methods.
[0060] In the process of performing the adjoint state method for gradient reverse propagation, the computational graph of the method not only transmits the gradient value, but also maintains a "path backtracking pointer" for each node. When the gradient is propagated from a node to its adjacent predecessor node, the predecessor node records the adjacent node that contributes the most in the gradient source as its backtracking pointer. After the entire reverse propagation process is completed, the backtracking pointers are traced in reverse from the final portfolio loss node until the initial driving factor node with the highest impact score is reached. The node sequence connected by the backtracking pointers is identified as the key risk transmission path. This path reveals the main transmission chain of risk from its source to the final impact point in a data-driven manner. Finally, the results of the above two tasks are encapsulated into an enhanced traceability link data structure in a common data exchange format. The data structure includes the following core fields: a "main driving risk factor" list, in which each entry records the unique identifier, type, name and quantitative impact score of a driving factor; and a "key transmission path" list, which is an ordered array, and each element in the array is an entity object representing a node on the path, which fully reproduces the step-by-step process of risk transmission.
[0061] The gradient calculation technique based on the adjoint state method is applied, and the quantitative contribution of all input factors to a specific output can be obtained through one backward calculation, which significantly improves the computational efficiency of attribution analysis in high-dimensional parameter space. Furthermore, this method not only identifies the main driving risk factors, but also accurately tracks and extracts the key path of risk transmission from a complex knowledge graph network by introducing a path backtracking pointer mechanism. This provides users with in-depth information about how risks are formed and transmitted, thereby improving the explainability of the analysis from identifying a single cause to understanding the entire impact chain.
[0062] When a one-time analysis is completed, a structured data object containing the analysis results is generated, such as a traceability link data structure containing a list of "main driving risk factors". At this time, the chart recommendation step is triggered, which first parses the metadata and structure of the data object, identifies key features such as data dimensions, field types, and basic statistical characteristics, and determines its analysis intent, including "comparison ranking" and "trend analysis". Subsequently, the parsed data structure features and determined analysis intent are jointly constructed into a structured request and sent to the large language model. The large language model receives the request and performs decision-making, returning a standardized object containing the optimal chart type recommendation and its logical reasons. Finally, the visualization rendering engine receives this recommendation result, automatically selects and configures the corresponding chart library components, and generates and presents expert-level visualizations that best interpret the current analysis results by inputting the original structured data object. In this way, different visualizations can be recommended for different analyses, improving user viewing efficiency.
[0063] In the front-end application, these link data structures are deeply bound to the corresponding visualization elements, for example, when rendering with a graphics library, they are stored as metadata in the data properties of the visualization curve elements representing extreme loss paths. In this way, the visualization results constructed by this method are no longer static pictures, but an intelligent interactive interface rich in backend model information. The front-end application is configured to listen to user click events on these elements, and once an interaction is detected, it immediately reads the link information stored in its metadata and encapsulates the list of main driving risk factors as parameters to automatically initiate a targeted counterfactual analysis request to the backend, thereby completing the complete process from data visualization to triggering deep attribution analysis through user interaction, providing a clear input and start signal for the final counterfactual analysis step.
[0064] By constructing and binding the "traceability link" containing the deep model information, the transparency and explainability of risk analysis are significantly enhanced. Compared with the traditional visualization which focuses on the presentation of simulation results, the core of this method is to give users the ability to explore the internal causes of the results. By introducing the efficient sensitivity analysis and gradient path tracking technology based on the adjoint state method, this method can identify the main driving risk factors of the specified simulation results instantly and quantitatively, and further track the key path of risk transmission in the knowledge graph. It provides users with clear insights from macro results to micro causes, thereby improving the basis and quality of decision-making.
[0065] When the user selects a visualization element associated with a specific simulation result on the generated visualization interface, for example, selects a path representing extreme loss, the front-end application reads the "traceability link" data structure bound on the visualization element. Then, the list of "main driving risk factors" contained in the link is sent to the backend through the application interface request to trigger counterfactual analysis. The analysis process is a "one-by-one suppression" modification simulation method. For each main driving risk factor received from the front end, the backend will perform an independent modification simulation based on the knowledge graph snapshot after the impact that led to the extreme loss path.
[0066] In specific operation, the analysis engine will temporarily "suppress" the influence of the current driving factor, for example, if the driving factor is the attribute of a node, it will reset its value to the original value before the impact. If the driving factor is the weight of a relationship, it will reset its risk transmission weight to zero. If the driving factor is the initial impact introduced by the user, it will temporarily remove the impact. After suppressing the influence of the single driving factor, the analysis engine re-executes the forward-looking simulation with this locally modified knowledge graph as the starting point. This modified simulation generates a new set of synthetic risk data paths. Subsequently, the analysis engine calculates the average final profit and loss of the modified path set and compares it with the profit and loss value of the original extreme loss path selected by the user. This method compares the average final profit and loss of the newly generated synthetic risk data path set with the final loss value of the original extreme loss path, and quantifies the contribution of the current single driving factor to the current extreme loss. Then, for each main driving risk factor in the list, the above-mentioned modification simulation and contribution calculation are repeated. Finally, the quantified contributions of all main driving risk factors are aggregated and normalized, and a clear attribution report is generated. The attribution report is presented to the user in the form of charts and text summaries, intuitively showing the responsibility of each driving factor for causing the specific simulation result.
[0067] By adopting the "one-by-one suppression" correction simulation method, the user can verify the real impact of each key driving factor immediately and interactively after selecting a certain simulation result of interest. By re-simulating a control scenario after suppressing a specific risk factor, the absolute contribution value of the factor to the original result is accurately calculated. This clear and intuitive attribution method provides a data-driven attribution report for the user, which not only greatly enhances the trust in the entire risk model, but also provides the most direct and powerful data support for formulating precise and specific risk source hedging or management strategies.
[0068] The present application improves the accuracy and relevance of analysis by constructing a dynamic financial knowledge graph that integrates real-time text events and provides business context. To improve efficiency, the forward-looking simulation function converts repetitive chart generation into a single multi-path scenario exploration. In addition, the method provides interactive counterfactual analysis and attribution reporting functions, replacing manual review and debugging with automated attribution. Users can select specific simulation results on the visualized results to obtain a quantitative contribution report of their driving factors, shifting the focus from technical verification to business decision-making and further improving the efficiency of the workflow.
[0069] Embodiment two:
[0070] To improve the visual clarity of financial data structures, a data structure adaptive visualization method based on a large language model is introduced.
[0071] The method obtains the daily holding details, historical transaction records, and daily profit and loss time series of the current investment portfolio up to the previous trading day by calling the application programming interface of a mainstream financial data service provider. A continuously running network information acquisition module captures an important news through real-time monitoring of multiple mainstream financial media: "The State Administration releases a draft of the adjustment of new energy vehicle subsidy policy for public comment."
[0072] The original content of the news is input into a large language model fine-tuned on a large amount of Chinese financial corpus. The model performs causal event extraction to generate a structured causal event data object, with the core content parsed as event type "industry regulatory policy change", participating entities "State Administration" and "new energy vehicle industry", and impact parameters "subsidy policy adjustment" and "potential negative impact".
[0073] The causal event triggers a dynamic update of the knowledge graph. An analysis group of virtual economic agents with multiple roles is instantiated. Upon receiving this event information, the agent group generates diverse decision responses. Through a summary analysis of these responses, a short-term negative consensus for the new energy vehicle industry is identified and quantified as a specific adjustment value. This adjustment value is used to adjust the negative risk transmission weight from the "national regulatory authority" node to the "new energy vehicle industry" node in the knowledge graph, as well as to adjust the competitive relationship weight between leading enterprises in the industry.
[0074] The user inputs a query in the natural language interaction interface: "What impact will it have on my holdings if the final draft of the subsidy policy next month is significantly reduced?". The large language model's hypothesis analysis program converts this query into structured intervention parameters. After clarifying the specific proportion of "significant reduction" in the dialogue with the user, the impact is applied to the knowledge graph snapshot, specifically temporarily significantly reducing the "policy support" attribute of the nodes related to the "new energy vehicle industry" in the knowledge graph. Based on this modified knowledge graph snapshot, a Monte Carlo simulation containing thousands of iterations is started, generating thousands of synthetic risk data paths for the portfolio in the next quarter.
[0075] The simulation results are generated in real time as an interactive dashboard. The probability density graph in the dashboard shows that the expected profit and loss distribution of the portfolio presents a significant negative skew. The worst-case scenario path (the 500th percentile path) in the risk path sector diagram shows that the portfolio may experience significant losses in the future. An accompanying state method-based sensitivity analysis is automatically performed on this worst-case scenario path, identifying its key driving factors and transmission paths, and encapsulating this information as a traceability link bound to the corresponding loss path curve on the sector diagram.
[0076] The user clicks on the loss path representing the worst-case scenario on the dashboard with the mouse. This interaction immediately triggers the counterfactual analysis process. The backend analysis engine reads the link information bound to the path and performs a "one-by-one suppression" correction simulation on the main driving risk factors contained therein.
[0077] The final attribution report is presented in the form of a waterfall chart, clearly revealing the factors contributing to the extreme loss: the user's assumption of "significant reduction in subsidies" is the largest negative contribution source; the updated knowledge graph has increased the competitive relationship weight between leading enterprises in the industry, amplifying the negative impact within the industry, which is the second largest contribution source; and the high stock price volatility of the power battery manufacturer, a core in the industry chain, is the third largest contribution source. Through this complete process, the fund manager not only quantifies the policy risk, but also deeply understands the risk transmission mechanism within the industry, enabling the development of more refined risk response strategies.
[0078] Embodiment Three:
[0079] To improve the intelligence, personalization and risk explainability of personal user financial planning, a data structure adaptive visualization method based on a large language model is introduced, which is applied to the scene of intelligent wealth management consultants.
[0080] First, the user's financial situation and personal goals will be comprehensively obtained. Through the authorized API interface, the user's internal quantitative data is automatically collected, for example, a user with total assets of 50,000 yuan has an investment portfolio of 30,000 yuan in stocks, 10,000 yuan in funds, and 10,000 yuan in cash. At the same time, the user inputs his specific financial goal: "plan to save 100,000 yuan as a down payment for a house within 5 years", and completes the risk preference assessment, the result is "stable type". In addition, external unstructured text data related to the user's holdings will be continuously monitored.
[0081] Next, the user's personal situation is mapped and integrated into the macro dynamic financial knowledge graph. The user's asset portfolio, specific holdings, and financial goals are all created as independent entity nodes in the knowledge graph. When new causal events are extracted from external text data, such as a new regulatory policy affecting a certain industry, a multi-agent system driven by a large language model is used to simulate and deduce the "consensus", and the resulting adjustment value is quantified, for example, the risk transmission weight of the policy to a certain technology company is adjusted from 0.3 to 0.6, and the knowledge graph is updated in real time.
[0082] Based on the dynamic knowledge graph, users can interact through natural language to test and explore their financial planning. Users can ask hypothetical questions such as "under the existing plan, considering the possibility of a 20% stock market correction in the future, what is the probability of achieving my financial goal?". The large language model will analyze this query and convert it into structured intervention parameters, and perform a Monte Carlo simulation with 5000 iterations on the knowledge graph to generate multiple synthetic risk data paths for the user's future asset growth. These simulation results will be presented in the form of a user-friendly, interactive financial health dashboard, which is displayed in the form of a column chart, visually displaying the probability of achieving the goal, for example, a probability of 72%, and various possible outcome distributions.
[0083] On the visual dashboard, if a user is concerned about a certain undesirable simulation result (e.g. a path that fails to achieve the goal), he can directly click on the visual element to interact. This operation will immediately trigger the counterfactual analysis process on the backend. Through the “one-by-one suppression” correction simulation method, the contribution of each driving factor that causes the result is accurately calculated, and a clear and understandable attribution report is generated. The report not only explains “why” the plan failed (for example, 50% contribution of market systemic risk, 30% contribution of specific asset volatility, and 20% contribution of insufficient savings rate), but also generates specific and executable optimization strategies based on the attribution results, such as: “To increase the probability of achieving your goal to 90%, we recommend that you increase your monthly investment by 2000 yuan, or adjust 15% of your high-risk portfolio to more stable assets. Do you need to simulate the adjusted plan for you?”.
[0084] While embodiments of the present application have been shown and described, it is to be understood that the embodiments described are merely divergences, modifications, replacements and variations of the embodiments of the present application, and the scope of the present application is defined by the appended claims and their equivalents.
Claims
1. An adaptive visualization method for data structures based on a large language model, characterized in that, include: Acquire internal quantitative data and external unstructured text data of the investment portfolio; The external unstructured text data is processed using a large language model to extract structured causal events; A dynamic financial knowledge graph is constructed using internal quantitative data and the structured causal events, and the risk transmission weights between entities in the dynamic financial knowledge graph are updated in real time using the structured causal events. The system receives risk shock assumptions input by the user, performs forward-looking simulations based on the dynamic financial knowledge graph and the risk shock assumptions, and generates multiple synthetic risk data paths representing various future possibilities. Visualization results are generated based on the multiple synthetic risk data paths, and the visualization results are linked to traceability links; In response to the user's selection of a specific simulation result on the visualization results, path sensitivity analysis is performed to identify a set of driving factors; The step of generating the visualization results includes: establishing traceable links to the corresponding driving factors in the dynamic financial knowledge graph for each path and statistical derivative element in the multiple synthetic risk data paths; binding the traceable links to the corresponding visualization elements in the visualization results, and triggering counterfactual analysis of the driving factors by interacting with the visualization elements; the process of establishing traceable links to the corresponding driving factors in the dynamic financial knowledge graph includes: performing path sensitivity analysis on a specified path in the synthetic risk data paths to obtain the quantitative impact score of each driving factor, calculating the sum of the absolute values of the quantitative impact scores of all driving factors, sorting the driving factors in descending order, and selecting the driving factors whose cumulative absolute values of the quantitative impact scores from the top reach a preset percentage of the total as the main driving risk factors; Based on the analysis results, a data structure containing sorted driving factor identifiers and quantified influence scores is generated as the traceability link; The steps of performing counterfactual analysis include: performing a modified simulation on the main driving risk factors by temporarily suppressing their risk transmission weights in the dynamic financial knowledge graph; comparing the specific simulation results with the modified simulation results to calculate the quantitative contribution of the main driving risk factors and generate an attribution report.
2. The adaptive visualization method for data structures based on a large language model according to claim 1, characterized in that, The steps of acquiring internal quantitative data and external unstructured text data of the investment portfolio, processing the external unstructured text data using a large language model, and extracting structured causal events include: The internal quantitative data includes daily portfolio holdings details, historical trading records, and daily profit and loss time series; the external unstructured text data includes regulatory announcements, listed company financial reports, and financial news articles. The external unstructured text data is transformed into structured causal events containing event types, participating entities, and influencing parameters by using a large language model to perform named entity recognition and relation extraction.
3. The adaptive visualization method for data structures based on a large language model according to claim 1, characterized in that, The process of constructing a dynamic financial knowledge graph includes: Initialize a foundational knowledge graph containing a predefined financial ontology, which defines entity types, attribute types, and relation types; The structured causal events are fused with the base knowledge graph. The fusion process includes creating and updating nodes in the knowledge graph that correspond to entities in the structured causal events; creating and updating relational edges between nodes that represent the structured causal events; adjusting the risk transmission weights associated with the relational edges and nodes according to the influence parameters of the structured causal events; attaching a time-sensitivity decay function to the updated risk transmission weights; and assigning a confidence score to the relational edges and weights according to the information source of the text data.
4. The adaptive visualization method for data structures based on a large language model according to claim 3, characterized in that: The step of adjusting the risk transmission weights associated with the relation edges and nodes based on the impact parameters of the structured causal events includes: Based on the scope of influence of the structured causal events, a group of virtual economic agents related to the structured causal events are instantiated from a predefined agent library, and each agent is assigned a specific role and behavior pattern. The structured causal events are presented as input information to an instantiated group of intelligent agents. The large language model is used to drive each agent to generate decisions and behavioral responses to the structured causal events based on its role and behavior pattern. The decisions and behavioral responses generated by the intelligent agents are aggregated, the aggregated results are quantified into adjustment values, and the risk transmission weights are updated using the adjustment values.
5. The adaptive visualization method for data structures based on a large language model according to claim 1, characterized in that, The step of conducting forward-looking simulations based on the dynamic financial knowledge graph and the risk shock assumptions includes: The large language model is used to parse the risk shock hypothesis of natural language input into structured intervention parameter objects. When there is ambiguity in the hypothesis parsing, clarification questions are generated based on the dynamic financial knowledge graph for user confirmation. The structured intervention parameter object is applied to the dynamic financial knowledge graph to adjust the quantitative attributes of the graph elements in the dynamic financial knowledge graph that are associated with the intervention parameter object; The Monte Carlo simulation is performed, and the stochastic process and related parameters of the Monte Carlo simulation are defined by the quantitative attributes of the adjusted graph elements in the dynamic financial knowledge graph, thereby generating the multiple synthetic risk data paths.
Citation Information
Patent Citations
Knowledge graph-based intelligent quantitative research platform system and method thereof
CN119693155A
Business risk assessment method and device, computer equipment and storage medium
CN119721689A