Low-consumption and high-trust text analysis method and device based on large language model

CN122047219BActive Publication Date: 2026-08-21HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610513322.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-17
Publication Date
2026-08-21
Estimated Expiration
2046-04-17

AI Technical Summary

Technical Problem

[0010]为了解决现有技术存在的大规模文本分析成本高、模型幻觉导致准确率低和数据解析不稳定的技术问题,本发明实施例提供了一种基于大语言模型的低消耗与高可信文本分析方法及装置

Benefits of technology

[0024] This invention proposes a low-cost and high-reliability text analysis method based on a large language model. It employs a dynamic binning algorithm to pre-calculate the token length of individual data entries and delimiters when constructing input requests for the large language model. Multiple independent data entries are aggregated while satisfying the model's context window threshold. A three-level analysis mechanism is proposed to suppress model illusion, guiding the model's thought process and outputting the final judgment. This invention is a lightweight text analysis method based on a large language model that overcomes model illusion and resource bottlenecks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122047219B_ABST
    Figure CN122047219B_ABST
Patent Text Reader

Abstract

The application discloses a low-consumption and high-trust text analysis method and device based on a large language model, and relates to the technical field of natural language processing. The method comprises the following steps: based on a preset context performance coefficient, calculating according to a context capacity maximum threshold value and a single request interception threshold value to obtain an effective load safety threshold value; based on the effective load safety threshold value, using a dynamic packing algorithm to perform request aggregation according to a system instruction template, a JSON protocol template, business text data, current text data and a preset safe empty token length to obtain a JSONL request; based on a three-level analysis mechanism of consistency checking, using a large language model to perform text analysis according to the JSONL request to obtain a comprehensive decision result and comprehensive decision evidence. The application is a lightweight text analysis method based on a large language model, which can overcome model hallucination and resource bottlenecks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and in particular to a low-cost and high-reliability text analysis method and apparatus based on a large language model. Background Technology

[0002] With the rapid development of artificial intelligence technology, using large language models (LLM) for complex text analysis has become a trend in the financial and legal industries, such as identifying merger and acquisition intentions and reviewing terms.

[0003] Currently, deep thinking models such as DeepSeek-R1 have significantly enhanced their reasoning abilities through large-scale reinforcement learning. In text analysis tasks, the typical process involves inputting the text to be analyzed into the model, which then generates analysis results based on prompts.

[0004] In conventional engineering implementations, large-scale datasets with tens of thousands of data points are typically processed using a single data point-single real-time request model. That is, for each piece of text to be analyzed, the system constructs a request containing the system prompt word SystemPrompt and the user content, and sends it separately to the large language model for inference.

[0005] However, significant shortcomings remain when handling large-scale, highly sensitive text analysis tasks. The operating costs are high; in a single data point-single request model, system prompts of approximately 1000 tokens in length are repeatedly transmitted tens of thousands of times. Since billing for large language models typically includes input tokens, this results in a significant waste of computing resources and funds on repeatedly transmitting the same instructions.

[0006] Insufficient credibility: Generative models possess inherent probabilistic properties. When relying on a single reasoning path, the model is prone to generating illusions—that is, generating seemingly reasonable but actually erroneous false information. In highly sensitive domains such as financial decision-making, this instability is unacceptable.

[0007] JSON format data parsing has a high failure rate, and the structured data output by large language models often has format deviations, such as missing closing symbols or containing illegal characters; this causes downstream programs to fail to parse the data, requiring manual intervention and reducing the degree of automation.

[0008] Low throughput efficiency: Traditional serial real-time calling methods are limited by network latency and model concurrency constraints, and it takes a very long time to process tens of thousands of data points.

[0009] In the existing technology, there is a lack of a lightweight text analysis method based on a large language model that can overcome model illusion and resource bottlenecks. Summary of the Invention

[0010] To address the technical problems of high cost, low accuracy due to model illusion, and unstable data parsing in existing technologies, embodiments of the present invention provide a low-cost and high-reliability text analysis method and apparatus based on a large language model. The technical solution is as follows:

[0011] On the one hand, a low-cost and high-reliability text analysis method based on a large language model is provided. This method is implemented using a low-cost and high-reliability text analysis device and includes:

[0012] Based on information retrieved from the local word segmenter, system instruction templates and JSON protocol templates are obtained; business text data is acquired.

[0013] Obtain the maximum context capacity threshold of the large language model and the single request interception threshold calculated in the cloud batch; based on the preset context efficiency coefficient, calculate the effective load security threshold according to the maximum context capacity threshold and the single request interception threshold.

[0014] Obtain the current text data; based on the effective payload security threshold, according to the system instruction template, JSON protocol template, business text data, current text data and preset security spare token length, use dynamic boxing algorithm to aggregate requests and obtain JSONL requests;

[0015] Based on a three-level analysis mechanism for consistency verification, text analysis is performed using a large language model according to the JSONL request to obtain a comprehensive adjudication result and comprehensive adjudication evidence.

[0016] On the other hand, a low-cost and high-reliability text analysis device based on a large language model is provided. This device is applied to a low-cost and high-reliability text analysis method based on a large language model. The device includes:

[0017] The basic information acquisition module is used to retrieve information based on the local word segmenter, obtain system instruction templates and JSON protocol templates, and acquire business text data;

[0018] The security threshold calculation module is used to obtain the maximum context capacity threshold of the large language model and the single request interception threshold of cloud batch computing; based on the preset context efficiency coefficient, it calculates the effective load security threshold according to the maximum context capacity threshold and the single request interception threshold.

[0019] The request dynamic aggregation module is used to obtain the current text data; based on the effective payload security threshold, the system instruction template, JSON protocol template, business text data, current text data and preset security spare token length are used to aggregate requests using a dynamic boxing algorithm to obtain JSONL requests;

[0020] The three-level text analysis module is used for a three-level analysis mechanism based on consistency verification. It performs text analysis using a large language model based on JSONL requests to obtain comprehensive adjudication results and comprehensive adjudication evidence.

[0021] On the other hand, a low-power and high-reliability text analysis device is provided, comprising: a processor; and a memory storing computer-readable instructions, which, when executed by the processor, implement any of the methods described above for low-power and high-reliability text analysis based on a large language model.

[0022] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored therein, the at least one instruction being loaded and executed by a processor to implement any of the above-described low-cost and high-reliability text analysis methods based on large language models.

[0023] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:

[0024] This invention proposes a low-cost and high-reliability text analysis method based on a large language model. It employs a dynamic binning algorithm to pre-calculate the token length of individual data entries and delimiters when constructing input requests for the large language model. Multiple independent data entries are aggregated while satisfying the model's context window threshold. A three-level analysis mechanism is proposed to suppress model illusion, guiding the model's thought process and outputting the final judgment. This invention is a lightweight text analysis method based on a large language model that overcomes model illusion and resource bottlenecks. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a flowchart of a low-cost and high-reliability text analysis method based on a large language model provided by an embodiment of the present invention;

[0027] Figure 2 This is a block diagram of a low-consumption and high-reliability text analysis device based on a large language model provided in an embodiment of the present invention;

[0028] Figure 3 This is a schematic diagram of the structure of a low-consumption and high-reliability text analysis device provided in an embodiment of the present invention. Detailed Implementation

[0029] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0030] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0031] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.

[0032] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0033] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0034] This invention provides a low-consumption and high-reliability text analysis method based on a large language model. This method can be implemented using a low-consumption and high-reliability text analysis device, which can be a terminal or a server. Figure 1 The flowchart shown is for a low-cost and high-reliability text analysis method based on a large language model. The processing flow of this method may include the following steps:

[0035] S1. Retrieve information based on the local word segmenter to obtain system instruction templates and JSON protocol templates; obtain business text data;

[0036] In one feasible implementation, a local word segmenter matching the cloud-based large language model is invoked to obtain the system instruction template, i.e., the serialized system prompt text; the JSON protocol template includes serialized text containing punctuation marks. Asynchronous business data streams are monitored to obtain business text data.

