Machine learning systems for error detection and correction in generated text

WO2026176367A1PCT designated stage Publication Date: 2026-08-27TERAGONIA INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/IB2026/051616
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-02-20
Filing Date
2026-02-19
Publication Date
2026-08-27

Smart Images

  • Figure IB2026051616_27082026_PF_FP_ABST
    Figure IB2026051616_27082026_PF_FP_ABST
Patent Text Reader

Abstract

This disclosure provides systems, methods, and devices that mitigate errors in machine-generated texts by employing multiple modules in a collaborative framework. In one aspect, a method is provided that includes determining, by a first machine learning (ML) module, a draft output. One or more errors may be identified by a second ML module in the draft output by verifying statements against data. A revised draft output may be determined by a third ML module that corrects at least a subset of the identified errors. It may then be determined that the revised draft output satisfies a termination condition, and the revised draft output may be output upon satisfying the termination condition. Other aspects are provided. For example, the data may include structured and unstructured data, and the disclosed techniques may include extracting and mapping information to improve the draft output.
Need to check novelty before this filing date? Find Prior Art

Description

DESCRIPTIONMACHINE LEARNING SYSTEMS FOR ERROR DETECTION AND CORRECTION IN GENERATED TEXTCROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application claims priority to and the benefit of U.S. Provisional Application No.63 / 760,755, filed February 20, 2025, the contents of which are incorporated into the present application by reference in its entirety.BACKGROUND

[0002] Artificial intelligence (Al) and machine learning techniques have become essential tools for performing complex analyses in various contexts. These technologies enable systems to process and interpret large volumes of structured data, such as databases and spreadsheets, as well as unstructured data like documents, emails, and multimedia content. Al models can identify patterns, extract meaningful insights, and generate predictive models that aid in decision-making processes. The integration of Al in analytical tasks allows organizations to automate workflows, enhance efficiency, and manage information more effectively. As a result, Al-driven analysis is widely applied across diverse industries, including finance, healthcare, marketing, and logistics.SUMMARY

[0003] The present techniques provide systems and methods for generating accurate and reliable outputs by utilizing a layered machine learning architecture involving multiple specialized models. The system includes multiple models that may operate in combination to detect and correct errors in generated outputs (such as text outputs). An ‘Analyst’ model may generate an initial draft output by analyzing both structured and unstructured data sources. A ‘Proofreader’ model may then identify errors in the draft output by cross-verifying statements against the data. An ‘Editor’ model may correct the identified errors and refines the draft output. These models may operate with internal iterative processes and feedback loops, both within and between modules, to iteratively improve the output. The integration of error detection mechanisms, confidence scoring, and explainable Al components may further ensure ensures that the final output meets predefined accuracy and quality criteria, making it particularly suitable for business applications where precision is critical.

[0004] In a first aspect, a method includes determining, by a first machine learning (ML) module, a draft output; identifying, by a second ML module, one or more errors in the draft output by verifying statements in the draft output against data; determining, by a third MLmodule, a revised draft output that corrects at least a subset of the one or more errors identified; determining, by the second ML module, that the revised draft output satisfies a termination condition; and outputting the revised draft output in response to determining that the termination condition is satisfied.

[0005] In a second aspect according to the first aspect, the data includes structured data and unstructured data.

[0006] In a third aspect according to the second aspect, the method further includes extracting factual and numerical information from the structured data and performing natural language processing on the unstructured data to extract relevant information.

[0007] In a fourth aspect according to the third aspect, the method further includes mapping the extracted information from the unstructured data to specific fields or aspects of the draft output using techniques including entity recognition, topic modeling, or semantic analysis.

[0008] In a fifth aspect according to the fourth aspect, mapping the extracted information includes performing entity recognition on the unstructured data to identify relevant entities and associating the identified entities with corresponding sections of the draft output.

[0009] In a sixth aspect according to any one of the first through fifth aspects, the first ML module utilizes internal iterative refinement to improve the draft output until one or more of a completeness criteria, a relevance criteria, or a combination thereof are satisfied.

[0010] In a seventh aspect according to the sixth aspect, the internal iterative refinement by the first ML module includes identifying missing or incomplete data required for the draft output; retrieving, based on the identified missing or incomplete data, additional data from a data source; and determining an updated draft output based on the additional data.

[0011] In an eighth aspect according to any one of the first through seventh aspects, identifying the one or more errors by the second ML module includes parsing statements in the draft output to be verified; retrieving corresponding data related to each parsed statement; comparing each parsed statement to the corresponding retrieved data to detect discrepancies; and determining the one or more errors to include at least a subset of the detected discrepancies.

[0012] In a ninth aspect according to the eighth aspect, the method further includes categorizing the detected discrepancies into one or more error types, wherein the error types include at least one of numerical errors, calculation errors, misstatements, citation errors, or a combination thereof.

[0013] In a tenth aspect according to any one of the first through ninth aspects, the second ML module utilizes internal iterative error detection to verify the accuracy of the draft output.

[0014] In an eleventh aspect according to the tenth aspect, the internal iterative error detection includes performing an initial analysis of the draft output to identify major errors and conducting focused iterations on specific error types identified in the initial analysis by performing deeper verification for each suspected error.

[0015] In a twelfth aspect according to the eleventh aspect, the method further includes adjusting confidence thresholds for error detection based on the prevalence of specific errors.

[0016] In a thirteenth aspect according to any one of the first through twelfth aspects, determining the revised draft output by the third ML module includes correcting the identified errors individually and integrating each correction into the draft output to determine the revised draft output.

[0017] In a fourteenth aspect according to the thirteenth aspect, correcting the errors individually includes addressing numerical errors by replacing incorrect numerical values with correct values retrieved from data sources; resolving calculation errors by recalculating using verified data and appropriate computational methods; amending misstatements by adjusting categorical statements to align with verified data; updating citation errors by adding or correcting citations based on the sources of the data; or a combination thereof.

[0018] In a fifteenth aspect according to any one of the first through fourteenth aspects, the method further includes repeating the steps of identifying the one or more errors and determining the revised draft output prior to determining that the termination condition is satisfied.

[0019] In a sixteenth aspect according to any one of the first through fifteenth aspects, the termination condition includes at least one of no errors being identified in the revised draft output by the second ML module; reaching a predefined iteration limit; changes between successive iterations being below a predefined threshold; or a combination thereof.

[0020] In a seventeenth aspect according to any one of the first through sixteenth aspects, the first ML module operates with parameters set to encourage creativity, and the second and third ML modules operate with parameters set to focus on accuracy by adjusting temperature settings, top-p settings, top-k settings, a repetition penalty setting, a presence penalty setting, a beam search width, or a combination thereof.

[0021] In an eighteenth aspect according to any one of the first through seventeenth aspects, the second and third ML modules have access to computational tools not accessible to the first ML module and utilize the computational tools to verify and correct calculations in the draft output.

[0022] In a nineteenth aspect according to any one of the first through eighteenth aspects, the first ML module, the second ML module, the third ML module, or a combination thereof is configured to access one or more tools.

[0023] In a twentieth aspect according to the nineteenth aspect, the tools include functions that can be invoked by the ML modules to perform operations including data retrieval, computation, transformation, verification, or a combination thereof.

[0024] In a twenty-first aspect according to any one of the nineteenth through twentieth aspects, the first ML module includes a first tool configured to select a language model for output generation and a second tool configured to determine needed data for output generation, or a combination thereof.

[0025] In a twenty-second aspect according to any one of the nineteenth through twenty-first aspects, the second ML module includes a first tool configured to determine relevant data based on the input and the draft output; a second tool configured to determine whether errors exist in the draft output; a third tool configured to generate detailed descriptions and suggested changes to the draft output based on the errors; or a combination thereof.

[0026] In a twenty-third aspect according to any one of the nineteenth through twenty-second aspects, the third ML module includes a tool for regenerating the draft output based on input received from the second ML module.

[0027] In a twenty-fourth aspect according to any one of the first through twenty-third aspects, the method further includes assigning confidence scores to data points and statements in the draft output based on at least one of source reliability, data extraction methods, computational complexity, or a combination thereof, and recalculating the confidence scores in each iteration as new data or corrections are incorporated.

[0028] In a twenty-fifth aspect according to any one of the first through twenty-fourth aspects, the method further includes determining, by the first, second, and third ML modules, a plurality of draft outputs and determining a combined output by synthesizing the plurality of draft outputs.

[0029] In a twenty-sixth aspect according to the twenty-fifth aspect, at least a subset of the plurality of draft outputs are determined in parallel.

[0030] In a twenty-seventh aspect according to any one of the first through twenty-sixth aspects, the draft output includes at least one of textual content, non-textual content, a classification output, a proposed computer action, an audio output, a graphical output, or a combination thereof.

[0031] In a twenty-eighth aspect, a system includes a processor and a memory storing instructions which, when executed by the processor, cause the processor to perform operations including determining, by a first ML module, a draft output; identifying, by a second ML module, one or more errors in the draft output by verifying statements in the draft output against data; determining, by a third ML module, a revised draft output that corrects at least a subset of the one or more errors identified; determining, by the second ML module, that the revised draft output satisfies a termination condition; and outputting the revised draft output in response to determining that the termination condition is satisfied.

[0032] In a twenty-ninth aspect according to the twenty-eighth aspect, the data includes structured data and unstructured data.

[0033] In a thirtieth aspect according to the twenty-ninth aspect, the operations further include extracting factual and numerical information from the structured data and performing natural language processing on the unstructured data to extract relevant information.

[0034] In a thirty-first aspect according to the thirtieth aspect, the operations further include mapping the extracted information from the unstructured data to specific fields or aspects of the draft output using techniques including entity recognition, topic modeling, or semantic analysis.

[0035] In a thirty-second aspect according to the thirty-first aspect, mapping the extracted information includes performing entity recognition on the unstructured data to identify relevant entities and associating the identified entities with corresponding sections of the draft output.

[0036] In a thirty-third aspect according to any one of the twenty-eighth through thirty-second aspects, the first ML module utilizes internal iterative refinement to improve the draft output until one or more of a completeness criteria, a relevance criteria, or a combination thereof are satisfied.

[0037] In a thirty-fourth aspect according to the thirty-third aspect, the internal iterative refinement by the first ML module includes identifying missing or incomplete data required for the draft output; retrieving, based on the identified missing or incomplete data, additional data from a data source; and determining an updated draft output based on the additional data.

[0038] In a thirty-fifth aspect according to any one of the twenty-eighth through thirty-fourth aspects, identifying the one or more errors by the second ML module includes parsing statements in the draft output to be verified; retrieving corresponding data related to each parsed statement; comparing each parsed statement to the corresponding retrieved data to detect discrepancies; and determining the one or more errors to include at least a subset of the detected discrepancies.

[0039] In a thirty-sixth aspect according to the thirty-fifth aspect, the operations further include categorizing the detected discrepancies into one or more error types, wherein the error types include at least one of numerical errors, calculation errors, misstatements, citation errors, or a combination thereof.

[0040] In a thirty-seventh aspect according to any one of the twenty-eighth through thirtysixth aspects, the second ML module utilizes internal iterative error detection to verify the accuracy of the draft output.

[0041] In a thirty-eighth aspect according to the thirty-seventh aspect, the internal iterative error detection includes performing an initial analysis of the draft output to identify major errors and conducting focused iterations on specific error types identified in the initial analysis by performing deeper verification for each suspected error.

[0042] In a thirty-ninth aspect according to the thirty-eighth aspect, the operations further include adjusting confidence thresholds for error detection based on the prevalence of specific errors.

[0043] In a fortieth aspect according to any one of the twenty-eighth through thirty-ninth aspects, determining the revised draft output by the third ML module includes correcting the identified errors individually and integrating each correction into the draft output to determine the revised draft output.

[0044] In a forty-first aspect according to the fortieth aspect, correcting the errors individually includes addressing numerical errors by replacing incorrect numerical values with correct values retrieved from data sources; resolving calculation errors by recalculating using verified data and appropriate computational methods; amending misstatements by adjusting categorical statements to align with verified data; updating citation errors by adding or correcting citations based on the sources of the data; or a combination thereof.

[0045] In a forty-second aspect according to any one of the twenty-eighth through forty-first aspects, the operations further include repeating the steps of identifying the one or more errors and determining the revised draft output prior to determining that the termination condition is satisfied.

[0046] In a forty-third aspect according to any one of the twenty-eighth through forty-second aspects, the termination condition includes at least one of no errors being identified in the revised draft output by the second ML module; reaching a predefined iteration limit; changes between successive iterations being below a predefined threshold; or a combination thereof.

[0047] In a forty-fourth aspect according to any one of the twenty-eighth through forty-third aspects, the first ML module operates with parameters set to encourage creativity, and thesecond and third ML modules operate with parameters set to focus on accuracy by adjusting temperature settings, top-p settings, top-k settings, a repetition penalty setting, a presence penalty setting, a beam search width, or a combination thereof.

[0048] In a forty-fifth aspect according to any one of the twenty-eighth through forty-fourth aspects, the second and third ML modules have access to computational tools not accessible to the first ML module and utilize the computational tools to verify and correct calculations in the draft output.

[0049] In a forty-sixth aspect according to any one of the twenty-eighth through forty-fifth aspects, the first ML module, the second ML module, the third ML module, or a combination thereof is configured to access one or more tools.

[0050] In a forty-seventh aspect according to the forty-sixth aspect, the tools include functions that can be invoked by the ML modules to perform operations including data retrieval, computation, transformation, verification, or a combination thereof.

[0051] In a forty-eighth aspect according to any one of the forty-sixth through forty-seventh aspects, the first ML module includes a first tool configured to select a language model for output generation and a second tool configured to determine needed data for output generation, or a combination thereof.

