GraphRAG and large language model-based expense report customer service question and answer method

By combining GraphRAG and large language models, the high cost and complex semantic understanding issues of human customer service in enterprise expense reimbursement customer service are solved. Multi-hop reasoning and global knowledge extraction are realized, improving the efficiency and effectiveness of intelligent customer service Q&A on enterprise expense reimbursement platforms.

CN120448491BActive Publication Date: 2026-07-31BAOWU SHARED SERVICES CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BAOWU SHARED SERVICES CO LTD
Filing Date
2025-04-25
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies for customer service in enterprise expense reimbursement suffer from high costs and low efficiency of manual customer service, making it difficult to meet the needs of large enterprises for timely responses to employee issues. Furthermore, traditional RAGs struggle to accurately understand the complex semantics and multi-hop reasoning of user questions.

Method used

A question-and-answer method for customer service based on GraphRAG and a large language model is adopted. A customer service dataset in a pre-formatted format is formed through annotation and prompting engineering. The large language model is fine-tuned using the DeepSpeed ​​distributed training framework. Combined with GraphRAG's retrieval enhancement generation, a knowledge graph is built and answers are generated. An expert large model is configured for verification. Finally, inference is accelerated through an HTTP gateway service framework and a Gunicorn server.

Benefits of technology

It enables multi-hop reasoning and global knowledge extraction, reduces labor costs, improves response efficiency and generalization ability, and enhances the intelligent customer service Q&A effect on enterprise reimbursement platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448491B_ABST
    Figure CN120448491B_ABST
Patent Text Reader

Abstract

This invention relates to a payment customer service question-and-answer method based on GraphRAG and a large language model. First, a payment question-and-answer dataset used in the enterprise's production environment is manually compiled. Through data preprocessing and manual annotation, a question-and-answer pair dataset is obtained. Then, text extraction and integration are performed on the question-and-answer pair dataset to construct a three-segment prompt word template, yielding data for fine-tuning. Using this fine-tuned data, parameter freezing and noise embedding techniques are used to fine-tune the parameters of an open-source base model, while a distributed training framework is employed to reduce the resources required for training. Next, retrieval enhancement generation based on graph representation is used to supplement the integrated dataset, and this supplementary information is fed into the large model for enhancement generation, improving the model's answer performance. Finally, during model inference, a high-speed inference framework and optimization algorithms are used to accelerate model inference and response speed, resulting in generated answers to payment-related questions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a customer service question-and-answer method based on GraphRAG and a large language model. Background Technology

[0002] In the field of corporate customer service, traditional customer service primarily relies on human customer service representatives. These representatives undergo training and learning to master the company's products, services, and solutions to common questions, thereby providing support and answers to users. This human-based customer service approach can take into account the personalized needs of users and provide a humanized service experience. However, as companies grow in size and customer demands increase, the traditional human customer service model faces many challenges.

[0003] Chinese patent application publication number CN118551772A discloses an intelligent dialogue platform based on a large language model. This platform addresses the shortcomings of earlier dialogue platforms in understanding complex semantics and providing personalized responses, achieving efficient and intelligent user interaction. It optimizes answer generation through data learning and context awareness, improving user experience and platform performance. However, it directly adopts the publicly available large language model for question-and-answer functionality without specific optimization for particular application scenarios, thus limiting its ability to understand user questions.

[0004] Therefore, the following problems currently exist in the field of corporate expense reimbursement customer service:

[0005] (1) The human-based customer service response method is costly and inefficient, and it is difficult to meet the needs of large enterprises to respond to employee questions in a timely manner.

[0006] (2) The question-and-answer method that matches questions with answers has limited understanding of user questions and is difficult to support multi-turn dialogues.

[0007] (3) Traditional RAG (Retrieval-Augmented Generation) based methods struggle to accurately understand the complex semantics of user questions. For example, when user questions involve multi-hop reasoning (requiring the extraction of information from multiple documents), traditional RAG methods may fail to retrieve all relevant documents.

