让AI代码推理能力在解题中不断进化,越算越聪明。
MARCO: Meta-Reflection with Cross-Referencing for Code Reasoning
- 通过元反思机制回顾解题路径,积累经验
- 引入跨代理参考,吸收他人解法与反馈
- 适合需要持续优化的代码生成与推理场景
大语言模型(LLMs)的推理能力是其解决复杂下游任务的核心。代码推理作为其中关键环节,涉及对编程语言的逻辑推演。本文探讨如何使LLM代理在每次解题后逐步变聪明,实现显著的累积性提升。现有研究多采用静态视角,使用固定模型解决单个问题;而本文提出动态演进框架MARCO(Meta-Reflection with Cross-Referencing),借鉴人类认知发展机制,融合知识积累与经验共享。具体而言,通过元反思机制回溯当前问题的推理路径,提取可复用的知识;同时通过跨参考机制,整合其他代理的解法与反馈,优化当前推理过程。在多个代码推理数据集上的实验表明,MARCO能有效提升模型性能。
原文摘要 · Abstract (English)
The ability to reason is one of the most fundamental capabilities of large language models (LLMs), enabling a wide range of downstream tasks through sophisticated problem-solving. A critical aspect of this is code reasoning, which involves logical reasoning with formal languages (i.e., programming code). In this paper, we enhance this capability of LLMs by exploring the following question: how can an LLM agent become progressively smarter in code reasoning with each solution it proposes, thereby achieving substantial cumulative improvement? Most existing research takes a static perspective, focusing on isolated problem-solving using frozen LLMs. In contrast, we adopt a cognitive-evolving perspective and propose a novel framework named Meta-Reflection with Cross-Referencing (MARCO) that enables the LLM to evolve dynamically during inference through self-improvement. From the perspective of human cognitive development, we leverage both knowledge accumulation and lesson sharing. In particular, to accumulate knowledge during problem-solving, we propose meta-reflection that reflects on the reasoning paths of the current problem to obtain knowledge and experience for future consideration. Moreover, to effectively utilize the lessons from other agents, we propose cross-referencing that incorporates the solution and feedback from other agents into the current problem-solving process. We conduct experiments across various datasets in code reasoning, and the results demonstrate the effectiveness of MARCO.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。