[0052] In a forty-ninth aspect according to any one of the forty-sixth through forty-eighth aspects, the second module includes a first tool configured to determine relevant data based on the input and the draft output; a second tool configured to determine whether errors exist in the draft output; a third tool configured to generate detailed descriptions and suggested changes to the draft output based on the errors; or a combination thereof.

[0053] In a fiftieth aspect according to any one of the forty-sixth through forty-ninth aspects, the third ML module includes a tool for regenerating the draft output based on input received from the second ML module.

[0054] In a fifty-first aspect according to any one of the twenty-eighth through fiftieth aspects, the operations further include assigning confidence scores to data points and statements in the draft output based on at least one of source reliability, data extraction methods, computational complexity, or a combination thereof, and recalculating the confidence scores in each iteration as new data or corrections are incorporated.

[0055] In a fifty-second aspect according to any one of the twenty-eighth through fifty-first aspects, the operations further include determining, by the first, second, and third ML modules, a plurality of draft outputs and determining a combined output by synthesizing the plurality of draft outputs.

[0056] In a fifty-third aspect according to the fifty-second aspect, at least a subset of the plurality of draft outputs are determined in parallel.

[0057] In a fifty-fourth aspect according to any one of the twenty-eighth through fifty-third aspects, the draft output includes at least one of textual content, non-textual content, a classification output, a proposed computer action, an audio output, a graphical output, or a combination thereof.

[0058] In a fifty-fifth aspect according to any one of the twenty-eighth through fifty-fourth aspects, the operations further comprise: generating an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied and based on overall confidence scores for the draft output and the revised draft output.

[0059] In a fifty-sixth aspect according to any one of the twenty-eighth through fifty-fifth aspects, the operations further comprise: generating an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied and based on individual confidence scores for multiple portions of the revised draft output.

[0060] In a fifty-seventh aspect according to any one of the twenty-eighth through fifty-sixth aspects, the operations further comprise: outputting an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied.

[0061] In a fifty-eighth aspect, a system includes a processor and a memory storing instructions which, when executed by the processor, cause the processor to perform operations including receiving a draft output; identifying, by a first ML module, one or more errors in the draft output by verifying statements in the draft output against data; determining, by a second ML module, a revised draft output that corrects at least a subset of the one or more errors identified; determining, by the first ML module, that the revised draft output satisfies a termination condition; and outputting the revised draft output in response to determining that the termination condition is satisfied.

[0062] The features and advantages described herein are not all-inclusive and, in particular, many additional features and advantages will be apparent to one of ordinary skill in the art in view of the figures and description. Moreover, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and not to limit the scope of the disclosed subject matter.BRIEF DESCRIPTION OF THE FIGURES

[0063] FIG. 1 illustrates a system for detecting and correcting errors in generated outputs according to one aspect of the present disclosure.

[0064] FIG. 2 illustrates a method for detecting and correcting errors in generated outputs according to one aspect of the present disclosure.

[0065] FIG. 3 illustrates a computer system according to one aspect of the present disclosure.DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

[0066] Existing techniques for generating outputs using large language models (LLMs) often involve a single model that produces output based on input data and user prompts. While these models are capable of generating coherent and contextually relevant text, they are prone to inaccuracies or "hallucinations," where the output contains incorrect information or unsupported statements. These inaccuracies can manifest as numerical errors, citation errors, categorical misstatements, ranking errors, and other discrepancies. In business contexts where accuracy is paramount — such as financial reporting, legal documentation, or compliance reports — these inaccuracies can lead to significant adverse consequences.

[0067] Existing techniques to mitigate hallucinations include adjusting model parameters to reduce creativity, such as lowering the temperature setting, and / or using retrieval-augmented generation (RAG) to ground the model's responses with relevant documents. However, such techniques may limit the model's analytical capabilities and typically do not fully eliminate inaccuracies. Moreover, uniformly adjusting parameters like temperature settings may suppress the model's ability to generate innovative or insightful content, affecting overall output quality. Additionally, relying on a single model without specialized functions for analysis, verification, and correction may not provide the necessary checks to ensure high accuracy.

[0068] Traditional human-in-the-loop methods involve human reviewers manually verifying and correcting outputs from analyzing unstructured data, which can be time-consuming and lack scalability. As organizations seek to automate complex report generation while maintaining high standards of accuracy, there is a need for improved techniques that systematically reduce errors in machine-generated outputs without compromising the models' analytical strengths.

[0069] One solution to this problem is to employ a multi-phase machine learning framework that utilizes specialized models for different tasks, integrated with iterative feedback loops for continual refinement. The present techniques involve three modules, which may also be referred to as agents. The modules may be configured to perform different functions, which may be referred to as the Analyst, the Proofreader, and the Editor. The Analyst module may generate an initial draft output by comprehensively analyzing both structured and unstructured data, using internal iterative processes to ensure completeness and relevance. The Proofreader module may identify errors in the draft by cross-verifying statements against thedata sources, utilizing iterative error detection mechanisms to thoroughly verify accuracy. The Editor module may then correct the identified errors and refines the draft output, ensuring that corrections are seamlessly integrated and that the overall narrative remains coherent

[0070] By separating the tasks into specialized modules these techniques allow for iterative improvement of the output until it meets predefined quality criteria. In certain implementations, specific settings may be adjusted for different modules (such as using higher temperatures for creative generation and lower temperatures for error checking) in order to balance creativity and precision at different stages of processing. Furthermore, the modules may be configured to employ both intra-module (within each agent) and inter-module (between agents) feedback loops to achieve improved output quality. Additionally, the modules may be configured to utilize different tools, further allowing for specific tailoring of capabilities for different stages of output processing. This layered approach enhances the ability to detect and correct errors, reduces the likelihood of inaccuracies, and maintains the modules' capacity for comprehensive analysis.

[0071] In some aspects, the present disclosure provides techniques for generating accurate and reliable outputs through a multi-phase machine learning framework that may be particularly beneficial in business applications requiring high precision, such as financial reporting, legal documentation, and compliance. For example, by employing specialized models for analysis, verification, and editing, organizations can automate the generation of complex reports while significantly reducing the risk of errors inherent in single-model systems.

[0072] These techniques may improve the experience for end users by providing high-confidence outputs, complete with confidence scores and explanations, thereby increasing trust in automated systems. Additionally, the use of iterative feedback loops and specialized models can optimize computational resources by focusing processing power where it is most needed, potentially improving the functioning of computer systems engaged in complex text or other output generation tasks. The modular design also allows for scalability and adaptability, accommodating future technological advancements and integration with existing enterprise systems and workflows. Furthermore, a confidence scoring mechanism may be used that adjusts based on error patterns or types, providing granular insights into the reliability of different sections of the output. Using such a mechanism, the system may reduce the need for human intervention, such as by leaving only a reduced quantity of low-confidence areas that require human review. Users can choose to accept high-confidence outputs as-is or focus their attention on flagged sections, enhancing efficiency and scalability.

[0073] FIG. 1 depicts a system 100 for detecting and correcting errors in generated outputs according to one aspect of the present disclosure. The system 100 includes a computingdevice 102 and data storage 110. The computing device 102 includes modules 132, 134, 136, a termination condition 174, and an output module 192. The module 132 includes tools 150 and a draft output 154. The module 134 includes tools 170 and errors 172. The module 136 includes tools 188 and a revised draft output 190.

[0074] The computing device 102 may be configured to determine a draft output 154. For example, the first module 132 may be configured to determine a draft output 154. The first module 132, which may be referred to as an Analyst Phase, Analysis agent, Analysis model, and the like may be implemented as a machine learning process implemented using one or more large language models (LLMs). In certain implementations, the first module 132 utilizes a neural network architecture suitable for natural language processing tasks, such as a transformer-based architecture. This architecture allows the model to process and generate human-like outputs based on input data.

[0075] In certain implementations, draft output 154 and the revised draft output 190 may comprise various forms of output, including but not limited to textual content, graphical content, audio content, classification results, or proposed actions. For example, the draft output 154 generated by the first module 132 may be a draft text, such as a draft report that includes analyses, summaries, insights, and interpretations of the data. In certain implementations, the report can cover topics such as financial performance, market analysis, operational metrics, or other business-related subjects, depending on the data provided and the intended purpose. For example, the draft output 154 may be a draft sustainability report summarizing a company's environmental impact, including sections on carbon emissions, energy consumption, and waste reduction efforts. As another example, the draft output 154 may include generated images or graphs representing data trends, an audio summary of key findings, or a set of proposed actions for system automation based on data analysis results. As further example, the system 100 may generate a classification result by processing image data to identify objects within images, produce an audio narration summarizing key findings from data analysis, or generate a proposed set of actions for automating tasks within a robotic process automation system.

[0076] The first module 132 may generate the draft output 154 by analyzing both structured data 122 and unstructured data 124 stored in the data storage 110. Structured data 122 may include databases, tables, spreadsheets, and other organized repositories containing factual and numerical information. Unstructured data 124 may include text documents, PDFs, emails, transcripts, and other sources lacking a predefined data model. The 132 may employ data retrieval functions to obtain necessary data from these sources. In certain implementations, after retrieving the necessary data, the first module 132 may formulate prompts or queries that are submitted to the underlying LLM. These prompts may include the retrieved data combinedwith specific instructions or templates for generating sections of the draft output 154. By incorporating the data into structured prompts, the module 132 may ensure that the LLM generates outputs that accurately reflects the provided information and adheres to the desired report structure. For example, the module 132 may retrieve sales figures and customer feedback data, and then construct a prompt for the LLM such as: "Using the following sales data and customer feedback, generate a comprehensive market analysis section for the report." The LLM may process this prompt, utilizing the supplied data to generate the corresponding textual content for inclusion in the draft output 154.

[0077] The data storage 110 may be configured to store data 120 utilized by the computing device 102 and the modules 132, 134, 136. In certain implementations, the data storage 110 may include one or more databases, data warehouses, data lakes, or other storage systems. The data storage 110 may be implemented using various types of hardware, such as magnetic disk drives, solid-state drives, network-attached storage (NAS), or storage area networks (SAN). The data storage 110 may also utilize cloud-based storage services accessible over network connections. The data storage 110 may ensure high availability and scalability to handle large volumes of data and may incorporate secure access controls to protect sensitive information. The data 120 stored in the data storage 110 may include both internal data and external data. Internal data may comprise proprietary company documents, reports, transactional records, or other confidential information specific to the organization. External data may include publicly available information, data retrieved from trusted third-party APIs, external documents such as industry reports, regulatory guidelines, or other reputable resources.

[0078] The data 120 stored in the data storage 110 may include both structured data 122 and unstructured data 124. Structured data 122 may refer to data organized in a predefined schema or format, such as relational databases, spreadsheets, Extensible Markup Language (XML) files, JavaScript Object Notation (JSON) files, Comma-Separated Values (CSV) files, YAML Ain't Markup Language (YAML) files, Hadoop Distributed File System (HDFS) files, and the like. This data may include tables with rows and columns where each column has a specific data type and meaning. Unstructured data 124 may refer to data that lacks a predefined structure or schema, such as text documents, PDFs, emails, images, audio files, and videos. For example, for generating a financial report, the structured data 122 may include transactional records from an Enterprise Resource Planning (ERP) system, budget spreadsheets, and financial statements stored in a relational database. The unstructured data 124 may include scanned contract documents in PDF format, email communications discussing financial strategies, meeting transcripts, and audio recordings of earnings calls.

[0079] Both structured data 122 and unstructured data 124 may include or correspond to internal data, such as local or private data, and / or external data, such as public data. In some aspects, one type or sub-type of data (e.g., internal structured data) is used to generate a draft output, and another, different type or sub-type of data (e.g., external structured and / or unstructured data) is used to revise or update the draft output. Alternatively, the same type and / or sub-types of data may be used to generated and revise the draft output.

[0080] The module 132 may include tools 150, which may include one or more functions or other processes that can be invoked by the module 132 to perform one or more actions (such as predefined functions). For example, the module 132 may include a first tool configured to select a language model for output generation, a second tool configured to determine needed data for output generation, a combination thereof.

[0081] In particular implementations, the first module 132 may utilize dynamic drill-down tools 150 to explore data at varying levels of granularity. The drill-down tools 150 may be specialized software components that enable multidimensional data analysis by allowing the module 132 to perform hierarchical navigation through datasets. These tools 150 may facilitate operations such as subsetting of datasets, executing complex queries with group-by and aggregation functions, and dynamically adjusting data scopes. The tools 150 may interface with the data storage 110 to retrieve data subsets based on specified dimensions, measures, and filters. By leveraging these drill-down tools 150 during internal iterative refinements, the module 132 may examine data at different depths and dimensions, uncovering intricate patterns and relationships that contribute to more insightful analysis. For example, the drilldown tools 150 may allow the module 132 to start analysis at a global level and progressively focus on specific regions, product categories, time periods, or customer segments. The tools 150 may support OLAP (Online Analytical Processing) functions, enabling the module 132 to perform multi-dimensional analysis efficiently. For example, while generating a market trend report, the first module 132 may retrieve sales figures from structured data 122, customer feedback from emails within unstructured data 124, and relevant industry news from additional unstructured text sources. The model iteratively refines the draft output 154 to include recent developments and ensures all product lines are covered.

[0082] In another example, while preparing a financial report, the first module 132 may identify missing quarterly figures by evaluating the completeness of required data against a predefined data schema or checklist. The module 132 may detect that certain data points, such as Q2 financial results, are absent from the dataset. To address this, the module 132 may formulate a data request specifying the missing information. This request may be sent to the data retrieval functions, which generate appropriate queries or API calls to the data storage 110. For instance, the data retrieval functions may construct a SQL query targeting therelevant database tables to retrieve the absent Q2 data. The query may be executed against the data storage 110, and the retrieved data may be returned to the module 132. Upon receiving the additional data, the module 132 may integrate it into the draft output 154 by updating relevant sections. This integration may involve recalculating financial metrics, such as year-over-year comparisons, updating tables and charts, and modifying narrative descriptions to reflect the newly included data. The module 132 may ensure that all references to the updated figures are consistent throughout the draft output 154.

