Data processing method and related system

By constructing a structured knowledge graph and a post-event reflection mechanism, the generation accuracy of large-scale language models has been improved, solving the problem of generating errors in answering questions outside the knowledge boundary, and achieving higher accuracy and reliability.

CN121765036APending Publication Date: 2026-03-31HUAWEI TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Large-scale language models are prone to factual errors when faced with problems that exceed their knowledge boundaries. Existing methods struggle to fully perceive the underlying knowledge structure in the retrieved text, leading to reduced generation accuracy.

Method used

By explicitly tracing knowledge, exploring knowledge triples, forming a structured knowledge graph, improving the reasoning accuracy of LLM, and using a post-reflection mechanism to identify effective knowledge for fine-tuning.

Benefits of technology

It improves the generation accuracy and reliability of large-scale language models when facing complex problems, and reduces the occurrence of illusion phenomena.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765036A_ABST
    Figure CN121765036A_ABST
Patent Text Reader

Abstract

The data processing method comprises the following steps: acquiring a question; the question comprises a first entity; determining a second entity from first retrieval content related to the question according to the question; a first relationship exists between the second entity and the first entity; the first entity, the second entity and the first relationship are used for forming a first relationship team; and according to the question and the first relation team, performing reply determination of the question through a language model. According to the method and the device, the structured knowledge graph is formed through explicit knowledge tracking and knowledge triple exploration for the retrieval content, the LLM reasoning precision can be improved based on the structured knowledge graph, the problem that the underlying logic structure is difficult to perceive in the prior art is solved, and the reply generation precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence (AI) technology, and more particularly to a data processing method, apparatus, computing device, chip, computing device cluster, computer-readable storage medium, and computer program product. Background Technology

[0002] Large-scale language models (LLMs) encapsulate rich human knowledge within their massive parameters, achieving impressive performance in many complex natural language tasks, including question answering. However, despite their impressive capabilities, LLMs still exhibit serious factual errors (i.e., illusions) when faced with questions exceeding their knowledge boundaries. As an effective solution to address this deficiency, Retrieval Augmented Generation (RAG) improves the accuracy and reliability of generated content by integrating question-related information from external knowledge bases into the LLM generation process through a combination of retrieval and generation. Specifically, for a given question, the RAG system first retrieves relevant document paragraphs from an external knowledge base and then uses these texts as contextual input, passing them along with the input question to the LLM as additional non-parametric knowledge. In this form, the LLM generates answers not only based on its internal knowledge representation but also by utilizing retrieved external information, significantly improving the accuracy of the answers and reducing the occurrence of illusions.

[0003] However, due to the complexity and diversity of natural language expressions, this ever-growing volume of text also presents additional challenges to LLM inference. Most existing methods simply accumulate all retrieved text into LLM prompts, often failing to fully perceive the underlying knowledge structure embedded in the text, thus reducing the accuracy of text response generation. Summary of the Invention

[0004] This application provides a data processing method, as well as an apparatus, computing device cluster, computer-readable storage medium, and computer program product corresponding to the above method.

[0005] In a first aspect, this application provides a data processing method, the method comprising: obtaining a question; the question containing a first entity; determining a second entity from first search content related to the question based on the question; the second entity having a first relationship with the first entity; the first entity, the second entity, and the first relationship constituting a first relationship pair; and determining a response to the question using a language model based on the question and the first relationship pair.

[0006] In this embodiment of the application, for the retrieved content, knowledge triples are explored through explicit knowledge tracing to form a structured knowledge graph. Based on this structured knowledge graph, the reasoning accuracy of LLM can be improved, solving the problem that the existing technology is difficult to perceive the underlying logical structure and improving the accuracy of response generation.

[0007] In one possible implementation, determining the second entity from the first search content related to the question includes: obtaining a first prompt based on the prompt using a language model, the first prompt indicating the determination of a second entity from the first search content that has the first relationship with the first entity; and determining the second entity from the search content that has the first relationship with the first entity based on the first prompt using a language model.

[0008] In one possible implementation, the method further includes: when the language model cannot determine the correct response to the question based on the question, obtaining first search content related to the question.

[0009] In one possible implementation, the method further includes: outputting the correct response when a correct response to the question is obtained through a language model based on the question and the first relation.

[0010] In one possible implementation, the method further includes: when a correct response to the question is obtained through the language model based on the question and the first relation team, the first relation team is used as a positive sample to fine-tune the language model.

[0011] This application proposes a post-event reflection mechanism. By retrospectively analyzing the generated knowledge graph, it identifies knowledge subgraphs that contribute to the final solution and filters out invalid or redundant search results. Compared to the indiscriminate fine-tuning training in the prior art, this application can improve the system's self-improvement capability by fine-tuning effective knowledge through this self-reflection approach.

[0012] In one possible implementation, the method further includes: when the language model cannot determine the correct answer to the question based on the question and the first relational team, determining a third entity from the first search content or a second search content related to the question; the third entity and the second entity have a second relation; the third entity, the second entity, and the second relation are used to constitute a second relational team; and determining the answer to the question through the language model based on the question, the first relational team, and the second relational team.

[0013] In one possible implementation, the method further includes: when a correct response to the question is obtained through the language model based on the question, the first relation pair, and the second relation pair, the first relation pair and the second relation pair are used as positive samples to fine-tune the language model.

[0014] In one possible implementation, the method further includes: when the language model cannot determine the correct answer to the question based on the question and the first relation pair, determining a fourth entity from the first search content or a second search content related to the question; the fourth entity has a third relation with the first entity; the third entity, the first entity, and the third relation are used to form a third relation pair; and determining the answer to the question through the language model based on the question and the third relation pair.

[0015] In one possible implementation, the method further includes: when a correct response to the question is obtained through a language model based on the question, the first relation pair, and the third relation pair, the third relation pair is used as a positive sample to fine-tune the language model.

[0016] Secondly, this application provides a data processing apparatus, the apparatus comprising:

[0017] The question acquisition module is used to acquire questions; the question contains a first entity;

[0018] A knowledge construction module is used to determine a second entity from first search content related to the question based on the question; the second entity has a first relationship with the first entity; the first entity, the second entity, and the first relationship are used to form a first relationship group;

[0019] The response confirmation module is used to determine the response to the question based on the question and the first relational group using a language model.

[0020] In one possible implementation, the knowledge building module is specifically used for:

[0021] Based on the prompt, a first prompt is obtained through the language model, which indicates that a second entity with the first relationship with the first entity is determined from the first search content;

[0022] Based on the first hint, a second entity with a first relationship to the first entity is identified from the search content using a language model.

[0023] In one possible implementation, the knowledge building module is further configured to:

[0024] When the language model cannot determine the correct answer to the question based on the question, the first search content related to the question is obtained.

[0025] In one possible implementation, the response determining module is further configured to:

[0026] When the correct answer to the question is obtained through the language model based on the question and the first relation, the correct answer is output.

[0027] In one possible implementation, the device further includes:

[0028] The training module is used to fine-tune the language model by using the first relation group as a positive sample when the correct response to the question is obtained through the language model based on the question and the first relation group.

[0029] In one possible implementation, the knowledge building module is further configured to:

[0030] When the language model cannot determine the correct answer to the question based on the question and the first relational team, a third entity is determined from the first search content or the second search content related to the question; the third entity and the second entity have a second relation; the third entity, the second entity, and the second relation are used to form a second relational team;

[0031] The response confirmation module is also used for:

[0032] The response to the question is determined using a language model based on the question, the first relationship team, and the second relationship team.

[0033] In one possible implementation, the device further includes:

