A Multi-Agent Interaction TOKEN Compression Strategy Method and System Based on LLMLINGUA

By adopting a multi-agent interaction token compression strategy based on LLMLINGUA, and dynamically selecting compression logic and deep semantic encoding, the problems of communication latency and computational burden in multi-agent systems are solved, achieving efficient data transmission and semantic recovery, and improving system response speed and adaptability.

CN120930657BActive Publication Date: 2026-01-30ARTIFICIAL INTELLIGENCE INNOVATION RES INST OF ZHEJIANG UNIV OF TECH BINJIANG DISTRICT HANGZHOU
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511454912.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-13
Publication Date
2026-01-30
Estimated Expiration
2045-10-13

AI Technical Summary

Technical Problem

Existing multi-agent systems suffer from high communication latency, heavy computational burden, loss of semantic information, and insufficient real-time response in information interaction, especially in dynamic adaptation to changing interaction scenarios.

Method used

A multi-agent interactive token compression strategy based on LLMLINGUA is adopted. Token sequences are generated through word segmentation and semantic parsing. Compression logic is dynamically selected by combining semantic density, proportion of mathematical symbols and contextual dependency features. A deep semantic encoding module is used to map the token sequence into a low-dimensional semantic vector. Contextual information is transmitted through a unique reference code. The receiving end decodes and recovers the original semantic text. Adaptive grouping matching and termination conditions optimize the decision-making process.

Benefits of technology

It significantly reduces communication load, ensures semantic integrity, reduces computing and storage overhead, improves system response speed and scalability, and adapts to the interaction needs of different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120930657B_ABST
    Figure CN120930657B_ABST
Patent Text Reader

Abstract

This invention discloses a multi-agent interaction token compression strategy method and system based on LLMLINGUA, belonging to the field of artificial intelligence and natural language processing technology. Addressing the problems of high communication load and difficulty in semantic recovery caused by high-frequency interactions in multi-agent systems, this invention adopts the following technical solution: inputting text data and performing word segmentation and semantic parsing to form low-dimensional semantic vectors; dynamically selecting the compression strategy type based on semantic density and number density features; using the LLMlingua module for deep encoding to generate low-dimensional semantic identifiers; storing identifiers in a dynamic reference library and assigning unique reference codes; transmitting reference codes and context information between agents; achieving adaptive grouping through cosine similarity calculation, skipping debates between similar groups and triggering debates between different groups; integrating the module into the multi-agent system. This invention significantly reduces communication load and computational overhead, ensures high-fidelity semantic restoration, and improves system response efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence and natural language processing technology, and in particular relates to a multi-agent interaction token compression strategy method and system based on LLMLINGUA. Background Technology

[0002] Large-scale language models and multi-agent systems are widely used in intelligent dialogue, collaborative decision-making, and distributed information retrieval. High-frequency information interaction between agents is crucial for enhancing system intelligence. However, each interaction requires the transmission of a large number of raw token sequences, placing stringent demands on network bandwidth and storage resources, significantly increasing the system's computational burden, and leading to increased communication and processing latency. In scenarios with high real-time requirements, such as multi-party collaborative dialogue or time-sensitive information retrieval, this latency issue is particularly prominent, directly impacting user experience and decision-making efficiency.

[0003] Currently, the industry mainly employs two types of methods to alleviate token transmission pressure: one is rule-based or simple summary-based compression, which reduces sequence length by pruning stop words or deleting redundant sentences; the other is coarse-grained merging or encoding of tokens using traditional word segmentation or statistical distribution techniques, such as using the token path with the highest probability calculated in existing patent schemes as the final label. While these methods can partially reduce the amount of data, they have the following core drawbacks: rule-based compression leads to the loss of key semantic information, statistical encoding sacrifices real-time response capabilities, and it is difficult to balance compression rate and semantic integrity; in addition, existing solutions are mostly statically designed, lacking adaptive adjustment mechanisms for different application scenarios, and cannot meet the changing interactive debate needs in multi-agent environments.

[0004] The reason for this is that multi-agent systems need to handle significantly different scenarios simultaneously, such as sophisticated reasoning, technical analysis, and free dialogue. Sophisticated reasoning scenarios involve complex mathematical symbols and tabular formulas, requiring high-fidelity compression; technical analysis scenarios need to retain technical terminology and procedural logic; and free dialogue scenarios have high redundancy but rely on contextual coherence. Static compression strategies cannot dynamically adapt to the characteristics of these scenarios, while traditional methods, lacking deep semantic understanding capabilities, inevitably destroy the text's structural coherence and logical connections during compression, leading to difficulties in semantic recovery at the receiving end. Therefore, there is an urgent need for a novel compression strategy that is dynamically adaptive and balances high compression ratio and high fidelity to address the problems of excessive token consumption, incomplete semantic restoration, and insufficient real-time response in multi-agent systems. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention proposes a multi-agent interaction token compression strategy method and system based on LLMLINGUA, thereby resolving the issues present in the prior art.