[0083] In certain implementations, the tools 150 of the first module 132 may include a Retrieval-Augmented Generation (RAG) system. The purpose of the RAG system may be to enable the first module 132 to query external knowledge bases, structured financial databases, or document repositories to fetch the most relevant and up-to-date financial data. The RAG system may consist of a retriever module and a reader module. A retriever module may implement vector-based similarity search or keyword-based search using embeddings, such as FAISS or Elasticsearch. The retriever module may also utilize tool-based retrieval algorithms to enable interaction with structured databases, including automatic SQL query generation and retrieval. This allows the first module 132 to access and retrieve data from both internal data sources, like company financial data warehouses, and external sources, such as market reports or SEC filings. A reader module may process retrieved documents and extracts the necessary information using domain-specific rules. The extracted information may then be dynamically integrated into the prompts of the first module 132 to ensure that the generated draft output 154 is grounded in factual data. Additionally, the tools 150 may include an output generation mechanism that converts context data into a required output for downstream usage. This mechanism may involve prompt tuning, where task-specific prompt templates are used and tailored to specific tasks, such as explaining deviations and identifying trends. Inputs may be formatted into structured formats, such as JSON or tabular summaries, before being fed to the LLM for generation. One or more prompting strategies may also be employed, including chain-of-thought prompting to encourage step-by-step reasoning in generating analyses, and few-shot examples that include predefined examples of variance analysis reports to guide the output.

[0084] The first module 132 may be configured to utilize internal iterative refinement to improve the draft output 154 until completeness and relevance criteria are met. The internal refinement may include repeatedly analyzing the draft output 154 to identify missing or incomplete data, retrieving additional data as needed, and updating the draft output accordingly. The process continues until predefined completeness and relevance criteria are satisfied, ensuring that the draft output 154 is comprehensive and accurately reflects the available data.

[0085] In certain implementations, the internal iterative refinement by the first module 132 comprises identifying missing or incomplete data required for the draft output 154. The model may check for gaps in the information needed to generate a complete and accurate draft output, recognizing references to data points that are absent or noticing insufficient details in certain sections. For example, the model may notice that customer satisfaction scores are missing for a particular region in a performance report.

[0086] Based on the identified missing or incomplete data, the first module 132 retrieves additional data from the data storage 110 using the data retrieval functions. The model utilizes adaptive data retrieval functions capable of modifying queries based on previous loop outcomes to fetch precise or additional data. For instance, the model adjusts its data query to include the missing region's data by altering the parameters of the data retrieval functions.

[0087] The first module 132 may then determine the draft output 154 based on the additional data by performing updated analyses. This may involve formulating revised prompts or queries that are submitted to the LLM, incorporating the newly retrieved data. The module 132 may use the same initial prompt or adjust it to reflect the inclusion of the new data. The LLM may process the prompt and generate updated textual content, which the module 132 may integrate into the draft output 154. This integration may include updating analyses, summaries, charts, and conclusions accordingly. For example, after incorporating the new customer satisfaction data, the module 132 may craft an updated prompt for the LLM that includes the complete dataset and requests regeneration of the relevant report sections. The prompt might be: "Update the customer satisfaction analysis in the report to include the following additional data for Region X." The LLM may then generate revised narratives and data interpretations, and the module 132 may update all associated visualizations and text in the draft output 154 to reflect the comprehensive dataset.

[0088] The model repeats the process of identifying missing data, retrieving additional data, and determining the updated draft output 154 until no missing or incomplete data is identified. This iterative refinement ensures that the draft output 154 is thorough and all necessary information is included. For instance, the module 132 may repeat this process until all regions are included, resulting in a comprehensive performance report.

[0089] Determining the draft output 154 by the first module 132 may include utilizing data retrieval functions to obtain necessary data. The module 132 may use adaptive data retrieval functions that modify queries based on previous outcomes to ensure the most relevant data is retrieved. For example, the model might use RESTful API calls to retrieve the latest stock prices, adjusting the request parameters based on the symbols that were previously missing.

[0090] The tools 150 utilized by the first module 132 may be specialized functions or APIs that the LLM can invoke during the text generation process to perform tasks beyond its internal capabilities. These tools 150 may be implemented as callable services within the system 100 that expose specific functionalities, such as data retrieval, computation, or transformation operations. The LLM may be provided with descriptions of these tools, known as tool manifests, which detail each tool's purpose, input parameters, and expected outputs. During outputs generation, the module 132 (e.g., an LLM of the module 132) may analyze the context and determine whether invoking a tool is necessary to fulfill the prompt accurately. If the module 132 decides to use a tool, the module 132 may generate a structured function call with the appropriate parameters. The system's runtime environment may intercept this function call, execute the corresponding tool, and return the result to the module 132 for inclusion in the generated outputs. For example, suppose the module 132 is generating a report section that requires the latest sales figures for a product. The LLM may recognize that it needs current data and decide to call the 'get_latest_sales_data' tool. It constructs a function call (such as 'get_latest_sales_data(product_id='XYZ')'). The system may execute this function, which queries the data storage 110 for the specified product's sales data and returns the results to the module 132. The module 132 may then incorporate this data into the draft output 154, ensuring that the information is accurate and up-to-date.

[0091] The first module 132 may be configured to explore data at varying levels of granularity to retrieve detailed information. The model may utilize one or more dynamic drilldown tools 150 to explore data hierarchically, adjusting focus levels during iterative loops to examine data at different depths. For instance, the model might analyze sales data at a regional level and then drill down to specific stores or product lines. As an example, starting with national sales figures, the module 132 may utilize one or more tools 150 to separately analyze state, city, and / or individual store performance to identify specific areas contributing to overall trends.

[0092] The first module 132 may verify that all relevant and / or required data is included in the analysis by performing self-evaluation prompts to assess the sufficiency and quality of its outputs. For example, the module 132 may cross-check key performance indicators against a predefined checklist to confirm that no critical metrics are omitted.

[0093] The computing device 102 further includes a second module 134, which may be configured to identify one or more errors 172 in the draft output 154 by verifying statements in the draft output against data 120. The second module 134, which may be referred to as the Proofreader Phase, Proofreader model, Proofreader agent, and the like, may be a machine learning process specialized in error detection and verification. In certain implementations, thesecond module 134 utilizes LLMs or agents configured to evaluate the accuracy of the draft output 154 by cross-verifying it against the available data sources stored in data storage 110.

[0094] For example, the second module 134 might be an LLM that is fine-tuned for validation tasks, which systematically checks each statement in the draft output 154 against data sources 120. The model parses statements in the draft output 154 to be verified, breaking down the outputs into individual statements, numerical values, calculations, and citations that require verification. For instance, parsing the sentence "The company's net profit grew by 10% compared to last year," the model identifies "net profit grew by 10%" as a numerical statement for verification.

[0095] For each parsed statement, the second module 134 may retrieve corresponding data related to each statement from the data storage 110. This retrieval may involve accessing both internal data sources, such as company financial records stored in structured data 122, and external data sources, such as market data from trusted APIs or industry reports included in external unstructured data 124. For example, the module 134 may access financial records to obtain actual net profit figures for the current and previous years. In certain implementations, the data accessed by the module 134 may be the same or similar to the data access by the module 132. In certain implementations, the module 134 may receive an indication of the data accessed by the module 132. In additional or alternative implementations, the module 134 may separately determine which data to access (e.g., based on the identified statements for verification).

[0096] The second module 134 may compare each parsed statement to the corresponding retrieved data to detect discrepancies. The module 134 may use comparison techniques and / or functions to identify any mismatches or inconsistencies. This may involve numerical comparisons, verification of calculations, checking categorical assertions, and confirming citations. For instance, the model calculates the percentage growth based on the retrieved figures and finds that the actual growth was 8%, not 10%.

[0097] The second module 134 may utilize tools 170 similar to the tools 150 used by the first module 132. These tools 170 may be functions or APIs that the LLM within the module 134 can invoke to perform specific tasks required during error detection and verification. The tools 170 may be defined with detailed descriptions, specifying their functionalities, input parameters, and output formats. In particular, the module 134 may include tools 170, which may include one or more functions or other processes that can be invoked by the module 134 to perform one or more actions (such as predefined functions). For example, the module 134 may include a first tool configured to determine relevant data based on the input and the draft output, a second tool configured to determine whether errors exist in the draft output, a thirdtool configured to generate detailed descriptions and suggested changes to the draft output based on the errors, or a combination thereof. The tools 170 may enable the module 134 to perform operations such as data retrieval, calculations, statistical analyses, and crossreferencing data points. The LLM may determine whether to call a tool based on the verification requirements of each parsed statement. For example, when validating a numerical value in the draft output 154, the LLM may decide to invoke a 'fetch_actual_value' tool to retrieve the authoritative data from the data storage 110. If verifying a calculation, the LLM might use a 'recalculate_metric' tool to perform the computation independently. For instance, if the draft output 154 states that "The company's market share increased by 5%," the module 134 may parse this statement and determine that verification is needed. The LLM may call the 'fetch_actual_value' tool with parameters specifying the relevant market share data. The tool may retrieve the actual figures from structured data 122, and the LLM may compare them to the draft output. If discrepancies are found, they may be logged as errors 172 for correction.

[0098] In certain implementations, the tools 170 of the second module 134 may include an error identification mechanism designed to detect inaccuracies in the draft output 154 generated by the first module 132 by cross-verifying the generated output with the source data. This mechanism may utilize chain-of-thought prompting to guide the LLM through a structured reasoning process to identify inconsistencies or omissions. Self-consistency techniques may be employed, generating multiple reasoning paths and comparing their outputs to improve reliability. In certain implementations, the tools 170 may incorporate data validation rules by encoding domain-specific validation rules, such as financial accounting standards, into prompts to assist in error detection. Additionally, the second module 134 may include an instructor library to enforce strict output formatting and standardization of feedback. This may involve schema validation to ensure outputs conform to predefined schemas, such as JSON or markdown formats with specific fields for errors, explanations, and suggested corrections. Feedback provided by the second module 134 may be structured into actionable items, such as one or more of an error type (e.g., describing the nature of the error, such as data mismatch or incorrect calculations), an explanation (e.g., detailing why the identified error is problematic), a suggested correction (e.g., proposing specific changes to rectify the error), or a combination thereof.

[0099] The module 134 may determine the one or more errors 172 to include at least a subset of the detected discrepancies. Discrepancies identified may be logged as errors. In certain implementations, an error may include any inaccuracy, inconsistency, required correction, or deviation from expected or desired output. Errors may include, but are not limited to, numerical errors, calculation errors, misstatements, citation errors, inconsistencies, logical contradictions, formatting issues, or any other discrepancies that require correction to alignthe draft output 154 with the intended standards of accuracy, coherence, and compliance. In certain implementations, the second module 134 further categorizes the detected discrepancies into one or more error types, such as numerical errors, calculation errors, misstatements, citation errors, or a combination thereof.

[0100] Numerical errors involve incorrect numerical values, such as wrong totals, percentages, or data points. For example, reporting the number of units sold as 5,000 when the actual number is 4,500. Calculation errors include computational errors in mathematical operations, such as erroneous sums, averages, percentages, or growth rates. For instance, miscalculating the average customer satisfaction score due to an error in summing survey results.

[0101] Misstatements may include incorrect categorical statements or logical inconsistencies, such as misranking (e.g., stating that a region is the top performer when data shows otherwise) or logical inconsistencies within the draft output 154. For example, claiming "Product Y outperformed Product X," while data indicates the opposite. Citation errors may include incorrect or missing citations for statements, affecting the credibility and traceability of the information. For instance, failing to cite the source of an industry benchmark used in the analysis, or citing to a data source that does not contain data relevant to the cited analysis. Inconsistencies may include deviations in terminology, formatting, or style from organizational guidelines. Required corrections may include any modifications needed to align the output with desired accuracy, coherence, and compliance standards.

[0102] The second module 134 may utilize internal iterative error detection to verify the accuracy of the draft output 154 and / or to ensure that all errors 172 are detected. This may include utilizing an internal looping mechanism where the module 134 repeatedly reviews the draft output 154, refining its verification strategies with each iteration to comprehensively identify different types of errors. For example, after identifying several numerical discrepancies, the module 134 may be configured to then focus more intensely on numerical data and calculations in subsequent iterations.

[0103] In certain implementations, the internal iterative error detection by the second module 134 comprises performing an initial analysis of the draft output 154 to identify major errors. The module 134 may be configured to perform a first-pass review to catch glaring errors, such as significant numerical discrepancies, obvious miscalculations, or missing citations. For example, detecting that a key financial ratio reported is significantly different from the calculated value. The second module 134 may then be configured to perform focused iterations on specific error types identified in the initial analysis by performing deeper verification for each suspected error. Subsequent iterations focus on specific error types,applying more stringent verification methods to each category. For instance, after identifying calculation errors, the module 134 may be configured to recalculate all financial ratios to ensure accuracy.

[0104] The module 134 may further adjust confidence thresholds for error detection based on the prevalence of specific errors. The second module 134 may dynamically adjust its confidence thresholds during iterations by analyzing patterns in the detected errors and the criticality of various sections of the draft output 154. Implementation may involve the module 134 maintaining a confidence score for each verification task, influenced by factors such as data source reliability, calculation complexity, and prior error rates. If certain errors are prevalent, the module 134 may lower the confidence thresholds for related verifications, making the detection criteria more stringent. For example, if multiple citation errors are found in the initial analysis, the module 134 may increase scrutiny for all references. It may decrease the acceptable confidence level for citation verifications, requiring stronger evidence before accepting a citation as correct. This could involve cross-referencing citations with multiple data sources or applying advanced plagiarism detection algorithms.