[0034] The training module is used to fine-tune the language model by using the first relationship pair and the second relationship pair as positive samples when the correct answer to the question is obtained through the language model based on the question, the first relationship pair, and the second relationship pair.

[0035] In one possible implementation, the knowledge building module is further configured to:

[0036] When the language model cannot determine the correct answer to the question based on the question and the first relation pair, a fourth entity is determined from the first search content or the second search content related to the question; the fourth entity has a third relation with the first entity; the third entity, the first entity, and the third relation are used to form a third relation pair;

[0037] The response confirmation module is also used for:

[0038] Based on the question and the third relation, the response to the question is determined using a language model.

[0039] In one possible implementation, the device further includes:

[0040] The training module is used to fine-tune the language model by using the third relation pair as a positive sample when the correct response to the question is obtained through the language model based on the question, the first relation pair, and the third relation pair.

[0041] Thirdly, this application provides a computing device. The computing device includes a memory and a processor; the memory stores code, and the processor is configured to execute the code, wherein when the code is executed, the computing device performs a method as described in the first aspect or any implementation thereof.

[0042] Fourthly, this application provides a chip. The chip includes at least one processing unit and an interface circuit, the interface circuit being used to provide program instructions or data to the at least one processing unit, the at least one processing unit being used to execute the program instructions to implement a method as described in the first aspect or any of the implementations of the first aspect.

[0043] Fifthly, this application provides a computing device cluster. The computing device cluster includes at least one computing device, which includes at least one processor and at least one memory. The at least one processor and the at least one memory communicate with each other. The at least one processor is configured to execute instructions stored in the at least one memory to cause the computing device or the computing device cluster to perform a method as described in the first aspect or any implementation thereof.

[0044] In a sixth aspect, this application provides a computer-readable storage medium storing instructions that instruct a computing device or a cluster of computing devices to perform the data processing method implementing the first aspect or any one of the first aspects.

[0045] In a seventh aspect, this application provides a computer program product containing instructions that, when run on a computing device or a cluster of computing devices, causes the computing device or cluster of computing devices to perform the data processing method described in the first aspect or any implementation thereof.

[0046] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description

[0047] Figure 1AA structural diagram illustrating the main framework of artificial intelligence;

[0048] Figure 1B Hezhi Figure 2 This is a schematic diagram of the application system framework of the present invention;

[0049] Figure 3 This is a schematic diagram of an optional hardware structure for a terminal.

[0050] Figure 4 This is a schematic diagram of the structure of a server;

[0051] Figure 5 This is a schematic diagram of a system architecture according to this application;

[0052] Figure 6 A process for providing a cloud service;

[0053] Figure 7 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0054] Figures 8 to 9B This is a schematic diagram of an application architecture according to an embodiment of this application;

[0055] Figure 10 A schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application;

[0056] Figure 11 A schematic diagram of the structure of a terminal device provided in an embodiment of this application;

[0057] Figure 12 A schematic diagram of the structure of a server provided in an embodiment of this application;

[0058] Figure 13 This is a schematic diagram of a chip structure provided in an embodiment of this application. Detailed Implementation

[0059] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0060] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0061] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0062] The terms "substantially," "about," and similar terms used in this application are used as approximations, not as terms of degree, and are intended to take into account the inherent biases of measurements or calculations known to those skilled in the art. Furthermore, the term "may" used in describing embodiments of this application refers to "one or more possible embodiments." The terms "use," "using," and "used" used in this application can be considered synonymous with the terms "utilize," "utilizing," and "utilized," respectively. Additionally, the term "exemplary" is intended to refer to an instance or illustration.

[0063] First, the overall workflow of the artificial intelligence system is described; please refer to [link / reference]. Figure 1A , Figure 1A The diagram illustrates a structural framework for artificial intelligence (AI). The framework is further elaborated below along two dimensions: the "Intelligent Information Chain" (horizontal axis) and the "IT Value Chain" (vertical axis). The "Intelligent Information Chain" reflects a series of processes from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. In this process, data undergoes a condensation process of "data—information—knowledge—wisdom." The "IT Value Chain" reflects the value that AI brings to the information technology industry, from the underlying infrastructure of human intelligence and information (provided and processed through technological means) to the industrial ecosystem of the system.

[0064] (1) Infrastructure

[0065] Infrastructure provides computing power to support artificial intelligence systems, enabling communication with the external world and providing support through a basic platform. This communication occurs through sensors; computing power is provided by intelligent chips (hardware acceleration chips such as CPUs, NPUs, GPUs, ASICs, and FPGAs); and the basic platform includes distributed computing frameworks and related platform guarantees and support, which may include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to acquire data, and this data is provided to intelligent chips in the distributed computing system provided by the basic platform for computation.

[0066] (2) Data

[0067] The data at the next layer of infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.

[0068] (3) Data processing

[0069] Data processing typically includes methods such as data training, machine learning, deep learning, search, reasoning, and decision-making.

[0070] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training of data by symbolizing and formalizing it.

[0071] Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching.

[0072] Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.

[0073] (4) General ability

[0074] After the data processing mentioned above, the results of the data processing can be used to form some general capabilities, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.

[0075] (5) Smart Products and Industry Applications

[0076] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Their application areas mainly include: intelligent terminals, intelligent transportation, intelligent healthcare, autonomous driving, smart cities, etc.

[0077] First, we will introduce the application scenarios of this application. This application can be used, but is not limited to, applications with generative artificial intelligence (AIGC) functionality (hereinafter referred to as text generation applications) or cloud services provided by cloud-side servers, etc., which will be introduced separately below:

[0078] I. Text Generation Applications

[0079] The product form of this application embodiment can be a text generation application. Text generation applications can run on terminal devices or cloud-based servers.

[0080] In one possible implementation, a text generation application can perform a text generation task based on input data (e.g., a question), wherein the text generation application can perform the text generation task in response to the input data (e.g., a question) and obtain the text generation result.

[0081] In one possible implementation, a user can open a text generation application installed on a terminal device and enter input data (e.g., a question). The text generation application can generate text from the input data using the methods provided in the embodiments of this application and present the text generation result to the user (the presentation method may include, but is not limited to, displaying, saving, uploading to the cloud, etc.).

[0082] In one possible implementation, a user can open a text generation application installed on a terminal device and input data. The text generation application can then send the input data to a cloud-based server. The cloud-based server uses the method provided in this application to generate text from the input data and sends the generated text back to the terminal device. The terminal device can then present the generated text to the user (the presentation method may include, but is not limited to, displaying, saving, or uploading to the cloud).

[0083] The following sections will introduce the text generation application in this application from the perspectives of functional architecture and product architecture that implements the functions.

[0084] Reference Figure 1B , Figure 1B This is a schematic diagram of the functional architecture of the text generation application in the embodiments of this application:

[0085] In one possible implementation, such as Figure 1BAs shown, the text generation application 102 can receive input parameters 101 (e.g., containing input data) and produce a text generation result 103. The text generation application 102 can be executed on at least one computer system (for example) and includes computer code that, when executed by one or more computers, causes the computers to execute a natural language model trained by the methods provided in the embodiments of this application.

[0086] Reference Figure 2 , Figure 2 This is a schematic diagram of the entity architecture for running a text generation application in this embodiment of the application:

[0087] See Figure 2 , Figure 2 A schematic diagram of a system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers (…). Figure 2 (The example includes a server), where server 200 can provide text generation services for one or more terminals.

[0088] The terminal 100 may have a text generation application installed or a webpage related to text generation open. The application or webpage can provide an interface. The terminal 100 can receive relevant parameters input by the user on the text generation interface and send the parameters to the server 200. The server 200 can obtain the processing result based on the received parameters and return the processing result to the terminal 100.