[0006] Firstly, to achieve the above objectives, this invention provides a multi-agent interaction token compression strategy method based on LLMLINGUA, comprising the following steps:

[0007] Receive text data generated by the intelligent agent, perform word segmentation and semantic parsing to generate a token sequence;

[0008] The compression logic is dynamically selected based on semantic density, the proportion of mathematical symbols, and contextual dependency features.

[0009] The token sequence is mapped into a low-dimensional semantic vector through a deep semantic encoding module;

[0010] Calculate the Euclidean distance between the low-dimensional semantic vector and the semantic center in the dynamic reference library, and assign a unique reference code;

[0011] Transmit the reference code and context information between intelligent agents;

[0012] The receiving end extracts the low-dimensional vector corresponding to the semantic center based on the citation code, and decodes it to recover the original semantic text.

[0013] Calculate the cosine similarity of the text embedding vectors of each agent's initial viewpoint;

[0014] Skip intra-group debates where the similarity exceeds a set threshold;

[0015] Multiple rounds of interactive debate are conducted among the differing groups until a consensus is reached or the termination condition is triggered.

[0016] Output the results of multi-agent collaborative decision-making.

[0017] Optionally, the word segmentation and semantic parsing process includes:

[0018] Map text to high-dimensional semantic vectors;

[0019] High-dimensional semantic vectors are reduced to a low-dimensional space by using a linear transformation matrix.

[0020] Optionally, the process of dynamically selecting compression logic includes:

[0021] When the text contains dense mathematical symbols or high-frequency table formulas, a conservative compression logic that preserves key data points is adopted.

[0022] When the text contains high-density numbering and verbs make up a significant proportion, a balanced compression logic that preserves the integrity of the process is adopted.

[0023] When the text contains high frequency of repeated words or a high proportion of interrogative sentences, an aggressive compression logic that removes redundant expressions is adopted.

[0024] The optional operations of the deep semantic encoding module include:

[0025] Compress text according to instructions, including prohibiting changes to word order, prohibiting modification of words, and prohibiting the addition of new words;

[0026] Text exceeding a set length is split into blocks ending with a period and compressed in blocks.

[0027] Optionally, the process of assigning a unique reference code includes:

[0028] Select the semantic center index corresponding to the minimum Euclidean distance as the reference code;

[0029] When the minimum Euclidean distance exceeds the error threshold, the low-dimensional semantic vector is added as the semantic center of the dynamic reference library.

[0030] Optionally, the process of triggering the termination condition includes:

[0031] The debate will be terminated early when all groups reach a set threshold of consensus.

[0032] After reaching the preset maximum number of debate rounds, a show of hands will be used to determine the final conclusion.

[0033] Secondly, the present invention also provides a multi-agent interactive token compression strategy system based on LLMLINGUA, for implementing a multi-agent interactive token compression strategy method based on LLMLINGUA, the system comprising:

[0034] The text preprocessing module is used to receive text data generated by the agent, perform word segmentation and semantic parsing to generate a token sequence;

[0035] The compression strategy selection module is used to dynamically select compression logic based on semantic density, proportion of mathematical symbols, and contextual dependency features.

[0036] The semantic encoding compression module is used to map token sequences into low-dimensional semantic vectors through deep semantic encoding;

[0037] The dynamic library management module is used to calculate the Euclidean distance between the low-dimensional semantic vector and the semantic center and assign a unique reference code.

[0038] The communication optimization module is used to transmit reference codes and context information between intelligent agents;

[0039] The semantic recovery module is used to extract the low-dimensional vector corresponding to the semantic center based on the citation code and decode it to recover the original semantic text;

[0040] The collaborative decision-making module is used to calculate the cosine similarity of the text embedding vectors of the agent's initial viewpoints, skip intra-group debates where the similarity exceeds a set threshold, and conduct multiple rounds of interactive debates between differing groups until the decision result is output.

[0041] Thirdly, the present invention also provides a computer terminal device, comprising:

[0042] One or more processors;

[0043] A memory, coupled to the processor, for storing one or more programs;

[0044] When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the multi-agent interaction TOKEN compression strategy method based on LLMLINGUA in the first aspect above.

[0045] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the steps of the multi-agent interaction token compression strategy method based on LLMLINGUA in the first aspect described above.

[0046] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the multi-agent interaction token compression strategy method based on LLMLINGUA in the first aspect described above.

[0047] Compared with the prior art, the present invention has the following advantages and technical effects:

[0048] This invention provides a multi-agent interactive token compression strategy method and system based on LLMLINGUA. This invention significantly reduces the communication load of multi-agent systems by using reference codes to replace the original token sequence transmission, achieving efficient data compression. Simultaneously, it ensures semantic integrity and high-fidelity restoration by utilizing deep semantic coding combined with a dynamic reference library mechanism to accurately recover the original content. It also significantly reduces computational and storage overhead, simplifying the processing flow through low-dimensional vector operations. Furthermore, it improves system response speed, with an adaptive grouping and matching mechanism avoiding redundant debates and dynamic termination rules accelerating the decision-making process. Attached Figure Description

