arXiv:2507.19904cs.SEcs.AI2025-07

首个评估大模型跨语言代码生成能力的基准测试

CrossPL: Evaluating Large Language Models on Cross Programming Language Code Generation

  • 基于156个有限状态机分析万级仓库,构建跨语言互操作任务集
  • 14个通用模型最高仅32.7%正确率,6个代码模型也表现不佳
  • 适合研究多语言协同开发、系统集成的大模型方向

随着大语言模型(LLMs)在软件工程中的深入应用,一个关键能力仍被忽视:生成可实现跨编程语言(CPL)互操作的正确代码。这一能力对通过进程间通信(IPC)集成多语言组件的复杂系统至关重要。为此,我们提出CrossPL,首个系统性评估LLMs跨语言互操作代码生成能力的基准。CrossPL包含1,982个围绕IPC的任务,覆盖六种常用编程语言和七种代表性跨语言技术。该基准通过分析19,169个多语言GitHub仓库(使用156个手工设计的有限状态机),并利用基于LLM的流水线自动提取跨语言代码片段、生成任务指令并验证功能正确性构建而成。我们在14个主流通用型大模型和6个代码专用型大模型上进行评估,采用基于有限状态机的验证方法。结果表明,即使表现最好的模型在跨语言场景下也仅达32.7%正确率,凸显该领域亟需更针对性的研究。基准与代码已公开于https://anonymous.4open.science/r/crosspl-2814。

原文摘要 · Abstract (English)

As large language models (LLMs) become increasingly embedded in software engineering workflows, a critical capability remains underexplored: generating correct code that enables cross-programming-language (CPL) interoperability. This skill is essential for building complex systems that integrate components written in multiple languages via mechanisms like inter-process communication (IPC). To bridge this gap, we present CrossPL, the first benchmark designed to systematically evaluate LLMs' ability to generate CPL-interoperating code. CrossPL comprises 1,982 tasks centered around IPC, covering six widely-used programming languages and seven representative CPL techniques. We construct this benchmark by (i) analyzing 19,169 multi-language GitHub repositories using 156 hand-crafted finite state machines (FSMs), and (ii) developing an LLM-based pipeline that automatically extracts CPL code snippets, generates task instructions, and validates functional correctness. We evaluate 14 state-of-the-art general-purpose LLMs and 6 code-oriented LLMs released in the past three years on CrossPL via FSM-based validation. Results reveal that even the best-performing models struggle with CPL scenarios, underscoring the need for more targeted research in this space. Our benchmark and code are available at: https://anonymous.4open.science/r/crosspl-2814.

跨语言生成代码生成LLM评测IPC

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