[0008] In summary, there is currently a lack of a customer service Q&A method for expense reports that can solve or partially solve the aforementioned problems. Summary of the Invention

[0009] The purpose of this invention is to overcome the shortcomings of the existing technology by providing a customer service question-and-answer method based on GraphRAG and a large language model, so as to solve or partially solve the problems of multi-hop reasoning and unsatisfactory global knowledge extraction capabilities.

[0010] The objective of this invention can be achieved through the following technical solutions:

[0011] One aspect of the present invention provides a payment customer service question-and-answer method based on GraphRAG and a large language model, comprising the following steps:

[0012] Obtain baseline question-and-answer data in response to expense reimbursement issues;

[0013] For the benchmark question and answer data, a report dataset in a preset format is obtained through annotation and prompting processes;

[0014] Based on the aforementioned payment dataset, through parameter freezing and noise embedding, the base large language model is fine-tuned using a zero-redundancy optimizer under the DeepSpeed ​​distributed training framework to complete the training of the payment customer service Q&A expert large model.

[0015] Based on the aforementioned payment data set, entities in the dataset are identified and relationships are established through GraphRAG-based retrieval enhancement, forming a payment problem knowledge graph. The knowledge graph is divided into multiple regions representing topics or concepts through community detection. A summary is generated for the entities and relationships in each region, and all of these are input into the payment customer service Q&A expert big model to generate preliminary answers to payment problems.

[0016] By modifying the prompts in the large model and configuring the customer service Q&A expert large model, the preliminary answer is verified to obtain the final answer.

[0017] As a preferred technical solution, the process of obtaining a pre-formatted expense report dataset based on the benchmark question-and-answer data includes the following steps:

[0018] Extract the question and answer fields from the big data, and convert them into structured text that includes question-answer pairs through formatting;

[0019] Add connection statements to the structured text;

[0020] Optimize structured text using a large language model;

[0021] The structured text is converted into a preset format to form a report dataset.

[0022] As a preferred technical solution, the process of training a large-scale model for customer service Q&A experts includes the following steps:

[0023] By constructing a Freeze fine-tuning script, all layers except the last few layers of the base large language model are frozen;

[0024] Based on the DeepSpeed ​​training framework and a pre-configured redundancy elimination scheme, the base large language model is fine-tuned.

[0025] As a preferred technical solution, the GraphRAG-based retrieval enhancement generation process includes the following steps:

[0026] Acquire the large-scale model of customer service Q&A experts and the embedded vector model for payment processing, and complete the service environment deployment;

[0027] Deploy a high-speed inference framework and a big oracle model service deployment framework;

[0028] Configure the path and address information for GraphRAG.

[0029] As a preferred technical solution, the process of configuring a large-scale customer service Q&A expert model to verify the preliminary answer includes the following steps:

[0030] By modifying the prompts in the large model, the model is configured to check whether the initial answers are sufficiently relevant to the user's expense report from the perspectives of accuracy, completeness, and logic.

[0031] In response to the large model's judgment that the preliminary answer is sufficiently relevant to the expense reimbursement question, the preliminary answer will be used as the final answer.

[0032] In response to the large model's judgment that the initial answer does not adequately match the claim question, the large model generates a reasoning chain based on the user's question. Using external information retrieved from the knowledge graph, the reasoning chain with the highest degree of matching with the external information and the most logically sound is selected to generate the final answer.

[0033] As a preferred technical solution, a high-speed inference framework and an HTTP gateway service framework are used to accelerate the inference of large models.

[0034] As a preferred technical solution, the following steps are also included:

[0035] The GraphRAG query functionality is encapsulated into an interface that can be called via POST requests. A web service is created using the Flask framework, and an HTTP POST route is built to receive query requests.

[0036] The client sends the query data to the server via a POST request, placing the query data in the query field of the request body.

