无需测试用例,用知识蒸馏生成科学代码。
No Test Cases, No Problem: Distillation-Driven Code Generation for Scientific Workflows

- 用师生蒸馏+领域示例生成代码,不依赖执行反馈。
- 在SciCode上准确率、可执行性、精度均超越现有方法。
- 适合无测试用例的科学计算场景,轻量模型即可用。
现有基于多智能体的大语言模型代码生成框架通常依赖输入/输出测试用例进行执行反馈并迭代优化。然而,这在科学工作流中不适用,因为输入/输出测试用例不存在,且生成它们需解决待解问题本身。为此,我们提出MOSAIC,一种无需训练的多智能体框架,可在无I/O监督下生成科学代码。MOSAIC采用学生-教师知识蒸馏机制,通过领域特定示例和结构化问题分解来指导生成。为缓解链式子问题间的幻觉,引入统一上下文窗口(CCW)以维持跨智能体推理一致性。在SciCode基准上的实验表明,MOSAIC在准确性、可执行性和数值精度上均优于现有方法,且仅使用轻量级模型。
原文摘要 · Abstract (English)
Existing multi-agent Large Language Model (LLM) frameworks for code generation typically use execution feedback and improve iteratively using Input/Output (I/O) test cases. However, this does not work for scientific workflows, where I/O test cases do not exist, and generating them requires solving the very problem at hand. To address this, we introduce MOSAIC, a training-free multi-agent framework for scientific code generation without I/O supervision. Instead of execution feedback, MOSAIC employs a student-teacher knowledge distillation framework that grounds generation through domain-specific examples and structured problem decomposition. To further mitigate hallucinations across chained subproblems, we introduce a Consolidated Context Window (CCW) for maintaining consistent reasoning across agents. Experiments on the SciCode benchmark show that MOSAIC improves accuracy, executability, and numerical precision over existing approaches while relying on lightweight models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。