A large model compression algorithm automatic generation method and system
Patent Information
- Application Number
- CN202610889751.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-09-04
AI Technical Summary
[0014]本发明通过引入异构多智能体协作流(包含分析、构思、架构与评估机制),将耗时的人工试错转化为机器自动演化,大幅缩短针对新型模型和新硬件的算法研发周期,解决了大模型压缩算法高度依赖人工设计、研发效率低下的问题
1. 基本解决自动化生成的“幻觉”问题,确保底层物理硬件的高度可编译与可部署性 现有的大模型代码生成工具缺乏物理约束,极易产生无法运行的错误逻辑。本发明通过步骤 S100 和 S200 构建的进化知识图谱,提取历史上已验证的优化轨迹作为“算法思维链(CoT)”。这种机制将漫无目的的随机搜索,转化为了受严密逻辑与物理限制约束的定向推导;再加上步骤 S400 严苛的多维同行评审(AI Peer Review)中对不支持硬件物理计算逻辑的“一票否决”机制,极大地过滤了不可行的理论设计,避免了物理验证环节的算力浪费,确保了生成的算法蓝图在真实硬件编译器上的绝对可行性。
Smart Images

Figure CN122693733A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer software technology and relates to an automatic generation method and system for a large model compression algorithm based on knowledge graphs and multi-agent systems with physical constraint perception capabilities. Background Technology
[0002] With the exponential growth of parameters in foundational models, such as large language models (LLMs) and hybrid expert models (MoEs), the demand for computing resources (especially memory capacity and memory access bandwidth) has increased dramatically. However, the development of underlying integrated circuits (ICs) and physical hardware is constrained by power consumption and area budgets, making it difficult to keep pace with the expansion of model size. Therefore, efficiently deploying massive foundational models on strictly limited physical devices has become a critical systems engineering bottleneck that urgently needs to be addressed in the field of artificial intelligence and software-hardware co-design.
[0003] To alleviate the aforementioned contradictions, model compression techniques (such as quantization and pruning) become essential. Currently, the most similar implementations to this invention in existing technologies mainly fall into three categories. However, objective analysis reveals significant technical limitations when dealing with the extremely complex model architectures and diverse underlying hardware constraints of today: I. Static Model Compression Based on Heuristic-Driven Manual Engineering Currently, the most mainstream basic model optimization schemes in industry mainly rely on the heuristic experience of human experts. Examples include the widely used GPTQ or AWQ equal-weight quantization algorithms, or the SmoothQuant weight-activation joint quantization method.
[0004] Such solutions are essentially highly labor-intensive manual trial-and-error processes. Whenever a new neural network architecture with long context processing capabilities or complex sparse routing mechanisms (such as MoE) emerges, engineers need to manually derive the operator logic and error compensation boundaries again, making the R&D iteration extremely inefficient.
[0005] In such schemes, the manually designed compression rules are often "specific optimal solutions" for a particular hardware architecture (such as the fixed-width cores of a specific GPU). When faced with diverse underlying memory architecture constraints, traditional unified compression strategies are often difficult to apply and cannot automatically evolve or invent new computational logic for diverse hardware environments.
[0006] II. Traditional Automated Parameter Search Based on Whiteboard Status (AutoML & Tabula Rasa ParametricSearch) To reduce the cost of manual intervention, some existing technologies attempt to introduce evolutionary computation or neural architecture search (NAS) tools to find compressed configurations.
[0007] Such approaches typically perform blind optimization within a pre-defined discrete or continuous parameter space. When faced with a basic model with hundreds of billions of parameters, the combinations of its search space explode exponentially, and traditional stochastic or gradient search methods are prone to getting trapped in local optima and consume enormous amounts of computational power.
[0008] Such approaches lack the ability to generate "structural algorithmic logic innovation": traditional AutoML tools are largely limited to basic parametric tuning, such as simply adjusting the number of network layers or the bit width of each layer under a fixed strategy. They cannot, like human scientists, break through the existing isolated parameter compression paradigm and derive entirely new algorithmic logic structures such as "dynamically sensing the context and jointly reallocating model weights and KV cache bit width budgets".
[0009] III. Zero-shot LLM Generation for System Design Based on Large-Scale Language Models With the development of generative artificial intelligence, the industry has begun to try to directly ask large language models to output system optimization code by inputting prompts.
[0010] Such schemes suffer from the "hallucinate" disaster due to the lack of structured historical memory: existing zero-sample or few-sample generation methods are in a "tabula rasa" state; due to the lack of systematic understanding of the historically verified scientific innovation trajectory (i.e. how predecessors have balanced accuracy with the physical limits of hardware), the model is very prone to "hallucinate", generating code designs that seriously violate the underlying physical hardware limitations, produce unstable numerical calculations, or are simply impossible to implement at the compiler level.
[0011] Such solutions lack rigorous multi-dimensional verification and closed-loop iteration: direct generation often ignores strict engineering feasibility review, resulting in the final synthesized algorithm blueprint not only failing to meet strict physical memory constraints, but also struggling to maintain the model's inference ability under actual extreme compression systems, which can easily lead to the collapse of the basic model generation capability.
[0012] In summary, existing model compression techniques are either limited by expensive and rigid human heuristic designs or constrained by blind search tools lacking physical constraints and historical logical memory. There is an urgent need in this field for a novel automated algorithm discovery and generation framework that can utilize structured historical innovation memory, endow intelligent agents with an "algorithmic thought chain," and autonomously deduce and synthesize algorithms that strictly adhere to underlying hardware constraints. Summary of the Invention
[0013] To address the problems existing in the prior art, the purpose of this invention is to provide an automatic generation method and system for large model compression algorithms based on knowledge graphs and multi-agent systems, with physical constraint awareness capabilities. This invention breaks through the limitations of traditional methods based on manual heuristic design and blind parameter search, endowing the automated system with an "algorithmic chain of thought," thereby achieving fully automated algorithm discovery and targeted synthesis at the system architecture level.
[0014] This invention introduces a heterogeneous multi-agent collaborative flow (including analysis, conception, architecture, and evaluation mechanisms) to transform time-consuming manual trial and error into automatic machine evolution, significantly shortening the algorithm development cycle for new models and new hardware, and solving the problem of high dependence on manual design and low development efficiency in large model compression algorithms.
[0015] The technical solution of this invention is as follows: An automatic generation method for large model compression algorithms, comprising the following steps: An algorithm logic network is constructed based on the evolutionary relationships among existing compression algorithms, serving as an evolutionary knowledge graph; Each edge chain containing multiple consecutive nodes in the evolutionary knowledge graph is used as an optimization path, and the matching degree between each optimization path and the compression task is evaluated as the score of the optimization path. Select one optimization path from the optimization paths whose scores are above the threshold as the high-score evolution path; The high-resolution evolution path is input into a multi-agent system, and the multi-agent system works together to perform reasoning analysis on the high-resolution evolution path and generate multiple innovative algorithm implementation blueprints. The implementation blueprints of the innovative algorithms are reviewed and quantitatively scored, and the implementation blueprint of the innovative algorithm with the highest score is taken as the theoretically feasible blueprint. The theoretically feasible blueprint was transformed into executable code and tested in a real hardware environment; The test results are compared with the test results of the existing best comparable compression algorithms. If the result is better than the existing best comparable compression algorithm, the compression algorithm corresponding to the theoretically feasible blueprint is added as a new node to the evolutionary knowledge graph; otherwise, the compression algorithm corresponding to the theoretically feasible blueprint is recorded in the log of the high-scoring evolution path to form a closed-loop feedback, and a new high-scoring evolution path is selected to generate the compression algorithm for the compression task.
[0016] Preferably, the method for constructing the algorithm logic network is as follows: each existing compression method is treated as a node, which contains structured metadata; directed edges are established between nodes according to the evolutionary relationship between compression methods, and the evolutionary relationship includes two types: direct upgrades on the same technical route and logical borrowing across technical branches.
[0017] Preferably, the metadata includes: the numerical precision attribute of the compression method, the hardware compatibility flag, and the performance leap index of the node corresponding to the compression method relative to its parent node.
[0018] Preferably, the method of using the analytical agent to logically deconstruct the high-scoring evolution path is as follows: extract the specific mathematical mechanism or structural change behind each performance improvement in the high-scoring evolution path, and output a structured mechanism diagnostic report.
[0019] Preferably, the method for generating an innovative algorithm implementation blueprint using a multi-agent system based on the high-scoring evolution path is as follows: using an analytical agent to logically deconstruct the high-scoring evolution path to obtain a mechanism diagnostic report; using a conceptual agent to perform divergent reasoning based on the mechanism diagnostic report and the compression task to propose multiple conceptual hypotheses for the compression task; and using an architectural agent to transform the conceptual hypotheses into an innovative algorithm implementation blueprint.
[0020] Preferably, the method for reviewing and quantifying the implementation blueprint of the innovative algorithm is as follows: the review agent scores the implementation blueprint of the innovative algorithm according to a preset quantitative evaluation standard to obtain the score of the implementation blueprint of the innovative algorithm; the evaluation dimensions of the quantitative evaluation standard include innovativeness, engineering feasibility, implementation motivation, expected results and hardware failure risk; the review module uses a physical constraint dictionary to detect whether the implementation blueprint of the innovative algorithm contains unsupported numerical calculation logic. If the detection passes and the score exceeds the set passing threshold, the implementation blueprint of the innovative algorithm is determined to be feasible and is regarded as a theoretically feasible blueprint.
[0021] Preferably, the method for testing in a real hardware environment is as follows: based on the operator logic in the theoretically feasible blueprint, the corresponding basic operation code is retrieved from open-source code libraries or reference implementations; then, the basic operation code is semantically fused and syntactically corrected using a code generation model to generate a compression algorithm for the compression task; the target basic model is compressed using the currently generated compression algorithm, and then the compressed target basic model is tested on limited physical test hardware using a selected dataset; the test results are compared with the test results of the existing best comparable compression algorithm. If it is superior to the existing best comparable compression algorithm, the compression algorithm corresponding to the theoretically feasible blueprint is added as a new node to the evolutionary knowledge graph; otherwise, the compression algorithm corresponding to the theoretically feasible blueprint is recorded in the log of the high-scoring evolutionary path to form a closed-loop feedback.
[0022] An automatic generation system for large model compression algorithms, characterized by including: The evolutionary knowledge graph generation module is used to construct an algorithm logic network based on the evolutionary relationships between existing compression algorithms, which serves as an evolutionary knowledge graph. The optimization path evaluation module is used to take each edge chain containing multiple consecutive nodes in the evolutionary knowledge graph as an optimization path, and evaluate the matching degree between each optimization path and the compression task as the score of the optimization path. The high-score evolution path selection module is used to select an optimization path from the optimization paths with scores higher than a threshold as the high-score evolution path. The algorithm implementation blueprint generation module is used to generate an innovative algorithm implementation blueprint based on the high-scoring evolution path using a multi-agent system; The algorithm implementation blueprint evaluation module is used to review and quantitatively score the innovative algorithm implementation blueprints, and the innovative algorithm implementation blueprint with the highest score is taken as the theoretically feasible blueprint. The conversion and testing module is used to convert the theoretically feasible blueprint into executable code and test it in a real hardware environment. The output and update module is used to compare the test results with the test results of the existing best comparable compression algorithms. If the result is better than the existing best comparable compression algorithm, the compression algorithm corresponding to the theoretically feasible blueprint is added as a new node to the evolutionary knowledge graph; otherwise, the compression algorithm corresponding to the theoretically feasible blueprint is recorded in the log of the high-scoring evolution path to form a closed-loop feedback, and a new high-scoring evolution path is selected to generate the compression algorithm for the compression task.
[0023] A computing device, characterized in that it comprises: a processor and a memory storing a computer program, wherein the computer program, when run by the processor, executes the method described above.
[0024] A computer-readable storage medium, characterized in that it stores instructions that, when executed on a computer, cause the computer to perform the above-described method.
[0025] This invention constructs and utilizes an Evolutionary Knowledge Graph (EKG) as a structured historical innovation memory bank. By allowing agents to trace and expand historically validated optimization trajectories, blind random search is transformed into "directed algorithm synthesis" subject to strict physical constraints and historical logic constraints. This ensures that the generated compression algorithm is not only theoretically innovative (breaking through existing accuracy-efficiency Pareto fronts) but also fully complies with the strict resource constraints of specific hardware (such as extreme memory and bandwidth constraints) at the underlying physical level. It possesses high compilability and deployability, solving the problems of blind trial and error and lack of physical constraints in the generation logic of traditional automated search.
[0026] This invention overcomes the technical bottleneck of traditional model compression, which relies on manual heuristic design and blind parameter search. The core key points are as follows: 1. Structured construction and dynamic maintenance mechanism of evolutionary knowledge graphs (EKG) This method transforms unstructured historical compression into a graph structure; nodes contain structured metadata such as accuracy and hardware compatibility; edges include two evolutionary relationships: "quantitative improvement" and "conceptual inspiration"; and it possesses dynamic update capabilities with positive and negative feedback writing. This data structure, which uses the "trajectory of human scientific innovation" as the constraint basis for machine generation, is the fundamental solution to the "illusion" caused by blind search (bringing a beneficial effect of extremely high generation success rate).
[0027] 2. A Physically Constrained Algorithm Thinking Chain Retrieval and Extraction Method Instead of generating code from scratch (Tabula Rasa) for a large model, we first traverse, evaluate, and sample high-scoring "historical evolution paths" in the EKG based on the compression task and hardware constraints of the external input, and use them as context (algorithmic thought chain) to realize the retrieval and matching mechanism of "transforming random search into directed inference".
[0028] 3. Algorithm generation workflow for heterogeneous multi-agent collaboration (analysis-conceptualization-architecture) The division of labor and flow logic of the large model in the system is clearly defined: analysis agent (deconstructing historical logic) -> design agent (combining new constraints and divergent assumptions) -> architecture agent (outputting rigorous mathematical formulas and operator blueprints).
[0029] 4. A multi-dimensional automated peer review (AI Peer Review) mechanism that integrates underlying hardware constraints. The review process, implemented before code generation, uses a multi-dimensional scale that scores code based on "innovation, engineering feasibility, and hardware failure risk," and includes a "one-vote veto" mechanism for logic that does not support hardware physical computing. This mechanism yields the beneficial effect of "intercepting uncompileable / undeployable logic and significantly reducing the cost of physical verification computing power."
[0030] 5. Semantic code fusion and physical-level closed-loop feedback mechanism Based on the architecture blueprint, executable code is generated by retrieving and integrating open-source operator libraries. After testing on physical devices, the success / failure results are used as positive / negative weight signals and rewritten back to the EKG parent node path, thus realizing the self-evolving closed-loop characteristics of the system.
[0031] The advantages of this invention are as follows: 1. Fundamentally solves the "illusion" problem of automated code generation, ensuring high compilability and deployability of the underlying physical hardware. Existing large model code generation tools lack physical constraints and are prone to generating erroneous logic that prevents them from running. This invention extracts historically validated optimization trajectories as "CoT" through the evolutionary knowledge graph constructed in steps S100 and S200. This mechanism transforms aimless random search into targeted derivation constrained by rigorous logic and physical limitations; coupled with the stringent multi-dimensional peer review (AI Peer Review) in step S400, which has a "one-vote veto" mechanism for logic that does not support hardware physical computation, it greatly filters out infeasible theoretical designs, avoids wasting computational power in the physical verification stage, and ensures the absolute feasibility of the generated algorithm blueprint on real hardware compilers.
[0032] 2. Significantly shortens the R&D cycle and enables automated system design for complex model architectures. Traditional manual compression methods often reach the limits of human design when dealing with extremely complex models such as long context mechanisms or sparse routing (MoE). This invention, through the heterogeneous multi-agent pipeline of "analysis-conceptualization-architecture" in step S300, can compress the optimization trial-and-error process that would take months to derive manually into an extremely short evolution cycle of an automated system. The system can automatically overcome the barriers of historical methods and synthesize entirely new algorithmic strategies (such as adaptive weight allocation and KV cache width), greatly improving the R&D efficiency of underlying basic software.
[0033] 3. Deeply Empowering the Co-design of Software Algorithms, Integrated Circuits (ICs), and Advanced Memory Systems: Existing compression methods typically focus only on upper-layer weight pruning, neglecting the reliability of the underlying memory. The architecture agent of this invention deeply integrates the hardware and software collaboration between the algorithm and the Domain Specific Architecture (DSA) when outputting the blueprint. The generated algorithm not only achieves extreme memory compression but also generates non-intrusive, highly efficient execution logic at the memory system level. It demonstrates superior performance tuning and stable operation defense capabilities under real-world high-load workloads.
[0034] 4. Breaking through the existing Pareto front of accuracy-efficiency, effectively preventing model collapse under extreme compression regimes. Traditional heuristic quantization often leads to catastrophic degradation of the basic model's inference ability at extremely low bit widths (e.g., below 3 bits). The system of this invention, through closed-loop physical verification and EKG dynamic feedback in step S500, can autonomously discover error compensation mechanisms that human experts have not considered. Experimental data shows that the automatically generated algorithms of this invention (such as the joint quantization mechanism for dense models and the adaptive error recovery mechanism for sparse architectures) can strictly control information loss, greatly reducing the physical memory footprint of the model while making the model's accuracy-efficiency curve significantly better than the existing state-of-the-art (SOTA) design, occupying a higher Pareto front. Attached Figure Description
[0035] Figure 1 This is a flowchart of the method of the present invention.
[0036] Figure 2 This is a flowchart of a basic model compression algorithm based on multi-agent and evolutionary knowledge graphs.
[0037] Figure 3 Flowchart for knowledge graph construction methods.
[0038] Figure 4 A schematic diagram of an evolutionary knowledge graph and an attribute diagram of an evolutionary chain; (a) Partial schematic diagram of the evolutionary knowledge graph, (b) Definition and relationship of chains.
[0039] Figure 5 Automatically generate method flowcharts for compression methods based on multi-agent collaboration.
[0040] Figure 6 This is a system diagram of the present invention. Detailed Implementation
[0041] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0042] Terminology Explanation: Large Language Models (LLMs) and Foundation Models: Neural network models with a large number of parameters (such as GPT, Qwen, etc.) are the target objects of this invention for compression and deployment.
[0043] Mixture-of-Experts (MoE) architecture: a sparse neural network architecture that dynamically activates only a portion of the "expert" network, rather than activating all parameters in every inference. Traditional compression methods are highly prone to causing complete performance degradation when compressing MoE.
[0044] Key-Value Cache: A cache used to store historical states when large models are processing long text (long context) inference. The Q-Enhance algorithm automatically generated in this invention successfully solves the bottleneck of its explosive memory usage.
[0045] Cold start without prior knowledge (Tabula Rasa): This refers to the initial computational state of a system without any prior knowledge or historical experience. Existing automated search tools often operate in this state, leading to blind searches; this invention introduces EKG to break this state.
[0046] Pareto frontier: In multi-objective optimization (such as achieving both high accuracy and low memory usage), it is impossible to improve the optimal state boundary of one objective without compromising the other. The purpose of this invention is to break through existing frontiers and find better solutions.
[0047] Algorithmic Chain-of-Thought (CoT) refers to historically validated optimization paths with logically progressive relationships extracted from evolutionary knowledge graphs by a system, used to provide structured engineering context guidance for multi-agent systems.
[0048] This invention provides a method and system for automatically generating basic model compression algorithms based on multi-agent systems and evolutionary knowledge graphs. To achieve the above objectives, the core technical idea of this invention is to construct a structured knowledge graph from historically validated algorithm evolution trajectories. When a new model compression task is received, high-scoring evolutionary paths are extracted through graph retrieval as an "algorithm thought chain." Subsequently, using a heterogeneous multi-agent collaborative flow configured with different instruction tasks, this thought chain is analyzed, diverged, and its architecture reconstructed. Finally, a novel model compression algorithm that conforms to physical hardware constraints is automatically synthesized and validated.
[0049] like Figure 1 As shown, an embodiment of the present invention provides an automatic generation method for large model compression algorithms, the steps of which include: An algorithm logic network is constructed based on the evolutionary relationships among existing compression algorithms, serving as an evolutionary knowledge graph; Each edge chain containing multiple consecutive nodes in the evolutionary knowledge graph is used as an optimization path, and the matching degree between each optimization path and the compression task is evaluated as the score of the optimization path. Select one optimization path from the optimization paths whose scores are above the threshold as the high-score evolution path; The high-resolution evolution path is input into a multi-agent system, and the multi-agent system works together to perform reasoning analysis on the high-resolution evolution path and generate multiple innovative algorithm implementation blueprints. The implementation blueprints of the innovative algorithms are reviewed and quantitatively scored, and the implementation blueprint of the innovative algorithm with the highest score is taken as the theoretically feasible blueprint. The theoretically feasible blueprint was transformed into executable code and tested in a real hardware environment; The test results are compared with the test results of the existing best comparable compression algorithms. If the result is better than the existing best comparable compression algorithm, the compression algorithm corresponding to the theoretically feasible blueprint is added as a new node to the evolutionary knowledge graph; otherwise, the compression algorithm corresponding to the theoretically feasible blueprint is recorded in the log of the high-scoring evolution path to form a closed-loop feedback, and a new high-scoring evolution path is selected to generate the compression algorithm for the compression task.
[0050] like Figure 2-5 The method of one embodiment of the present invention specifically includes the following steps: S100: Construct and maintain an Evolutionary Knowledge Graph (EKG) This step aims to transform the unstructured historical compression algorithm into a structured algorithmic logic network, which will serve as an evolutionary knowledge graph for subsequent multi-agent generation.
[0051] S101: Node Definition: Establish algorithm nodes in a graph database (such as Neo4j). Each node represents a historical compression method and contains structured metadata. The metadata specifically includes: the numerical precision attributes of the compression method (such as w8a8, w4a16), hardware compatibility indicators (such as whether it supports domain-specific architectures DSA or specific tensor cores), and performance leap indicators relative to the parent node (such as memory reduction ratio, precision compensation value).
[0052] S102: Edge Relationship Establishment: Establish directed edges between nodes to define the evolutionary relationships between algorithms. Evolutionary relationships are specifically divided into two categories: one is "Quantitative Improvements," which represents direct upgrades on the same technical route (such as the introduction of learnable parameters); the other is "Conceptual Inspirations," which represents logical borrowing across technical branches.
[0053] S103: Dynamic Update Mechanism: This evolutionary knowledge graph is a dynamic network that receives feedback from subsequent steps S500. If the generated compression algorithm is successfully verified, it is added to the graph as a new "positive node"; if the verification fails, a negative feedback label (suppression signal) is recorded on the corresponding parent node path to adjust the subsequent retrieval weights.
[0054] S200: Evolutionary Path Retrieval and Scoring Based on Compression Tasks (Algorithm Thinking Chain Extraction) This step aims to transform blind parameter searching into historically grounded, targeted derivation.
[0055] S210: Task Constraint Input: The system receives compression tasks from external input.
[0056] S220: Global Graph Traversal and Scoring: A separate AI scoring module traverses all consecutive optimization paths (i.e., an edge chain containing multiple consecutive nodes) in the evolutionary knowledge graph. The scoring module calculates a relevance score for each optimization path based on its historical performance improvement, hardware compatibility, and matching degree with the current compression task.
[0057] S230: Thought Chain Sampling: The system sets a high confidence threshold and randomly samples a specific high-scoring evolutionary path (trajectory) from the set of paths with scores higher than the threshold. This high-scoring evolutionary path will be used as contextual corpus (i.e., "Algorithmic Chain-of-Thought") and input into the subsequent multi-agent collaborative system.
[0058] S300: Synthesis of Heterogeneous Multi-Agent Cooperative Algorithm (Core Generation Steps) This step transforms the extracted high-scoring evolutionary paths into entirely new algorithmic blueprints by configuring language model agents with different roles. Specific roles include analysis agents, conceptual agents, and architecture agents.
[0059] S310: Analyzer Agent's parsing logic: The Analyzer Agent receives the high-scoring evolution path selected in step S230 and performs logical deconstruction. Specifically, it extracts the specific mathematical mechanisms or structural changes behind each performance improvement in the high-scoring evolution path (e.g., "the shift from method A to method B is due to the introduction of outlier protection with activation awareness") and outputs a structured "mechanism diagnostic report".
[0060] S320: Ideator Agent's Divergent Hypothesis: The Ideator Agent receives the "Mechanism Diagnostic Report" and the "Compression Task" from step S210. Combining these two, the Ideator Agent performs divergent reasoning and proposes several "conceptual hypotheses" for the current compression task. For example, the outlier protection logic originally used for weights is migrated and extended to the quantization of large model KV Cache (key-value cache) for long contexts.
[0061] S330: Architect Agent Blueprint Generation: The Architect Agent receives the above "conceptual assumptions" and translates and formalizes them into a rigorous "algorithm implementation blueprint." This algorithm implementation blueprint must include specific mathematical formulas, quantization bit width allocation rules (such as group size, symmetric / asymmetric mapping), and underlying operator execution logic steps, and must not contain vague natural language descriptions.
[0062] S400: Automated Peer Review Based on Multidimensional Rules (AI Peer Review) This step aims to perform physical-level feasibility filtering on the generated algorithm implementation blueprint to prevent "illusion" or uncompileable flawed designs.
[0063] S410: Multidimensional Evaluation Scale: The Reviewer Agent scores the algorithm implementation blueprint according to a preset quantitative evaluation standard. The evaluation dimensions include and are assigned strict weights: innovativeness (0.25), engineering feasibility (0.25), implementation motivation (0.20), expected results (0.20), and hardware failure risk (0.10).
[0064] S420: Hard Constraints Lead to Veto: The review module contains a dictionary of physical constraints (e.g., certain types of hardware explicitly do not support floating-point operations at specific depths). If an algorithm implementation blueprint contains unsupported numerical calculation logic, or its weighted total score is lower than a preset passing threshold (e.g., 4.0 / 5.0), the algorithm implementation blueprint is directly discarded; only algorithm implementation blueprints that pass the review are placed into the "Theoretical Feasible Blueprint Candidate Pool" as theoretically feasible blueprints.
[0065] S500: Semantic Code Fusion and Closed-Loop Physical Verification This step transforms the theoretically feasible blueprint into executable code and tests it in a real hardware environment.
[0066] S510: Semantic Code Fusion Guided by a Large Model: Based on the operator logic in the theoretically feasible blueprint, the system retrieves the corresponding basic operation code (Kernels) from open-source code libraries or reference implementations. Then, using a code generation model, these code fragments are semantically fused and syntactically corrected to generate a compilable compression algorithm execution pipeline as the compression algorithm corresponding to the compression task.
[0067] S520: Real-world benchmarking: On limited physical test hardware, the accuracy and throughput of the target base model compressed by the currently generated compression algorithm are tested using specific datasets (such as WikiText, MMLU).
[0068] S530: Write-back Results (Feedback Loop): Compare the test results with the test results of the existing best comparable compression algorithm. If it is better than the existing best comparable compression algorithm, then add the compression algorithm corresponding to the theoretically feasible blueprint as a new node to the evolutionary knowledge graph; otherwise, record the low-scoring method generated by the review into the log of the high-scoring evolutionary path, forming a closed-loop feedback.
[0069] like Figure 6 As shown, an embodiment of the present invention provides an automatic generation system for large model compression algorithms, characterized in that it includes... The evolutionary knowledge graph generation module is used to construct an algorithm logic network based on the evolutionary relationships between existing compression algorithms, which serves as an evolutionary knowledge graph. The optimization path evaluation module is used to take each edge chain containing multiple consecutive nodes in the evolutionary knowledge graph as an optimization path, and evaluate the matching degree between each optimization path and the compression task as the score of the optimization path. The high-score evolution path selection module is used to select an optimization path from the optimization paths with scores higher than a threshold as the high-score evolution path. The algorithm implementation blueprint generation module is used to generate an innovative algorithm implementation blueprint based on the high-scoring evolution path using a multi-agent system; The algorithm implementation blueprint evaluation module is used to review and quantitatively score the innovative algorithm implementation blueprints, and the innovative algorithm implementation blueprint with the highest score is taken as the theoretically feasible blueprint. The conversion and testing module is used to convert the theoretically feasible blueprint into executable code and test it in a real hardware environment. The output and update module is used to compare the test results with the test results of the existing best comparable compression algorithms. If the result is better than the existing best comparable compression algorithm, the compression algorithm corresponding to the theoretically feasible blueprint is added as a new node to the evolutionary knowledge graph; otherwise, the compression algorithm corresponding to the theoretically feasible blueprint is recorded in the log of the high-scoring evolution path to form a closed-loop feedback, and a new high-scoring evolution path is selected to generate the compression algorithm for the compression task.
[0070] An embodiment of the present invention provides a computing device, characterized in that it includes: a processor and a memory storing a computer program, wherein the computer program is executed by the processor to perform the above-described method.
[0071] An embodiment of the present invention provides a computer-readable storage medium, characterized in that it stores instructions that, when executed on a computer, cause the computer to perform the above-described method.
[0072] Those skilled in the art can also use the following alternative solutions to achieve the same or similar inventive objectives. These alternative solutions should also be included within the scope of protection of this invention: 1. Alternative solutions for "Evolutionary Knowledge Graph (EKG) construction and storage" Preferred approach: Use a graph database (such as Neo4j) to build a graph containing nodes and directed edges.
[0073] Alternative Solution A (Vector Retrieval / RAG Replacement): Instead of using an explicit graph database, the metadata and evolutionary relationships of historical compression algorithms are transformed into high-dimensional text vectors and stored in a vector database. When extracting the "algorithm thought chain," the most relevant historical methods are retrieved as contextual corpus by calculating the cosine similarity (Retrieval-Augmented Generation, RAG) between the current task constraints and historical node vectors.
[0074] Alternative B (tree structure alternative): Construct the algorithm evolution path as a decision tree or Monte Carlo search tree (MCTS), and sample the path by calculating the upper bound of confidence (UCT) for each branch when searching the evolution path.
[0075] 2. Alternative solutions for "heterogeneous multi-agent cooperative synthesis (S300)" Preferred solution: Deploy three independent and clearly defined intelligent agents (analysis agent, conceptual agent, and architecture agent) to perform pipeline operations.
[0076] Alternative Solution A (Single Large Model + Chain-of-Thought Prompting): Instead of splitting into multiple physical or logical agents, a single, ultra-large-scale language model is used. By injecting it with "Chain-of-Thought Prompting" templates containing multi-step reasoning logic, the same model can complete the entire process of "feature deconstruction -> hypothesis formulation -> code blueprint output" in multiple rounds of dialogue.
[0077] Alternative Solution B (Generator-Adversarial Dual-Agent Alternative): The process is simplified to a two-node architecture: a "Generator" and a "Critic". The generator directly receives the EKG path and outputs a blueprint, while the critic is responsible for identifying errors and rejecting the work for rework. The algorithm synthesis is completed through internal adversarial game theory.
[0078] 3. Alternative solutions for "Multidimensional Automated Peer Review (S400)" Preferred approach: Use language models as reviewers to score and veto applications based on a pre-defined quantitative matrix (innovation, feasibility, etc.).
[0079] Alternative Option A (Cost / Proxy Model-Based Cost Assessment): Instead of using a language model for scoring, a lightweight cost prediction model (Cost / Proxy Model) is trained. The generated algorithm blueprint is input into this cost prediction model, which directly outputs the estimated memory usage and inference latency. If the estimated value exceeds the hardware constraint threshold, it is rejected outright.
[0080] Alternative Solution B (Formal Verification Alternative): Instead of relying on language model review for the legality of underlying operators, a formal verification tool (such as SMT Solver) is introduced to perform mathematical-level boundary overflow and deadlock detection on the generated quantization bit width allocation rules.
[0081] 4. Alternative solutions for "Closed-Loop Physical Verification (S500)" Preferred approach: Compile and run the code and test benchmarks on real physical test hardware (such as an actual GPU or a specific in-memory computing chip).
[0082] Alternative Solution A (Hardware Simulator-Based Verification): When generating compression algorithms for novel Domain-Specific Architecture (DSA) or Fully Homomorphic Encryption (TFHE) accelerators that have not yet been taped out, instead of relying on real physical hardware, the generated execution pipeline is connected to a cycle-accurate hardware simulator (such as Gem5) for performance profiling, and the latency and power consumption data output by the simulator are written back to the EKG as feedback signals.
[0083] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An automatic generation method for large model compression algorithms, comprising the following steps: An algorithm logic network is constructed based on the evolutionary relationships among existing compression algorithms, serving as an evolutionary knowledge graph; Each edge chain containing multiple consecutive nodes in the evolutionary knowledge graph is used as an optimization path, and the matching degree between each optimization path and the compression task is evaluated as the score of the optimization path. Select one optimization path from the optimization paths whose scores are above the threshold as the high-score evolution path; The high-resolution evolution path is input into a multi-agent system, and the multi-agent system works together to perform reasoning analysis on the high-resolution evolution path and generate multiple innovative algorithm implementation blueprints. The implementation blueprints of the innovative algorithms are reviewed and quantitatively scored, and the implementation blueprint of the innovative algorithm with the highest score is taken as the theoretically feasible blueprint. The theoretically feasible blueprint was transformed into executable code and tested in a real hardware environment; The test results are compared with the test results of the existing best comparable compression algorithms. If the result is better than the existing best comparable compression algorithm, the compression algorithm corresponding to the theoretically feasible blueprint is added as a new node to the evolutionary knowledge graph; otherwise, the compression algorithm corresponding to the theoretically feasible blueprint is recorded in the log of the high-scoring evolution path to form a closed-loop feedback, and a new high-scoring evolution path is selected to generate the compression algorithm for the compression task.
2. The method according to claim 1, characterized in that, The method for constructing the algorithm logic network is as follows: each existing compression method is treated as a node, which contains structured metadata; directed edges are established between nodes according to the evolutionary relationship between compression methods. The evolutionary relationship includes two types: direct upgrades on the same technical route and logical borrowing across technical branches.
3. The method according to claim 2, characterized in that, The metadata includes: the numerical precision attribute of the compression method, the hardware compatibility flag, and the performance leap index of the node corresponding to the compression method relative to its parent node.
4. The method according to claim 1, 2, or 3, characterized in that, The method of using an analytical agent to logically deconstruct the high-scoring evolution path is as follows: extract the specific mathematical mechanisms or structural changes behind each performance improvement in the high-scoring evolution path, and output a structured mechanism diagnostic report.
5. The method according to claim 1, 2, or 3, characterized in that, The method for generating an innovative algorithm implementation blueprint using a multi-agent system based on the high-scoring evolution path is as follows: An analytical agent is used to logically deconstruct the high-scoring evolution path to obtain a mechanism diagnostic report; a conceptual agent is used to perform divergent reasoning based on the mechanism diagnostic report and the compression task to propose multiple conceptual hypotheses for the compression task; and an architectural agent is used to transform the conceptual hypotheses into an innovative algorithm implementation blueprint.
6. The method according to claim 1, 2, or 3, characterized in that, The method for reviewing and quantifying the implementation blueprint of the innovative algorithm is as follows: the review agent scores the implementation blueprint of the innovative algorithm according to a preset quantitative evaluation standard to obtain the score of the implementation blueprint of the innovative algorithm; the evaluation dimensions of the quantitative evaluation standard include innovativeness, engineering feasibility, implementation motivation, expected results and hardware failure risk; the review module uses a physical constraint dictionary to detect whether the implementation blueprint of the innovative algorithm contains unsupported numerical calculation logic. If the detection passes and the score exceeds the set passing threshold, the implementation blueprint of the innovative algorithm is determined to be feasible and is regarded as a theoretically feasible blueprint.
7. The method according to claim 1, 2, or 3, characterized in that, The method for testing in a real hardware environment is as follows: based on the operator logic in the theoretically feasible blueprint, retrieve the corresponding basic operation code from the open source code library or reference implementation; Subsequently, a code generation model is used to perform semantic-level fusion and syntax correction on the basic operation code to generate the compression algorithm for the compression task. The target base model is compressed using the currently generated compression algorithm, and then the compressed target base model is tested on limited physical test hardware using the selected dataset. The test results are compared with the test results of the existing best comparable compression algorithms. If the compression algorithm is better than the existing best comparable compression algorithm, the compression algorithm corresponding to the theoretically feasible blueprint is added as a new node to the evolutionary knowledge graph; otherwise, the compression algorithm corresponding to the theoretically feasible blueprint is recorded in the log of the high-scoring evolutionary path to form a closed-loop feedback.
8. An automatic generation system for large model compression algorithms, characterized in that, include The evolutionary knowledge graph generation module is used to construct an algorithm logic network based on the evolutionary relationships between existing compression algorithms, which serves as an evolutionary knowledge graph. The optimization path evaluation module is used to take each edge chain containing multiple consecutive nodes in the evolutionary knowledge graph as an optimization path, and evaluate the matching degree between each optimization path and the compression task as the score of the optimization path. The high-score evolution path selection module is used to select an optimization path from the optimization paths with scores higher than a threshold as the high-score evolution path. The algorithm implementation blueprint generation module is used to generate an innovative algorithm implementation blueprint based on the high-scoring evolution path using a multi-agent system; The algorithm implementation blueprint evaluation module is used to review and quantitatively score the innovative algorithm implementation blueprints, and the innovative algorithm implementation blueprint with the highest score is taken as the theoretically feasible blueprint. The conversion and testing module is used to convert the theoretically feasible blueprint into executable code and test it in a real hardware environment. The output and update module is used to compare the test results with the test results of the existing best comparable compression algorithms. If the result is better than the existing best comparable compression algorithm, the compression algorithm corresponding to the theoretically feasible blueprint is added as a new node to the evolutionary knowledge graph; otherwise, the compression algorithm corresponding to the theoretically feasible blueprint is recorded in the log of the high-scoring evolution path to form a closed-loop feedback, and a new high-scoring evolution path is selected to generate the compression algorithm for the compression task.
9. A computing device, characterized in that, include: A processor, a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A storage instruction that, when executed on a computer, causes the computer to perform the method as described in any one of claims 1 to 7.