[0105] In certain implementations, identifying the one or more errors 172 by the second module 134 may include adjusting confidence thresholds iteratively for critical sections of the draft output 154 to tighten verification intensity. For critical sections, such as financial summaries or compliance-related content, the module 134 may iteratively determine stricter confidence thresholds, requiring higher certainty before confirming the accuracy of those sections. For example, in a compliance report, the model demands stricter verification for any legal statements or regulatory references.

[0106] The computing device 102 may further include a termination condition 174 to determine when the iterative processes should conclude. The termination condition 174 may be based on predefined criteria, such as no remaining errors detected by the second module 134 or reaching a maximum number of iterations. In certain implementations, the second module 134 may determine that there are zero errors in the draft output 154. In such cases, the system may conclude the process without invoking the third module 136, as the draft output 154 already satisfies the accuracy and completeness criteria.

[0107] Upon completion of the error identification and correction processes, the computing device 102 may utilize an output module 192 to present the final, revised draft output 190. The revised draft output 190 may be a high-confidence, polished report that includes explanations, confidence scores, and proper citations, enhancing traceability and user trust.

[0108] The computing device 102 includes a third module 136, which may be configured to determine a revised draft output 190 that corrects at least a subset of the one or more errors172 identified by the second module 134. The third module 136, which may be referred to as the Editor Phase, and Editor model, and / or an Editor module, may be a machine learning process specialized in content correction and refinement. In certain implementations, the third module 136 utilizes large language models (LLMs) or modules focused on correcting the errors identified by the second module 134 and enhancing the overall quality of the draft output 154. The module 136 operates with parameters set to prioritize accuracy and consistency (such as lower temperature settings than the module 132). For example, the third module 136 may be based on an LLM that is fine-tuned for editing tasks and trained to follow style guides and language conventions specific to the organization. This training enables the model to make precise corrections while maintaining the desired tone and style of the document.

[0109] Determining the revised draft output 190 by the third module 136 may involve several steps. The module 136 may begin by correcting the identified errors 172 individually. Each error may be addressed based on the discrepancies identified by the second module 134. The third module 136 may formulate prompts or queries that are submitted to an LLM, including the statement to be corrected along with any corresponding correction details. The LLM may process these prompts and return the corrected statements, which the module 136 may then integrate into the revised draft output 190. For example, if the draft output 154 incorrectly states that "The company's net profit grew by 10% compared to last year," and the actual growth is 8%, the third module 136 may submit a prompt to the LLM such as: "Correct the following statement using the verified data: 'The company's net profit grew by 10% compared to last year.' The correct growth percentage is 8%." The LLM may then return the corrected statement, and the module 136 may update the growth percentage from 10% to the verified 8% in the net profit statement.

[0110] After correcting each error, the third module 136 may integrate each correction into the draft output 154 while ensuring contextual consistency. This may involve submitting the corrected statements along with the draft output 154 to the LLM, requesting integration into the resulting revised draft output 190. The LLM may process the input and adjust the surrounding outputs to maintain the flow and readability of the document. The module 136 may ensure that corrections do not disrupt the overall narrative or introduce inconsistencies elsewhere in the outputs.

[0111] For instance, upon updating the net profit growth figure, the module 136 may adjust subsequent sentences that reference the growth percentage to align with the corrected figure. This might involve altering conclusions or recommendations that were based on the initial, incorrect percentage.

[0112] In certain implementations, the third module 136 may review the revised draft output 190 after each correction for coherence. This review ensures that each correction aligns with the surrounding content and that the document remains cohesive. For example, the module 136 verifies that the conclusions drawn from the net profit growth are still valid after the correction and adjusts them if necessary.

[0113] Once all identified errors 172 have been corrected individually, the third module 136 may perform a holistic refinement of the entire draft output 154. This may involve submitting the current draft output to the LLM along with instructions to refine language, style, and formatting according to organizational guidelines. The LLM may process these instructions and generate the updated output, resulting in the revised draft output 190. The module 136 may apply organizational style guides, enforce consistent terminology, and standardize formatting elements. For example, the module 136 may provide a prompt such as: "Refine the following text to conform with our company's style guide, ensuring consistent terminology and formatting." The LLM may then adjust the outputs to enforce consistent use of terms like "the company" versus "the organization," and standardize headline capitalization throughout the document.

[0114] The module 136 may include tools 188, which may include one or more functions or other processes that can be invoked by the module 136 to perform one or more actions (such as predefined functions). For example, the module 136 may include a tool for regenerating the draft output based on input received from the second module 134. In particular implementations, the third module 136 may have access to one or more tools 188, such as calculators, error correction algorithms, style and consistency checkers, and citation management systems, similar to the tools 150 and 170 but tailored for editing tasks. These tools 188 may be callable functions or services that the LLM can invoke to perform specific correction and refinement operations. The tools 188 enable the third module 136 to verify and correct calculations, enforce stylistic coherence, manage citations, and integrate corrections seamlessly into the revised draft output 190. For instance, the module 136 may use a 'recalculate_financial_ratios' tool to recompute key metrics using verified data from the data storage 110. The module 136 may also utilize a 'style_enforcement' tool that applies predefined style guidelines to the outputs, ensuring consistency in terminology, tone, and formatting. As another example, the third module 136 may use a financial calculator tool to recompute financial ratios and a grammar checker to correct passive voice constructions. By utilizing these tools 188, the model ensures that both the factual accuracy and the linguistic quality of the draft output 154 are improved.

[0115] In certain implementations, the tools 188 of the third module 136 may include a feedback incorporation mechanism that revises the draft output 154 based on feedback fromthe second module 134. This may involve prompt refinement, utilizing custom-tuned prompts designed to incorporate error-specific feedback seamlessly into the revised draft output 190. The third module 136 may employ iterative refinement, integrating feedback in a prioritized order to ensure that critical errors are addressed first and ensuring alignment with both the retrieved data and domain-specific rules. The tools 188 may also include a rewrite validation mechanism that validates the rewritten output against both the feedback from the second module 134 and the original data. This process may involve a feedback loop mechanism where revised reports are sent back to the second module 134 for validation until no errors are detected. An error counter and exception handling system may be implemented to track the number of proofreader-editor cycles and halt the process if a specified threshold is exceeded, raising an exception for human intervention.

[0116] In certain implementations, correcting the errors individually by the third module 136 may include addressing various types of errors, which may be categorized by the module 134 as discussed above. Numerical errors are addressed by replacing incorrect numerical values with correct values retrieved from data sources 120. For example, changing "5,000 units sold" to "4,500 units sold" based on verified sales data stored in structured data 122.

[0117] Calculation errors may be resolved by recalculating using verified data and appropriate computational methods. The third module 136 may utilize one or more tools 188 (e.g., calculator(s)) to ensure accuracy in mathematical operations. For instance, recomputing the average selling price per unit after correcting the total revenue and unit sales figures.

[0118] Misstatements may be resolved by adjusting categorical statements to align with verified data. The model revises statements to accurately reflect rankings or classifications based on the data. For example, revising "The Northeast region led sales" to "The Southeast region led sales" after data verification shows the Southeast region had higher sales figures.

[0119] Citation errors may be resolved by adding or correcting citations based on the sources of the data. The third module 136 ensures proper attribution and compliance with referencing standards. For instance, adding a citation for an industry forecast graph sourced from a market research firm.

[0120] In certain implementations, the third module 136 may address a combination of error types simultaneously. For example, simultaneously correcting a misstatement about market share and adding the appropriate citation for the data.

[0121] In certain implementations, the computing device 102 may be configured to repeat the steps of identifying the one or more errors 172 and determining the revised draft output 190 prior to determining that the termination condition 174 is satisfied. This may include an inter-module feedback loop where the second module 134 detects errors in the draft output154, and the third module 136 corrects them. The revised draft output 190 (e.g., a corrected output) is then fed back to the second module 134 for re-evaluation. This loop may be repeated one or more times, continuing iteratively and allowing for successive refinement of the output until the termination condition 174 is met. The looping behavior enhances the accuracy and quality of the final output by systematically addressing and eliminating errors identified in each iteration.

[0122] In particular, the computing device 102 may be further configured to determine, such as by the second module 134, that the revised draft output 190 satisfies a termination condition 174. The termination condition 174 may involve criteria such as detecting no remaining errors, reaching a predefined iteration limit, or achieving minimal changes between iterations, indicating convergence. The second module 134 verifies whether the revised draft output 190 meets the termination condition 174 by determining if no further errors 172 are detected or if other predefined criteria are satisfied. For example, after the third proofreading iteration, the second module 134 finds no discrepancies exceeding the confidence threshold, and thus confirms that the termination condition 174 is met. For instance, the draft output 154 may undergo four iterations of error detection and correction before meeting the termination criteria set by the termination condition 174.

[0123] In another example, if the termination condition 174 is satisfied during the initial analysis by the second module 134 — indicating that the draft output 154 contains no detectable errors — the process may conclude without invoking the third module 136. By allowing the termination condition 174 to be satisfied from the first iteration, the system 100 ensures that processing resources are utilized effectively, and unnecessary iterations are avoided when the draft output 154 is already of acceptable quality.

[0124] In certain implementations, the termination condition 174 may include one or more criteria such as no errors being identified in the revised draft output 190 by the second module 134, reaching a predefined iteration limit, changes between successive iterations being below a predefined threshold, or a combination of these criteria. In certain implementations, the process terminates when the error detection process finds no remaining errors in the draft output 154, as indicated by an empty error log maintained by the second module 134 after the latest iteration. To prevent excessive looping, a maximum number of iterations may be set, and if this limit is reached, the process terminates even if errors remain; for example, the system 100 may stop after five iterations even if minor citation errors persist. Additionally, if the changes made in recent iterations are minimal, indicating convergence, the process may terminate; for instance, less than 0.1% of the text changes between iterations, triggering termination. A combination of these criteria may also be used, such that the process terminates because no critical errors are detected and the iteration limit is reached. If thesecond module 134 identifies zero errors during the initial verification of the draft output 154, the termination condition 174 is satisfied immediately, and the process concludes without the need for further iterations or corrections by the third module 136.

[0125] This termination mechanism ensures efficient processing by balancing thoroughness with computational resources and time constraints. For example, the system may balance the need for accuracy with processing time by setting practical iteration limits within the termination condition 174.

[0126] The computing device 102 may be configured to output the revised draft output 190 using the output module 192. For instance, the final revised draft output 190 may be presented to the user or downstream systems. The output may include additional information such as confidence scores, explanations, rationales, and an audit trail of the revisions made. For instance, the system 100 delivers the final quarterly financial report to the CFO, accompanied by a dashboard displaying confidence levels across different sections of the report provided by the output module 192. This allows stakeholders to assess the reliability of various parts of the report.

[0127] In certain implementations, the modules 132, 134, 136 may be configured to utilize different techniques to process different types of data types. In certain implementations, the models extract factual and numerical information from the structured data 122 using data retrieval functions and querying methods. This extraction is efficient due to the organized nature of structured data. For instance, the first module 132 may use SQL queries to retrieve inventory levels from a warehouse management system stored in the structured data 122.

[0128] The modules 132, 134, 136 may be configured to perform natural language processing (NLP) on the unstructured data 124 to extract relevant information. NLP techniques enable the models to interpret and analyze text that lacks a predefined structure. For example, the first module 132 may apply sentiment analysis to customer reviews to gauge overall satisfaction with a new product.

[0129] In certain implementations, the modules 132, 134, 136 may map the extracted information from the unstructured data 124 to specific fields or aspects of the draft output 154 using techniques including entity recognition, topic modeling, or semantic analysis. This mapping ensures that the information extracted is accurately reflected in the appropriate sections of the draft output 154. For instance, if the unstructured data 124 includes emails discussing customer complaints about a specific product, the first module 132 maps these complaints to the product performance section of the draft output 154, using entity recognition to identify the product name and semantic analysis to understand the context of the complaints.

[0130] Mapping the extracted information may involve performing entity recognition on the unstructured data 124 to identify relevant entities. Entity recognition algorithms, such as Named Entity Recognition (NER) models, may be applied to the text to detect and classify key entities like individuals, organizations, locations, dates, product names, and financial figures. The modules 132, 134, 136 may use machine learning techniques to parse the text and tag entities with appropriate labels. For example, in processing meeting transcripts, the models may identify mentions of "Company X," "Project Alpha," and "Q42024." "Company X" may be recognized as an organization, "Project Alpha" as a project or initiative, and "Q4 2024" as a temporal reference. The models may extract these entities along with contextual information, such as sentiments expressed or actions discussed concerning them. Once identified, the entities may be associated with corresponding sections of the draft output 154. For instance, information about "Project Alpha" may be mapped to the section on ongoing projects, while data related to "Company X" partnerships may be included in the collaborative ventures section.

[0131] The modules 132, 134, 136 may associate the identified entities with corresponding sections of the draft output 154 through a process of context analysis and mapping. This may involve analyzing the relationships between entities and topics within the unstructured data 124 and aligning them with the structure of the draft output 154. The models may employ techniques such as topic modeling, semantic analysis, and ontology mapping to understand the content and categorize it appropriately. For example, after identifying "Project Alpha" as an entity, the models may determine from the context that it relates to a new product development initiative. Semantic analysis may reveal that discussions about "Project Alpha" involve milestones achieved, challenges faced, and future plans. The models may map this information to the "Ongoing Projects" section of the draft output 154, organizing the content under relevant subheadings. The mapping process may also consider the hierarchical structure of the report, ensuring that subtopics and related entities are correctly nested. This precise association of extracted information with report sections may enhance the logical flow and readability of the final document.

