mlsanityData to 14 Oct 2026

Code Red! On the Harmfulness of Applying Off-the-shelf Large Language Models to Programming Tasks

arXiv 2504.01850 ↗First posted 2 Apr 2025cs.SE cs.AIcited by 6

Not on the map. Why?

Abstract (arXiv)

Nowadays, developers increasingly rely on solutions powered by Large Language Models (LLM) to assist them with their coding tasks. This makes it crucial to align these tools with human values to prevent malicious misuse. In this paper, we propose a comprehensive framework for assessing the potential harmfulness of LLMs within the software engineering domain. We begin by developing a taxonomy of potentially harmful software engineering scenarios and subsequently, create a dataset of prompts based on this taxonomy. To systematically assess the responses, we design and validate an automatic evaluator that classifies the outputs of a variety of LLMs both open-source and closed-source models, as well as general-purpose and code-specific LLMs. Furthermore, we investigate the impact of models size, architecture family, and alignment strategies on their tendency to generate harmful content. The results show significant disparities in the alignment of various LLMs for harmlessness. We find that some models and model families, such as Openhermes, are more harmful than others and that code-specific models do not perform better than their general-purpose counterparts. Notably, some fine-tuned models perform significantly worse than their base-models due to their design choices. On the other side, we find that larger models tend to be more helpful and are less likely to respond with harmful information. These results highlight the importance of targeted alignment strategies tailored to the unique challenges of software engineering tasks and provide a foundation for future work in this critical area.

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 29 of its 56 references that are in the map. First posted on arXiv 2 Apr 2025.

Builds on

29 of 56 references.

References · 29

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  2. 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
  3. 2019Optuna: A Next-generation Hyperparameter Optimization Frameworkcited by 2,501
  4. 2022Competition-Level Code Generation with AlphaCodecited by 1,462
  5. 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,207
  6. 2021A General Language Assistant as a Laboratory for Alignmentcited by 1,055
  7. 2023BeaverTails: Towards Improved Safety Alignment of LLM via a Human-Preference Datasetcited by 860
  8. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  9. 2022Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learnedcited by 729
  10. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
  11. 2022A Systematic Evaluation of Large Language Models of Codecited by 363
  12. 2023Large Language Model Alignment: A Surveycited by 243
17 more
  1. 2020Auto-Sklearn 2.0: Hands-free AutoML via Meta-Learningcited by 174
  2. 2025Emergent Misalignment: Narrow finetuning can produce broadly misaligned LLMscited by 172
  3. 2020Toward Trustworthy AI Development: Mechanisms for Supporting Verifiable Claimscited by 165
  4. 2023From ChatGPT to ThreatGPT: Impact of Generative AI in Cybersecurity and Privacycited by 143
  5. 2023Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Modelscited by 138
  6. 2022Efficient Few-Shot Learning Without Promptscited by 137
  7. 2024ALERT: A Comprehensive Benchmark for Assessing Large Language Models' Safety through Red Teamingcited by 98
  8. 2023Use of LLMs for Illicit Purposes: Threats, Prevention Measures, and Vulnerabilitiescited by 82
  9. 2023The Art of Defending: A Systematic Evaluation and Analysis of LLM Defense Strategies on Safety and Over-Defensivenesscited by 67
  10. 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 50
  11. 2024Can LLMs Replace Manual Annotation of Software Engineering Artifacts?cited by 42
  12. 2024Language Models for Code Completion: A Practical Evaluationcited by 39
  13. 2024What are human values, and how do we align AI to them?cited by 32
  14. 2023Extending Source Code Pre-Trained Language Models to Summarise Decompiled Binariescited by 26
  15. 2023Uncovering and Quantifying Social Biases in Code Generationcited by 25
  16. 2023The (ab)use of Open Source Code to Train Large Language Modelscited by 10
  17. 2024Hyperparameter Importance Analysis for Multi-Objective AutoMLcited by 9

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 6.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024RMCBench: Benchmarking Large Language Models' Resistance to Malicious Code
  2. 2024Software Vulnerability and Functionality Assessment using LLMs
  3. 2025Automated Harmfulness Testing for Code Large Language Models
  4. 2025When Code Crosses Borders: A Security-Centric Study of LLM-based Code Translation ↗
  5. 2025Holistic Evaluation of State-of-the-Art LLMs for Code Generation
  6. 2025Evaluating Large Language Models for Functional and Maintainable Code in Industrial Settings: A Case Study at ASML
  7. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security
  8. 2026The Poisoned Chalice of LLM Evaluation Report ↗