This paper presents CodeRefine, a novel framework for automatically transforming research paper methodologies into functional code using Large Language Models (LLMs). Our multi-step approach first extracts and summarizes key text chunks from papers, analyzes their code relevance, and creates a knowledge graph using a predefined ontology. Code is then generated from this structured representation and enhanced through a proposed retrospective retrieval-augmented generation approach. CodeRefine addresses the challenge of bridging theoretical research and practical implementation, offering a more accurate alternative to LLM zero-shot prompting. Evaluations on diverse scientific papers demonstrate CodeRefine's ability to improve code implementation from the paper, potentially accelerating the adoption of cutting-edge algorithms in real-world applications.
翻译:本文提出CodeRefine,一种利用大语言模型自动将研究论文方法论转化为功能代码的新型框架。我们的多步骤方法首先从论文中提取并总结关键文本块,分析其代码相关性,并利用预定义本体构建知识图谱。随后基于该结构化表示生成代码,并通过所提出的回溯检索增强生成方法进行优化。CodeRefine解决了理论研究和实际实现之间的衔接难题,为大语言模型零样本提示方法提供了更准确的替代方案。在多样化学术论文上的评估表明,CodeRefine能够改进论文代码实现,可能加速前沿算法在实际应用中的推广。