[0089] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters on its own, without the need for the server to cooperate. This application embodiment is not limited to this.

[0090] The following description Figure 2 The product form of the mid-terminal 100;

[0091] The terminal 100 in this application embodiment can be a mobile phone, tablet computer, wearable device, vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc., and this application embodiment does not impose any restrictions on it.

[0092] Figure 3A schematic diagram of an optional hardware structure for terminal 100 is shown.

[0093] refer to Figure 3 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), a processor 170, an external interface 180, a power supply 190, and other components. Those skilled in the art will understand that... Figure 3 These are merely examples of terminals or multi-functional devices and do not constitute a limitation on terminals or multi-functional devices. They may include more or fewer components than shown in the illustration, or combine certain components, or use different components.

[0094] The input unit 130 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the portable multi-functional device. Specifically, the input unit 130 may include a touchscreen 131 (optional) and / or other input devices 132. The touchscreen 131 can collect touch operations performed by the user on or near it (such as operations performed by the user using fingers, knuckles, styluses, or any suitable object on or near the touchscreen), and drive the corresponding connection devices according to a pre-set program. The touchscreen can detect the user's touch actions, convert the touch actions into touch signals and send them to the processor 170, and can receive and execute commands sent by the processor 170; the touch signal includes at least touch point coordinate information. The touchscreen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, various types of touchscreens, such as resistive, capacitive, infrared, and surface acoustic wave, can be used to implement the touchscreen. Besides the touchscreen 131, the input unit 130 may also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0095] Other input devices 132 can receive input data, etc.

[0096] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the terminal 100, interactive interfaces, file display, and / or playback of any multimedia file. In this embodiment, the display unit 140 can be used to display the interface of a text generation application, the generated text generation results, etc.

[0097] The memory 120 can be used to store instructions and data. The memory 120 may primarily include an instruction storage area and a data storage area. The data storage area can store various types of data, such as multimedia files and text. The instruction storage area can store software units such as operating systems, applications, and instructions required for at least one function, or subsets or extended sets thereof. It may also include non-volatile random access memory. It provides the processor 170 with hardware, software, and data resources for managing the computing device, supporting control software and applications. It is also used for storing multimedia files, as well as storing running programs and applications.

[0098] The processor 170 is the control center of the terminal 100. It connects various parts of the terminal 100 via various interfaces and lines. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it performs various functions and processes data of the terminal 100, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 170. In some embodiments, the processor and memory can be implemented on a single chip; in some embodiments, they can also be implemented separately on independent chips. The processor 170 can also be used to generate corresponding operation control signals, send them to the corresponding components of the computing processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that the various functional modules therein perform corresponding functions, thereby controlling the corresponding components to act according to the instructions.

[0099] The memory 120 can be used to store software code related to the data processing method, and the processor 170 can execute the steps of the chip's data processing method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to achieve the corresponding functions.

[0100] The radio frequency unit 110 (optional) can be used for receiving and transmitting signals during information transmission or calls. For example, it can receive downlink information from the base station and process it for the processor 170; additionally, it can transmit uplink data to the base station. Typically, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, the radio frequency unit 110 can also communicate wirelessly with network devices and other devices. This wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0101] In this embodiment of the application, the radio frequency unit 110 can send input data to the server 200 and receive the text generation result sent by the server 200.

[0102] It should be understood that the radio frequency unit 110 is optional and can be replaced with other communication interfaces, such as a network port.

[0103] The terminal 100 also includes a power supply 190 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0104] Terminal 100 also includes an external interface 180, which can be a standard Micro USB interface or a multi-pin connector, which can be used to connect terminal 100 to other devices for communication or to connect a charger to charge terminal 100.

[0105] Although not shown, terminal 100 may also include a flash, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with various functions, etc., which will not be described in detail here. Some or all of the methods described below can be applied to, for example... Figure 3 In the terminal 100 shown.

[0106] The following description Figure 2 The product form of the mid-range server 200;

[0107] Figure 4 A structural diagram of a server 200 is provided, as follows: Figure 4 As shown, server 200 includes bus 201, processor 202, communication interface 203, and memory 204. Processor 202, memory 204, and communication interface 203 communicate with each other via bus 201.

[0108] Bus 201 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0109] The processor 202 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).

[0110] Memory 204 may include volatile memory, such as random access memory (RAM). Memory 204 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0111] The memory 204 can be used to store software code related to the data processing method, and the processor 202 can execute the steps of the chip's data processing method, and can also schedule other units to achieve corresponding functions.

[0112] It should be understood that the aforementioned terminal 100 and server 200 can be centralized or distributed devices. The processors (e.g., processor 170 and processor 202) in the aforementioned terminal 100 and server 200 can be hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the processor can be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0113] It should be understood that the steps related to the model inference process in the embodiments of this application involve AI-related operations. When performing AI operations, the instruction execution architecture of the terminal device and server is not limited to the processor-memory architecture described above. The following section will further explain... Figure 5 The system architecture provided in the embodiments of this application will be described in detail.

[0114] Figure 5 This is a schematic diagram of the system architecture provided for an embodiment of this application. Figure 5 As shown, the system architecture 500 includes an execution device 510, a training device 520, a database 530, a client device 540, a data storage system 550, and a data acquisition system 560.

[0115] The execution device 510 includes a calculation module 511, an I / O interface 512, a preprocessing module 513, and a preprocessing module 514. The calculation module 511 may include a target model / rule 501, while the preprocessing modules 513 and 514 are optional.

[0116] The execution device 510 can be a terminal device or a server that runs the aforementioned text generation application.

[0117] The data acquisition device 560 is used to collect training samples. Training samples can be program files (including program code and program input data), etc. After collecting the training samples, the data acquisition device 560 stores these training samples in the database 530.

[0118] The training device 520 can maintain training samples in the database 530 to obtain the target model / rule 501 from the neural network to be trained.

[0119] It should be noted that in practical applications, the training samples maintained in database 530 may not all come from the data acquisition device 560; they may also be received from other devices. Furthermore, it should be noted that training device 520 may not necessarily train the target model / rule 501 entirely based on the training samples maintained in database 530; it may also obtain training samples from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.

[0120] The target model / rule 501 trained using training device 520 can be applied to different systems or devices, such as... Figure 5 The execution device 510 shown can be a terminal, such as a mobile phone terminal, tablet computer, laptop computer, augmented reality (AR) / virtual reality (VR) device, vehicle terminal, etc., or it can be a server, etc.

[0121] Specifically, the training device 520 can transfer the trained model to the execution device 510.

[0122] exist Figure 5 In the execution device 510, an input / output (I / O) interface 512 is configured for data interaction with external devices. Users can input data to the I / O interface 512 through the client device 540 (e.g., input data in the embodiment of this application).

[0123] Preprocessing modules 513 and 514 are used to preprocess the input data received from the I / O interface 512. It should be understood that preprocessing modules 513 and 514 may be absent, or only one preprocessing module may be used. When preprocessing modules 513 and 514 are absent, the calculation module 511 can be used directly to process the input data.

[0124] During the preprocessing of input data by the execution device 510, or during the calculation module 511 of the execution device 510 performing calculations and other related processes, the execution device 510 can call data, code, etc. in the data storage system 550 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 550.

[0125] Finally, the I / O interface 512 provides the processing results (such as text generation results) to the client device 540, thereby providing them to the user.