[0132] The modules 132, 134, 136 may iteratively refine the mappings to enhance accuracy through a feedback loop and machine learning optimization techniques. This refinement may be based on additional data retrieved or feedback received from other modules or external sources. Initially, the modules may generate mappings based on preliminary analyses, which might contain misalignments due to ambiguous references or insufficient context. To address this, the models may reprocess the unstructured data 124 with updated parameters or enhanced algorithms, correcting any misclassifications. For example, the model might initially associate "Company X" with a competitor section due to mentions of market rivalry. However,upon further analysis, it may detect additional context indicating a strategic partnership. The models may adjust their entity relationships based on new information, reassigning "Company X" to the partnership discussion in the draft output 154. This refinement may involve updating the models' understanding of entity co-occurrence patterns, sentiment analysis results, and contextual cues. Machine learning techniques like reinforcement learning or active learning may be employed, where the models learn from previous iterations and any corrective feedback, continuously improving the accuracy of mappings.

[0133] In scenarios where the data 120 comprises large volumes of unstructured data 124, the modules 132, 134, 136 may be configured to perform iterative natural language processing to extract relevant information. The modules 132, 134, 136 may handle the large volumes by processing the unstructured data 124 in multiple passes. Each pass enhances the understanding of the data, extracting more nuanced information. For instance, processing thousands of customer feedback entries in waves, the first pass extracts basic sentiments, the second identifies specific product mentions, and the third captures detailed opinions.

[0134] The extraction accuracy is refined through multiple iterations. Iterative processing allows the modules 132, 134, 136 to reduce ambiguities and improve overall accuracy of the extracted information. For example, initially identifying ambiguous terms like "service" contextually as "customer service" or "product servicing" in subsequent iterations.

[0135] Performing iterative natural language processing may include conducting multiple parsing passes to process the unstructured data 124, each pass enhancing the understanding of context and nuances. Multiple parsing passes enable the model to build upon previous analyses, capturing deeper context and subtleties in language. For instance, the first pass captures surface-level information, while later passes detect sarcasm or idiomatic expressions in social media posts about the company.

[0136] The modules 132, 134, 136 may be configured to adjust processing techniques based on feedback from previous iterations to reduce ambiguities. The modules 132, 134, 136 may refine dictionaries or update language models to better handle domain-specific terminology based on the feedback. For example, after misinterpreting industry-specific jargon, the module 132, 134, 136 may update its vocabulary to correctly process terms like "bull market" and "bear trap."

[0137] In this manner, the system 100 efficiently processes both structured and unstructured data 124, utilizing iterative refinement and advanced processing techniques to generate an accurate and comprehensive revised draft output 190. The layered approach involving the first module 132 (Analyst Phase), the second module 134 (Proofreader Phase), and the thirdmodule 136 (Editor Phase), along with internal and inter-module feedback loops, ensures the reliability and accuracy of generated reports or analyses.

[0138] In certain implementations, to enhance efficiency and scalability, the computing device 102 may execute the steps of determining the draft output 154, identifying the one or more errors 172, and determining the revised draft output 190 in parallel for different sections of the draft output. By dividing the draft output 154 into multiple sections that can be processed independently, the system 100 allows simultaneous execution of the modules 132, 134, 136 on different parts of the text. This parallel processing significantly reduces the overall processing time and improves efficiency. For example, while one set of models processes the financial overview section of a report, another set simultaneously works on the market analysis section. This division enables the system 100 to handle complex and lengthy documents effectively.

[0139] To do so, the computing device 102 and / or the modules 132, 134, 136 may be configured to split the draft output 154 into multiple sections. The draft output 154 may be partitioned based on logical divisions such as chapters, topics, or other relevant subdivisions, ensuring each section is a coherent unit. For instance, an annual report may be divided into an executive summary, financial statements, operational highlights, and future outlook sections.

[0140] Each section may then assigned to be processed independently by corresponding instances of the first module 132 (Analyst Phase), the second module 134 (Proofreader Phase), and the third module 136 (Editor Phase). These instances process their assigned sections through the iterative loop independently of the other sections. For example, the financial statements section is processed by one set of models focusing on numerical accuracy, while the future outlook section is processed by another set emphasizing language refinement. This approach allows the modules 132, 134, 136 to specialize and optimize their processing strategies for different types of content.

[0141] Upon completion of processing each section and after the termination condition 174 is satisfied for each, the system 100 may synthesize the independently processed sections into the final draft output using an output module 192. The integration may involve combining the sections while ensuring overall coherence, consistent formatting, and adherence to the organization's style guidelines. In certain implementations, the output module 192 may include a summarizer module 194 configured to generate the final output by consolidating and / or combining the independently processed sections. The summarizer module 194 may perform additional proofreading and editing, ensuring coherence and consistency across the entire document. In certain implementations, the output module 192 may employ a synthesizermodule or process that is configured to analyze the language and structure of the combined sections to detect and resolve any inconsistencies. In certain implementations, this synthesizing may include the use of natural language generation techniques that adjust transitions between sections, harmonize terminology, and unify stylistic elements such as tense, voice, and narrative perspective. The module may also implement a global search-and-replace function to standardize terms (e.g., replacing all instances of "our company" with "the organization"). Additionally, the module may perform a final validation pass to ensure that cross-references, tables of contents, and indices are correctly updated.

[0142] In certain implementations, the modules 132, 134, 136 may be implemented as modular subcomponents, such as within one or more agentic frameworks. In such implementations, the modules 132, 134, 136 may be instantiated with specialized configurations or trained using domain-specific data to excel in their designated functions. The modules 132, 134, 136 may operate concurrently or sequentially within the processing workflow. Access to the modules 132, 134, 136 may be managed through an agent management framework within the computing device 102, which orchestrates their activation based on the requirements of the task. The framework may route data and control signals to the appropriate modules, collect their outputs, and integrate the results. The modules 132, 134, 136 may communicate with each other through defined interfaces and data exchange protocols, allowing for collaborative processing. The agent framework may ensure scalability by dynamically allocating resources and enabling the addition of new modules as needed. Additionally, although each of the modules 132, 134, 136 are discussed herein as single modules, in practice one or more of the modules may be implemented by multiple modules in particular implementations. As discussed above, the modules 132, 134, 136 may be configured to utilize one or more tools 150, 170, 188. In such instances, the modules 132, 134, 136 may be further configured to dynamically select and combine tools in sequence to perform tasks required for determining, revising, or otherwise processing the draft output 154 and / or the revised draft output 190. For example, the modules 132, 134, 136 may be configured to analyze the task requirements and decide which tools to invoke and in what sequence, effectively orchestrating the workflow to achieve optimal results.

[0143] In certain implementations, the agentic framework may include one or more tools shared across multiple modules 132, 134, 136, such as to enhance reasoning and reduce hallucinations. Advanced prompting strategies may be employed, such as chain-of-thought reasoning, which encourages models to perform step-by-step reasoning processes. Few-shot examples tailored to specific tasks, such as variance analysis tasks, may be provided to guide the modules' outputs. Self-consistency techniques may be utilized for multiple-generation verification, where modules generate multiple outputs and compare them to improve reliability.A data alignment protocol may be implemented to ensure that all modules access and interpret source data in a consistent manner. This protocol may involve using a common data schema for retrieved RAG outputs and providing shared access to intermediate outputs, such as annotated reports with error flags. The data alignment protocol ensures coherence and consistency across modules during processing.

[0144] An error escalation mechanism may be included to ensure that unresolved issues, such as repeated errors in the proofreader-editor loop, trigger notifications or exceptions for human intervention. This mechanism may involve tracking the number of iterations between the second module 134 and third module 136 and raising an alert if a specified threshold is exceeded, allowing users to intervene when necessary.

[0145] In certain implementations, the system 100 includes mechanisms for confidence scoring and explainable Al to enhance transparency and user trust. The computing device 102 assigns confidence scores to data points and statements in the draft output 154 based on factors such as source reliability, data extraction methods, computational complexity, or a combination thereof. For example, a statement sourced directly from audited financial records stored in the structured data 122 receives a high confidence score, while one derived from sentiment analysis of social media data in the unstructured data 124 is assigned a lower score.

[0146] The confidence scores may be recalculated in each iteration as new data or corrections are incorporated. Confidence scores are dynamically updated throughout the iterative process, with scores potentially increasing as errors are corrected or decreasing if uncertainties remain. For instance, after correcting a misstatement and verifying it against multiple data sources 120, the confidence score for that section may increase.

[0147] In determining the confidence scores, the system 100 may consider additional metrics such as faithfulness, answer relevancy, answer completeness, and quality of source attribution. Faithfulness may indicate a degree to which the generated output accurately reflects the underlying data and information sources without introducing unsupported content. Answer relevancy measures how pertinent and appropriate the output is concerning the intended topic or query. Answer completeness may assess whether the output fully addresses all aspects of the query or required content areas. Quality of source attribution may indicate a correctness, adequacy, and credibility of citations and references to data sources used in the draft output 154. For example, an output section may receive a high faithfulness score if it precisely mirrors information from verified data sources without deviation. Conversely, if the generated response only partially addresses the questions posed, omitting significant details, it may receive a lower answer completeness score. Similarly, if citations are provided but referto outdated or less credible sources, the quality of source attribution score may be adjusted accordingly.

[0148] In certain implementations, sections of the draft output 154 requiring more iterations due to complex computations or data extraction are assigned lower confidence scores. This indicates to users that these sections may need further review. For example, a section analyzing projected market growth rates, which required several iterations due to conflicting data, is assigned a lower confidence score to highlight potential uncertainties.

[0149] The system 100 may be configured to allow users to set thresholds for automatic approvals or mandatory reviews based on the assigned confidence scores. Users can define thresholds for confidence scores, such that any section with a score below a specified percentage may require manual review, while sections above the threshold are accepted without additional verification. For example, outputs with confidence scores above 95% may be automatically approved and integrated into the final output, whereas those with scores below 95% are flagged for human review. This mechanism enables users to focus their attention on areas of the output that may contain uncertainties or require expert judgment, enhancing the overall efficiency of the review process.

[0150] The computing device 102 may be configured to generate explanations for decisions made during each iteration, including rationales for corrections and changes. The system 100 may be configured to provide explanations for each correction made, which may detail the rationale behind the change, such as discrepancies identified or data sources consulted. For example, the generated explanations may indicate that a sales figure was adjusted due to updated numbers from the latest inventory report stored in the structured data 122. In this way, by providing transparent explanations and linking outputs to confidence scores and data sources, the system 100 enhances user trust and facilitates informed decision-making. Users receive outputs with accompanying confidence scores and can choose to accept the outputs as-is or delve deeper into the explanations and data sources if the confidence scores are below their acceptable thresholds.

[0151] In certain implementations, generating explanations may include documenting the sources of data used for corrections. Corrections are linked to specific data sources 120, allowing users to trace back to original data points for verification. For example, linking a corrected market share percentage to the specific industry report from which the data was obtained.

[0152] The system 100 may additionally or alternatively determine justification for each correction based on discrepancies identified. Justifications explain why a correction was necessary, referencing discrepancies between the draft output 154 and the data 120. Forinstance, justifying the change in projected revenue due to updated sales forecasts reflecting market downturns.

[0153] In certain implementations, an audit trail may be maintained of changes made, decisions taken, and rationales provided during the iterative processes. This audit trail may record all changes, including timestamps, the nature of the correction, the module or model responsible, and supporting data sources or explanations. For instance, the audit trail may log that the net profit figure was updated on December 17, 2024, by the third module 136, referencing the audited financial statement as the data source.

[0154] A summary of the iterative process leading to the final revised draft output 190 may be provided. This summary outlines the iterative refinement process, highlighting key corrections and the evolution of the draft output 154. For example, a report appendix detailing major revisions, such as adjustments in key financial metrics and the reasons behind them.

[0155] In certain implementations, the confidence scores and complexity rankings may be displayed to users along with explanations and rationales. User interfaces within the output module 192 display confidence scores and complexity rankings for each section, accompanied by explanations and rationales, aiding in informed decision-making. For instance, a dashboard shows that the "Emerging Markets Analysis" section has a confidence score of 85% due to volatile data sources, prompting further review by stakeholders. Users may be provided with interfaces to view the audit trail and make informed decisions on approvals or modifications. Interactive dashboards allow users to access the audit trail, review changes, and accept or request further modifications. For example, a manager reviews the audit trail before approving the final report, focusing on sections with lower confidence scores.

[0156] In certain implementations, the system 100 integrates human feedback by allowing human reviewers to approve, reject, or modify the draft output 154 based on their expertise and judgment. Human reviewers can directly interact with the draft output 154, making edits, commenting on sections, or providing feedback that the system 100 can learn from in future iterations. For example, a subject matter expert updates the technical specifications in a product report and provides feedback on terminology.

[0157] The system 100 may incorporate or learn from feedback provided by reviewers through interactive learning mechanisms. When human reviewers make edits, provide comments, or correct errors in the draft output 154, the system may capture this feedback and feed it back into the modules 132, 134, 136. This may involve updating model parameters, retraining certain components, or adjusting the models' decision-making processes. Technical implementation may include the use of techniques such as supervised learning, where the corrected outputs provided by humans serve as labeled training data. The models may learnfrom these examples to improve future performance. Additionally, reinforcement learning approaches may be employed, where the models receive rewards or penalties based on the reviewers' approval or rejection of the generated content. For example, if a reviewer consistently changes the phrasing of certain technical terms, the language refinement module within the third module 136 may update its language model to adopt the preferred terminology. Over time, the modules may become more aligned with the organization's standards and the reviewers' preferences, enhancing the quality and acceptability of the generated reports.