[0049] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0050] Figure 1 This is a general flowchart of an embodiment of the present invention;

[0051] Figure 2 This is a flowchart illustrating the preprocessing process from original text to low-dimensional vectors, as shown in an embodiment of the present invention.

[0052] Figure 3 This is a schematic diagram of the compression strategy judgment and dynamic mapping process in an embodiment of the present invention. Detailed Implementation

[0053] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0054] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0055] Example 1

[0056] like Figure 1 As shown, this embodiment provides a multi-agent interaction token compression strategy method based on LLMLINGUA, including:

[0057] Receive text data generated by the intelligent agent, perform word segmentation and semantic parsing to generate a token sequence;

[0058] The compression logic is dynamically selected based on semantic density, the proportion of mathematical symbols, and contextual dependency features.

[0059] The token sequence is mapped into a low-dimensional semantic vector through a deep semantic encoding module;

[0060] Calculate the Euclidean distance between the low-dimensional semantic vector and the semantic center in the dynamic reference library, and assign a unique reference code;

[0061] Transmit the reference code and context information between intelligent agents;

[0062] The receiving end extracts the low-dimensional vector corresponding to the semantic center based on the citation code, and decodes it to recover the original semantic text.

[0063] Calculate the cosine similarity of the text embedding vectors of each agent's initial viewpoint;

[0064] Skip intra-group debates where the similarity exceeds a set threshold;

[0065] Multiple rounds of interactive debate are conducted among the differing groups until a consensus is reached or the termination condition is triggered.

[0066] Output the results of multi-agent collaborative decision-making.

[0067] The method specifically includes the following steps:

[0068] S1: Input preprocessing: Receive text data generated by each agent, perform standard word segmentation and semantic parsing, and form a preliminary token sequence;

[0069] S2: Design a dynamic compression method and determine the compression strategy by classifying the components;

[0070] S3: Use the LLMlingua module to perform deep encoding on the token sequence;

[0071] S4: Establish a dynamic reference library, store the encoded low-dimensional semantic identifiers into the dynamic reference library, and assign a unique reference code;

[0072] S5: Optimizes multi-agent communication, where agents only transmit generated reference codes and necessary context information;

[0073] S6: Configured for adaptive grouping and matching among agents to participate in decision-making;

[0074] S7: System integration and optimization, integrating the above modules into a multi-agent large model system to form a multi-agent system that integrates token compression and debate mechanism.

[0075] As one implementation method in this embodiment, the word segmentation and semantic parsing process includes:

[0076] Map text to high-dimensional semantic vectors;

[0077] High-dimensional semantic vectors are reduced to a low-dimensional space by using a linear transformation matrix.

[0078] The preprocessing flow from the original text to the low-dimensional vector is as follows: Figure 2 As shown, the process covers steps S1 to S2.

[0079] Specifically, in step S1, input preprocessing involves receiving text data generated by each agent, performing standard word segmentation and semantic parsing to form a preliminary token sequence, as follows:

[0080] S1.1: After preprocessing, it is mapped to the initial semantic representation vector:

[0081] ;

[0082] in Represents a vector of dimension x. Indicates encoder, Represents the original text;

[0083] S1.2: To achieve dimensionality reduction, matrix transformations are used to map high-dimensional semantic vectors to a low-dimensional space:

[0084] ;

[0085] in For low-dimensional semantic vectors ( ≪ ), It is a high-dimensional semantic vector The original dimension, i.e. . It is the low-dimensional semantic vector after dimensionality reduction. Target dimensions ( ≪ ),Right now . For the dimensionality reduction weight matrix, For bias terms;

[0086] As one implementation method in this embodiment, the process of dynamically selecting compression logic includes:

[0087] When the text contains dense mathematical symbols or high-frequency table formulas, a conservative compression logic that preserves key data points is adopted.

[0088] When the text contains high-density numbering and verbs make up a significant proportion, a balanced compression logic that preserves the integrity of the process is adopted.

[0089] When the text contains high frequency of repeated words or a high proportion of interrogative sentences, an aggressive compression logic that removes redundant expressions is adopted.

[0090] Specifically, in step S2, the compression method is set to dynamic compression, and the compression strategy is determined based on classification, as follows:

[0091] Fast rule filtering, utilizing compression timing modeling formulas:

[0092] ;

[0093] in: ∈{semantic density, proportion of mathematical symbols, contextual dependency, ...}, These are the scene weighting coefficients (obtained through regression of historical data). The baseline threshold offset (Bias Term) in the compression timing modeling formula reflects the system's basic sensitivity to compression triggering without considering the influence of any features. This parameter is obtained through regression analysis of historical task data and serves as an initial reference value for the global compression strategy. It, along with the weighted sum of various features, determines the final Threshold value, thereby determining whether to trigger a precise inference-based compression strategy. A precise inference strategy is triggered when Threshold > Γ (Γ = 0.82).