[0126] exist Figure 5In the illustrated scenario, the user can manually provide input data, which can be done through the interface provided by I / O interface 512. Alternatively, the client device 540 can automatically send input data to I / O interface 512. If user authorization is required for the client device 540 to automatically send input data, the user can set the corresponding permissions in the client device 540. The user can view the output results of the execution device 510 on the client device 540, which can be presented in various forms such as display, sound, or animation. The client device 540 can also act as a data acquisition terminal, collecting the input data and output results of the input I / O interface 512 as shown in the figure, and storing them as new sample data in database 530. Alternatively, data can be collected directly from the I / O interface 512 without going through the client device 540, using the input data and output results of the input I / O interface 512 as shown in the figure, and storing them as new sample data in database 530.

[0127] It is worth noting that, Figure 5 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 5 In this context, the data storage system 550 is an external storage device relative to the execution device 510. However, in other cases, the data storage system 550 may also be placed within the execution device 510. It should be understood that the aforementioned execution device 510 may be deployed within the client device 540.

[0128] From the inference side of the model:

[0129] In this embodiment, the computing module 511 of the execution device 510 can obtain the code stored in the data storage system 550 to implement the steps related to the model reasoning process in this embodiment.

[0130] In this embodiment of the application, the computing module 511 of the execution device 510 may include hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the training device 520 may be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0131] Specifically, the computing module 511 of the execution device 510 can be a hardware system with the function of executing instructions. The steps related to the model inference process provided in this application embodiment can be software code stored in the memory. The computing module 511 of the execution device 510 can obtain the software code from the memory and execute the obtained software code to implement the steps related to the model inference process provided in this application embodiment.

[0132] It should be understood that the computing module 511 of the execution device 510 can be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps related to the model reasoning process provided in the embodiments of this application can also be implemented by the hardware system in the computing module 511 of the execution device 510 without the function of executing instructions, which is not limited here.

[0133] From the training side of the model:

[0134] In this embodiment of the application, the training device 520 can access the memory ( Figure 5 (Not shown in the diagram, but can be integrated into the training device 520 or deployed separately from the training device 520) The code stored in the diagram can be used to implement the steps related to model training in the embodiments of this application.

[0135] In this embodiment of the application, the training device 520 may include hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the training device 520 may be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0136] It should be understood that the training device 520 can be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps related to the training of the neutralization model provided in the embodiments of this application can also be implemented by the hardware system in the training device 520 without the function of executing instructions, which is not limited here.

[0137] II. Cloud-based text generation services provided by the server:

[0138] In one possible implementation, the server can provide text generation services to the client side via an application programming interface (API).

[0139] In this process, the terminal device can send relevant parameters (such as input data) to the server through the API provided by the cloud. The server can obtain the processing result (such as text generation result) based on the received parameters and return the processing result to the terminal.

[0140] The description of the terminal and server can be found in the above embodiments, and will not be repeated here.

[0141] like Figure 6 The process of using a text generation cloud service provided by a cloud platform is illustrated.

[0142] 1. Activate and purchase the text generation service.

[0143] 2. Users can download the software development kit (SDK) corresponding to the text generation service. Cloud platforms typically provide multiple development versions of the SDK for users to choose from based on their development environment needs, such as a Java version SDK, a Python version SDK, a PHP version SDK, an Android version SDK, etc.

[0144] 3. After downloading the corresponding version of the SDK to their local machine according to their needs, users can import the SDK project into their local development environment, configure and debug it in the local development environment, and develop other functions in the local development environment to form an application that integrates text generation capabilities.

[0145] 4. When a text generation application needs to generate text, it can trigger a text generation API call. When the application triggers text generation, it sends an API request to the running instance of the text generation service in the cloud environment. The API request carries the input data, which is then processed by the running instance in the cloud environment to obtain the processing result (such as the text generation result).

[0146] 5. The cloud environment returns the processing result to the application, thus completing a text generation service call.

[0147] In addition to applications and cloud services, this application can also be implemented as a large-scale application SDK.

[0148] Since the embodiments of this application involve a large number of neural network applications, for ease of understanding, the relevant terms and concepts such as neural networks involved in the embodiments of this application will be introduced below.

[0149] (1) Neural Network

[0150] A neural network can be composed of neural units, which can be defined as a computational unit that takes xs (i.e., input data) and an intercept of 1 as input. The output of this computational unit can be:

[0151]

[0152] Where s = 1, 2, ..., n, where n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer, and the activation function can be the sigmoid function. A neural network is a network formed by connecting multiple of the above-mentioned individual neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be a region composed of several neural units.

[0153] (2) Backpropagation algorithm

[0154] Convolutional neural networks can employ backpropagation (BP) to correct the parameters in the initial super-resolution model during training, thereby reducing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates an error loss; this error loss information is then propagated back to update the parameters in the initial super-resolution model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the super-resolution model, such as the weight matrix.

[0155] (3) Loss Function

[0156] In training a deep neural network, to ensure the output closely approximates the desired predicted value, we compare the network's prediction with the target value. Based on the difference, we update the weight vector of each layer (usually pre-configuring parameters before the initial update). For example, if the prediction is too high, the weight vector is adjusted to predict a lower value. This adjustment continues until the deep neural network predicts the target value or a value very close to it. Therefore, we need to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are important equations used to measure the difference between the predicted and target values. Taking the loss function as an example, a higher output value (loss) indicates a greater difference, and training the deep neural network becomes a process of minimizing this loss.

[0157] (4) Knowledge graph: A graph data structure consisting of several knowledge triples (subject entity, relation, object entity).

[0158] Large-Scale Language Models (LLMs) encapsulate rich human knowledge within their massive parameters, achieving impressive performance in many complex natural language tasks, including question answering. However, despite their impressive capabilities, LLMs still exhibit serious factual errors (i.e., illusions) when faced with questions exceeding their knowledge boundaries. As an effective solution to address this deficiency, Retrieval Augmented Generation (RAG) improves the accuracy and reliability of generated content by integrating question-related information from external knowledge bases into the LLM generation process through a combination of retrieval and generation. Specifically, for a given question, the RAG system first retrieves relevant document paragraphs from an external knowledge base and then uses these texts as contextual input, passing them along with the input question to the LLM as additional non-parametric knowledge. In this form, the LLM generates answers not only based on its internal knowledge representation but also by utilizing retrieved external information, significantly improving the accuracy of the answers and reducing illusions.

[0159] A single "retrieval-generation" process is usually sufficient to meet the information requirements of a single-hop question. However, complex multi-hop question answering tasks remain challenging because they require more relevant knowledge and multi-step reasoning ability. Therefore, how to improve the performance of RAG systems on multi-hop question answering tasks has attracted widespread attention in the research community.

[0160] A feasible and widely adopted strategy is to extend the RAG into a multi-round iterative process. This process alternates between two phases: (1) using LLM to perform partial reasoning based on the input question and currently collected information to guide subsequent retrievals; and (2) performing new retrievals to collect more information to enhance subsequent LLM reasoning, until all collected information is sufficient for LLM to deduce the final answer or the maximum number of iterations is exceeded. Through this workflow of alternating retrieval and LLM reasoning, the iterative RAG can effectively bridge the semantic gap between the input question and the required knowledge.

[0161] However, "more doesn't always mean better"—while iterative retrieval can periodically introduce new external paragraphs to enrich nonparametric knowledge, the ever-growing text also presents additional challenges to LLM inference due to the complexity and diversity of natural language expressions. Most existing methods simply accumulate all retrieved paragraphs into the LLM's prompts, often failing to fully perceive the underlying knowledge structure embedded in the text. This knowledge structure is crucial for LLM inference, reflecting the logical connections and hierarchical relationships between information, and helping LLM to more effectively understand, organize, and integrate external information. Ignoring these implicit structures may make it difficult for LLM to discern the relationships between information, leading to misunderstandings or omissions in the reasoning process. Therefore, a clear knowledge structure is essential for achieving high-quality multi-step reasoning.