[0158] In certain implementations, the first module 132 may operate with parameters set to encourage creativity, such as higher temperature settings (e.g., temperature value of 0.8 to 1 .0), promoting diversity in generated outputs. Additional parameters such as higher top-p (e.g., 0.9 to 1.0), higher top-k (e.g., greater than 50), or lower repetition penalties may be used to enhance creativity. The second module 134 and the third module 136 may operate with parameters set to focus on accuracy and consistency by using lower temperature settings (e.g., temperature value of 0.2 to 0.5), lower top-p (e.g., 0.7 to 0.8), lower top-k (e.g., less than 40), higher repetition penalties, presence penalties, or adjusted beam search widths. For example, temperature settings control the randomness of the output generated by LLMs, with higher values allowing for more variability. Parameters like top-p and top-k control the nucleus and k-sampling strategies, influencing the diversity of the generated outputs. Repetition and presence penalties discourage the model from repeating the same content. Beam search width affects the number of alternative output sequences considered during generation. For example, the first module 132 may generate the initial draft output 154 with creative expressions and varied phrasings due to a higher temperature setting of 0.9 and a top-p value of 0.95. Conversely, the second and third modules 134, 136, with temperature settings of 0.3 and 0.2 respectively, and lower top-p values of 0.8, may focus on precision during error detection and correction, standardizing terminology and ensuring consistency to produce the revised draft output 190.

[0159] The system 100 may be configured to integrate with external tools and application programming interfaces (APIs) for data retrieval, calculation, and verification tasks utilized by the modules 132, 134, 136. The models interact with external APIs and tools for functions such as querying databases, performing complex calculations, or accessing specialized verification services. For example, the first module 132 and / or the data storage 110 may be configured to use a third-party financial API to retrieve real-time stock prices for inclusion in a financial analysis report.

[0160] In certain implementations, the first module 132, the second module 134, and the third module 136 may be neural networks utilizing advanced architectures suited for natural language processing tasks. In various implementations, these architectures may includetransformer models, recurrent neural networks (RNNs), or convolutional neural networks (CNNs), and the like. For example, the first module 132 may utilize a GPT-based (Generative Pre-trained Transformer) architecture, which excels in outputs generation tasks by using selfattention mechanisms to capture long-range dependencies in outputs data. The second module 134 may employ a BERT (Bidirectional Encoder Representations from Transformers) architecture, which is effective for understanding context and meaning in text, making it suitable for error detection and proofreading tasks. The third module 136 may use a T5 (Text-to-Text Transfer Transformer) architecture, which is versatile for text-to-text transformations required during editing and refinement. In certain implementations, the models may be pretrained on large datasets and fine-tuned on domain-specific data to enhance their performance in the targeted application areas. They may also incorporate techniques such as transfer learning, multi-task learning, or ensemble methods to improve accuracy and robustness.

[0161] Although many examples above focus on financial analysis implementations and textual outputs, similar techniques may be applied to other types of analyses and outputs across different industries and use cases. For instance, in the legal industry, the system 100 may generate case summaries by analyzing court documents and prior case law, ensuring all legal citations are accurate and up-to-date. In an artificial intelligence application, the system 100 may generate classification outputs by processing image data to identify objects, or produce proposed computer actions for robotic process automation. In multimedia applications, the system 100 may generate audio outputs, such as synthesized speech reports or audio summaries, and graphical outputs, such as data visualizations or infographics generated based on analyzed data. In healthcare, the system 100 may compile patient reports by extracting data from medical records and ensuring compliance with regulations like HIPAA, processing sensitive patient information securely and summarizing medical histories accurately. The modules 132, 134, 136 may be adapted to support multilingual output generation, processing data sources and producing outputs in multiple languages while maintaining accuracy and consistency, such as generating reports in both English and Spanish to accommodate diverse stakeholders.

[0162] FIG. 2 depicts a method 200 for detecting and correcting errors in generated outputs according to one aspect of the present disclosure. The method 200 may be implemented on a computer system, such as the system 100. For example, the method 200 may be implemented by the computing device 102. The method 200 may also be implemented by a set of instructions stored on a computer readable medium that, when executed by a processor, cause the computing device to perform the method 200. Although the examples below are described with reference to the flowchart illustrated in FIG. 2, many other methods of performing the acts associated with FIG. 2 may be used. For example, the order of some ofthe blocks may be changed, certain blocks may be combined with other blocks, one or more of the blocks may be repeated, and some of the blocks may be optional.

[0163] At block 202, the method 200 includes determining, by a first module, a draft output. For example, the computing device 102 may utilize the first module 132 to generate a draft output 154. In certain implementations, the draft output 154 may be a draft report. The first module 132 may utilize internal iterative refinement to improve the draft output 154 until completeness and relevance criteria are met. In some cases, the data 120 used by the first module 132 may include structured data 122 and unstructured data 124. The method 200 may further include extracting factual and numerical information from the structured data 122 and performing natural language processing on the unstructured data 124 to extract relevant information. For instance, the first module 132 may utilize data retrieval functions to obtain necessary data, explore data at varying levels of granularity to retrieve detailed information, and verify that all relevant data is included in the analysis. In certain implementations, the method 200 may involve mapping the extracted information from the unstructured data 124 to specific fields or aspects of the draft output 154 using techniques including entity recognition, topic modeling, or semantic analysis. Mapping the extracted information may comprise performing entity recognition on the unstructured data 124 to identify relevant entities, associating the identified entities with corresponding sections of the draft output 154, and iteratively refining the mappings to enhance accuracy. Moreover, the internal iterative refinement by the first module 132 may include identifying missing or incomplete data required for the draft output 154, retrieving, based on the identified missing or incomplete data, additional data from a data source (such as the data storage 110), determining an updated draft output 154 based on the additional data, and repeating the identifying, retrieving, and determining steps until no missing or incomplete data is identified.

[0164] At block 204, the method 200 includes identifying, by a second module, one or more errors in the draft output by verifying statements (or components / sections) in the draft output against data. For example, the computing device 102 may employ the second module 134 to identify errors 172 in the draft output 154 by verifying statements against the data 120 for textbased outputs. In certain implementations, identifying the one or more errors by the second module 134 may comprise parsing statements in the draft output 154 to be verified, retrieving corresponding data related to each parsed statement, comparing each parsed statement to the corresponding retrieved data to detect discrepancies, and determining the errors 172 to include at least a subset of the detected discrepancies. The method 200 may further involve categorizing the detected discrepancies into one or more error types. These error types may comprise at least one of numerical errors, including incorrect numerical values; calculation errors, including computational errors in mathematical operations; misstatements, includingincorrect categorical statements or logical inconsistencies; citation errors, including incorrect or missing citations for statements; or a combination thereof. In some implementations, the second module 134 may utilize internal iterative error detection to verify the accuracy of the draft output 154. The internal iterative error detection may include performing an initial analysis of the draft output 154 to identify major errors and conducting focused iterations on specific error types identified in the initial analysis by performing deeper verification for each suspected error. The method 200 may also include adjusting confidence thresholds for error detection based on the prevalence of specific errors. Furthermore, the second and third modules 134, 136 may have access to computational tools not accessible to the first module 132 and may utilize the computational tools to verify and correct calculations in the draft output 154.

[0165] At block 206, the method 200 includes determining, by a third module, a revised draft output that corrects at least a subset of the one or more errors identified. For example, the computing device 102 may use the third module 136 to produce a revised draft output 190 that corrects the errors 172 identified by the second module 134. In certain implementations, determining the revised draft output by the third module 136 may involve correcting the identified errors individually, integrating each correction into the draft output 154 while ensuring contextual consistency, reviewing the draft output 154 after each correction for coherence, and performing a holistic refinement of the entire draft output 154 after all corrections are made. Correcting the errors individually may include addressing numerical errors by replacing incorrect numerical values with correct values retrieved from data sources 120; resolving calculation errors by recalculating using verified data and appropriate computational methods; amending misstatements by adjusting categorical statements to align with verified data; updating citation errors by adding or correcting citations based on the sources of the data; or a combination thereof. Furthermore, the second and third modules 134, 136 may have access to computational tools not accessible to the first module 132 and may utilize the computational tools to verify and correct calculations in the draft output 154.

[0166] At block 208, the method 200 includes determining, by the second module, that the revised draft output satisfies a termination condition. For example, the computing device 102 may have the second module 134 determine that the revised draft output 190 satisfies a termination condition 174. In certain implementations, the method 200 may further comprise repeating the steps of identifying the one or more errors and determining the revised draft output prior to determining that the termination condition 174 is satisfied. The termination condition 174 may comprise at least one of no errors being identified in the revised draft output 190 by the second module 134; reaching a predefined iteration limit; changes between successive iterations being below a predefined threshold; or a combination thereof.

[0167] At block 210, the method 200 includes outputting the revised draft output in response to determining that the termination condition is satisfied. For example, the computing device 102 may output the revised draft output 190 via the output module 192 once the termination condition 174 is met. Outputting the revised draft output may include displaying the revised draft output or causing the revised draft output to be displayed on another device. For example, the revised draft output may be sent via a wired or wireless interface to a device that requested the output. In some aspects, the revised draft output is output with a corresponding confidence value.

[0168] In some aspects, the method 200 may optionally include outputting an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied or not satisfied. For example, the computing device 102 may output an aggregate and / or average confidence score of the underlying overall confidence scores for each draft of the output (e.g., a first / initial draft, a first revised draft, a second revised draft, etc.). As another example, the computing device 102 may output an aggregate and / or average confidence score of the underlying confidence scores for portions or statements of the revised output.

[0169] Additionally, or alternatively, the method 200 may optionally include outputting a revision log for the revised draft output in response to determining that the termination condition is satisfied or not satisfied. For example, the computing device 102 may output a log including a list of items that were corrected or fixed. The log may include the original or draft output portion along with the corrected or revised output portion.

[0170] In some aspects, such as when the termination condition is not satisfied, the method 200 may optionally include outputting an issues or errors list for the original draft output or for a partially revised output. The issues or errors list may identify the unresolvable issues or errors in the draft, such as the errors for portions or statements that cannot be satisfactorily resolved, such as resolved to satisfy an individual confidence score or metric threshold.

[0171] In the above aspects where additional information is output with the revised draft output or alternative information is output instead of the revised draft output, the additional and / or alternative information enables the user requesting the output additional insight into the quality of the output and / or what was revised or fixed by the output.

[0172] In certain implementations, the first module 132 may operate with parameters set to encourage creativity, and the second module 134 and the third module 136 may operate with parameters set to focus on accuracy by adjusting temperature settings. Additionally, the first, second, and third modules 132, 134, 136 each may include one or more specialized modules assigned specific tasks based on expertise.

[0173] Furthermore, the method 200 may include assigning confidence scores to data points and statements in the draft output 154 based on at least one of source reliability, data extraction methods, computational complexity, or a combination thereof, and recalculating the confidence scores in each iteration as new data or corrections are incorporated. Sections of the draft output 154 requiring more iterations due to complex computations or data extraction may be assigned lower confidence scores.

[0174] The method 200 may further comprise allowing users to set thresholds for automatic approvals or mandatory reviews based on the assigned confidence scores. In addition, the method 200 may involve generating explanations for decisions made during each iteration, including rationales for corrections and changes, and maintaining an audit trail of changes made, decisions taken, and rationales provided during the iterative processes.

[0175] In certain implementations, generating explanations may include documenting the sources of data used for corrections, providing justification for each correction based on discrepancies identified, and summarizing the iterative process leading to the final draft output 190.

[0176] FIG. 3 illustrates an example computer system 300 that may be utilized to implement one or more of the devices and components discussed herein, such as the computing device 102. In particular implementations, one or more computer systems 300 perform one or more steps of the methods described or illustrated herein. In particular implementations, one or more computer systems 300 provide the functionalities described or illustrated herein, such as executing the modules 132, 134, 136 for generating, verifying, and refining draft output 154. In particular implementations, software running on one or more computer systems 300 performs one or more steps of the methods described or illustrated herein or provides the functionalities described or illustrated herein. Particular implementations may include one or more portions of one or more computer systems 300. Herein, a reference to a computer system may encompass a computing device, and vice versa, where appropriate. Moreover, a reference to a computer system may encompass one or more computer systems, where appropriate.

[0177] This disclosure contemplates any suitable number of computer systems 300. This disclosure contemplates the computer system 300 taking any suitable physical form. As an example and not by way of limitation, the computer system 300 may be a high-performance server equipped with specialized hardware accelerators, such as Graphics Processing Units (GPUs) or Tensor Processing Units (TPUs), to facilitate the intensive computations required by the modules 132, 134, 136. The computer system 300 may also be an embedded computer system, a system-on-chip (SOC), a single-board computer system (SBC) (such as, forexample, a computer-on-module (COM) or system-on-module (SOM)), a cluster of computing nodes in a data center, or a combination of these. Where appropriate, the computer system 300 may include one or more computer systems 300; be unitary or distributed; span multiple locations; span multiple machines; span multiple data centers; or reside in a cloud computing environment, which may include one or more cloud components in one or more networks.

[0178] Where appropriate, one or more computer systems 300 may perform without substantial spatial or temporal limitation one or more steps of the methods described or illustrated herein. As an example and not by way of limitation, one or more computer systems 300 may perform in real time or in batch mode one or more steps of the methods described or illustrated herein, such as processing large volumes of data 120 to generate the draft output 154 and the revised draft output 190. One or more computer systems 300 may perform at different times or at different locations one or more steps of the methods described or illustrated herein, where appropriate.

[0179] In particular implementations, computer system 300 includes a processor 306, memory 304, storage 308, an input / output (I / O) interface 310, and a communication interface 312. The processor 306 may be configured to execute the modules 132, 134, 136, handling tasks such as data retrieval, natural language processing, error detection, and text generation. The memory 304 may store the runtime data and parameters required by the modules during execution. The storage 308 may contain the data storage 110, including structured data 122 and unstructured data 124 utilized by the models. Although this disclosure describes and illustrates a particular computer system having a particular number of particular components in a particular arrangement, this disclosure contemplates any suitable computer system having any suitable number of any suitable components in any suitable arrangement.

