论文精选

QuSema:用量子知识增强智能体检测量子库中的静默 Bug

QuSema: Detecting Silent Bugs in Quantum Libraries via Quantum-knowledge-enhanced Agents

精选理由

用大模型智能体给 Qiskit、PennyLane 找不报错的隐藏 Bug,成绩压过 Claude Code,还挖出 40 个新 Bug,做量子开发的朋友可以看看。

QuSema 是一个面向量子计算库的自主测试智能体,把量子语义和文档约束作为源码级语义 oracle,判断合法输入是否会产生无效输出。它通过循环检查 API 文档和源码、推断量子操作的预期行为,再生成可执行测试来验证偏差。在 Qiskit 和 PennyLane 上的 20 个历史静默 Bug 基准中,其平均 Bug 定位数超过 Claude Code 和 Codex,DeepSeek 配置的成本还低于 Claude Code。QuSema 共发现 40 个经开发者确认的新 Bug,其中 30 个为不报错的静默 Bug。

原文 · arXiv: DeepSeek

QuSema: Detecting Silent Bugs in Quantum Libraries via Quantum-knowledge-enhanced Agents

Quantum libraries are now critical infrastructure for quantum algorithm development, yet their correctness remains difficult to test. Existing testing techniques mainly rely on failure-based or comparison-based oracles, exposing bugs only when executions fail, violate runtime checks, or disagree with another implementation. Their applicability is limited when suitable execution-based oracles are unavailable, leaving some silent bugs undetected. Such missed bugs can produce incorrect results that propagate into experimental conclusions, simulation studies, and algorithmic designs. Here we present QuSema, an autonomous testing agent for finding silent bugs in quantum libraries. QuSema uses constraints from quantum semantics and documentation as a source-level semantic oracle to assess whether implementation logic can produce invalid outputs from valid inputs. It operates through an agentic loop that repeatedly inspects library API documentation and source code, reasons about the intended behavior of quantum operations, identifies potential semantic deviations, and validates them by generating executable tests through library APIs. Guided by quantum-domain reasoning, QuSema turns high-level behavioral mismatches into concrete, user-triggerable bug reports, enabling it to uncover non-crash defects. We implement QuSema for Qiskit and PennyLane. On a benchmark of 20 historical silent bugs, QuSema achieves higher mean bug relocation counts than Claude Code and Codex, with the DeepSeek configuration costing less than Claude Code. QuSema also discovers 40 previously unknown bugs confirmed by the developers, including 30 silent bugs.