用少量示例提示让大模型高效生成汽车软件代码
Software Defined Vehicle Code Generation: A Few-Shot Prompting Approach
- 仅用系统提示和优化结构,无需训练即可引导大模型生成汽车代码
- 少样本提示策略在代码生成任务中表现最佳,准确率显著提升
- 适合汽车软件开发者快速构建原型,降低对模型架构的依赖
软件定义汽车(SDV)的兴起标志着汽车产业的范式转变,软件成为定义车辆功能的核心。开发专用应用需要高效工具以加速代码生成。近年来,通用大语言模型(LLM)展现出变革潜力,但受限于专有模型架构的访问权限,难以适配如SDV代码生成等特定任务。本研究提出使用提示(prompt)作为与LLM交互的基本策略,通过精心设计的提示结构,在不进行训练或访问底层模型的前提下,有效引导模型输出。研究在多个模型上开展大量实验,采用不同提示技术,并基于自建基准测试评估其在生成SDV代码方面的性能。结果表明,采用少样本提示策略的模型在量化指标上优于其他方法,能更准确地匹配预期输出。
原文摘要 · Abstract (English)
The emergence of Software-Defined Vehicles (SDVs) marks a paradigm shift in the automotive industry, where software now plays a pivotal role in defining vehicle functionality, enabling rapid innovation of modern vehicles. Developing SDV-specific applications demands advanced tools to streamline code generation and improve development efficiency. In recent years, general-purpose large language models (LLMs) have demonstrated transformative potential across domains. Still, restricted access to proprietary model architectures hinders their adaption to specific tasks like SDV code generation. In this study, we propose using prompts, a common and basic strategy to interact with LLMs and redirect their responses. Using only system prompts with an appropriate and efficient prompt structure designed using advanced prompt engineering techniques, LLMs can be crafted without requiring a training session or access to their base design. This research investigates the extensive experiments on different models by applying various prompting techniques, including bare models, using a benchmark specifically created to evaluate LLMs' performance in generating SDV code. The results reveal that the model with a few-shot prompting strategy outperforms the others in adjusting the LLM answers to match the expected outcomes based on quantitative metrics.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。