[0037] The server extracts query information from the request and passes it to the GraphRAG query function;

[0038] The GraphRAG query method is executed, and the returned results are used to extract valid text using regular expressions and encapsulated into JSON format response data.

[0039] The server returns the query results as an HTTP response. If the query is successful, it returns the results and status information; if an error occurs, it returns the error information and status code.

[0040] As a preferred technical solution, the following steps are also included:

[0041] The server is equipped with a Gunicorn server, which processes requests in parallel by setting up multiple worker processes.

[0042] As a preferred technical solution, the process of obtaining raw question-and-answer data includes the following steps:

[0043] Obtain raw answer data for reimbursement questions that are representative and have a high probability of repetition;

[0044] Based on the original answer data, the question types are clustered according to semantic similarity.

[0045] In another aspect, an electronic device is provided, including one or more processors, a memory, and one or more programs stored in the memory, said one or more programs including instructions for executing the aforementioned query-response method based on GraphRAG and a large language model.

[0046] In another aspect, a computer-readable storage medium is provided, comprising one or more programs executable by one or more processors of an electronic device, the one or more programs including instructions for performing the aforementioned query-response method for customer service based on GraphRAG and a large language model.

[0047] Compared with the prior art, the present invention has at least one of the following beneficial effects:

[0048] (1) Achieving Multi-hop Reasoning and Global Knowledge Extraction: This invention utilizes GraphRAG-based retrieval enhancement to identify entities and establish relationships within a dataset, forming a knowledge graph for payment-related questions. Community detection divides this knowledge graph into multiple regions representing topics or concepts. A summary is generated for the entities and relationships within each region, and these summaries are input into a large-scale payment customer service question-and-answer expert model to generate preliminary answers to payment-related questions. GraphRAG leverages the entities and relationships within the knowledge graph to achieve multi-hop reasoning. For example, when a user's question involves multiple entities or requires deriving an answer from multiple steps, GraphRAG can efficiently find relevant paths and generate accurate answers through the graph structure, without being limited by the user's word choice and expression. Instead, it starts from the semantics of the question and searches for relevant knowledge within the knowledge graph.

[0049] (2) Reduce the amount of annotation and improve efficiency: This invention uses a zero-redundancy optimizer to fine-tune the base large language model under the DeepSpeed ​​distributed training framework, and completes the training of the large model of the customer service Q&A expert. The large language model can be fine-tuned with a small amount of high-quality data, which significantly improves the speed of answering user questions and the efficiency of response. At the same time, it reduces the dependence on human customer service and specific terms and conditions in the field of payment, thereby reducing labor costs.

[0050] (3) Strong generalization and adaptability: Large language models are trained on a wide range of datasets, have better generalization ability, and can adapt to different intelligent customer service question and answer tasks. By fine-tuning and introducing graph retrieval to enhance generation, they can adapt to knowledge in the enterprise reimbursement field, improve the application effect in professional fields, and show superior performance compared to traditional machine learning models and small language models.

[0051] (4) Improve training and inference efficiency: This invention significantly improves the efficiency of model training and inference and the speed of GraphRAG generation by introducing DeepSpeed, vLLM, Gunicorn optimization and HTTP service, thereby enhancing the practical application value of the model. Attached Figure Description

[0052] Figure 1 This is a flowchart of the customer service Q&A method for payment processing based on GraphRAG and a large language model in the embodiment.

[0053] Figure 2 This is a schematic diagram of the input text structure during GraphRAG inference.

[0054] Figure 3 This is a schematic diagram of the dataset structure during the training of the Qwen2.5-7B expert large model;

[0055] Figure 4This is a schematic diagram of the loss function curve during the training process of the Qwen2.5-7B expert large model;

[0056] Figure 5 This is a schematic diagram illustrating the concurrent testing of response speed under relatively high pressure conditions.

[0057] Figure 6 This is a schematic diagram of the electronic device in the embodiment. Detailed Implementation