[0180] In particular implementations, the processor 306 includes hardware for executing instructions, such as those making up a computer program. The processor 306 may be a multicore CPU, a GPU, or an Al accelerator optimized for executing deep learning algorithms and transformer-based architectures employed by the modules 132, 134, 136. As an example and not by way of limitation, to execute instructions, the processor 306 may retrieve (or fetch) the instructions from an internal register, an internal cache, memory 304, or storage 308; decode and execute the instructions; and then write one or more results to an internal register, internal cache, memory 304, or storage 308. In particular implementations, the processor 306 may include one or more internal caches for data, instructions, or addresses. This disclosure contemplates the processor 306 including any suitable number of any suitable internal caches, where appropriate. As an example and not by way of limitation, the processor 306 may include one or more instruction caches, one or more data caches, and one or more translation lookaside buffers (TLBs). Instructions in the instruction caches may be copies of instructionsin memory 304 or storage 308, and the instruction caches may speed up retrieval of those instructions by the processor 306.

[0181] Data in the data caches may be copies of data in memory 304 or storage 308 that are to be operated on by computer instructions; the results of previous instructions executed by the processor 306 that are accessible to subsequent instructions or for writing to memory 304 or storage 308; or any other suitable data. The processor 306 may leverage advanced caching mechanisms to optimize access to frequently used machine learning parameters and data subsets, improving the performance of iterative processes such as those in the modules 132, 134, 136. The TLBs may speed up virtual-address translation for the processor 306. In particular implementations, processor 306 may include one or more internal registers for data, instructions, or addresses. This disclosure contemplates the processor 306 including any suitable number of any suitable internal registers, where appropriate. Where appropriate, the processor 306 may include one or more arithmetic logic units (ALUs), be a multi-core processor, or include one or more processors 306. In implementations involving parallel processing for different sections of the draft output 154, the processor 306 may coordinate multiple processing units or threads to handle concurrent execution of the modules. Although this disclosure describes and illustrates a particular processor, this disclosure contemplates any suitable processor.

[0182] In particular implementations, the memory 304 includes main memory for storing instructions for the processor 306 to execute or data for the processor 306 to operate on. The memory 304 may store the weights and biases of the neural network architectures used in the modules 132, 134, 136, as well as temporary data generated during model execution, such as intermediate representations of text, error logs for errors 172, and confidence scores. As an example, and not by way of limitation, computer system 300 may load instructions from storage 308 or another source (such as another computer system 300) to the memory 304. The processor 306 may then load the instructions from the memory 304 to an internal register or internal cache. To execute the instructions, the processor 306 may retrieve the instructions from the internal register or internal cache and decode them. During or after execution of the instructions, the processor 306 may write one or more results (which may be intermediate or final results) to the internal register or internal cache. The processor 306 may then write one or more of those results to the memory 304.

[0183] In particular implementations, the processor 306 executes only instructions in one or more internal registers or internal caches or in memory 304 (as opposed to storage 308 or elsewhere) and operates only on data in one or more internal registers or internal caches or in memory 304 (as opposed to storage 308 or elsewhere). One or more memory buses may couple the processor 306 to the memory 304. The bus may include one or more memorybuses, as described in further detail below. In particular implementations, one or more memory management units (MMUs) reside between the processor 306 and memory 304 and facilitate accesses to the memory 304 requested by the processor 306. In particular implementations, the memory 304 includes random access memory (RAM). This RAM may be volatile memory, where appropriate. Where appropriate, this RAM may be dynamic RAM (DRAM) or static RAM (SRAM). High-bandwidth memory modules may be utilized to meet the memory access speed requirements of large-scale neural network computations. Moreover, where appropriate, this RAM may be single-ported or multi-ported RAM. This disclosure contemplates any suitable RAM. Memory 304 may include one or more memories 304, where appropriate. Although this disclosure describes and illustrates particular memory implementations, this disclosure contemplates any suitable memory implementation.

[0184] In particular implementations, the storage 308 includes mass storage for data or instructions. The storage 308 may house the data storage 110, containing the structured data 122 and unstructured data 124 accessed by the modules. It may also store datasets used for training and fine-tuning the models, such as historical reports, domain-specific literature, and model checkpoints. As an example and not by way of limitation, the storage 308 may include a hard disk drive (HDD), a solid-state drive (SSD), flash memory, or a combination of these for faster data retrieval. The storage 308 may include removable or non-removable (or fixed) media, where appropriate. The storage 308 may be internal or external to computer system 300, where appropriate. In particular implementations, the storage 308 is non-volatile, solid-state memory. In particular implementations, the storage 308 includes read-only memory (ROM). This disclosure contemplates mass storage 308 taking any suitable physical form.

[0185] In implementations where large volumes of unstructured data 124 need to be processed, such as iterative natural language processing tasks, the storage 308 may employ distributed file systems or database systems to manage data efficiently. Technologies like Hadoop Distributed File System (HDFS) or NoSQL databases may be used to handle scalability and rapid access to data.

[0186] The storage 308 may include one or more storage control units facilitating communication between processor 306 and storage 308, where appropriate. Where appropriate, the storage 308 may include one or more storages 308. Although this disclosure describes and illustrates particular storage, this disclosure contemplates any suitable storage.

[0187] In particular implementations, the I / O Interface 310 includes hardware, software, or both, providing one or more interfaces for communication between computer system 300 and one or more I / O devices. The computer system 300 may include one or more of these I / O devices, where appropriate. One or more of these I / O devices may enable communicationbetween a person (i.e., a user) and computer system 300. For example, the I / O Interface 310 may connect to user interfaces provided by the output module 192, such as dashboards displaying confidence scores, visual loop maps, and audit trails. An I / O device may include a keyboard, monitor, screen, or touch screen, allowing users to interact with the system 100, review the draft output 154, and provide feedback or approvals. Where appropriate, the I / O Interface 310 may include one or more device or software drivers enabling processor 306 to drive one or more of these I / O devices. The I / O Interface 310 may include one or more I / O Interfaces 310, where appropriate. Although this disclosure describes and illustrates a particular I / O interface, this disclosure contemplates any suitable I / O interface or combination of I / O interfaces.

[0188] In particular implementations, communication interface 312 includes hardware, software, or both providing one or more interfaces for communication (such as, for example, packet-based communication) between computer system 300 and one or more other computer systems 300 or one or more networks 314. The communication interface 312 may facilitate connections to external data sources, APIs, or services utilized by the modules 132, 134, 136, such as third-party financial APIs for retrieving real-time stock prices or market data. As an example and not by way of limitation, communication interface 312 may include a network interface controller (NIC) or network adapter for communicating with an Ethernet or any other wire-based network, or a wireless NIC (WNIC) or wireless adapter for communicating with a wireless network.

[0189] This disclosure contemplates any suitable network 314 and any suitable communication interface 312 for the network 314. As an example and not by way of limitation, the network 314 may include one or more of a local area network (LAN), a wide area network (WAN), or one or more portions of the Internet. The communication interface 312 may also support secure communication protocols to ensure data privacy and compliance with regulations like GDPR or HIPAA when processing sensitive information. One or more portions of one or more of these networks may be wired or wireless. Computer system 300 may include any suitable communication interface 312 for any of these networks, where appropriate. Communication interface 312 may include one or more communication interfaces 312, where appropriate. Although this disclosure describes and illustrates particular communication interface implementations, this disclosure contemplates any suitable communication interface implementation.

[0190] The computer system 300 may also include a bus 302. The bus 302 may include hardware, software, or both and may communicatively couple the components of the computer system 300 to each other. In particular implementations, the bus 302 may facilitate high-speed data transfer between the processor 306, memory 304, and storage 308, which is critical forthe performance of the machine learning models during training and inference. As an example and not by way of limitation, the bus may include a Peripheral Component Interconnect Express (PCIe) bus, utilized for connecting GPUs or other accelerators to the system. The bus may include one or more buses, where appropriate. Although this disclosure describes and illustrates a particular bus, this disclosure contemplates any suitable bus or interconnect.

[0191] In some aspects, the system 300 may include or correspond to a server or cloud-hosted computing system. For example, the system 300 may be implemented on one or more servers (physical or virtual) executing one or more of the modules 132, 134, and / or 136, such as Al or ML-based Analyst, Proofreader, and Editor modules, with access to structured and unstructured data 122 and 124.

[0192] In some such aspects, the system 300 may use API-based delivery for outputs and / or API-based reception for output requests. For example, the module functionality may be accessible via APIs (e.g., REST, gRPC), allowing external systems to submit input data and receive corrected outputs programmatically.

[0193] Additionally, or alternatively, the system 300 may include or correspond to a distributed / networked computing environment. For example, the different modules (Analyst, Proofreader, Editor) of the system 300 may run on separate networked nodes or services that communicate over wired and / or wireless networks.

[0194] In some other aspects, the system 300 may include or correspond to a local or edge-deployed system, such as enterprise or on-premise software. In such aspects, the modules (e.g., software) may be installed and executed on local machines, private data centers, or edge devices, optionally operating offline or with limited connectivity.

[0195] In other aspects, the system 300 may include or correspond to a wireless / network-connected client-server delivery-based system. For example, end-user devices (e.g., laptops, tablets, mobile devices) communicate wirelessly with backend systems, including or corresponding to system 300, that perform the generation, verification, and correction processes.

[0196] As described above, the draft and corrected outputs may include or correspond to many different types of outputs. A few illustrative examples are provided below. In a first aspect, the draft output may correspond to a textual output with factual and numerical hallucinations, and system 300 can perform factual and numerical hallucination correction to generate a revised textual output that is free of hallucinations or has less hallucinations. In some such examples, the input data may include or correspond to structured data (e.g., databases, spreadsheets, tagged text, etc.) and / or unstructured data (e.g., unstructured / untagged text), and the output data may be generated textual reports, summaries, narratives, modified databases / spreadsheets, etc.

[0197] The system 300 may use multiple modules to generate the output and to revise the output, such as an analyst agent or module, a proofreader agent or module, and an editor agent or module. As an illustrative example, the analyst (e.g., module A) performs draft text generation using an LLM optimized for reasoning and synthesis, the proofreader (module B) utilizes a verification-focused LLM with access to data retrieval and computation tools to proofread the draft text and identify potential errors, and the editor (e.g., module C) uses a precision-focused LLM for correction and rewriting of the errors. As illustrative, non-limiting examples, the errors or error types that can be identified and / or addressed include, but are not limited to, numerical hallucinations, misstated facts, incorrect comparisons or trends, and citation errors.

[0198] In a second aspect, the draft output may correspond to a textual output with logical and reasoning errors or hallucinations, and system 300 can perform factual and logical and reasoning error or hallucination correction to generate a revised textual output that is free of errors / hallucinations or has less errors / hallucinations. In some such examples, the input data may include or correspond to structured and / or unstructured data, and the output data may be analytical or explanatory text.

[0199] The system 300 may use multiple modules to generate the output and to revise the output, such as an analyst agent or module, a proofreader agent or module, and an editor agent or module. As an illustrative example, the analyst (e.g., module A) performs draft text generation using a high-temperature LLM (e.g., creative and / or variable LLM) optimized for ideation and reasoning, the proofreader (module B) utilizes a logic- and consistency-checking LLM to proofread the draft text and identify potential errors, and the editor (e.g., module C) uses a coherence-optimized LLM for correction and rewriting of the errors. As illustrative, nonlimiting examples, the errors or error types that can be identified and / or addressed include, but are not limited to, logical contradictions, unsupported conclusions, and internal inconsistencies across sections.

[0200] In a third aspect, the draft output may correspond to an image output with structural or object-based hallucinations, and system 300 can perform structural or object hallucination correction to generate a revised image output that is free of errors / hallucinations or has less errors / hallucinations. In some such examples, the input data may include or correspond to text prompt(s) and / or reference image(s), and the output data may include or correspond to a generated image or images.

[0201] The system 300 may use multiple modules to generate the output and to revise the output, such as an analyst agent or module, a proofreader agent or module, and an editor agent or module. As an illustrative example, the analyst (e.g., module A) performs image generation using generative image model (e.g., diffusion-based), the proofreader (module B) utilizes a vision-language model (VLM) for semantic and structural verification of the draft image to identify potential errors, and the editor (e.g., module C) uses Image-editing or image-to-image generative model for correction of the errors. As illustrative, non-limiting examples, the errors or error types that can be identified and / or addressed include, but are not limited to, extra or missing objects / features, anatomical or structural impossibilities, prompt noncompliance, or size and / or placement errors.

[0202] In a fourth aspect, the draft output may correspond to an audio output with content or temporal accuracy errors or hallucinations, and system 300 can perform content and temporal accuracy errors hallucination correction to generate a revised audio output that is free of errors / hallucinations or has less errors / hallucinations. In some such examples, the input data may include or correspond to text script(s), structured data, and / or transcripts, and the output data may include or correspond to generated audio (e.g., narrated reports, summaries).

[0203] The system 300 may use multiple modules to generate the output and to revise the output, such as an analyst agent or module, a proofreader agent or module, and an editor agent or module. As an illustrative example, the analyst (e.g., module A) performs text and / or audio generation using a text and / or audio generation model, the proofreader (module B) utilizes a speech-to-text and verification model to identify potential errors, and the editor (e.g., module C) uses audio regeneration or text-based correction model for correction of the errors. As illustrative, non-limiting examples, the errors or error types that can be identified and / or addressed include, but are not limited to, misstated facts in spoken output, incorrect sequencing or timing, or omitted or duplicated content.

[0204] Although three module examples are illustrated and described herein, in other examples, additional modules or fewer modules may be employed. For example, the system 300 may include revising and fixing type modules, and the original draft generation module may be part of another system. As another example, multiple second-type modules may be used to identify different types of errors / hallucinations and / or multiple third-type modules may be used to correct the different types of errors / hallucinations.