[0037] S2. Obtain the maximum context capacity threshold of the large language model and the single request interception threshold for cloud batch computing; based on the preset context efficiency coefficient, calculate the effective load security threshold according to the maximum context capacity threshold and the single request interception threshold.

[0038] The effective load safety threshold is calculated as follows (1):

[0039] (1);

[0040] in, The effective load safety threshold; This represents the maximum threshold for the context capacity of a large language model. This is the preset context performance coefficient; This is the threshold for intercepting a single request in the cloud-based batch computing protocol.

[0041] In one feasible implementation, when processing massive amounts of discrete short text (such as tens of thousands of financial events), system prompts often contain complex instructions and few sample examples, and the token length is often much longer than a single piece of business data. Existing technologies use "single request-single data" or static fixed-length concurrency, resulting in two serious wastes of underlying hardware resources: network I / O and GPU memory waste, with extremely low payload ratios causing long instructions to be repeatedly transmitted and repeatedly occupying the KV cache of large model inference chips; and attention dilution, where simply piling text into the physical maximum window of a large model can cause the self-attention mechanism of the Transformer architecture to fail over long-distance dependencies, leading to missed detections.

[0042] This invention proposes a dynamic instruction amortization algorithm based on attention boundary protection. In order to protect the analysis and reasoning performance of large models, the system dynamically calculates the "effective context threshold", and the calculation formula is as shown in the above formula (1).

[0043] in, This is a preset context efficiency coefficient, with a value between 0.7 and 0.9, used to ensure that the concatenated text is in the high-sensitivity zone of the model's attention mechanism.

[0044] This method is essentially a Single Instruction, Multiple Data (SIMD) computational scheduler for LLM input structures. It achieves this by introducing... The coefficients aim to strike a balance between "avoiding model performance collapse caused by attention dilution" and "maximizing instruction amortization to reduce GPU computing power overhead." This is not only a change in the algorithm, but also a direct optimization of the burden of computer network communication and chip inference costs.

[0045] S3. Obtain the current text data; Based on the effective payload security threshold, according to the system instruction template, JSON protocol template, business text data, current text data and preset security spare token length, use dynamic boxing algorithm to aggregate requests and obtain JSONL requests;

[0046] Optionally, based on the payload security threshold, and according to the system instruction template, JSON protocol template, business text data, current text data, and preset security spare token length, a dynamic boxing algorithm is used to aggregate requests to obtain JSONL requests, including:

[0047] Based on the system instruction template, JSON protocol template, business text data and current text data, perform differential tokenization to obtain the system prompt word token length, structure tag token length, batch text token length and current text token length;

[0048] The current text load threshold is calculated based on the length of the system prompt word token, the length of the structure tag token, the length of the text token in the batch, the length of the current text token, and the preset safe spare token length.

[0049] Based on the effective payload security threshold and the current text payload threshold, construct a JSONL request according to the system instruction template, JSON protocol template, business text data, and current text data.

[0050] In one feasible implementation, in order to solve the high cost problem caused by redundant transmission of system prompt words, the present invention aggregates as much text to be processed as possible into a single request through the Next-fit strategy, without exceeding the maximum context window of the model and the API length limit.

[0051] Optionally, differential tokenization is performed based on the system instruction template, JSON protocol template, business text data, and current text data to obtain the length of the system prompt word token, the length of the structure tag token, the length of the text token within the batch, and the length of the current text token, including:

[0052] Tokenizer word segmentation and encoding are performed on the system instruction template to obtain the length of the system prompt word token;

[0053] Perform template pre-calculation on the JSON protocol template to obtain the length of the structure token;

[0054] Perform tokenizer segmentation and encoding on the business text data to obtain the length of the text token within the batch;

[0055] Perform tokenizer segmentation and encoding on the current text data to obtain the length of the current text token.