[0162] In this application, we designed a novel structured RAG paradigm (named KnowTrace). This paradigm coherently traces the knowledge structure related to a question to enhance multi-step reasoning capabilities. At a high level, we draw on a profound insight from constructivist theory: learning is not merely the accumulation of information, but rather the construction and expansion of one's cognitive patterns through the active absorption of key information. Inspired by this principle, KnowTrace views LLM as an active knowledge organizer (rather than a passive information receiver), explicitly tracing question-related knowledge triples from retrieved paragraphs and progressively forming a concrete knowledge graph (KG) to achieve structured retrieval enhancement generation. Specifically, KnowTrace can be described as a reasoning-guided knowledge graph expansion process, in which the LLM agent alternates between the following two steps: 1) Knowledge exploration: combining the input question with the current knowledge graph to propose a set of entities that need to be explored, while determining the corresponding relation guidance, and the generated entity-relation pairs serve as new retrieval queries; 2) Knowledge completion: based on the retrieved documents, these entity-relation pairs are completed to generate complete knowledge triples to expand the current knowledge graph—until the LLM has acquired enough knowledge to solve the input question or has reached the predetermined expansion round limit.

[0163] Thanks to this explicit knowledge tracing perspective, KnowTrace adaptively maintains a clear knowledge graph for each input question during multi-step reasoning. This transparent structure provides LLMs with an easily understandable context to enhance their reasoning capabilities, while also offering a graphical explanation of the entire reasoning trajectory. For the trajectory leading to the correct answer, the constructed knowledge graph naturally induces a post-hoc reflection mechanism, identifying key evidence subgraphs through knowledge backtracking. Notably, this provides a simple yet effective way to extract higher-quality reasoning paths, enabling KnowTrace to achieve more advanced performance in a self-learning manner. Unlike existing self-learning methods that indiscriminately fine-tune along the entire correct trajectory, our paradigm can selectively filter out informational impurities (i.e., irrelevant knowledge and useless retrieval results) in the reasoning trajectory for better self-improvement. Overall, by demonstrating its dual advantages in multi-step reasoning and self-improvement, this application highlights the significant implications of structured knowledge tracing for enhanced retrieval generation.

[0164] Existing Retrieval Augmentation (RAG) methods, while improving the performance of Large-Scale Language Models (LLMs) by introducing external information, still face several key challenges when dealing with complex multi-hop problems. First, as the number of iterative retrievals increases, the accumulated text volume grows rapidly, making it difficult for language models to efficiently extract key knowledge, especially implicit logical relationships within the text, thus limiting the accuracy of multi-step reasoning. Second, some solutions attempt to optimize the reasoning process by reorganizing the retrieved text or external corpora, but these methods are not only computationally expensive but also prone to losing key information relevant to the problem. In short, existing methods lack an efficient and structured way to ensure the clear presentation and reasonable organization of knowledge during the reasoning process, making it difficult for models to fully realize their potential when dealing with complex reasoning tasks. Therefore, the goal of this application is to provide a novel structured retrieval augmentation method to address the shortcomings of existing technologies in handling complex knowledge structuring, reasoning efficiency, and knowledge completeness.

[0165] The data processing methods of this application are described below. See also... Figure 7 The flowchart shown illustrates a data processing method that can be executed by a data processing system. The method includes:

[0166] 701. Obtain the question; the question contains a first entity;

[0167] One application scenario of this application is a multi-hop fact question answering system based on a large language model in an open domain. The overall architecture of the system is as follows: Figure 8As shown, the basic operating logic of a multi-hop fact question answering system based on a large language model in an open domain is as follows: First, the user inputs a complex multi-hop question into the system; then, the core reasoning module LLM performs partial reasoning based on the input question, analyzing and proposing the current retrieval query; next, an external database returns relevant documents to enhance the reasoning of the large language model; this process continues until the large language model provides the final predicted answer. Such systems have broad application prospects in multiple industries, effectively solving complex problems and improving the quality and efficiency of information acquisition, thus possessing significant practical significance and research value.

[0168] In this application, the entity can be a conceptual description, such as a person's name or a place name.

[0169] 702. Based on the question, determine a second entity from the first search content related to the question; the second entity has a first relationship with the first entity; the first entity, the second entity, and the first relationship are used to form a first relationship pair;

[0170] In one possible implementation, when the language model cannot determine the correct answer to the question based on the question itself, first search results related to the question are retrieved. For example, entity-relationship pairs can be retrieved from an external database, returning one or more relevant documents for each entity-relationship pair.

[0171] In one possible implementation, based on the prompt, a first prompt is obtained through a language model, the first prompt indicating that a second entity with the first relationship to the first entity is determined from the first search content; based on the first prompt, a second entity with the first relationship to the first entity is determined from the search content through a language model.

[0172] For example, given a question, we can first analyze the input question and extract the initial entity (e.g., the first entity) to be explored and the corresponding relationship guidance, in the form of: [Entity Name: Relationship Guidance Description].

[0173] In this embodiment of the application, for the retrieved content, knowledge triples are explored through explicit knowledge tracing to form a structured knowledge graph. Based on this structured knowledge graph, the reasoning accuracy of LLM can be improved, solving the problem that the existing technology is difficult to perceive the underlying logical structure and improving the accuracy of response generation.

[0174] This mechanism allows LLM to progressively generate knowledge graphs during retrieval and reasoning, rather than simply accumulating large amounts of unstructured text information. Compared to existing Retrieval Augmentation (RAG) methods, this embodiment places greater emphasis on the structured organization of knowledge, thereby reducing the burden on LLM to handle text complexity. In each step of reasoning, the system generates relevant entities and relations based on the current question and retrieves and completes the required knowledge triples (entity-relation-entity) until the question is answered. This structured reasoning approach improves the accuracy and efficiency of the system when handling complex, multi-hop problems.

[0175] 703. Based on the question and the first relation, determine the response to the question using a language model.

[0176] In one possible implementation, the correct response is output when the correct response to the question is obtained through a language model based on the question and the first relation.

[0177] In one possible implementation, when the correct response to the question is obtained through the language model based on the question and the first relation team, the first relation team is used as a positive sample to fine-tune the language model.

[0178] For the correct reasoning trajectory, a closed subgraph between the answer entity and the initial entity is extracted through knowledge backtracking. The corresponding exploration data and completion data are added to the fine-tuning dataset D. FT After constructing a certain amount of fine-tuning data, the LLM is subjected to standard supervised fine-tuning on this data. Based on the knowledge graph autonomously constructed for each question, this application proposes a post-reflection mechanism called knowledge backtracking, which is used to identify supporting evidence and filter useless search content, thereby extracting high-quality reasoning trajectories that can be further used to fine-tune and optimize model performance, achieving self-improvement of the model. This application proposes a post-reflection mechanism that identifies knowledge subgraphs that contribute to the final solution by backtracking and analyzing the generated knowledge graph, and filters out invalid or redundant search results. Compared with the indiscriminate fine-tuning training in the prior art, this application can fine-tune the system based on effective knowledge through this self-reflection method, thereby improving the system's self-improvement capability.

[0179] In one possible implementation, when the language model cannot determine the correct answer to the question based on the question and the first relation pair, a third entity is determined from the first search content or the second search content related to the question; the third entity has a second relation with the second entity; the third entity, the second entity, and the second relation are used to form a second relation pair; the answer to the question is determined by the language model based on the question, the first relation pair, and the second relation pair.