[0094] The first compression stage is designed to be task-aware. It determines the relevant scenario based on different characteristics, and then employs different compression strategies accordingly.

[0095] Firstly, the "precise reasoning" type contains complex mathematical symbols, dense formulas, a large number of numerical values, statistical tables, and charts, emphasizing accuracy and completeness. Specifically, it contains mathematical symbol density >15%, table / formula frequency >2 times / 100 words, and other characteristic indicators. It is identified as a scenario for mathematical proofs, physical derivations, financial reports, scientific research data analysis, and interpretation of A / B test results. The compression strategy adopted is conservative compression, retaining key data points and indicators, and structured summarization, with a compression rate of R=0.7±0.05.

[0096] Secondly, the technical analysis type contains professional terminology but has a clear structure, medium length, clear steps, operation commands, and includes factors such as numbering and subtasks. Specifically, it contains characteristic indicators such as a number density of >5 per 100 words and a verb ratio of >25%. It is identified as a scenario for code review, paper summary, and technical solution evaluation. The compression logic adopted is balanced compression, retaining key terms, process integrity and sequence, and compression rate R=0.5.

[0097] Third, free dialogue and interactive question-and-answer (multi-turn) type, including context-dependent and historical dialogue, may have factors such as repeated confirmation, casual language, high repetition rate, and no strict format. Specifically, it contains characteristic indicators such as repeated word frequency >30% and question sentence ratio >40%. It is determined to be a daily chat, simple question and answer, non-technical discussion scenario. The compression logic is set to a compression rate of about 0.3 and redundant expressions are deleted.

[0098] As one implementation method in this embodiment, the operation of the deep semantic coding module includes:

[0099] Compress text according to instructions, including prohibiting changes to word order, prohibiting modification of words, and prohibiting the addition of new words;

[0100] Text exceeding a set length is split into blocks ending with a period and compressed in blocks.

[0101] Compression strategy determination and dynamic mapping process as follows Figure 3 As shown, the relevant process involves steps S3 to S4.

[0102] Specifically, in step S3, the token sequence is deeply encoded using the LLMlingua module. This module, based on a self-attention mechanism and a deep neural network algorithm, extracts key information from the original token and maps it to a low-dimensional semantic space to generate a low-dimensional semantic identifier representing the original semantics. This step preserves the core semantic information of the text while significantly reducing the data dimensionality, meeting the requirements for efficient data transmission. The details are as follows:

[0103] The pre-trained small model used for module compression is a GPT-4 model that has undergone data distillation; the requirement is to shorten the original text as much as possible using GPT-4, with the specific instructions being:

[0104] "Please compress the given text into the shortest possible expression so that GPT-4 can restore the original text as much as possible while retaining the most original information. Please strictly adhere to the following five rules:"

[0105] 1. Only unimportant words can be deleted;

[0106] 2. The original word order must not be changed;

[0107] 3. The words themselves must not be modified;

[0108] 4. Abbreviations or emojis are not allowed;

[0109] 5. No new words or symbols may be added;

[0110] Please simplify the text as much as possible, retaining only the core information through deletion. If you understand correctly, please compress the following content: {text to compress}, the compressed result is as follows:

[0111] The module proposes alignment gap (AG) to evaluate the quality of automatically labeled tags; This represents the tagging function, if a word correspond One of the words in it has , This is the compressed version of the module. Its generation process strictly follows preset compression instructions, removing redundant words while retaining key information and maintaining the word order and content. This results in a shorter, semantically more faithful token sequence, used for matching rate calculation and subsequent reference code allocation. The matching rate (MR) is defined as follows:

[0112] ;

[0113] in The cardinality (number of elements) of a set.

[0114] As one implementation method in this embodiment, the process of allocating a unique reference code includes:

[0115] Select the semantic center index corresponding to the minimum Euclidean distance as the reference code;

[0116] When the minimum Euclidean distance exceeds the error threshold, the low-dimensional semantic vector is added as the semantic center of the dynamic reference library.

[0117] Specifically, in step S4, the configuration involves storing the encoded low-dimensional semantic identifiers into a dynamic reference library and assigning a unique reference code to each identifier. The details are as follows:

[0118] S4.1: The length of the reference code is much shorter than the original token sequence, thereby reducing the actual number of tokens transmitted. This mechanism can dynamically update the mapping relationship based on the interaction frequency and context, achieving flexible and efficient data management;

[0119] For each low-dimensional vector The system searches for the most similar existing semantic center in the dynamic reference library. And calculate the mapping error. :

[0120] ;

[0121] S4.2: Select the center index corresponding to the minimum error And use it as a short quote code:

[0122] ;

[0123] The reference code 𝑐 replaces the original token sequence when transmitted between agents, achieving the effect of data compression.