[0056] In one feasible implementation, the length of the system prompt token is calculated based on the system instruction template. The system performs real-time encoding on each discrete short text entering the queue, extracts the length of the text token within the batch and the length of the current text token, and performs template pre-calculation on the JSON protocol template, such as the overhead of marking brackets, commas, etc., to obtain the length of the structure token.

[0057] Optionally, based on the payload security threshold and the current text payload threshold, a JSONL request is constructed according to the system instruction template, JSON protocol template, business text data, and current text data, including:

[0058] When the current text load threshold exceeds the effective load safety threshold, construct the first JSONL request based on the system instruction template, JSON protocol template, and business text data;

[0059] When the current text load threshold equals the effective load safety threshold, construct a second JSONL request based on the system instruction template, JSON protocol template, business text data, and current text data;

[0060] If the current text load threshold is less than the effective load safety threshold, the current text data will be merged into the business text data, and no request will be built at this time.

[0061] In one feasible implementation, the process is calculated as follows (2):

[0062] (2);

[0063] in, The length of the system prompt token; The token length is marked in the structure; The length of the text token within the batch; The length of the current text token; This is the preset length of the security spare token.

[0064] like If so, then push it into the current batch array; if If the current batch is closed and serialized into a single JSONL request packet, local cache resources are released to start the next computation cycle. This allows the system prompt to be shared by multiple texts in a single request, significantly improving the Payload Ratio.

[0065] The requests generated by "dynamic boxing" are saved as JSONL files and uploaded via the cloud's Batch API. Leveraging the off-peak computing features of cloud providers (typically priced at 50% of real-time calls) and combining this with token compression from dynamic boxing, a double cost reduction is achieved.

[0066] S4. A three-level analysis mechanism based on consistency verification is used to perform text analysis using a large language model based on the JSONL request, in order to obtain a comprehensive adjudication result and comprehensive adjudication evidence.

[0067] Optionally, based on a three-level analysis mechanism for consistency verification, text analysis is performed using a large language model according to the JSONL request to obtain a comprehensive adjudication result and comprehensive adjudication evidence, including:

[0068] Based on the original text citation template guided by the judgment criteria, a preliminary review is conducted using a large language model according to the JSONL request to obtain preliminary judgment results and preliminary judgment evidence.

[0069] Based on the independent reasoning re-trigger template, and according to the JSONL request, a large language model is used to conduct parallel review to obtain the review result and the review evidence.

[0070] Based on the chain-thinking template of comparison-reflection-correction, a comprehensive decision is made using a large language model based on the JSONL request, preliminary judgment result, preliminary judgment evidence, retrial judgment result, and retrial judgment evidence, to obtain a comprehensive judgment result and comprehensive judgment evidence.

[0071] In one feasible implementation, this invention addresses the inherent "illusion" problem of large generative models, where existing technologies typically employ majority voting (Self-Consistency). However, this method has drawbacks: large models are prone to "consistency errors" (i.e., when processing fuzzy short text, multiple samples output the same incorrect label). Simply statistically analyzing the output (Label) fails to uncover the fallacies in the internal logic. Furthermore, the JSON format of large models may be corrupted during output (e.g., truncated, missing quotes), causing interruptions in the engineering pipeline parsing.

[0072] This invention constructs a three-level analysis mechanism for consistency verification of "preliminary examination - parallel review - comprehensive adjudication":

[0073] The first level of preliminary review (FA) involves constructing a request with detailed judgment criteria, inputting aggregated text data, and requiring the model to output preliminary judgment results and reasons for citing the original text.

[0074] The second-level parallel review (SA) initiates an independent inference request without altering the input request content, obtaining a second independent result. This process can be executed in parallel with the initial analysis (FA).

[0075] The third level of comprehensive adjudication (CA) forces the model to execute a "Compare-Reflect-Correction" chain of thought. The model needs to compare the differences between FA and SA, reflect on potential omissions or misjudgments, and finally give an authoritative ruling. The CA stage can effectively identify consistency errors between FA and SA (implicit corrections) and also resolve explicit disagreements.

