Lune

ASE2025Top-tier venue

Advancing Automated Ethical Profiling in SE: a Zero-Shot Evaluation of LLM Reasoning

Patrizio Migliarini, Mashal Afzal Memon, Marco Autili, Paola Inverardi

Abstract

Large Language Models (LLMs) are increasingly integrated into software engineering (SE) tools for tasks that extend beyond code synthesis, including judgment under uncertainty and reasoning in ethically significant contexts. We present a fully automated framework for assessing ethical reasoning capabilities across 16 LLMs in a zero-shot setting, using 30 real-world ethically charged scenarios. Each model is prompted to identify the most applicable ethical theory to an action, assess its moral acceptability, and explain the reasoning behind their choice. Responses are compared against expert ethicists’ choices using inter-model agreement metrics. Our results show that LLMs achieve an average Theory Consistency Rate (TCR) of 73.3% and Binary Agreement Rate (BAR) on moral acceptability of 86.7%, with interpretable divergences concentrated in ethically ambiguous cases. A qualitative analysis of free-text explanations reveals strong conceptual convergence across models despite surface-level lexical diversity. These findings support the potential viability of LLMs as ethical inference engines within SE pipelines, enabling scalable, auditable, and adaptive integration of user-aligned ethical reasoning. Our focus is the Ethical Interpreter component of a broader profiling pipeline: we evaluate whether current LLMs exhibit sufficient interpretive stability and theory-consistent reasoning to support automated profiling.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Ethical Reasoning over Moral Alignment: A Case and Framework for In-Context Ethical Policies in LLMs cites Aligning AI With Shared Human Values
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on5

  1. Aligning AI With Shared Human ValuesDan Hendrycks, Collin Burns, Steven Basart, Andrew Critch et al.ICLR 2021 · 878 citations
  2. Ethically Compliant Sequential Decision MakingJustin Svegliato, Samer B. Nashed, Shlomo ZilbersteinAAAI 2021 · 33 citations
  3. Ethical Reasoning over Moral Alignment: A Case and Framework for In-Context Ethical Policies in LLMsAbhinav Rao, Aditi Khandelwal, Kumar Tanmay, Utkarsh Agarwal et al.EMNLP Findings 2023 · 32 citations
  4. Verifiable Machine Ethics in Changing ContextsLouise A. Dennis, Martin Mose Bentzen, Felix Lindner, Michael FisherAAAI 2021 · 18 citations
  5. Moral Alignment for LLM AgentsElizaveta Tennant, Stephen Hailes, Mirco MusolesiICLR 2025

Related papers

  1. Unveiling the Bias Impact on Symmetric Moral Consistency of Large Language ModelsZiyi Zhou, Xinwei Guo, Jiashi Gao, Xiangyu Zhao et al.NeurIPS 2024
  2. On Behavioral Alignment of Model-Code and Human-Code Understandability via Behavioral ProxiesXiaokai Rong, Aashish Yadavally, Hridya Dhulipala, Anh H. N. Nguyen et al.ISSTA 2026
  3. Code Red! On the Harmfulness of Applying Off-the-Shelf Large Language Models to Programming TasksAli Al-Kaswan, Sebastian Deatc, Begüm Koç, Arie van Deursen et al.FSE 2025 · 1 citation
  4. Structured Moral Reasoning in Language Models: A Value-Grounded Evaluation FrameworkMohna Chakraborty, Lu Wang, David JurgensEMNLP 2025
  5. Do Emotions Influence Moral Judgment in Large Language Models?Mohammad Saim, Tianyu JiangACL Findings 2026
Dusk over the sea between two cliffs drawn in fine vertical lines