[0058] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0059] Example 1

[0060] Regarding the problems existing in the aforementioned prior art, see [link to relevant documentation]. Figure 1 This embodiment provides a payment reimbursement customer service question-and-answer method based on GraphRAG and a large language model, aiming to reduce the cost of manual customer service, improve the real-time response efficiency to user questions and answers, and at the same time have better concurrency performance and generalization ability, thereby improving the application effect in intelligent customer service fields such as enterprise payment reimbursement platforms. The method includes the following steps:

[0061] Step S1, Data Collection. Specifically, Step S1 includes steps S101-S103:

[0062] Step S101: Obtain Q&A data from the enterprise expense reimbursement platform:

[0063] We collect repetitive, synonymous, and easily responsive / resolved expense reimbursement-related questions generated during the daily operation of the enterprise expense reimbursement platform. Through manual sorting, several pairs of synonymous and near-synonymous questions are initially categorized, resulting in the question-and-answer data for the enterprise expense reimbursement platform.

[0064] Step S102, Data Preprocessing:

[0065] Data processing is performed using Python scripts. The collected data is processed using Python scripts. First, the initial data file is read, and the "question" and "answer" fields for each line are extracted using the data parsing module. Then, the formatting module combines the extracted content into a text structure according to a predetermined format, while maintaining the semantic integrity of the original question-answer pairs and adding semantically coherent connecting sentences to enhance readability when necessary. A large language model with more parameters, such as GPT-4o, is used to process and optimize some awkward text while preserving semantics. Finally, the text output module saves the formatted content as a standard question-answer pair format for subsequent data processing.

[0066] Step S103, Filtering high-quality tabular data:

[0067] We selected representative and logically sound question-and-answer data from the enterprise expense reporting platform from the initial data, and paid attention to the semantic diversity of different question-and-answer pairs.

[0068] Step S2, data integration. Specifically, step S2 includes steps S201-S203:

[0069] Step S201, extract table information:

[0070] Extract the preprocessed tabular data into text format, denoted as "content information".

[0071] Step S202, Prompt word template sampling:

[0072] To avoid the classification results output by the expert model being overly sensitive to prompt words, a prompt word candidate set was designed. For each sample, a template "prompt word" is randomly sampled, which can effectively alleviate the sensitivity of the expert model to prompt words.

[0073] Step S203, Input text construction:

[0074] When constructing the input text, "examples" can be selectively added to enhance the contextual learning ability of the expert large model. The final constructed input text = {hint words} + {content information} + {examples}, such as... Figure 3 As shown.

[0075] Step S3: Fine-tune and organize the data.

[0076] Alpaca format data, three-part prompt template: Alpaca is a fine-tuning dataset format built on Meta's open-source LLaMA model. Its data format provides a three-part prompt template, containing a clear task description (instruction), input, and output. To convert TXT files containing question-answer pairs to the Alpaca dataset format, a script was written using Python. First, the Python script reads the TXT file. Each record is formatted as "Question: <Question content>" and "Answer: <Answer content>". Each question-answer pair is extracted using regular expressions or simple string splitting methods.

[0077] The script first reads each line of data, extracting the corresponding text content by searching for keywords in "question" and "answer". Then, it saves the extracted "question" and "answer" in Alpaca format, storing the "question" in the `instruction` field and the "answer" in the `output` field. For each question-answer pair, a JSON object is generated using an appropriate structured approach.

[0078] The processed data is saved as a new JSON file according to the Alpaca dataset format. Each question-answer pair is stored as an independent JSON object, ultimately forming a complete Alpaca format dataset for subsequent fine-tuning and other work.

[0079] Step S4: Forming the expert large model. Specifically, step S4 includes steps S401-S403:

[0080] Step S401: Fine-tuning and training of the expert large model.

