arXiv:2509.10946cs.SEcs.AI2025-09中稿 · publication in Com…

LLM生成嵌入式机器学习代码常出错,且问题难被发现。

When the Code Autopilot Breaks: Why LLMs Falter in Embedded Machine Learning

  • 构建自动流水线验证LLM在嵌入式ML中的代码生成表现
  • 发现格式错误与运行时破坏性代码导致失败率上升
  • 提出错误分类体系,适合关注AI工程可靠性的研究者

大型语言模型(LLMs)正被用于自动化嵌入式机器学习工作流中的软件生成,但其输出常无声失败或行为异常。本文基于一个协调数据预处理、模型转换和设备端推理代码生成的自动驾驶框架,实证研究了LLM驱动的机器学习流水线中的故障模式。结果表明,提示格式、模型行为及结构假设会显著影响成功率与故障特征,而这些往往无法被标准验证流程检测到。分析揭示了多种易出错行为,包括因格式引发的误解释,以及虽能编译但破坏下游运行的代码。我们构建了故障类别分类体系,并在多个LLM上分析错误,识别出共性根源与系统脆弱性。尽管研究聚焦特定设备,但揭示了更广泛的LLM代码生成挑战。最后讨论了提升可靠性与可追溯性的方向。

原文摘要 · Abstract (English)

Large Language Models (LLMs) are increasingly used to automate software generation in embedded machine learning workflows, yet their outputs often fail silently or behave unpredictably. This article presents an empirical investigation of failure modes in LLM-powered ML pipelines, based on an autopilot framework that orchestrates data preprocessing, model conversion, and on-device inference code generation. We show how prompt format, model behavior, and structural assumptions influence both success rates and failure characteristics, often in ways that standard validation pipelines fail to detect. Our analysis reveals a diverse set of error-prone behaviors, including format-induced misinterpretations and runtime-disruptive code that compiles but breaks downstream. We derive a taxonomy of failure categories and analyze errors across multiple LLMs, highlighting common root causes and systemic fragilities. Though grounded in specific devices, our study reveals broader challenges in LLM-based code generation. We conclude by discussing directions for improving reliability and traceability in LLM-powered embedded ML systems.

大模型嵌入式代码生成可靠性

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