[0076] To address the issue of unstable return formats in large models, this invention constructs a feedback control closed loop based on explicit extraction of intermediate states and injection of heterogeneous contexts, and designs a two-level parsing mechanism:

[0077] Priority 1: Use the Python standard library json.loads for strict parsing.

[0078] Priority 2: If strict parsing fails, catch the exception and automatically switch to the demjson3 library. This library uses a relaxed parsing based on an Abstract Syntax Tree (AST), which can automatically correct common errors such as missing quotes and extra commas, reconstruct the syntax tree for broken text nodes, and force the extraction of complete feature data, ensuring high availability of the pipeline without manual intervention.

[0079] The system analyzes the results and forcibly separates the model output into two feature dimensions to construct the reasoning state tuples. This process is as follows: (3) and (4):

[0080] (3);

[0081] (4);

[0082] in, For discrete decision labels, such as intent classification, This is a continuous chain of original evidence and a logical deduction sequence upon which the label is generated.

[0083] The integrated adjudication node dynamically constructs a "Conflict Feature Space," which structurally splices together the preliminary judgment results, preliminary judgment evidence, retrial judgment results, and retrial judgment evidence.

[0084] This invention uses the deepseek-R1 large model and sets... T model × α = 6000. During the CA phase, specific logical verification constraint instructions are input into the large model. The logical verification rules are executed; if... The model focuses on comparing two The degree of logical closure; even (There is a risk of implicit consistency illusion), and the model must also perform reverse verification to check the dual-path consistency. Whether there are common factual omissions or false associations, the final output will be the disambiguated ruling.

[0085] The core technology of this solution is "data augmentation and control flow redirection based on transparent white-boxing of the reasoning process." It not only addresses the engineering challenge of unstable output using an AST engine, but also possesses a significant substantive feature: explicitly extracting the internal "Logical Reasoning Chain (CoT)" of preceding tasks as new feature parameters, injecting them as input variables into subsequent nodes. This transforms the large model's challenge from "generating a judgment from scratch" to a system-preset "courtroom-style cross-examination." This mechanism, which breaks the "illusion of implicit consistency" through "forced feature collision," effectively overcomes the performance bottleneck of traditional voting methods.

[0086] In one feasible implementation, this invention achieves "one-time transmission, multiple reuses" of system prompt words through a dynamic binning algorithm. In experimental data, an average of 10.75 texts are aggregated into one request. Combined with the half-price discount of the Batch API, the overall cost is reduced by more than 30% compared to the traditional single real-time call (even when three inferences are performed).

[0087] The "three-level analysis" mechanism effectively suppressed model illusions. Experimental data in Table 1 (Decision Logical Distribution and Accuracy Verification Table) shows that with N=11,601, the correction rate for explicit divergent samples (FA≠SA) is high, and it can also detect implicit samples where FA and SA are consistent but incorrect. The overall accuracy is improved to 99.74%, exceeding the industry standard of 3σ (99.73%).

[0088] Table 1

[0089]

[0090] Compared to manual analysis and single-step sequential reasoning, asynchronous concurrent processing improves efficiency by hundreds and tens of times, respectively, as shown in Table 2 (a comparison of the cost and efficiency of different processing modes). Introducing AST-based relaxed parsing ensures a near 100% success rate in result parsing, solving the "last mile" problem in the practical application of large language models.

[0091] Table 2

[0092]

[0093] This invention proposes a low-cost and high-reliability text analysis method based on a large language model. It employs a dynamic binning algorithm to pre-calculate the token length of individual data entries and delimiters when constructing input requests for the large language model. Multiple independent data entries are aggregated while satisfying the model's context window threshold. A three-level analysis mechanism is proposed to suppress model illusion, guiding the model's thought process and outputting the final judgment. This invention is a lightweight text analysis method based on a large language model that overcomes model illusion and resource bottlenecks.

[0094] Figure 2 This is a block diagram of a low-cost and high-reliability text analysis device based on a large language model, provided in an embodiment of the present invention. This device is used for a low-cost and high-reliability text analysis method based on a large language model. (Refer to...) Figure 2 The device includes a basic information acquisition module 210, a security threshold calculation module 220, a request dynamic aggregation module 230, and a three-level text analysis module 240. Among them:

