arXiv:2508.16713cs.SEcs.AI2025-08被引 5

用大模型辅助高能物理代码开发,提升文档生成与代码重构效率。

CelloAI: Leveraging Large Language Models for HPC Software Development in High Energy Physics

  • 基于检索增强生成的本地化编码助手,支持代码注释与理解。
  • 在ATLAS/CMS/DUNE项目中验证,提升代码生成准确率与可读性。
  • 适合高能物理领域科研人员,保障数据隐私与科学计算安全。

下一代高能物理实验将产生空前规模的数据,需融合高性能计算(HPC)与传统高吞吐计算。然而,现有科学代码库存在架构迁移难、文档稀疏等问题,阻碍了HPC的应用。本文提出CelloAI,一个本地部署的编码助手,利用大语言模型(LLM)结合检索增强生成(RAG)技术,支持高能物理代码的文档生成与代码编写。系统通过从论文、海报、演示文稿等RAG来源中检索信息,自动生成函数/类的Doxygen风格注释,提供文件级摘要,并支持交互式代码问答。在代码生成方面,采用语法感知分块策略,在嵌入时保留语法边界,提高大代码库中的检索精度;集成调用图知识,保持依赖关系感知,提供性能优化与精准重构建议。我们在ATLAS、CMS和DUNE的真实项目上评估了不同嵌入模型的检索效果,结果表明该系统显著提升代码理解能力,支持可靠生成,同时满足科学计算所需的透明性与安全性要求。

原文摘要 · Abstract (English)

Next-generation High Energy Physics (HEP) experiments will generate unprecedented data volumes, necessitating High Performance Computing (HPC) integration alongside traditional high-throughput computing. However, HPC adoption in HEP is hindered by the challenge of porting legacy software to heterogeneous architectures and the sparse documentation of these complex scientific codebases. We present CelloAI, a locally hosted coding assistant that leverages Large Language Models (LLMs) with retrieval-augmented generation (RAG) to support HEP code documentation and generation. This local deployment ensures data privacy, eliminates recurring costs and provides access to large context windows without external dependencies. CelloAI addresses two primary use cases, code documentation and code generation, through specialized components. For code documentation, the assistant provides: (a) Doxygen style comment generation for all functions and classes by retrieving relevant information from RAG sources (papers, posters, presentations), (b) file-level summary generation, and (c) an interactive chatbot for code comprehension queries. For code generation, CelloAI employs syntax-aware chunking strategies that preserve syntactic boundaries during embedding, improving retrieval accuracy in large codebases. The system integrates callgraph knowledge to maintain dependency awareness during code modifications and provides AI-generated suggestions for performance optimization and accurate refactoring. We evaluate CelloAI using real-world HEP applications from ATLAS, CMS, and DUNE experiments, comparing different embedding models for code retrieval effectiveness. Our results demonstrate the AI assistant's capability to enhance code understanding and support reliable code generation while maintaining the transparency and safety requirements essential for scientific computing environments.

代码生成大模型高能物理RAG

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