[0180] In one possible implementation, when the language model cannot determine the correct answer to the question based on the question and the first relation pair, a fourth entity is determined from the first search content or the second search content related to the question; the fourth entity has a third relation with the first entity; the third entity, the first entity, and the third relation are used to form a third relation pair; the answer to the question is determined by the language model based on the question and the third relation pair.

[0181] For example, knowledge completion can be performed based on entity-relation pairs and related documents to obtain complete knowledge triples in the form of (subject entity, relation, object entity), forming an initial knowledge structure. Entering the second round of iterations, combined with The system determines whether the input question is sufficient to deduce the final answer. If so, it uses a thought process chain to generate the thought process and predicted answer. If not, it enters a new exploration phase, proposing entities to be explored in this round and corresponding relationship guidance based on the current structure and the input question. The retrieval and knowledge completion operations are the same as those described above. This process continues to iterate until the LLM assesses that the current knowledge structure is sufficient to answer the input question, or the predefined maximum number of knowledge expansions has been reached.

[0182] In one possible implementation, when the correct answer to the question is obtained through the language model based on the question, the first relation pair, and the second relation pair, the first relation pair and the second relation pair are used as positive samples to fine-tune the language model.

[0183] In one possible implementation, when the correct response to the question is obtained through the language model based on the question, the first relation pair, and the third relation pair, the third relation pair is used as a positive sample to fine-tune the language model.

[0184] For example, refer to Figure 9A , Figure 9A This is a schematic diagram of an application framework for an embodiment of this application. The core idea is to seamlessly integrate the knowledge structuring process into the multi-step reasoning process of LLM, treating LLM as an active knowledge organizer rather than a passive information receiver. Specifically, as... Figure 9A As shown, KnowTrace consists of three core modules: a knowledge exploration module, a retrieval module, and a knowledge completion module. These three modules achieve reasoning and solution to complex problems through dynamic expansion of the knowledge graph and multi-round reasoning interaction.

[0185] The knowledge exploration module is the system's starting point, responsible for preliminary analysis of user questions and determining whether it can answer them based on existing explicit knowledge structures. When the knowledge structure is sufficient, the knowledge exploration module integrates existing knowledge with the input question to provide the final answer; when the knowledge structure is insufficient, the knowledge exploration module obtains more relevant information from the current knowledge structure. Formally, in the i-th iteration, for the input question q and the current knowledge graph... (Initially empty), the Knowledge Exploration LLM receives a set of structured cue words p e First, assess Does it provide enough information to answer the input question q? If so, it automatically generates the thought process T and the final answer A; if not, it begins the exploration process, starting from the current... Select the corresponding entities and generate a relation description for each relation to guide the retrieval of relevant information, that is, determine a set of entity-relation pairs ER that needs to be explored.

[0186] or

[0187] Where f e This serves as an example of a knowledge exploration module, used to assist LLM in conforming to instructions.

[0188] Guided by the knowledge exploration module, the retrieval module performs targeted information retrieval from the external document library C based on entity-relation pairs, returning the Top-N relevant documents.

[0189]

[0190] The retrieval methods used are traditional text retrieval methods, such as BM25, DPR, and Contriever.

[0191] The knowledge completion module is based on the relevant documents returned by the retrieval module. The entity relationships explored in this round are used to complete the ER, resulting in complete knowledge triples. These new triples are then incorporated into the current knowledge graph to further enrich the model's cognitive structure. Specifically, the knowledge completion LLM accepts a set of cue words p c The aim is to use target information from relevant documents to complete and obtain new knowledge triples T:

[0192]

[0193] Where T represents a complete set of knowledge triples, in the form of (subject entity, relation, object entity). These triples are then incorporated into the current knowledge structure. From This module is used to stimulate the next round of knowledge exploration.

[0194] Based on these three modules, KnowTrace can guide further knowledge expansion through the existing knowledge structure in each round of reasoning until the input question is fully answered. The knowledge structure constructed in this process demonstrates clear logical relationships to the LLM, effectively promoting its reasoning ability, and also providing an easily understandable graphical explanation of the entire multi-step reasoning process. This transparent graphical explanation further stimulates a post-hoc reflection mechanism called knowledge backtracking.

[0195] For a detailed flowchart of the knowledge retrieval process, please refer to [link / reference]. Figure 9B As shown, by backtracking the knowledge graph during the reasoning process, effective knowledge crucial to problem-solving is identified and extracted. Its core lies in reflecting on the entire correct reasoning trajectory through knowledge backtracking, filtering out useful reasoning paths, and extracting high-quality reasoning evidence. This mechanism helps the system to self-improve, further enhancing its performance in multi-hop problem-solving. Figure 9B As shown, given an input question q, KnowTrace obtains a knowledge graph K after multiple rounds of knowledge expansion. q And based on K q After successfully obtaining the correct answer, we can backtrack from the answer entity A to the initial entity I to obtain a closed subgraph.

[0196]

[0197] This subgraph contains all supporting evidence helpful to the final reasoning, while directly eliminating useless retrievals and irrelevant knowledge in the process, thus providing high-quality reasoning basis. This basis not only helps analyze the reasoning logic but also provides high-quality knowledge references for subsequent optimization and improvement of the model. By reflecting on and extracting the correct path, the system can use the exploration and completion data corresponding to this key knowledge to fine-tune its training. This differs from traditional self-fine-tuning, which is usually based on a complete correct reasoning trajectory, potentially including invalid steps. In the post-reflection mechanism of this application, KnowTrace can selectively fine-tune only those knowledge and paths that are helpful to the reasoning.

[0198] For example, the multi-step inference process of KnowTrace is as follows:

[0199]

[0200] An example of the process for Algorithm 1 is as follows:

[0201] 1. Given a complex multi-hop problem, KnowTrace will first analyze the input problem and extract the initial entities to be explored and the corresponding relationship guidance, in the form of: [Entity Name: Relationship Guidance Description];

[0202] 2. Specific retrieval methods (such as BM25) retrieve entity-relation pairs from external databases (such as Wikipedia), returning N relevant documents for each entity-relation pair;

[0203] 3. KnowTrace performs knowledge completion based on entity-relation pairs and related documents, resulting in complete knowledge triples in the form of (subject entity, relation, object entity), forming an initial knowledge structure.

[0204] 4. Enter the second round of iteration, combining... The system determines whether the input question is sufficient to deduce the final answer. If so, it uses a thought process chain to generate the thought process and predicted answer. If not, it enters a new exploration phase, proposing entities to be explored in this round and corresponding relationship guidance based on the current structure and input question. The retrieval and knowledge completion operations are the same as in steps 2 and 3.

[0205] 5. This process continues iteratively until the LLM evaluates that the current knowledge structure is sufficient to answer the input question, or reaches the predefined maximum number of knowledge expansions limit.

[0206] (2) The self-fine-tuning process based on knowledge backtracking is as follows:

[0207]

[0208] An example of Algorithm 2 is shown below:

[0209] 1. For a given multi-hop question-answering dataset (such as HotpotQA), during the data collection phase, KnowTrace uses the process in Algorithm 1 to reason about and answer each training question;

[0210] 2. Then, determine whether the prediction is correct based on the answer label. If it is incorrect, discard the case and do not process it.

[0211] 3. For the reasoning trajectory that yields the correct answer, a closed subgraph between the answer entity and the initial entity is extracted through knowledge backtracking. The corresponding exploration data and completion data are then added to the fine-tuning dataset D. FT

[0212] 4. After constructing a certain amount of fine-tuning data, perform standard supervised fine-tuning of the LLM on this data.