[0081] After data integration, this invention combines parameter freezing and NEFTune to improve the performance and adaptability of large language models for specific tasks. Freeze fine-tuning maintains a low parameter count while achieving efficient downstream task adaptation, thereby improving the platform's flexibility and efficiency. NEFTune adds noise to the training data to enhance the generalization ability and robustness of the expert model, further ensuring the quality and reliability of the expert model's output.

[0082] Specifically, Freeze refers to updating only a small portion of the model's weights during training, freezing most of the original model's parameters, and training only a subset of parameters. This allows for training large models on a single GPU or without TP or PP operations, reducing memory requirements. This fine-tuning method only needs to fine-tune high-level features, accelerating model convergence. By freezing the parameters of the first few dozen layers and only training and updating the parameters of the last few layers, it maximizes the preservation of common language features learned during the pre-training of large language models, resulting in strong interpretability.

[0083] Directly fine-tuning all parameters of a large model can lead to overfitting on downstream tasks. The Freeze method reduces the risk of overfitting by fixing the underlying parameters and preserving the general characteristics of the pre-trained model. This method is particularly suitable for fine-tuning datasets with smaller amounts of data, reducing the data collection requirements for enterprise payment platforms and shifting the focus from data quantity to data quality. It allows for the collection of more diverse and logically sound question-and-answer data.

[0084] Noise Embedding Finetuning (NEFTune) is an innovative fine-tuning technique used to enhance and perturb the input training data, improving the generalization ability of expert large models (AMLs) and thus alleviating overfitting during the fine-tuning stage and the "illusion problem" that occurs in the application of AMLs. It achieves data diversity and robustness by introducing uniformly distributed noise into word vectors. Specifically, in each training iteration, uniformly distributed noise is added to the word vectors. This improvement is not only simple to implement but also does not introduce new model parameters, requiring no additional computational resources or data overhead. NEFTune not only improves the tolerance of AMLs to noise but also enhances their adaptability to unseen samples, resulting in better performance in practical applications. In actual experiments, introducing NEFTune can improve accuracy by approximately 8%.

[0085] Step S402: Expert large model training and optimization.

[0086] Considering the increasing computational and memory requirements during training as deep learning models grow in size, this method incorporates DeepSpeed ​​for accelerated training. DeepSpeed ​​significantly reduces the resources required for model and data parallelism through its parallelized optimizer ZeRO (Zero Redundancy Optimizer), thus accelerating model training. This method, based on the ZeRO2 scheme in DeepSpeed, optimizes the storage of optimizer states and gradients, enabling large expert models to be trained in parallel in a distributed environment, thereby maximizing the utilization of GPU computing resources. Applying DeepSpeed ​​significantly improves the training speed of large expert models. Compared to traditional training methods, training time is reduced by more than 50%, while handling larger-scale models. This improvement not only enhances training efficiency but also reduces computational resource requirements, making the training of large-scale models more feasible.

[0087] Step S5: Graph retrieval enhancement.

[0088] RAG enhances the accuracy and richness of content generation by integrating external knowledge bases and dynamically incorporating relevant information during the generation process. Compared to methods based on vector similarity matching and traditional RAG, GraphRAG (Graph-based Retrieval Augmented Generation) in this embodiment introduces a knowledge graph, storing dataset information in the form of nodes and relationships. This provides richer context and relational information, enabling multi-hop reasoning. For example, when a user question involves multiple entities or requires deriving the answer from multiple steps, GraphRAG can efficiently find relevant paths and generate accurate answers through the graph structure. Entities (concepts, pathways, locations, etc.) are identified from the question-answering dataset, and a relationship network between them is constructed to form a knowledge graph of related questions. Using a community detection algorithm, the nodes in the knowledge graph are divided into different regions, with each community representing a specific topic or concept. A summary is generated for the entities and relationships within each community, and these summaries are fed into the large model for augmentation, improving the model's answer performance.

[0089] Modify GraphRAG's default prompts by introducing thought chain cues into the prompts for large models, guiding them to generate relatively high-quality answers, such as... Figure 2 As shown.