[0124] S4.3: Decoding and recovery; the receiving end queries the low-dimensional vector in the reference library based on the reference code. Then, the decoding module is used to restore the original text. :

[0125] ;

[0126] in This is a decoding recovery function that combines context and feedback information to achieve semantic reconstruction.

[0127] In step S5, the configuration is optimized for multi-agent communication. In the multi-agent system, agents only transmit the generated reference code and necessary context information. Specifically, the receiving agent queries the dynamic reference library based on the reference code, and when needed, uses a preset decoding module to restore the low-dimensional identifier to the original or high-fidelity text, completing the information transmission. This design effectively avoids the repeated transmission of large segments of redundant tokens, greatly reducing the consumption of network bandwidth and computing resources.

[0128] As one implementation method in this embodiment, the process of triggering the termination condition includes:

[0129] The debate will be terminated early when all groups reach a set threshold of consensus.

[0130] After reaching the preset maximum number of debate rounds, a show of hands will be used to determine the final conclusion.

[0131] Specifically, in step S6, the configuration involves adaptive grouping and matching among agents to participate in decision-making; as follows:

[0132] S6.1: The multi-agent grouping design is as follows: after each agent expresses its initial viewpoint, a text embedding model is used to vectorize each initial viewpoint, and then the cosine similarity is calculated.

[0133] S6.2: In the inductive decision-making part, after all the cosine similarity calculations in this round are completed, each agent will selectively ignore similar viewpoints based on its own characteristics, and will tend to participate in the debate if the group of agents with different viewpoints will participate.

[0134] S6.3: If there is a situation where the similarity within each group is consistent and no different viewpoints can be found, the group will choose not to discuss it, thereby further reducing token consumption;

[0135] S6.4: Establish an early termination mechanism to allow the debate to end when information is exchanged between groups and all summarized points are consistent;

[0136] S6.5: If, after the predetermined number of debates, the solutions of the various agents still differ, the final answer shall be selected by a show of hands according to the "majority rule".

[0137] In step S7, the specific configuration is system integration and optimization; the above modules are integrated into a multi-agent large model system to form an end-to-end token compression, transmission and recovery process; the system is suitable for collaborative dialogue scenarios, as well as complex information retrieval and distributed decision-making, which significantly improves the overall operating efficiency and response speed.

[0138] Based on the above general method, the implementation process of this invention will be described below based on a specific scenario:

[0139] Scenario 1: Multi-agent collaborative dialogue scenario;

[0140] Scenario Description: Five agents engage in three rounds of dialogue surrounding "product performance evaluation," and finally output a summary conclusion.

[0141] 1. S1 Input Preprocessing:

[0142] 1.1 Each agent generates the original text .

[0143] 1.2 Standard word segmentation and semantic parsing to generate a preliminary token sequence. .

[0144] 1.3 Mapping to high-dimensional semantic vectors:

[0145] ;

[0146] 1.4 To achieve dimensionality reduction, matrix transformations are used to map high-dimensional semantic vectors to a low-dimensional space:

[0147] ;

[0148] in For low-dimensional semantic vectors ( ≪ ), For the dimensionality reduction weight matrix, This is a bias term.

[0149] 2. S2 dynamic compression strategy determination:

[0150] 2.1 Calculate each feature: semantic density Numbering density The proportion of interrogative sentences wait.

[0151] 2.2 Calculate the trigger threshold

[0152] ;

[0153] 2.3 If Then it is a precise reasoning type; otherwise, according to Choose the technical analysis type, or the default free-flowing dialogue type.

[0154] 3. S3LLMlingua depth encoding:

[0155] 3.1 Will Input a pre-trained small model to generate a low-dimensional semantic identifier vector set { }

[0156] 4. S4 Dynamic Reference Library Mapping:

[0157] For each vector :

[0158] 4.1 Calculate the vectors with all centers. Euclidean distance:

[0159] ;

[0160] 4.2 Select the index corresponding to the minimum error:

[0161] ;

[0162] 4.3 If (New concept threshold), then extract To expand the dynamic library for the new center.

[0163] 5. S5 communication optimization:

[0164] The agent only sends the reference code sequence and context label.

[0165] 6. S6 Adaptive Grouping and Debate:

[0166] 6.1 Decoding and recovery of each agent and use Generate a text draft.

[0167] 6.2 Calculate the cosine similarity of viewpoint vectors and group them into "similar" and "dissimilar" categories.

[0168] 6.3 Groups with high similarity should skip the debate within their own group and conduct dialogues between different groups, up to three rounds.

[0169] 7. S7 Integration and Output:

[0170] Finally, the conclusions of each group are summarized, and a complete evaluation report is output.

[0171] Scenario 2: Text Processing Case Study

[0172] Scenario Description: A portion of a novel's text is processed. The goal is to transmit only the compressed, key information within a multi-agent system, and then reconstruct the complete text using a reference library and a decoding module. The entire process consists of the following steps:

