arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.22626cs.AI
收藏

SwiftSolve:面向竞赛编程的自迭代、复杂度感知多智能体框架

SwiftSolve: A Self-Iterative, Complexity-Aware Multi-Agent Framework for Competitive Programming

Algoverse Research(Algoverse研究机构);UC Berkeley(加州大学伯克利分校);TU Darmstadt(德意志图林根大学);Zuse School ELIZA(Zuse学校ELIZA)

Adhyayan Veer Singh, Aaron Shen, Brian Law, Ahmed Ismail, Jonas Rohweder, Sean O'Brien, Kevin Zhu

AI总结:

SwiftSolve 提出复杂度感知多智能体框架,通过规划、剖析与复杂度引导修复,在竞赛编程中提升效率,运行级成功率从 52.6% 提升至 73.1%。

摘要:

仅保证正确性是不够的:大语言模型生成的程序经常能通过单元测试,却违反竞赛的时间或内存限制。我们提出 SwiftSolve,一个面向竞赛编程的复杂度感知多智能体系统,它将算法规划与经验性性能剖析及复杂度引导的修复相结合。我们将竞赛编程视为一个软件环境,其中专门的智能体充当程序员,各自承担规划、编码、剖析和复杂度分析等角色。规划器提出算法草图;确定性静态剪枝器过滤高风险计划;编码器生成 ISO C++17 代码;剖析器在固定输入规模计划表上编译并执行候选程序,记录墙钟时间和峰值内存;复杂度分析器拟合对数-对数增长(s, R2),并带有大语言模型回退机制,以分配复杂度类别并将针对性补丁分派给规划器或编码器。智能体通过带类型、带版本的 JSON 进行通信;控制器强制执行迭代上限和收益递减停止规则。在 POSIX 沙箱(2 秒 / 256-512 MB)中对 26 个问题(16 个 BigO,10 个 Codeforces Div. 2)进行评估,SwiftSolve 在首次尝试时达到 pass@1 = 61.54%(16/26),Solved@<=3 = 80.77%,且延迟变化很小(每次尝试平均从 11.96 秒到 12.66 秒)。总体运行级成功率为 73.08%,平均耗时 12.40 秒。失败主要受资源限制,表明是效率问题而非逻辑错误。与 Claude Opus 4 相比,SwiftSolve 将运行级成功率从 52.6% 提升至 73.1%,但运行时开销约为 2 倍(12.4 秒对比 6.8 秒)。除正确性(pass@k)外,我们还报告了效率指标(针对运行时和内存的 eff@k、TLE 或 MLE 的发生率以及 BigO 上的复杂度拟合准确率),证明剖析和复杂度引导的重规划在保持准确性的同时减少了低效问题。

英文摘要:

Correctness alone is insufficient: LLM-generated programs frequently satisfy unit tests while violating contest time or memory budgets. We present SwiftSolve, a complexity-aware multi-agent system for competitive programming that couples algorithmic planning with empirical profiling and complexity-guided repair. We frame competitive programming as a software environment where specialized agents act as programmers, each assuming roles such as planning, coding, profiling, and complexity analysis. A Planner proposes an algorithmic sketch; a deterministic Static Pruner filters high-risk plans; a Coder emits ISO C++17; a Profiler compiles and executes candidates on a fixed input-size schedule to record wall time and peak memory; and a Complexity Analyst fits log-log growth (s, R2) with an LLM fallback to assign a complexity class and dispatch targeted patches to either the Planner or Coder. Agents communicate via typed, versioned JSON; a controller enforces iteration caps and diminishing returns stopping. Evaluated on 26 problems (16 BigO, 10 Codeforces Div. 2) in a POSIX sandbox (2 s / 256-512 MB), SwiftSolve attains pass@1 = 61.54% (16/26) on the first attempt and Solved@<=3 = 80.77% with marginal latency change (mean 11.96 s to 12.66 s per attempt). Aggregate run-level success is 73.08% at 12.40 s mean. Failures are predominantly resource-bound, indicating inefficiency rather than logic errors. Against Claude Opus 4, SwiftSolve improves run-level success (73.1% vs 52.6%) at approximately 2x runtime overhead (12.4 s vs 6.8 s). Beyond correctness (pass@k), we report efficiency metrics (eff@k for runtime and memory, incidence of TLE or MLE, and complexity fit accuracy on BigO), demonstrating that profiling and complexity-guided replanning reduce inefficiency while preserving accuracy.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