[0090] Step S6: Expert large model reasoning optimization and graph retrieval generation enhance access acceleration.

[0091] During the inference phase of the expert large model, the text to be inferred is fed into the expert large model according to the training format to obtain a binary classification result indicating whether it is sensitive. At the same time, the vLLM acceleration inference framework is combined to accelerate the inference speed of the expert large model and improve its performance. The Gunicorn HTTP gateway service framework is used to enhance the concurrency performance and response speed of GraphRAG.

[0092] As the complexity and scale of Natural Language Processing (NLP) tasks continue to increase, large language models face significant computational resource consumption and latency issues during inference. This method combines vLLM to accelerate inference, aiming to greatly improve the throughput and memory utilization efficiency of language model services in real-time scenarios. vLLM achieves a significant improvement in inference speed by optimizing memory usage and computation processes. This framework supports model parallelism and pipelined processing, effectively handling ultra-large-scale models and improving the overall efficiency of inference.

[0093] In its implementation, this method integrates vLLM into the expert large model. First, leveraging the parallel nature of the model, the various parts of the expert large model are distributed across different computational units to achieve load balancing. Second, pipelined processing ensures that multiple inference requests can be executed simultaneously at different computational stages, maximizing the utilization of computational resources. Furthermore, for memory management, an efficient caching strategy is employed to reduce memory consumption and data transfer latency. These measures result in a significant performance improvement during inference. This method implements a vLLMWrapper class adapted for Qwen 2.5, improving the inference speed of the fine-tuned Qwen by 33.8%, without requiring any changes to the expert large model architecture. This enhances the practical application value of the expert large model to a certain extent.

[0094] Considering the application scenarios of customer service Q&A, and to standardize the model's interface for network accessibility, this method encapsulates the GraphRAG query function into an interface that can be called via POST requests. First, a web service is created based on the Flask framework, defining an HTTP POST route to receive query requests. The client sends query data to the server via a POST request, placing the query data in the `query` field of the request body. The server extracts the query information from the request and passes it to the GraphRAG query function. After the GraphRAG query method executes, the returned results are first processed using regular expressions to extract valid text, then encapsulated into JSON format response data to ensure it conforms to the client's expected format. The server returns the query results as an HTTP response; if the query is successful, it returns the result and status information; if an error occurs, it returns an error message and status code. Ultimately, in this way, the GraphRAG query function is packaged into a standardized HTTP API, allowing any client supporting the HTTP protocol to call the interface and obtain query results, thus achieving remote access to the query function and inter-system compatibility.

[0095] Considering the high concurrency of customer service Q&A scenarios, Gunicorn was used as the WSGI server to deploy the application and further improve the concurrent processing capabilities of the aforementioned APIs. Gunicorn is a high-performance Python WSGI HTTP server capable of handling a large number of concurrent requests. During application deployment, Gunicorn was configured to increase its processing capacity by setting up multiple worker processes to process requests in parallel, thereby significantly improving the API's response speed and concurrency capabilities. Especially in high-traffic environments, it effectively reduces the burden on individual processes, ensuring system stability and efficiency. In this way, the API can maintain low response latency and high throughput when handling a large number of requests, thus providing users with faster and more stable service.

[0096] To verify the effectiveness of this method in the customer service Q&A scenario for expense reporting, the obtained expert model was evaluated as follows:

[0097] Evaluation dataset preparation:

[0098] Since most corporate expense reimbursement data involves specific clauses and regulations related to corporate expense reimbursement, the training objective of the fine-tuning task in this application scenario is mainly knowledge injection to improve the model's performance in a specific domain, namely corporate expense reimbursement question-and-answer. Therefore, the fine-tuned data is used directly for evaluation to assess the text similarity between the model's fine-tuned generation and the corresponding human responses in the dataset.

[0099] Evaluation results:

