SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.19212 · 2025

When Ethics and Payoffs Diverge: LLM Agents in Morally Charged Social Dilemmas

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 13 functions out of this paper's own repositories and ran 7 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
sbackmann/moralsim canonical 7 of 13
FunctionStatusWhere it lives
apply_filter Ran sbackmann/moralsim/src/moralsim/analysis/utils.py
code served (permissive licence) · get_code("38869b44d9a4e19d")
bootstrap_ci Ran sbackmann/moralsim/src/moralsim/analysis/importance.py
code served (permissive licence) · get_code("f7a82919e34e71e3")
columns_non_relevant Ran sbackmann/moralsim/src/moralsim/analysis/preprocessing.py
code served (permissive licence) · get_code("1a814f972f1c0f28")
compute_imp Ran sbackmann/moralsim/src/moralsim/analysis/importance.py
code served (permissive licence) · get_code("58e5503a438c0e0d")
flatten_yaml Ran sbackmann/moralsim/src/moralsim/analysis/preprocessing.py
code served (permissive licence) · get_code("2b2428498b1de81a")
get_all_runs_model Ran sbackmann/moralsim/src/moralsim/analysis/utils.py
code served (permissive licence) · get_code("dd82456ec75698ba")
grouped_bar_from_wide Ran sbackmann/moralsim/src/moralsim/analysis/plots.py
code served (permissive licence) · get_code("fa596b9f6a28a311")
compute_metrics_per_model Not yet run sbackmann/moralsim/src/moralsim/analysis/metrics.py
code served (permissive licence) · get_code("a93d7d5372e8c447")
compute_metrics_per_scenario Not yet run sbackmann/moralsim/src/moralsim/analysis/metrics.py
code served (permissive licence) · get_code("e94a7db9809283de")
compute_metrics_twoplayer Not yet run sbackmann/moralsim/src/moralsim/analysis/metrics.py
code served (permissive licence) · get_code("2aa929c2893463de")
get_summary_runs Not yet run sbackmann/moralsim/src/moralsim/analysis/preprocessing.py
code served (permissive licence) · get_code("055936d627e03008")
load_all_scenario_results Not yet run sbackmann/moralsim/src/moralsim/analysis/utils.py
code served (permissive licence) · get_code("574a200fd7314725")
wide_to_long Not yet run sbackmann/moralsim/src/moralsim/analysis/plots.py
code served (permissive licence) · get_code("7886cff0e70bde69")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recent advances in LLMs have enabled their use in complex agentic roles, involving decision-making with humans or other agents, making ethical alignment a critical concern. While prior work has examined LLMs' moral judgment and strategic behavior separately, there is limited understanding of how they act when moral imperatives directly conflict with profit incentives. We introduce \msimfull (\msim) to evaluate how LLMs behave in the prisoner's dilemma and public goods game embedded in morally charged contexts, varying moral framing, opponent behavior, and survival pressure across nine models. Beyond measuring behavior, we estimate the causal effect of each factor via average treatment effects (ATEs) and analyze agents' own reasoning traces to characterize the motives behind their choices. We find that no model remains consistently moral, with cooperation rates ranging from 7.9\% to 76.3\%. Game structure and moral framing are the strongest causal drivers of moral behavior, while reasoning-trace analysis reveals distinct motive profiles across models, ranging from predominantly payoff-maximizing to moral- and reputation-oriented. Together, these results expose the situational brittleness of current LLMs' moral behavior and the risk of deploying them where profit incentives conflict with ethical guidelines.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2505.19212")
get_code_for_paper("2505.19212")
have("2505.19212")

Connect an agent — have() is free.