[0173] 1. S1 Data Preprocessing:

[0174] The input text is cleaned and segmented to generate a standard token sequence. For example: Original text: "Once upon atime, in a land far away, there lived a wise old owl." Segmentation result: ['Once', 'upon', 'a', 'time', ',', 'in', 'a', 'land', 'far', 'away', ',', 'there', 'lived', 'a', 'wise', 'old', 'owl', '.'].

[0175] 2. S2 compression strategy determination:

[0176] A pre-trained Transformer model is used to generate the embedding vector for each token, and a high-dimensional semantic representation of the entire sentence is calculated. To reduce the amount of data transmitted, matrix transformations are used to reduce the dimensionality of the high-dimensional vectors. Compression is then performed based on semantic determination.

[0177] 3. S3LLMlingua depth encoding:

[0178] The goal of using the LLMlingua method is to enable the model to generate compressed text from the original text that meets the following criteria:

[0179] (i) Token reduction: Compressed hints should be shorter to reduce costs and speed up reasoning.

[0180] (ii) Information content: Necessary information should be retained.

[0181] (iii) Faithfulness: The compressed prompts should remain faithful and avoid introducing fictitious content to ensure accuracy when prompting large language models in downstream tasks.

[0182] However, compression inevitably introduces the illusion problem, leading to two proposed solutions. The design instructions ensure the generated text remains faithful to the original, and chunked compression is employed: experience shows that the length of the original text significantly impacts compression performance. For example, GPT-4 tends to use a high compression ratio when handling very long contexts, likely due to its limited ability to process long contexts. This aggressive compression results in significant information loss, severely impacting the performance of downstream tasks. Dividing each long context into multiple chunks, each containing no more than 512 tokens and ending with a period, effectively mitigates this problem. GPT-4 is then instructed to compress each chunk individually.

[0183] First, calculate the importance score for each token:

[0184] ;

[0185] in, It is the importance weight of the token in the context. This involves identifying duplicate tokens. By setting an appropriate compression rate (e.g., 40%), important tokens are filtered out, and compressed text is generated.

[0186] The original text above, after being compressed, becomes: "Once land far wise owl."

[0187] Will Input a pre-trained small model to generate a low-dimensional semantic identifier vector set { }

[0188] 4. S4 Dynamic Reference Library Mapping:

[0189] The reduced-dimensional vector u is used to query its corresponding semantic center in the dynamic reference library to generate a unique reference code. After mapping, the reference code obtained is: #1045.

[0190] 5. S5 Multi-Agent Transport Mapping Optimization:

[0191] During transmission, only the reference code #1045 and a small amount of context information are sent, without transmitting the complete text and high-dimensional vectors, thus significantly reducing bandwidth consumption.

[0192] The receiving agent uses the reference code to query the dynamic reference library and obtain the corresponding low-dimensional vector. And the complete text is recovered through the decoding module:

[0193] ;

[0194] The decoding module, combined with contextual information, restores the low-dimensional vector into high-fidelity text. The final restored result may be:

[0195] "Once upon a time, in a distant land, there was a wise owl who lived in the forest."

[0196] like If there is a significant discrepancy between the recovered text and the expected text, the encoding and mapping parameters are adjusted through a feedback mechanism. Calculating the recovery quality metrics (BLEU, ROUGE) allows for the assessment of the semantic similarity between the recovered text and the original text.

[0197] 6. S6 Adaptive Grouping and Debate:

[0198] 6.1 Decoding and recovery of each agent and use Generate a text draft.

[0199] 6.2 Calculate the cosine similarity of viewpoint vectors and group them into "similar" and "dissimilar" categories.

[0200] 6.3 Groups with high similarity should skip the debate within their own group and conduct dialogues between different groups, up to three rounds.

[0201] 7. The manifestation of the S7 debate process in a multi-agent system and its system integration and optimization:

[0202] Design of multi-agent cooperative communication and feedback algorithm. Information transmission and feedback updates between multi-agent systems are achieved through the following algorithm:

[0203] Sending Agent (Agent A):

[0204] Get the original text Encoding dimensionality reduction yields Query the dynamic reference library to obtain the reference code. Construct message packet { ,Context summary}; Send message packets through the network transmission module.

[0205] Receiving Agent (Agent B):

[0206] Received message packet { ,Context summary}; Query the reference library to obtain Call the decoding module ; Calculate recovery evaluation indicators ;if If the value is below the preset threshold, feedback information will be provided. (Adjustment suggestions and error information) are sent back to the sending end or the central coordination server.

[0207] Central coordinating agent:

[0208] Collect feedback information from multiple agents; adjust the global parameters of the dynamic reference library and decoding module; broadcast the latest model parameters to all agents to ensure global consistency.

[0209] The above describes the entire process of implementing the method of this invention in two scenarios.

[0210] Based on this, the present invention provides a multi-agent interactive token compression strategy method based on LLMLINGUA, and the technical effects achieved by the present invention are as follows:

[0211] Significantly reduce communication load: Mapping the original high-dimensional token sequence to low-dimensional semantic identifiers and replacing long sequences with extremely short reference codes for transmission can compress the amount of data in a single interaction to 10%–30% of the original. The dynamic reference library mechanism can reuse existing identifiers for high-frequency interaction content, further reducing redundant transmission.

[0212] Ensuring semantic integrity and high-fidelity restoration: The LLMlingua module, based on self-attention and deep semantic coding, extracts core text information; combined with the context-feedback decoding recovery function g(·), semantic content highly consistent with the original text can be reconstructed at the receiving end, with a recovery error of less than 5%. Multi-level compression strategies (precise reasoning, technical analysis, and free dialogue) can be flexibly switched in different scenarios, balancing compression rate and content integrity requirements.

[0213] Reduced computational and storage overhead: The dimensionality-reduced weight matrix W and bias b only need to be loaded during model initialization or lightweight updates. The online inference stage only involves low-dimensional vector operations, which can reduce the computational cost of a single encoding by 40%–60%. The dynamic reference library adopts a central vector index structure, and the near nearest neighbor search latency is controlled within 20 milliseconds, making it suitable for real-time system deployment.

[0214] Improve system response speed and scalability: The adaptive grouping and matching mechanism avoids repeated debates on similar viewpoints among multiple agents, and the dynamic termination rule can end the decision-making process in advance when opinions converge, reducing the average number of decision rounds by 30%.

[0215] Example 2

[0216] In this embodiment, a computer terminal device is provided, including:

[0217] One or more processors;

[0218] A memory, coupled to the processor, for storing one or more programs;

[0219] When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the multi-agent interaction TOKEN compression strategy method based on LLMLINGUA described above.

[0220] In this embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the above-described multi-agent interaction token compression strategy method based on LLMLINGUA.

[0221] In this embodiment, an electronic device is also provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the steps of the above-described multi-agent interaction token compression strategy method based on LLMLINGUA.

[0222] In this embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the above-described multi-agent interaction token compression strategy method based on LLMLINGUA.

[0223] The aforementioned program can run on a processor or be stored in memory (or a computer-readable medium). Computer-readable media includes both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, 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, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0224] These computer programs may also be loaded onto a computer or other programmable data processing equipment, causing a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes can be implemented by different modules for different steps.

[0225] This embodiment provides such an apparatus or system. The system, referred to as the LLMLINGUA-based multi-agent interaction token compression strategy system, includes:

[0226] The text preprocessing module is used to receive text data generated by the agent, perform word segmentation and semantic parsing to generate a token sequence;

[0227] The compression strategy selection module is used to dynamically select compression logic based on semantic density, proportion of mathematical symbols, and contextual dependency features.

[0228] The semantic encoding compression module is used to map token sequences into low-dimensional semantic vectors through deep semantic encoding;

[0229] The dynamic library management module is used to calculate the Euclidean distance between the low-dimensional semantic vector and the semantic center and assign a unique reference code.

[0230] The communication optimization module is used to transmit reference codes and context information between intelligent agents;

[0231] The semantic recovery module is used to extract the low-dimensional vector corresponding to the semantic center based on the citation code and decode it to recover the original semantic text;

[0232] The collaborative decision-making module is used to calculate the cosine similarity of the text embedding vectors of the agent's initial viewpoints, skip intra-group debates where the similarity exceeds a set threshold, and conduct multiple rounds of interactive debates between differing groups until the decision result is output.

[0233] As one implementation method in this embodiment, the text preprocessing module includes:

[0234] High-dimensional semantic mapping unit, used to map text into high-dimensional semantic vectors;

[0235] The vector dimensionality reduction processing unit is used to reduce high-dimensional semantic vectors to a low-dimensional space through a linear transformation matrix.

[0236] As one implementation method in this embodiment, the compression strategy selection module includes:

[0237] A precision reasoning-type decision unit is used to trigger conservative compression logic when the text contains dense mathematical symbols or high-frequency table formulas.

[0238] A technical analysis-based decision unit is used to trigger balanced compression logic when the text contains high-density numbering and verbs account for a significant proportion.

[0239] The free-conversation type decision unit is used to trigger aggressive compression logic when the text contains high frequency of repeated words or a high proportion of interrogative sentences.

[0240] As one implementation method in this embodiment, the semantic encoding compression module includes:

[0241] The instruction constraint execution unit is used to compress text according to rules that prohibit changing word order, modifying words, and adding new words;

[0242] The text chunking and compression unit is used to divide text exceeding a set length into chunks ending with a period and process them in chunks.

[0243] As one implementation method in this embodiment, the dynamic library management module includes:

[0244] The semantic center alignment unit is used to calculate the Euclidean distance between the low-dimensional semantic vector and each semantic center;

[0245] The reference code allocation unit is used to select the semantic center index corresponding to the minimum distance as the reference code;