[0100] Hyperparameters play a crucial role in fine-tuning expert large models. The hyperparameter settings during fine-tuning directly affect the performance and convergence speed of the expert large model. Freeze tuning involves several important hyperparameters, including:

[0101] (1)freeze_trainable_layers indicates the range of parameters for Freeze fine-tuning. Generally, the last few layers of the model are used for fine-tuning, while the parameters of other layers remain unchanged.

[0102] (2) lr represents the learning rate of the expert model fine-tuning, which affects the rate of decrease of the loss function during model fine-tuning and the final convergence of the fine-tuning.

[0103] (3) num_train_epochs represents the number of training epochs on the dataset during fine-tuning. One epoch means that the model is trained on the entire dataset for one round.

[0104] (4) neftune_alpha represents the noise scaling parameter used by NEFTune.

[0105] After trying various parameter combinations, the final hyperparameters were determined to be: freeze_trainable_layers = 8, lr = 5e-5, num_train_epochs = 5, neftune_alpha = 5. The decrease in the loss function during fine-tuning is shown below. Figure 4 As shown. Other large-scale model inference settings refer to the official Qwen2.5 GitHub settings, and all experiments were completed using a single A100 graphics card. Testing was conducted using the enterprise expense reporting question-and-answer dataset. The BLEU score quantifies the quality of the generated text by comparing the degree of n-gram (n consecutive words) matching between the generated text and the reference text; generally, 4-grams are used to measure the generation of short sentences in the generated text. The Rouge-N score splits the generated text and the reference text into n-grams and evaluates the text generation quality by calculating the recall of the reference text. The Rouge-L score comprehensively evaluates the text generation quality by calculating the recall and precision of the longest common subsequence (LCS) of the generated text and the reference text. Testing was conducted using the finely tuned Qwen2.5-7B expert large-scale model, with BLEU-4 = 54.56%, Rogue-1 = 66.23%, Rogue-2 = 55.05%, and Rogue-L = 60.29%. It is evident that the expert large-scale model of this method performs well on multiple evaluation metrics.

[0106] High-voltage concurrent test experiment:

[0107] To test the response speed of the Qwen2.5-7B expert large model and GraphRAG under relatively high-pressure user access environment, the Postman software tool was used to set up 20 virtual users to send 153 requests within 10 minutes, and the average response speed of GraphRAG was calculated. Figure 5 As shown in the figure, the shaded area represents virtual users, the blue curve represents the average response time, and the purple curve represents the response time represented by the numbers at the 90th percentile. According to the figure, even though the running speed of the GraphRAG framework itself is generally considered a drawback, this method can use the vLLM model inference acceleration tool and the Gunicorn HTTP gateway service framework to improve the performance and response speed of GraphRAG under concurrent conditions. Furthermore, the running parameters of vLLM and Gunicorn can be adjusted according to the resource conditions of the runtime environment to further improve concurrent performance.

[0108] Example 2

[0109] Based on Embodiment 1, this embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, the one or more programs including instructions for executing the customer service question-and-answer method based on GraphRAG and a large language model as described in Embodiment 1.

[0110] like Figure 6 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above-mentioned functions. Figure 1 The method described herein. Of course, in addition to software implementation, this invention does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0111] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0112] Example 3

[0113] Based on the foregoing embodiments, this embodiment provides a computer-readable storage medium including one or more programs executable by one or more processors of an electronic device, the one or more programs including instructions for executing the customer service question-and-answer method based on GraphRAG and a large language model as described in Embodiment 1.