[0213] KnowTrace can be directly used as the core module of this system, processing user input, proactively retrieving relevant article paragraphs, expanding the corresponding knowledge structure, and thus providing highly accurate answers. The constructed knowledge structure provides users with clear reasoning explanations and explicit knowledge chains. Furthermore, the system can collect higher-quality fine-tuning data through knowledge backtracking, achieving effective self-iteration and possessing broad adaptability, thus it can be well migrated to other vertical domain retrieval and question-answering scenarios. The specific process is as follows:

[0214] 1) KnowTrace can interact with users online and collect user feedback through certain strategies. By backtracking the knowledge structure corresponding to positive feedback, an offline dataset can be built.

[0215] 2) Perform standard-supervised fine-tuning based on the collected data to improve the overall reasoning ability of the system;

[0216] 3) Deploy the fine-tuned system and allow users to interact with it. Collect a batch of data periodically and conduct offline training.

[0217] This application presents experiments demonstrating the techniques used. It utilizes three standard multi-hop question-answering scenarios: the HotpotQA dataset, the 2WikiMulti-hopQA dataset, and the MuSiQue dataset. These three datasets all contain a large number of complex multi-hop fact questions, requiring interactive retrieval with external databases to collect sufficient supporting information in order to provide a satisfactory correct answer. Specific scenario data is shown in the table below:

[0218] For these three datasets, this application selected 500 multi-hop questions as the test environment, and used strict matching (EM) and F1 score between predicted and standard answers as evaluation metrics. Regarding baseline methods, we considered four existing retrieval augmentation methods: (1) no RAG, i.e., CoT; (2) single-round RAG, such as CoT-RAG, RePlug, SuRE, RECOMP; (3) iterative RAG, such as IRCoT, Self-Ask, ReAct, ITER-RETGEN; and (4) structure-enhanced RAG, i.e., SG-Prompt. Experiments were conducted using LLaMA3-Instruct-8B as the base model.

[0219] The experimental results are shown in the table below:

[0220] Table 1

[0221]

[0222] As shown in Table 1, the KnowTrace method in this application consistently outperforms the baseline method in terms of inference performance on three standard multi-hop question-answering datasets, demonstrating the superiority of explicit knowledge tracing. Furthermore, KnowTraceFT achieves even better performance after self-improvement guided by knowledge backtracking, indicating that high-quality data derived from knowledge backtracking can effectively stimulate the self-improvement of the overall system.

[0223] Reference Figure 10 , Figure 10 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application, such as... Figure 10 As shown in the figure, an embodiment of this application provides a data processing apparatus 1000, comprising:

[0224] Question acquisition module 1001 is used to acquire questions; the question includes a first entity;

[0225] Knowledge construction module 1002 is used to determine a second entity from a first search content related to the question based on the question; the second entity has a first relationship with the first entity; the first entity, the second entity, and the first relationship are used to form a first relationship group;

[0226] The response confirmation module 1003 is used to determine the response to the question based on the question and the first relational group through a language model.

[0227] In one possible implementation, the knowledge building module is specifically used for:

[0228] Based on the prompt, a first prompt is obtained through the language model, which indicates that a second entity with the first relationship with the first entity is determined from the first search content;

[0229] Based on the first hint, a second entity with a first relationship to the first entity is identified from the search content using a language model.

[0230] In one possible implementation, the knowledge building module is further configured to:

[0231] When the language model cannot determine the correct answer to the question based on the question, the first search content related to the question is obtained.

[0232] In one possible implementation, the response determining module is further configured to:

[0233] When the correct answer to the question is obtained through the language model based on the question and the first relation, the correct answer is output.

[0234] In one possible implementation, the device further includes:

[0235] The training module is used to fine-tune the language model by using the first relation group as a positive sample when the correct response to the question is obtained through the language model based on the question and the first relation group.

[0236] In one possible implementation, the knowledge building module is further configured to:

[0237] When the language model cannot determine the correct answer to the question based on the question and the first relational team, a third entity is determined from the first search content or the second search content related to the question; the third entity and the second entity have a second relation; the third entity, the second entity, and the second relation are used to form a second relational team;

[0238] The response confirmation module is also used for:

[0239] The response to the question is determined using a language model based on the question, the first relationship team, and the second relationship team.

[0240] In one possible implementation, the device further includes:

[0241] The training module is used to fine-tune the language model by using the first relationship pair and the second relationship pair as positive samples when the correct answer to the question is obtained through the language model based on the question, the first relationship pair, and the second relationship pair.

[0242] In one possible implementation, the knowledge building module is further configured to:

[0243] When the language model cannot determine the correct answer to the question based on the question and the first relation pair, a fourth entity is determined from the first search content or the second search content related to the question; the fourth entity has a third relation with the first entity; the third entity, the first entity, and the third relation are used to form a third relation pair;

[0244] The response confirmation module is also used for:

[0245] Based on the question and the third relation, the response to the question is determined using a language model.

[0246] In one possible implementation, the device further includes:

[0247] The training module is used to fine-tune the language model by using the third relation pair as a positive sample when the correct response to the question is obtained through the language model based on the question, the first relation pair, and the third relation pair.

[0248] The following describes an execution device provided in an embodiment of this application. Please refer to [link / reference]. Figure 11 , Figure 11 This is a schematic diagram of an execution device provided in an embodiment of this application. Specifically, the execution device 1100 includes: a receiver 1101, a transmitter 1102, a processor 1103, and a memory 1104 (wherein the execution device 1100 may have one or more processors 1103). Figure 11 (Taking a processor as an example), processor 1103 may include application processor 11031 and communication processor 11032. In some embodiments of this application, receiver 1101, transmitter 1102, processor 1103 and memory 1104 may be connected via bus or other means.

[0249] Memory 1104 may include read-only memory and random access memory, and provides instructions and data to processor 1103. A portion of memory 1104 may also include non-volatile random access memory (NVRAM). Memory 1104 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0250] Processor 1103 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.

[0251] The methods disclosed in the embodiments of this application can be applied to or implemented by processor 1103. Processor 1103 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the hardware or by instructions in software form within processor 1103. Processor 1103 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Processor 1103 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1104. Processor 1103 reads the information from memory 1104 and, in conjunction with its hardware, completes the steps involved in the model inference process described above.

[0252] Receiver 1101 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1102 can be used to output digital or character information through the first interface; transmitter 1102 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1102 may also include a display device such as a display screen.

[0253] This application also provides a server device; please refer to [link / reference]. Figure 12 , Figure 12This is a schematic diagram of a server structure provided in an embodiment of this application. Specifically, server 1200 is implemented by one or more servers. Server 1200 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1212 (e.g., one or more processors) and memory 1232, and one or more storage media 1230 (e.g., one or more mass storage devices) for storing application programs 1242 or data 1244. The memory 1232 and storage media 1230 can be temporary or persistent storage. The program stored in storage media 1230 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the server. Furthermore, the CPU 1212 may be configured to communicate with storage media 1230 and execute the series of instruction operations in storage media 1230 on server 1200.

[0254] Server 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input / output interfaces 1258; or, one or more operating systems 1241, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0255] In this embodiment, the central processing unit 1212 is used to execute the data processing method described in the above embodiment.

[0256] This application also provides a computer program product that, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0257] This application also provides a computer-readable storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0258] The execution device, training device, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip within the execution device to execute the data processing method described in the above embodiments, or to cause the chip within the training device to execute the data processing method described in the above embodiments. Optionally, the storage unit can be a storage unit within the chip, such as a register or cache. Alternatively, the storage unit can be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, such as random access memory (RAM).

