# Large Language Models in Code Co-generation for Safe Autonomous Vehicles

arXiv: https://arxiv.org/abs/2505.19658 · HTML: https://mlsanity.com/paper/2505.19658/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- Placed in Large language models for driving, one of 9 directions in End-to-end autonomous driving.
- Builds on 8 of its 26 references that are in the map.
- First posted on arXiv 26 May 2025.

## Placed in

- End-to-end autonomous driving / [Large language models for driving](https://mlsanity.com/driving/large-language-models-for-driving/)

## Builds on (most cited first, 8 of 8)

- [Don't Make Your LLM an Evaluation Benchmark Cheater](https://mlsanity.com/paper/2311.01964/) (2023)
- [Using Large Language Models to Generate JUnit Tests: An Empirical Study](https://mlsanity.com/paper/2305.00418/) (2023)
- [Fully Autonomous Programming with Large Language Models](https://mlsanity.com/paper/2304.10423/) (2023)
- [Engineering Safety Requirements for Autonomous Driving with Large Language Models](https://mlsanity.com/paper/2403.16289/) (2024)
- [Exploring Human-AI Collaboration in Agile: Customised LLM Meeting Assistants](https://mlsanity.com/paper/2404.14871/) (2024)
- [Top Pass: Improve Code Generation by Pass@k-Maximized Code Ranking](https://mlsanity.com/paper/2408.05715/) (2024)
- [Correlation of Software-in-the-Loop Simulation with Physical Testing for Autonomous Driving](https://mlsanity.com/paper/2406.03040/) (2024)
- [LLMs Can Check Their Own Results to Mitigate Hallucinations in Traffic Understanding Tasks](https://mlsanity.com/paper/2409.12580/) (2024)

## Built on by (most cited first, 1 of 1)

- [LLM-Empowered Functional Safety and Security by Design in Automotive Systems](https://mlsanity.com/paper/2601.02215/) (2026)

## Abstract (arXiv)

Software engineers in various industrial domains are already using Large Language Models (LLMs) to accelerate the process of implementing parts of software systems. When considering its potential use for ADAS or AD systems in the automotive context, there is a need to systematically assess this new setup: LLMs entail a well-documented set of risks for safety-related systems' development due to their stochastic nature. To reduce the effort for code reviewers to evaluate LLM-generated code, we propose an evaluation pipeline to conduct sanity-checks on the generated code. We compare the performance of six state-of-the-art LLMs (CodeLlama, CodeGemma, DeepSeek-r1, DeepSeek-Coders, Mistral, and GPT-4) on four safety-related programming tasks. Additionally, we qualitatively analyse the most frequent faults generated by these LLMs, creating a failure-mode catalogue to support human reviewers. Finally, the limitations and capabilities of LLMs in code generation, and the use of the proposed pipeline in the existing process, are discussed.