[0246] The dynamic library update unit is used to add semantic centers when the minimum distance exceeds the error threshold.

[0247] As one implementation method in this embodiment, the collaborative decision-making module includes:

[0248] The debate termination judgment unit is used to terminate the debate in advance when the consensus between groups reaches a set threshold.

[0249] The majority voting execution unit is used to determine the final conclusion by a show of hands after the maximum number of debate rounds has been reached.

[0250] The system or apparatus is used to implement the functions of the methods in the above embodiments. Each module in the system or apparatus corresponds to each step in the method, as has been described in the method and will not be repeated here.

[0251] The above implementation method solves the problem of multi-agent interaction token compression strategy based on LLMLINGUA in related technologies, thereby ensuring that the problems existing in the prior art are resolved.

[0252] The above are merely preferred embodiments 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 scope of the technology 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 method for LLMLINGUA-based multi-agent interaction TOKEN compression strategy, characterized in that, The method comprises the following steps: Receiving text data generated by an intelligent agent, performing word segmentation and semantic analysis to generate a token sequence; Dynamically selecting compression logic according to semantic density, mathematical symbol proportion, and context dependence features; Mapping the token sequence into a low-dimensional semantic vector through an LLMlingua module; Calculating the Euclidean distance between the low-dimensional semantic vector and the semantic center in the dynamic reference library, and assigning a unique reference code; Transmitting the reference code and context information between intelligent agents; Receiving end extracts the low-dimensional vector corresponding to the semantic center according to the reference code, and decodes to restore the original semantic text; Calculating the cosine similarity of the text embedding vectors of the initial viewpoints of each intelligent agent; Directly skipping the intra-group debate of the groups with similarity exceeding a certain threshold; Carrying out multi-round interactive debate between the difference groups until reaching a consensus or triggering a termination condition; Outputting the multi-agent collaborative decision result; The process of assigning a unique reference code comprises: Selecting the semantic center index corresponding to the minimum Euclidean distance as the reference code; When the minimum Euclidean distance exceeds the error threshold, adding the low-dimensional semantic vector as a new semantic center in the dynamic reference library.

2. The method of claim 1, wherein, The process of word segmentation and semantic analysis comprises: Mapping the text into a high-dimensional semantic vector; Reducing the high-dimensional semantic vector to a low-dimensional space through a linear transformation matrix.

3. The method of claim 1, wherein, The process of dynamically selecting compression logic comprises: When the text contains dense mathematical symbols or high-frequency table formulas, adopting a conservative compression logic that preserves key data points; When the text contains high-density numbering and a significant proportion of verbs, adopting a balanced compression logic that preserves the integrity of the process; When the text contains high repetition word frequency or a high proportion of questions, adopting an aggressive compression logic that deletes redundant expressions.

4. The method of claim 1, wherein, The operation of the LLMlingua module comprises: Compressing the text according to instruction constraints, including prohibiting changing the order of words, prohibiting modifying words, and prohibiting adding new words; Splitting the text exceeding a certain length into blocks ending with a period and compressing the blocks.

5. The method of claim 1, wherein, The process of triggering the termination condition comprises: Terminating the debate early when the consistency of viewpoints between all groups reaches a certain threshold; After reaching the maximum number of debate rounds, determining the final conclusion through a show of hands.

6. A multi-agent interaction TOKEN compression strategy system based on LLMLINGUA, characterized in that, The system is used to implement the method of any one of claims 1-5, and comprises: A text preprocessing module for receiving text data generated by an intelligent agent, performing word segmentation and semantic analysis to generate a token sequence; A compression strategy selection module for dynamically selecting compression logic according to semantic density, mathematical symbol proportion, and context dependence features; A semantic encoding compression module for mapping the token sequence into a low-dimensional semantic vector through deep semantic encoding; A dynamic library management module for calculating the Euclidean distance between the low-dimensional semantic vector and the semantic center and assigning a unique reference code; A communication optimization module for transmitting the reference code and context information between intelligent agents; A semantic recovery module for extracting the low-dimensional vector corresponding to the semantic center according to the reference code and decoding to restore the original semantic text; A collaborative decision module for calculating the cosine similarity of the text embedding vectors of the initial viewpoints of intelligent agents, skipping intra-group debate of groups with similarity exceeding a certain threshold, and carrying out multi-round interactive debate between difference groups until outputting the decision result.

7. A computer terminal device, characterized by The method comprises the following steps: one or more processors; a memory coupled to the processors for storing one or more programs; the one or more programs, when executed by the one or more processors, cause the one or more processors to implement steps of the method of any one of claims 1-5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that the computer program, which when executed by the processor, implements steps of the method of any one of claims 1-5.

9. A computer program product comprising a computer program, characterized in that, the computer program, which when executed by the processor, implements steps of the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Method for compressing context of large language model

    CN118551012A

  • Multi-agent cooperative emotion support dialogue generation method and system

    CN120561255A