[0259] For details, please refer to Figure 13 , Figure 13 This is a schematic diagram of a chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 1300. The NPU 1300 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core part of the NPU is the arithmetic circuit 1303, which is controlled by the controller 1304 to extract matrix data from the memory and perform multiplication operations.

[0260] In some implementations, the arithmetic circuit 1303 internally includes multiple processing engines (PEs). In some implementations, the arithmetic circuit 1303 is a two-dimensional pulsating array. The arithmetic circuit 1303 can also be a one-dimensional pulsating array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1303 is a general-purpose matrix processor.

[0261] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1302 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1301 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 1308.

[0262] Unified memory 1306 is used to store input and output data. Weight data is directly transferred to weight memory 1302 via Direct Memory Access Controller (DMAC) 1305. Input data is also transferred to unified memory 1306 via DMAC.

[0263] BIU stands for Bus Interface Unit, which is used for interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1309.

[0264] The Bus Interface Unit (BIU) 1310 is used by the instruction fetch memory 1309 to fetch instructions from external memory, and also by the memory access controller 1305 to fetch the original data of the input matrix A or the weight matrix B from external memory.

[0265] The DMAC is mainly used to move input data from external memory DDR to unified memory 1306, or to weight data to weight memory 1302, or to input data to input memory 1301.

[0266] The vector computation unit 1307 includes multiple processing units that further process the output of the computation circuit 1303 when needed, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as Batch Normalization, pixel-level summation, and upsampling of feature planes.

[0267] In some implementations, the vector computation unit 1307 can store the processed output vector in the unified memory 1306. For example, the vector computation unit 1307 can apply a linear function, or a nonlinear function, to the output of the computation circuit 1303, such as performing linear interpolation on the feature planes extracted by the convolutional layer, or, for example, accumulating a vector of values ​​to generate activation values. In some implementations, the vector computation unit 1307 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as an activation input to the computation circuit 1303, for example, for use in subsequent layers of the neural network.

[0268] The instruction fetch buffer 1309 connected to the controller 1304 is used to store the instructions used by the controller 1304;

[0269] Unified memory 1306, input memory 1301, weighted memory 1302, and instruction fetch memory 1309 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.

[0270] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.

[0271] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0272] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0273] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0274] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A data processing method, characterized by, The method comprises: acquiring a question; the question contains a first entity; determining a second entity from first search content related to the question according to the question; the second entity has a first relationship with the first entity; the first entity, the second entity, and the first relationship are used to constitute a first relationship team; determining a correct reply to the question through a language model according to the question and the first relationship team.

2. The method of claim 1, wherein, The method further comprises: acquiring first search content related to the question when the language model cannot determine a correct reply to the question according to the question. The method further comprises:

3. The method according to claim 1 or 2, characterized in that, outputting the correct reply when the correct reply to the question is obtained through the language model according to the question and the first relationship team. The method further comprises:

4. The method according to any one of claims 1 to 3, characterized in that, fine-tuning the language model by taking the first relationship team as a positive sample when the correct reply to the question is obtained through the language model according to the question and the first relationship team. The method further comprises:

5. The method according to any one of claims 1 to 4, characterized in that, determining a third entity from the first search content or second search content related to the question when the language model cannot determine the correct reply to the question according to the question and the first relationship team; the third entity has a second relationship with the second entity; the third entity, the second entity, and the second relationship are used to constitute a second relationship team; determining a correct reply to the question through a language model according to the question, the first relationship team, and the second relationship team.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: fine-tuning the language model by taking the first relationship team and the second relationship team as positive samples when the correct reply to the question is obtained through the language model according to the question, the first relationship team, and the second relationship team. The method further comprises:

7. The method of claim 6, wherein, determining a fourth entity from the first search content or second search content related to the question when the language model cannot determine the correct reply to the question according to the question and the first relationship team; the fourth entity has a third relationship with the first entity; the third entity, the first entity, and the third relationship are used to constitute a third relationship team; determining a correct reply to the question through a language model according to the question and the third relationship team.

8. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: fine-tuning the language model by taking the third relationship team as a positive sample when the correct reply to the question is obtained through the language model according to the question, the first relationship team, and the third relationship team. The device comprises:

9. The method of claim 8, wherein, a question acquisition module configured to acquire a question; the question contains a first entity; ​ 10. A data processing apparatus, characterized by, ​ ​ The knowledge construction module is configured to: According to the prompt, a first prompt is obtained by the language model, and the first prompt indicates that a second entity having the first relationship with the first entity is determined from the first search content.

11. The apparatus of claim 10, wherein, According to the first prompt, the second entity having the first relationship with the first entity is determined from the search content by the language model. The knowledge construction module is further configured to: When the language model cannot determine the correct reply to the question according to the question, the first search content related to the question is obtained.

12. The apparatus of claim 10 or 11, wherein, The reply determination module is further configured to: When the correct reply to the question is obtained according to the question and the first relationship queue by the language model, the correct reply is output.

13. The apparatus of any one of claims 10 to 12, wherein, The device further comprises: A training module is configured to, when the correct reply to the question is obtained according to the question and the first relationship queue by the language model, fine-tune the language model by taking the first relationship queue as a positive sample.

14. The apparatus of any one of claims 10 to 13, wherein, The knowledge construction module is further configured to: When the language model cannot determine the correct reply to the question according to the question and the first relationship queue, a third entity is determined from the first search content or second search content related to the question; the third entity has a second relationship with the second entity; the third entity, the second entity, and the second relationship are used to constitute a second relationship queue.

15. The apparatus of any one of claims 10 to 14, wherein, The reply determination module is further configured to: According to the question, the first relationship queue, and the second relationship queue, the reply to the question is determined by the language model. The device further comprises: A training module is configured to, when the correct reply to the question is obtained according to the question, the first relationship queue, and the second relationship queue by the language model, fine-tune the language model by taking the first relationship queue and the second relationship as positive samples.

16. The apparatus of claim 15, wherein, The knowledge construction module is further configured to: When the language model cannot determine the correct reply to the question according to the question and the first relationship queue, a fourth entity is determined from the first search content or second search content related to the question; the fourth entity has a third relationship with the first entity; the third entity, the first entity, and the third relationship are used to constitute a third relationship queue.

17. The apparatus of any one of claims 10 to 14, wherein, The reply determination module is further configured to: According to the question and the third relationship queue, the reply to the question is determined by the language model. The device further comprises: A training module is configured to, when the correct reply to the question is obtained according to the question, the first relationship queue, and the third relationship queue by the language model, fine-tune the language model by taking the third relationship as a positive sample.

18. The apparatus of claim 17, wherein, ​ ​ 19. A computing device, comprising: A computing device comprising a memory and a processor; the memory stores code, the processor is configured to execute the code, when the code is executed, the computing device performs the method according to any one of claims 1 to 9.

20. A chip, characterized by An apparatus comprising at least one processing unit and interface circuitry for providing program instructions or data to the at least one processing unit, the at least one processing unit being configured to execute the program instructions to implement the method according to any one of claims 1 to 9.

21. A cluster of computing devices, characterized in that, The computing device cluster comprises at least one computing device, the at least one computing device comprising at least one processor and at least one memory, the at least one memory storing computer readable instructions; the at least one processor executes the computer readable instructions to cause the computing device cluster to perform the method according to any one of claims 1 to 9.

22. A computer-readable storage medium, characterized in that, Computer readable instructions for implementing the method according to any one of claims 1 to 9.

23. A computer program product, characterised in that, Computer readable instructions for implementing the method according to any one of claims 1 to 9.