[0095] The basic information acquisition module 210 is used to retrieve information based on the local word segmenter, obtain system instruction templates and JSON protocol templates, and acquire business text data;

[0096] The security threshold calculation module 220 is used to obtain the maximum context capacity threshold of the large language model and the single request interception threshold of cloud batch calculation; based on the preset context efficiency coefficient, the effective load security threshold is calculated according to the maximum context capacity threshold and the single request interception threshold.

[0097] The request is sent to the dynamic aggregation module 230 to obtain the current text data. Based on the effective payload security threshold, the request is aggregated using the dynamic boxing algorithm according to the system instruction template, JSON protocol template, business text data, current text data and the preset security spare token length to obtain JSONL requests.

[0098] The text three-level analysis module 240 is used for a three-level analysis mechanism based on consistency verification. According to the JSONL request, it uses a large language model to perform text analysis to obtain a comprehensive adjudication result and comprehensive adjudication evidence.

[0099] The effective load safety threshold is calculated as follows (1):

[0100] (1);

[0101] in, The effective load safety threshold; This represents the maximum threshold for the context capacity of a large language model. This is the preset context performance coefficient; This is the threshold for intercepting a single request in the cloud-based batch computing protocol.

[0102] Optionally, the dynamic aggregation module 230 is requested to further:

[0103] Based on the system instruction template, JSON protocol template, business text data and current text data, perform differential tokenization to obtain the system prompt word token length, structure tag token length, batch text token length and current text token length;

[0104] The current text load threshold is calculated based on the length of the system prompt word token, the length of the structure tag token, the length of the text token in the batch, the length of the current text token, and the preset safe spare token length.

[0105] Based on the effective payload security threshold and the current text payload threshold, construct a JSONL request according to the system instruction template, JSON protocol template, business text data, and current text data.

[0106] Optionally, the dynamic aggregation module 230 is requested to further:

[0107] Tokenizer word segmentation and encoding are performed on the system instruction template to obtain the length of the system prompt word token;

[0108] Perform template pre-calculation on the JSON protocol template to obtain the length of the structure token;

[0109] Perform tokenizer segmentation and encoding on the business text data to obtain the length of the text token within the batch;

[0110] Perform tokenizer segmentation and encoding on the current text data to obtain the length of the current text token.

[0111] Optionally, the dynamic aggregation module 230 is requested to further:

[0112] When the current text load threshold exceeds the effective load safety threshold, construct the first JSONL request based on the system instruction template, JSON protocol template, and business text data;

[0113] When the current text load threshold equals the effective load safety threshold, construct a second JSONL request based on the system instruction template, JSON protocol template, business text data, and current text data;

[0114] If the current text load threshold is less than the effective load safety threshold, the current text data will be merged into the business text data, and no request will be built at this time.

[0115] Optionally, the text three-level analysis module 240 is further used for:

[0116] Based on the original text citation template guided by the judgment criteria, a preliminary review is conducted using a large language model according to the JSONL request to obtain preliminary judgment results and preliminary judgment evidence.

[0117] Based on the independent reasoning re-trigger template, and according to the JSONL request, a large language model is used to conduct parallel review to obtain the review result and the review evidence.

[0118] Based on the chain-thinking template of comparison-reflection-correction, a comprehensive decision is made using a large language model based on the JSONL request, preliminary judgment result, preliminary judgment evidence, retrial judgment result, and retrial judgment evidence, to obtain a comprehensive judgment result and comprehensive judgment evidence.

[0119] This invention proposes a low-cost and high-reliability text analysis method based on a large language model. It employs a dynamic binning algorithm to pre-calculate the token length of individual data entries and delimiters when constructing input requests for the large language model. Multiple independent data entries are aggregated while satisfying the model's context window threshold. A three-level analysis mechanism is proposed to suppress model illusion, guiding the model's thought process and outputting the final judgment. This invention is a lightweight text analysis method based on a large language model that overcomes model illusion and resource bottlenecks.

