arXiv:2505.03906cs.DCcs.LG2025-05被引 3

用多智能体系统实时检索最新优化方法,提升LLM生成高性能计算代码的效率。

MARCO: Multi-Agent Code Optimization with Real-Time Knowledge Integration for High-Performance Computing

  • 分设生成与评估智能体,通过反馈循环迭代优化代码。
  • 相比单用Claude 3.5 Sonnet,平均提速14.6%;加网络搜索后提升30.9%。
  • 适合需要高效代码优化的研发人员,尤其关注HPC性能调优者。

大型语言模型(LLMs)虽已革新软件开发,但在高性能计算(HPC)领域仍受限。HPC代码需针对并行性、内存效率及架构特性进行专门优化,通用LLM常忽略这些需求。本文提出MARCO(多智能体实时代码优化器),采用专用多智能体架构增强LLM生成的HPC代码。该框架分离代码生成与性能评估智能体,并通过反馈回路持续优化。核心创新在于集成网络搜索组件,可实时从最新会议论文中获取优化技术,弥补预训练模型的知识滞后。在LeetCode 75题集上的评估显示,MARCO相较Claude 3.5 Sonnet平均减少14.6%运行时间;引入网络搜索后,性能较基础版提升30.9%。结果表明,多智能体系统能有效应对HPC代码生成的特殊需求,提供无需领域微调的低成本替代方案。

原文摘要 · Abstract (English)

Large language models (LLMs) have transformed software development through code generation capabilities, yet their effectiveness for high-performance computing (HPC) remains limited. HPC code requires specialized optimizations for parallelism, memory efficiency, and architecture-specific considerations that general-purpose LLMs often overlook. We present MARCO (Multi-Agent Reactive Code Optimizer), a novel framework that enhances LLM-generated code for HPC through a specialized multi-agent architecture. MARCO employs separate agents for code generation and performance evaluation, connected by a feedback loop that progressively refines optimizations. A key innovation is MARCO's web-search component that retrieves real-time optimization techniques from recent conference proceedings and research publications, bridging the knowledge gap in pre-trained LLMs. Our extensive evaluation on the LeetCode 75 problem set demonstrates that MARCO achieves a 14.6\% average runtime reduction compared to Claude 3.5 Sonnet alone, while the integration of the web-search component yields a 30.9\% performance improvement over the base MARCO system. These results highlight the potential of multi-agent systems to address the specialized requirements of high-performance code generation, offering a cost-effective alternative to domain-specific model fine-tuning.

代码优化多智能体HPC实时知识

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。