[0205] Herein, a computer-readable non-transitory storage medium or media may include one or more semiconductor-based or other types of integrated circuits (ICs), such as field-programmable gate arrays (FPGAs) or application-specific ICs (ASICs) tailored for machinelearning workloads. Hard disk drives (HDDs), solid-state drives (SSDs), and other storage technologies may also be used. A computer-readable non-transitory storage medium may be volatile, non-volatile, or a combination of volatile and non-volatile, where appropriate.

[0206] Herein, “or” is inclusive and not exclusive, unless expressly indicated otherwise or indicated otherwise by context. Therefore, herein, “A or B” means “A, B, or both,” unless expressly indicated otherwise or indicated otherwise by context. Moreover, “and” is both joint and several, unless expressly indicated otherwise or indicated otherwise by context. Therefore, herein, “A and B” means “A and B, jointly or severally,” unless expressly indicated otherwise or indicated otherwise by context.

[0207] The scope of this disclosure encompasses all changes, substitutions, variations, alterations, and modifications to the example implementations described or illustrated herein that a person having ordinary skill in the art would comprehend. The scope of this disclosure is not limited to the example implementations described or illustrated herein. Moreover, although this disclosure describes and illustrates respective implementations herein as including particular components, elements, features, functions, operations, or steps, any of these implementations may include any combination or permutation of any of the components, elements, features, functions, operations, or steps described or illustrated anywhere herein that a person having ordinary skill in the art would comprehend. Furthermore, reference in the appended claims to an apparatus or system or a component of an apparatus or system being adapted to, arranged to, capable of, configured to, enabled to, operable to, or operative to perform a particular function encompasses that apparatus, system, component, whether or not it or that particular function is activated, turned on, or unlocked, as long as that apparatus, system, or component is so adapted, arranged, capable, configured, enabled, operable, or operative. Additionally, although this disclosure describes or illustrates particular implementations as providing particular advantages, particular implementations may provide none, some, or all of these advantages.

[0208] All of the disclosed methods and procedures described in this disclosure can be implemented using one or more computer programs or components. These components may be provided as a series of computer instructions on any conventional computer readable medium or machine readable medium, including volatile and non-volatile memory, such as RAM, ROM, flash memory, magnetic or optical disks, optical memory, or other storage media. The instructions may be provided as software or firmware, and may be implemented in whole or in part in hardware components such as ASICs, FPGAs, DSPs, or any other similar devices. The instructions may be configured to be executed by one or more processors, which when executing the series of computer instructions, performs or facilitates the performance of all or part of the disclosed methods and procedures.

[0209] It should be understood that various changes and modifications to the examples described here will be apparent to those skilled in the art. Such changes and modifications can be made without departing from the spirit and scope of the present subject matter and without diminishing its intended advantages. It is therefore intended that such changes and modifications be covered by the appended claims.

Claims

CLAIMS1. A method comprising:determining, by a first machine learning (ML) module, a draft output;identifying, by a second ML module, one or more errors in the draft output by verifying statements in the draft output against data;determining, by a third ML module, a revised draft output that corrects at least a subset of the one or more errors identified;determining, by the second ML module, that the revised draft output satisfies a termination condition; andoutputting the revised draft output in response to determining that the termination condition is satisfied.

2. The method of claim 1 , wherein the data comprises structured data and unstructured data.

3. The method of claim 2, further comprising:extracting factual and numerical information from the structured data; and performing natural language processing on the unstructured data to extract relevant information.

4. The method of claim 3, further comprising:mapping the extracted information from the unstructured data to specific fields or aspects of the draft output using techniques including entity recognition, topic modeling, or semantic analysis.

5. The method of claim 4, wherein mapping the extracted information comprises: performing entity recognition on the unstructured data to identify relevant entities; and associating the identified entities with corresponding sections of the draft output.

6. The method of claim 1, wherein the first ML module utilizes internal iterative refinement to improve the draft output until one or more of a completeness criteria, a relevance criteria, or a combination thereof are satisfied.

7. The method of claim 6, wherein the internal iterative refinement by the first ML module comprises:identifying missing or incomplete data required for the draft output;retrieving, based on the identified missing or incomplete data, additional data from a data source; anddetermining an updated draft output based on the additional data.

8. The method of claim 1 , wherein identifying the one or more errors by the second ML module comprises:parsing statements in the draft output to be verified;retrieving corresponding data related to each parsed statement;comparing each parsed statement to the corresponding retrieved data to detect discrepancies; anddetermining the one or more errors to include at least a subset of the detected discrepancies.

9. The method of claim 8, further comprising:categorizing the detected discrepancies into one or more error types, wherein the error types comprise at least one of numerical errors, calculation errors, misstatements, citation errors, or a combination thereof.

10. The method of claim 1, wherein the second ML module utilizes internal iterative error detection to verify an accuracy of the draft output.11 . The method of claim 10, wherein the internal iterative error detection comprises: performing an initial analysis of the draft output to identify major errors; and conducting focused iterations on specific error types identified in the initial analysis by performing deeper verification for each suspected error.

12. The method of claim 11 , further comprising:adjusting confidence thresholds for error detection based on a prevalence of specific errors.

13. The method of claim 1 , wherein determining the revised draft output by the third ML module comprises:correcting the identified errors individually; andintegrating each correction into the draft output to determine the revised draft output.

14. The method of claim 13, wherein correcting the errors individually comprises:addressing numerical errors by replacing incorrect numerical values with correct values retrieved from data sources;resolving calculation errors by recalculating using verified data and appropriate computational methods;amending misstatements by adjusting categorical statements to align with verified data;updating citation errors by adding or correcting citations based on the data sources; or a combination thereof.

15. The method of claim 1 , further comprising:repeating the steps of identifying the one or more errors and determining the revised draft output prior to determining that the termination condition is satisfied.

16. The method of claim 1, wherein the termination condition comprises at least one of:no errors being identified in the revised draft output by the second ML module; reaching a predefined iteration limit;changes between successive iterations being below a predefined threshold; or a combination thereof.

17. The method of claim 1 , wherein the first ML module operates with parameters set to encourage creativity, and the second and third ML modules operate with parameters set to focus on accuracy by adjusting temperature settings, top-p settings, top-k settings, a repetition penalty setting, a presence penalty setting, a beam search width, or a combination thereof.

18. The method of claim 1 , wherein the second and third ML modules have access to computational tools not accessible to the first ML module, and utilize the computational tools to verify and correct calculations in the draft output.

19. The method of claim 1 , wherein the first ML module, the second ML module, the third ML module, or a combination thereof is configured to access one or more tools.

20. The method of claim 19, wherein the tools comprise functions that can be invoked by the ML modules to perform operations comprising data retrieval, computation, transformation, verification, or a combination thereof.21 . The method of claim 19, wherein the first ML module comprises:a first tool configured to select a language model for output generation; and a second tool configured to determine needed data for output generation; or a combination thereof.

22. The method of claim 19, wherein the second ML module comprises:a first tool configured to determine relevant data based on an input and the draft output; a second tool configured to determine whether errors exist in the draft output;a third tool configured to generate detailed descriptions and suggested changes to the draft output based on the errors; ora combination thereof.

23. The method of claim 19, wherein the third ML module comprises a tool for regenerating the draft output based on input received from the second ML module.

24. The method of claim 1 , further comprising:assigning confidence scores to data points and statements in the draft output based on at least one of source reliability, data extraction methods, computational complexity, or a combination thereof; andrecalculating the confidence scores in each iteration as new data or corrections are incorporated.

25. The method of claim 1 , further comprising:determining, by the first, second and third ML modules, a plurality of draft outputs; and determining a combined output by synthesizing the plurality of draft outputs.

26. The method of claim 25, wherein at least a subset of the plurality of draft outputs are determined in parallel.

27. The method of claim 1 , wherein the revised draft output comprises at least one of: textual content;non-textual content;a classification output;a proposed computer action;an audio output;a graphical output; ora combination thereof.

28. The method of claim 1 , further comprising:generating an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied and based on overall confidence scores for the draft output and the revised draft output.

29. The method of claim 1 , further comprising:generating an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied and based on individual confidence scores for multiple portions of the revised draft output.

30. The method of claim 1 , further comprising:outputting an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied.31 . A system comprising:one or more processors; andat least one memory storing instructions which, when executed by the one or more processors, cause the system to perform operations including:determining, by a first machine learning (ML) module, a draft output; identifying, by a second ML module, one or more errors in the draft output by verifying statements in the draft output against data;determining, by a third ML module, a revised draft output that corrects at least a subset of the one or more errors identified;determining, by the second ML module, that the revised draft output satisfies a termination condition; andoutputting the revised draft output in response to determining that the termination condition is satisfied.

32. The system of claim 31 , wherein the data comprises structured data and unstructured data.

33. The system of claim 32, wherein the operations further comprise:extracting factual and numerical information from the structured data; and performing natural language processing on the unstructured data to extract relevant information.

34. The system of claim 33, wherein the operations further comprise:mapping the extracted information from the unstructured data to specific fields or aspects of the draft output using techniques including entity recognition, topic modeling, or semantic analysis.

35. The system of claim 34, wherein mapping the extracted information comprises: performing entity recognition on the unstructured data to identify relevant entities; and associating the identified entities with corresponding sections of the draft output.

36. The system of claim 31, wherein the first ML module utilizes internal iterative refinement to improve the draft output until one or more of a completeness criteria, a relevance criteria, or a combination thereof are satisfied.

37. The system of claim 36, wherein the internal iterative refinement by the first ML module comprises:identifying missing or incomplete data required for the draft output;retrieving, based on the identified missing or incomplete data, additional data from a data source; anddetermining an updated draft output based on the additional data.

38. The system of claim 31 , wherein identifying the one or more errors by the second ML module comprises:parsing statements in the draft output to be verified;retrieving corresponding data related to each parsed statement;comparing each parsed statement to the corresponding retrieved data to detect discrepancies; anddetermining the one or more errors to include at least a subset of the detected discrepancies.

39. The system of claim 38, wherein the operations further comprise: categorizing the detected discrepancies into one or more error types, wherein the error types comprise at least one of numerical errors, calculation errors, misstatements, citation errors, or a combination thereof.

40. The system of claim 31, wherein the second ML module utilizes internal iterative error detection to verify an accuracy of the draft output.41 . The system of claim 40, wherein the internal iterative error detection comprises:performing an initial analysis of the draft output to identify major errors; and conducting focused iterations on specific error types identified in the initial analysis by performing deeper verification for each suspected error.

42. The system of claim 41 , wherein the operations further comprise:adjusting confidence thresholds for error detection based on a prevalence of specific errors.

43. The system of claim 31 , wherein determining the revised draft output by the third ML module comprises:correcting the identified errors individually; andintegrating each correction into the draft output to determine the revised draft output.

44. The system of claim 43, wherein correcting the errors individually comprises: addressing numerical errors by replacing incorrect numerical values with correct values retrieved from data sources;resolving calculation errors by recalculating using verified data and appropriate computational methods;amending misstatements by adjusting categorical statements to align with verified data;updating citation errors by adding or correcting citations based on the data sources; or a combination thereof.

45. The system of claim 31 , wherein the operations further comprise:repeating the steps of identifying the one or more errors and determining the revised draft output prior to determining that the termination condition is satisfied.

46. The system of claim 31 , wherein the termination condition comprises at least one of:no errors being identified in the revised draft output by the second ML module; reaching a predefined iteration limit;changes between successive iterations being below a predefined threshold; or a combination thereof.

47. The system of claim 31 , wherein the first ML module operates with parameters set to encourage creativity, and the second and third ML modules operate with parameters set tofocus on accuracy by adjusting temperature settings, top-p settings, top-k settings, a repetition penalty setting, a presence penalty setting, a beam search width, or a combination thereof.

48. The system of claim 31 , wherein the second and third ML modules have access to computational tools not accessible to the first ML module, and utilize the computational tools to verify and correct calculations in the draft output.

49. The system of claim 31 , wherein the first ML module, the second ML module, the third ML module, or a combination thereof is configured to access one or more tools.

50. The system of claim 49, wherein the tools comprise functions that can be invoked by the ML modules to perform operations comprising data retrieval, computation, transformation, verification, or a combination thereof.51 . The system of claim 49, wherein the first ML module comprises:a first tool configured to select a language model for output generation; and a second tool configured to determine needed data for output generation; or a combination thereof.

52. The system of claim 49, wherein the second ML module comprises:a first tool configured to determine relevant data based on an input and the draft output; a second tool configured to determine whether errors exist in the draft output;a third tool configured to generate detailed descriptions and suggested changes to the draft output based on the errors; ora combination thereof.

53. The system of claim 49, wherein the third ML module comprises a tool for regenerating the draft output based on input received from the second ML module.

54. The system of claim 31 , wherein the operations further comprise:assigning confidence scores to data points and statements in the draft output based on at least one of source reliability, data extraction methods, computational complexity, or a combination thereof; andrecalculating the confidence scores in each iteration as new data or corrections are incorporated.

55. The system of claim 31 , wherein the operations further comprise:determining, by the first, second, and third ML modules, a plurality of draft outputs; and determining a combined output by synthesizing the plurality of draft outputs.

56. The system of claim 55, wherein at least a subset of the plurality of draft outputs are determined in parallel.

57. The system of claim 31 , wherein the revised draft output comprises at least one of: textual content;non-textual content;a classification output;a proposed computer action;an audio output;a graphical output; ora combination thereof.

58. The system of claim 31 , wherein the operations further comprise:generating an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied and based on overall confidence scores for the draft output and the revised draft output.

59. The system of claim 31 , wherein the operations further comprise:generating an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied and based on individual confidence scores for multiple portions of the revised draft output.

60. The system of claim 31 , wherein the operations further comprise:outputting an overall confidence value for the revised draft output in response to determining that the termination condition is satisfied.