Table of Contents
Fetching ...

Software Defined Vehicle Code Generation: A Few-Shot Prompting Approach

Quang-Dung Nguyen, Tri-Dung Tran, Thanh-Hieu Chu, Hoang-Loc Tran, Xiangwei Cheng, Dirk Slama

TL;DR

This work tackles SDV code generation by leveraging prompt engineering rather than fine-tuning proprietary LLMs. It introduces a system-prompt–driven approach that embeds VSS API knowledge and the digital.auto Playground to steer LLMs toward executable SDV code, accompanied by a bespoke SDV code-generation benchmark. Empirical results across multiple models show that few-shot prompting with system prompts yields domain-aligned, executable code and substantial improvements across CodeBLEU, CodeBERTScore, ROUGE-L, and ChrF. The contributions include a publicly available benchmark and a practical pathway for rapid SDV prototyping, highlighting the potential of prompt-based adaptation for domain-specific software development in automotive contexts.

Abstract

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.

Software Defined Vehicle Code Generation: A Few-Shot Prompting Approach

TL;DR

This work tackles SDV code generation by leveraging prompt engineering rather than fine-tuning proprietary LLMs. It introduces a system-prompt–driven approach that embeds VSS API knowledge and the digital.auto Playground to steer LLMs toward executable SDV code, accompanied by a bespoke SDV code-generation benchmark. Empirical results across multiple models show that few-shot prompting with system prompts yields domain-aligned, executable code and substantial improvements across CodeBLEU, CodeBERTScore, ROUGE-L, and ChrF. The contributions include a publicly available benchmark and a practical pathway for rapid SDV prototyping, highlighting the potential of prompt-based adaptation for domain-specific software development in automotive contexts.

Abstract

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.

Paper Structure

This paper contains 13 sections, 3 figures, 3 tables.

Figures (3)

  • Figure 1: An Overview of our proposed system prompt structure.
  • Figure 2: API Description Sample.
  • Figure 3: Few-Shot Prompting Delivers Superior Responses Compared to Zero-Shot Prompting