[0120] Figure 3 This is a schematic diagram of the structure of a low-power and high-reliability text analysis device provided in an embodiment of the present invention, as shown below. Figure 3 As shown, low-power and high-reliability text analysis devices may include the above-mentioned Figure 2 The illustrated low-power and high-reliability text analysis device is based on a large language model. Optionally, the low-power and high-reliability text analysis device 310 may include a first processor 2001.

[0121] Optionally, the low-power and high-reliability text analysis device 310 may also include a memory 2002 and a transceiver 2003.

[0122] The first processor 2001, memory 2002, and transceiver 2003 can be connected via a communication bus.

[0123] The following is combined Figure 3 A detailed introduction to the various components of the low-power and high-reliability text analysis device 310 is provided below:

[0124] The first processor 2001 is the control center of the low-power and high-reliability text analysis device 310. It can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 can be one or more central processing units (CPUs), application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0125] Optionally, the first processor 2001 can perform various functions of the low-consumption and high-reliability text analysis device 310 by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.

[0126] In a specific implementation, as one example, the first processor 2001 may include one or more CPUs, for example... Figure 3 CPU0 and CPU1 are shown in the diagram.

[0127] In a specific implementation, as one example, the low-power and high-reliability text analysis device 310 may also include multiple processors, for example... Figure 3 The first processor 2001 and the second processor 2004 are shown in the diagram. Each of these processors can be a single-core processor or a multi-core processor. Here, a processor can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0128] The memory 2002 is used to store the software program that executes the present invention, and is controlled by the first processor 2001 to execute it. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.

[0129] Optionally, the memory 2002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 2002 may be integrated with the first processor 2001 or may exist independently, and may be connected to the interface circuit of the low-power, high-reliability text analysis device 310 via... Figure 3 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0130] The transceiver 2003 is used to communicate with network devices or with terminal devices.

[0131] Alternatively, transceiver 2003 may include a receiver and a transmitter. Figure 3 (Not shown separately). The receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.

[0132] Optionally, the transceiver 2003 can be integrated with the first processor 2001 or exist independently, and can be interfaced with the high-reliability text analysis device 310 via a low-power interface circuit. Figure 3 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0133] It should be noted that, Figure 3 The structure of the low-power and high-reliability text analysis device 310 shown does not constitute a limitation on the router. Actual low-power and high-reliability text analysis devices may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0134] Furthermore, the technical effects of the low-consumption and high-reliability text analysis device 310 can be referred to the technical effects of the low-consumption and high-reliability text analysis method based on a large language model described in the above method embodiments, and will not be repeated here.

[0135] It should be understood that the first processor 2001 in the embodiments of the present invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or it may be any conventional processor, etc.

[0136] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0137] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0138] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0139] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.

[0140] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0141] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0142] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0143] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0144] The units described as separate components may or may not be physically separate. 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 units can be selected to achieve the purpose of this embodiment according to actual needs.

[0145] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0146] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0147] 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 variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included 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 low-cost and high-reliability text analysis method based on a large language model, characterized in that, The method includes: Based on information retrieved from the local word segmenter, system instruction templates and JSON protocol templates are obtained; business text data is acquired. Obtain the maximum context capacity threshold of the large language model and the single request interception threshold calculated in the cloud batch; based on the preset context efficiency coefficient, calculate the effective load security threshold according to the maximum context capacity threshold and the single request interception threshold. Retrieve the current text data; based on the effective payload security threshold, and according to the system instruction template, JSON protocol template, business text data, current text data, and preset security spare token length, use a dynamic boxing algorithm to aggregate requests and obtain JSONL requests, including: Based on the system instruction template, JSON protocol template, business text data and current text data, perform differential tokenization to obtain the system prompt word token length, structure tag token length, batch text token length and current text token length; The current text load threshold is calculated based on the length of the system prompt word token, the length of the structure tag token, the length of the text token in the batch, the length of the current text token, and the preset safe spare token length. Based on the effective payload security threshold and the current text payload threshold, construct a JSONL request according to the system instruction template, JSON protocol template, business text data and current text data; Based on a three-level analysis mechanism for consistency verification, text analysis is performed using a large language model according to the JSONL request to obtain a comprehensive adjudication result and comprehensive adjudication evidence, including: Based on the original text citation template guided by the judgment criteria, a preliminary review is conducted using a large language model according to the JSONL request to obtain preliminary judgment results and preliminary judgment evidence. Based on the independent reasoning re-trigger template, and according to the JSONL request, a large language model is used to conduct parallel review to obtain the review result and the review evidence. Based on the chain-thinking template of comparison-reflection-correction, a comprehensive decision is made using a large language model based on the JSONL request, preliminary judgment result, preliminary judgment evidence, retrial judgment result, and retrial judgment evidence, to obtain a comprehensive judgment result and comprehensive judgment evidence.