[0114] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0115] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A payment customer service question-and-answer method based on GraphRAG and a large language model, characterized in that, Includes the following steps: Obtain baseline question-and-answer data in response to expense reimbursement issues; For the benchmark question and answer data, a report dataset in a preset format is obtained through annotation and prompting processes; Based on the aforementioned payment dataset, through parameter freezing and noise embedding, the base large language model is fine-tuned using a zero-redundancy optimizer under the DeepSpeed ​​distributed training framework to complete the training of the payment customer service Q&A expert large model. Based on the aforementioned payment data set, entities in the dataset are identified and relationships are established through GraphRAG-based retrieval enhancement, forming a payment problem knowledge graph. The knowledge graph is divided into multiple regions representing topics or concepts through community detection. A summary is generated for the entities and relationships in each region, and all of these are input into the payment customer service Q&A expert big model to generate preliminary answers to payment problems. By modifying the prompts in the large model and configuring the customer service Q&A expert large model to verify the preliminary answer, the final answer is obtained. The process of configuring a large-scale model of customer service Q&A experts to verify the preliminary answers includes the following steps: By modifying the prompts in the large model, the model is configured to check whether the initial answers are sufficiently relevant to the user's expense report from the perspectives of accuracy, completeness, and logic. In response to the large model's judgment that the preliminary answer is sufficiently relevant to the expense reimbursement question, the preliminary answer will be used as the final answer. In response to the large model's judgment that the initial answer does not adequately match the claim question, the large model generates a reasoning chain based on the user's question. Using external information retrieved from the knowledge graph, the reasoning chain with the highest degree of matching with the external information and the most logically sound is selected to generate the final answer.

2. The payment customer service question-and-answer method based on GraphRAG and a large language model according to claim 1, characterized in that, The process of obtaining a pre-formatted expense report dataset based on the benchmark question-and-answer data includes the following steps: Extract the question and answer fields from the big data, and convert them into structured text that includes question-answer pairs through formatting; Add connection statements to the structured text; Optimize structured text using a large language model; The structured text is converted into a preset format to form a report dataset.

3. The payment customer service question-and-answer method based on GraphRAG and a large language model according to claim 1, characterized in that, The process of training a large-scale customer service Q&A expert model includes the following steps: By constructing a Freeze fine-tuning script, all layers except the last few layers of the base large language model are frozen; Based on the DeepSpeed ​​training framework and a pre-configured redundancy elimination scheme, the base large language model is fine-tuned.

4. The payment customer service question-and-answer method based on GraphRAG and a large language model according to claim 1, characterized in that, The GraphRAG-based retrieval enhancement generation process includes the following steps: Acquire the large-scale model of customer service Q&A experts and the embedded vector model for payment processing, and complete the service environment deployment; Deploy a high-speed inference framework and a large language model service deployment framework; Configure the path and address information for GraphRAG.

5. The payment customer service question-and-answer method based on GraphRAG and a large language model according to claim 1, characterized in that, Accelerate large model inference by leveraging a high-speed inference framework and an HTTP gateway service framework.

6. The payment customer service question-and-answer method based on GraphRAG and a large language model according to claim 5, characterized in that, It also includes the following steps: The GraphRAG query functionality is encapsulated into an interface that can be called via POST requests. A web service is created using the Flask framework, and an HTTP POST route is built to receive query requests. The client sends the query data to the server via a POST request, placing the query data in the query field of the request body. The server extracts query information from the request and passes it to the GraphRAG query function; The GraphRAG query method is executed, and the returned results are used to extract valid text using regular expressions and encapsulated into JSON format response data. The server returns the query results as an HTTP response. If the query is successful, it returns the results and status information; if an error occurs, it returns the error information and status code.

7. The payment customer service question-and-answer method based on GraphRAG and a large language model according to claim 5, characterized in that, It also includes the following steps: The server is equipped with a Gunicorn server, which processes requests in parallel by setting up multiple worker processes.

8. An electronic device, characterized in that, It includes one or more processors, memory, and one or more programs stored in the memory, said one or more programs including instructions for performing the GraphRAG and large language model-based customer service question-and-answer method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, Includes one or more programs that are executed by one or more processors of an electronic device, said one or more programs including instructions for performing the GraphRAG and large language model-based customer service question-and-answer method as described in any one of claims 1-7.