Skip to content
Open access

Multi-SALLM: a multilingual security assessment of generated code

Aug 2026 · International Conference on Automated Software Engineering · Vol 33 · 0 citations · 49 references

TL;DR

Multi-SALLM, a benchmarking framework designed to systematically evaluate Large Language Models’ ability to generate secure code, reveals three key findings: functional correctness and security are closely related but not equivalent, and sampling strategy is a critical risk factor.

Abstract

As Large Language Models (LLMs) become increasingly integrated into software engineers’ daily workflows, it is critical to ensure the code they generate is not just functionally correct but also secure. While LLMs can boost developer productivity, prior empirical studies have shown that they often produce insecure code. This issue stems from two key factors. First, the datasets commonly used to evaluate LLMs don’t accurately reflect real-world software engineering tasks where security is a concern. Instead, they tend to focus on competitive programming problems or classroom-style exercises, which lack the complexity and security risks of production code integrated into larger systems. Second, current evaluation metrics mostly emphasize functional correctness and overlook security aspects altogether. To address these gaps, we introduce Multi-SALLM, a benchmarking framework designed to systematically evaluate LLMs’ ability to generate secure code. The framework includes three main components: (1) a novel dataset of security-focused Python, Java, and C++ prompts translated into 23 natural languages, (2) automated assessment techniques for analyzing generated code, and (3) new metrics that assess models from the perspective of secure code generation. Our empirical evaluation of four state-of-the-art LLMs (StarCoder2, Qwen2.5-Coder, GPT-4o-Mini, Gemini-2.5-Flash) reveals three key findings. First, functional correctness and security are closely related but not equivalent. GPT-4o-Mini achieves the highest pass@k and also exhibits high vulnerable@k, largely because it produces more compilable and analyzable outputs; in contrast, models that appear safer often do so due to lower functional yield rather than consistently secure generation. Second, programming language has a stronger impact than natural language: performance is broadly stable across the 23 natural languages and does not alter relative model rankings, whereas the target programming language introduces substantial variation, with Java consistently lagging behind Python and C++. Third, sampling strategy is a critical risk factor: increasing temperature and k increase the likelihood of obtaining a correct solution but also increase vulnerable@k and sharply reduce security@k, indicating that broader exploration systematically surfaces more insecure variants.

Read PDF

Similar papers

Open access Jul 2026

Can Language Models Generate Secure Terraform Code? A Security-Focused Benchmark Using Static Analysis

An empirical benchmark evaluating whether LLMs and SLMs can generate security-compliant AWS Terraform configurations suggests that prompt design is a critical factor, highlighting the need for a proper pipeline for developing and validating LLM-assisted secure IaC generation.

Francis Luis Santos Vargas, R. Mansilha, Diego Kreutz · 0 citations
Book Open access Jul 2026

Evaluating and Improving the Quality of LLM-Generated Code

This tutorial introduces a reusable, end-to-end evaluation pipeline grounded in empirical software engineering practices, focusing on post-generation validation rather than prompt design, allowing for validating AI-generated code in modern development workflows.

Glaucia Melo, Jessica Pourleyli, Genevieve Caumartin et al. · 0 citations
#software testing Preprint Aug 2026

Benchmarking the Titans: A Multi-Dimensional Empirical Evaluation of LLM Code Generation Quality in the .NET Ecosystem

An automated, multi-dimensional evaluation framework for C# code generation, applying it to four state-of-the-art LLMs: GPT, Gemini, Claude, and Grok is presented and a substantial gap between correctness and quality attributes is revealed.

Seyed Mohammad Mahdi Ghalandarian, Majid Bazargani, Masoumeh Taromirad · 0 citations
Preprint Aug 2026

Unreliable in Practice? A Comprehensive Study of Errors in LLM-Generated Code

It is observed that generated code often omits basic input validation or memory-safety checks, which can lead to overflows, resource exhaustion, or other reliability/security issues, and even the largest models frequently make simple mistakes.

Rodrigo Pato Nogueira, Marco Vieira, João R. Campos · 0 citations
Open access Jul 2026

PROBE: Benchmarking code generation in large language models

The findings show that, while LLMs achieve promising results, they struggle with harder problems and with programming languages that have fewer available resources for training, and they often fail due to fundamental and easily avoidable errors that underscore the unreliability of automatically generated code.

Rodrigo Pato Nogueira, Marco Vieira, João R. Campos · 1 citation