2. The low-cost and high-reliability text analysis method based on a large language model according to claim 1, characterized in that, The effective load safety threshold is calculated as follows (1): (1); in, The effective load safety threshold; This represents the maximum threshold for the context capacity of a large language model. This is the preset context performance coefficient; This is the threshold for intercepting a single request in the cloud-based batch computing protocol.

3. The low-cost and high-reliability text analysis method based on a large language model according to claim 1, characterized in that, The process of performing differential tokenization based on system instruction templates, JSON protocol templates, business text data, and current text data to obtain the length of the system prompt word token, the length of the structure tag token, the length of the text token within the batch, and the length of the current text token includes: Tokenizer word segmentation and encoding are performed on the system instruction template to obtain the length of the system prompt word token; Perform template pre-calculation on the JSON protocol template to obtain the length of the structure token; Perform tokenizer segmentation and encoding on the business text data to obtain the length of the text token within the batch; Perform tokenizer segmentation and encoding on the current text data to obtain the length of the current text token.

4. The low-cost and high-reliability text analysis method based on a large language model according to claim 1, characterized in that, The process of constructing a JSONL request based on the effective payload security threshold and the current text payload threshold, according to the system instruction template, JSON protocol template, business text data, and current text data, includes: When the current text load threshold exceeds the effective load safety threshold, construct the first JSONL request based on the system instruction template, JSON protocol template, and business text data; When the current text load threshold equals the effective load safety threshold, construct a second JSONL request based on the system instruction template, JSON protocol template, business text data, and current text data; If the current text load threshold is less than the effective load safety threshold, the current text data will be merged into the business text data, and no request will be built at this time.

5. A low-cost and high-reliability text analysis device based on a large language model, wherein the low-cost and high-reliability text analysis device based on a large language model is used to implement the low-cost and high-reliability text analysis method based on a large language model as described in any one of claims 1-4, characterized in that, The device includes: The basic information acquisition module is used to retrieve information based on the local word segmenter, obtain system instruction templates and JSON protocol templates, and acquire business text data; The security threshold calculation module is used to obtain the maximum context capacity threshold of the large language model and the single request interception threshold of cloud batch computing; based on the preset context efficiency coefficient, it calculates the effective load security threshold according to the maximum context capacity threshold and the single request interception threshold. The request dynamic aggregation module is used to obtain the current text data; based on the effective payload security threshold, the system instruction template, JSON protocol template, business text data, current text data and preset security spare token length are used to aggregate requests using a dynamic boxing algorithm to obtain JSONL requests; The three-level text analysis module is used for a three-level analysis mechanism based on consistency verification. It performs text analysis using a large language model based on JSONL requests to obtain comprehensive adjudication results and comprehensive adjudication evidence.

6. A low-power and highly reliable text analysis device, characterized in that, The low-power and high-reliability text analysis device includes: processor; A memory storing computer-readable instructions that, when executed by the processor, implement the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Enterprise process intelligent analysis system based on large language model

    CN121119659A

  • Quantitative decision-making method for electric vehicle fire safety three-level evaluation system

    CN121365896A