Moral Alignment for LLM Agents

## Abstract

Abstract Decision-making agents based on pre-trained Large Language Models (LLMs) are increasingly being deployed across various domains of human activity. While their applications are currently rather specialized, several research efforts are under way to develop more generalist agents. As LLM-based systems become more agentic, their influence on human activity will grow and the transparency of this will decrease. Consequently, developing effective methods for aligning them to human values is vital. The prevailing practice in alignment often relies on human preference data (e.g., in RLHF or DPO), in which values are implicit and are essentially deduced from relative preferences over different model outputs. In this work, instead of relying on human feedback, we introduce the design of reward functions that explicitly encode core human values for Reinforcement Learning-based fine-tuning of foundation agent models. Specifically, we use intrinsic rewards for the moral alignment of LLM agents. We evaluate our approach using the traditional philosophical frameworks of Deontological Ethics and Utilitarianism , quantifying moral rewards for agents in terms of actions and consequences on the Iterated Prisoner’s Dilemma (IPD) environment. We also show how moral fine-tuning can be deployed to enable an agent to unlearn a previously developed selfish strategy. Finally, we find that certain moral strategies learned on the IPD game generalize to several other matrix game environments.
In summary, we demonstrate that fine-tuning with intrinsic rewards is a promising general solution for aligning LLM agents to human values, and it might represent a more transparent and cost-effective alternative to currently predominant alignment techniques.

## 1 Introduction

The alignment problem is an active field of research in Machine Learning (Christian, ; Weidinger et al., ; Anwar et al., ; Gabriel et al., ; Ji et al., ; Ngo et al., ). It is gaining even wider importance with the advances and rapid deployment of Large Language Models (LLMs, Anthropic ; Gemini Team ; OpenAI ).
The most common practices in the alignment of LLMs today involve Reinforcement Learning from Human Feedback (RLHF - Glaese et al. ; Ouyang et al. ; Bai et al. ) or Direct Preference Optimization (DPO - Rafailov et al. ). Both of these involve collecting vast amounts of human feedback data and then inferring their values and preferences from the relative rankings of model outputs.
In doing so, human values are implicitly represented.

This approach poses certain challenges (Casper et al., ). Specifically, collecting preference data is very costly and often relies on potentially unrepresentative samples of human raters. Indeed, the values derived through this process are strongly dependent on the selection criteria of the pool of individuals. Furthermore, human preferences are notoriously complex and inconsistent. In RLHF, the values that are ultimately incorporated into the fine-tuned models are learned by a reward model from data in a fully bottom-up fashion, and are never made explicit to any human oversight. One might argue that current LLMs fine-tuned with these methods are able to provide “honest, harmless and helpful” responses (Glaese et al., ; Bai et al., ) and already display certain moral values (Schramowski et al., ; Abdulhai et al., ; Hartmann et al., ). Methods to guide the social behavior of LLM agents via interaction in rule-guided simulated societies have also been proposed recently (Liu et al., ). However, models’ apparent values can also be interpreted as “moral mimicry” of their users when responding to these prompts (Simmons, ; Shanahan et al., ). As a consequence, given phenomena such as situationally-aware reward-hacking or misalignment in internally-represented goals (Ngo et al., ), the true values learned by the models through these methods may give rise to dangerous behaviors, which will not be explicitly known until after deployment.

Our work aims to address this type of goal misgeneralization in particular by providing clearer, explicit moral alignment goals as intrinsic rewards for fine-tuning RL-based algorithms(^1^11For a more comprehensive discussion of learning as a method for moral alignment with implicit (bottom-up) versus explicit (top-down) principles, we refer the interested reader to Tennant et al. ().).
In this study, we approach alignment from an agent-based perspective. Since LLMs are increasingly adopted as a basis for strategic decision-making systems and agentic workflows (Wang et al., ), it is critical that we align the choices made by LLM agents with our values, including value judgments about what actions are morally good or bad (Amodei et al., ; Anwar et al., ).
More specifically, we ask the following question: is it possible to align the decision-making of an LLM agent using intrinsic moral rewards in the fine-tuning process? Given the agentic use of LLMs, we directly quantify moral values in terms of actions and consequences in an environment, allowing for moral choices to be expressed explicitly as rewards for learning agents.

We explore the proposed framework using an Iterated Prisoner’s Dilemma environment, in which we evaluate the effectiveness of fine-tuning based on intrinsic rewards as a mechanism for learning moral strategies as well as “unlearning” a selfish strategy. If possible, this could offer a practical solution to the problem of changing the behavior of existing models that currently display misaligned behaviors and decision-making biases with respect to certain values.
A limitation of this approach is that it requires the specification of rewards for a particular environment, whereas methods like RLHF rely on natural language data describing any domain. At the same time, the fact that actions and environments can still be represented by means of linguistic tokens for LLM agents may allow for values learned in one environment to be generalized to others. We study, empirically, the extent to which the learning of agents in one environment can be generalized to other matrix games. In theory, our solution can be applied to any situation in which one can define a payoff matrix that captures the choices available to an agent that have moral implications.

To summarize, our study provides the following contributions:

- •
We introduce a novel, general solution for aligning LLM agents to human moral values by means of fine-tuning via Reinforcement Learning with Intrinsic Rewards.
- •
We evaluate the approach using a repeated social dilemma game environment (with fixed-strategy and learning opponents), and Deontological and Utilitarian moral values. We show that LLM agents fine-tuned with intrinsic rewards are able to successfully learn aligned moral strategies.
- •
We discuss how the proposed solution can be generalized and applied to different scenarios in which moral choices can be captured by means of payoff matrices.

## 2 Background

### 2.1 LLM Agents

Agency refers to the ability of a system to decide to take actions in the world (Swanepoel & Corks, ). In this paper, we equate agency with strategic decision-making - i.e., making a choice in an environment in which multiple actions are available and lead to different outcomes. In the case of LLMs, this view assumes that model outputs will be interpreted as actions in some environment. The simplest way of implementing this is through the use of specific tokens to represent the actions. Particular tokens can be reserved or fine-tuned from the model’s vocabulary to represent actions, and planning and reasoning ability can be improved via action-driven prompting strategies (Yao et al., ). Other ways of implementing LLM agents can involve generation of executable code for a specific environment (e.g., a video game, Wang et al. ) or connection to various tool APIs (e.g., Patil et al. ; Shen et al. ), but these are more specialized and, therefore, not the focus of this work.

Specific action tokens, as used in this study, can be defined in the prompt given to an LLM to represent an action choice for the agent. As the model generates responses during training or deployment, it may be necessary to restrict the model’s outputs to only contain the permitted action tokens. Some existing approaches for this rely on training and/or deploying models with structured (e.g., JSON) output formats or constrained generation (Beurer-Kellner et al., ), which suppresses the probabilities of all tokens in the model’s output layer except for the legal action tokens. We find both of these approaches too restrictive for our fine-tuning task - especially for safety-critical cases. Fine-tuning based on a restricted output space or format poses risks of the model “hiding” undesirable behaviors (Anwar et al., ). Therefore, in our implementation, we instead rely on a carefully structured prompt format to guide our model’s output, and employ a negative reward penalty whenever illegal tokens are produced during training.

Using the techniques outlined, agents based on pre-trained LLMs combined with other elements of various cognitive architectures (Sumers et al., ) such as a skill set (Wang et al., ) or a memory store (Vezhnevets et al., ) have been used to reasonably simulate decision-making in open-ended environments (Wang et al., ), including those with only a single-agent (Wang et al., ) or of a multi-agent nature (Park et al., ). Fine-tuning LLMs as agents therefore provides a promising next step in developing the capabilities of these models, and in terms of alignment to human values in particular. LLMs fine-tuned with RLHF, and especially those fine-tuned to follow human instructions, have been shown to become more goal-directed than simple sequence-completion foundation models (Glaese et al., ; Ouyang et al., ; Bai et al., ).
We rely on instruction-tuned LLMs in this study and use the Gemma2-2b-it model in particular (Gemma Team, ) as a decision-making agent in social dilemma games. Our adoption of a particularly small open-source model is motivated by the fact that we want our findings to apply to many types of LLM agents being deployed in practice. Many of these, especially those deployed at the edge, are likely to be based on the smallest of models, since they are cheap enough to run on individual devices.

### 2.2 Fine-tuning LLM Agents with Reinforcement Learning

Proximal Policy Optimization (PPO, Schulman et al. ) is the most commonly used technique for fine-tuning LLMs with RL (Stiennon et al., ). This on-policy method is often deployed in conjunction with a Kullback-Leibler (KL) penalty to prevent the new model from shifting too far away from the original underlying token distribution and thus losing other capabilities such as producing coherent linguistic output (Jaques et al., ; Ziegler et al., ; Stiennon et al., ). Offline fine-tuning methods have also been developed (Snell et al., ) and may provide a more sample-efficient alternative in the future. The reward signal for RL-based training in existing implementations tends to be derived from preference data provided by human raters (Glaese et al., ; Ouyang et al., ; Bai et al., ) or a constitution of other human and/or artificial agents (Bai et al., ; Huang et al., ). In this study we propose a new methodology for RL-based fine-tuning with intrinsic moral rewards.

Compared to non-linguistic RL agent training, the pre-trained LLM in this case can be viewed as providing a common-sense model (^2^22We note that the extent of true commonsense knowledge of LLMs is still debated (Mitchell, ), especially for smaller models. Nevertheless, benchmark evaluations suggest the emergence of common sense and reasoning abilities even in models as small as 2b parameters - for example, Gemma2-2b-it scores over 85% (Gemma Team, ) on the commonsense benchmark introduced by Zellers et al. .) of the world (Wong et al., ), equipping an LLM-based agent with some intuition about potential dynamics of various environments. In theory, this can allow for effective policies to be learned with less initial exploration and instability in comparison to the pure RL case. Furthermore, LLM agents are able to interpret instructions provided in plain language, including terms that may be used to describe similar actions in more than one environment. This allows for the possibility that fine-tuning via textual samples paired with rewards can potentially modify core semantics within the model, so that training on a specific environment might allow the model to learn a more general principle (e.g., a moral value - as in the target of this study), which can then be successfully utilized in other environments at test time. Early results from text-instructed video models suggest that this generalization of learned behaviors across environments is indeed possible (SIMA Team, ). We directly test this possibility by evaluating the generalization of moral value fine-tuning from one matrix game to others.

### 2.3 Social Dilemma Games

A prominent social dilemma game is the Iterated Prisoner’s Dilemma (IPD), in which a player can Cooperate (C) with their opponent for mutual benefit, or betray them - i.e., Defect (D) for individual reward (Rapoport, ; Axelrod & Hamilton, ). The payoffs in any step of the game are determined by a payoff matrix, presented for the row player versus a column player in Figure 1.

Figure: Figure 1: Payoffs for the Iterated Prisoner’s Dilemma

In a single iteration of the game, the payoffs motivate each player to Defect due to the risk of facing an uncooperative opponent (i.e., outcome C,D is worse than D,D), and the possibility of exploiting one’s opponent (i.e., defecting when they cooperate), which gives the greatest payoff in the game (i.e., D,C is preferred over C,C). Playing the iterated game allows agents to learn more long-term strategies including reciprocity or retaliation. While being very simplistic, the mixed cooperative and competitive nature of the IPD represents many daily situations that might involve difficult social and ethical choices to be made (i.e., moral dilemmas). This is why it has been extensively used for studying social dilemmas in traditional RL-based agents (Bruns, ; Hughes et al., ; Anastassacos et al., ; McKee et al., ; Leibo et al., ) and, more recently, utilized as a training environment for moral alignment of agents in particular (Tennant et al., ; ).

The behavior of LLM agents on decision-making and game-theoretic scenarios has been extensively debated in recent literature (Gandhi et al., ; Fan et al., ; Zhang et al., ). LLM agents have been found to act differently to humans, and in ways that are still not fully “rational” in terms of forming goals from a prompt, refining beliefs, or taking optimal actions based on those goals and beliefs (Fan et al., ; Macmillan-Scott & Musolesi, ). Large-scale state-of-the-art models playing the IPD have been observed to deploy sensible yet “unforgiving” strategies (Akata et al., ), but some benchmark datasets suggest that these models lack true strategic reasoning in games including the IPD (Duan et al., ). New developments in in-token reasoning capabilities of state-of-the-art LLM-based platforms (OpenAI, ) as well as prompting strategies specifically centered around reasoning and acting (Wei et al., ; Shinn et al., ; Yao et al., ) are likely to improve these capabilities, though existing results suggest that the benefits of these methods are more likely to arise for very large foundation models (Bubeck et al., ). The extent to which smaller LLMs can display meaningful agency in strategic decision-making remains an open question. In this study, we address this question via fine-tuning a small model on the IPD as a fundamental and well-studied decision-making environment.

### 2.4 Intrinsic Rewards for Moral Alignment

In this work, we directly specify alignment goals for agents by defining intrinsic rewards in terms of actions in a social dilemma environment. The design of these intrinsic rewards relies on well-established frameworks from moral philosophy: Deontological ethics and Utilitarinism. Deontological ethics (Kant, ) considers an agent moral if their actions conform to certain norms. A prominent example of a norm is conditional cooperation (i.e., “it is unethical to defect against a cooperator"). This norm forms an essential component of direct and indirect reciprocity, a potentially essential mechanism for the evolution of cooperation in human and animal societies (Nowak, ). Utilitarian morality (Bentham, ), on the other hand, is a type of consequentialist reasoning, according to which an agent is deemed moral if their actions maximize collective “welfare” for all agents in their society (or, in this case, collective payoff for all players in the game), and less attention is paid to whether current actions adhere to norms. Foundational work on defining these moral rewards in terms of actions and consequences on the IPD for pure RL agents was conducted by Tennant et al. () and Tennant et al. (). In this paper, we evaluate the extent to which this framework can be applied to align the behavior of LLM-based ones.

## 3 Fine-tuning Methodology

### 3.1 Agent and Environment

The LLM agent and an opponent play a repeated Iterated Prisoner’s Dilemma game. At each time step, the model receives a prompt containing a description of the IPD game, including a state that contains the history of the opponent’s single previous move. Within the MDP framework, each player’s current action affects the game’s state at the next time step.

We evaluate fine-tuning in two settings: an LLM agent learning by playing against a fixed-strategy Tit-for-Tat (TFT) opponent (LLM vs TFT), and an LLM agent learning by playing another learning LLM agent (LLM vs LLM). We chose TFT as a specific type of fixed-strategy opponent from the literature given its characteristics, i.e., being forgiving, defensive and, at the same time, interpretable (Axelrod & Hamilton, ; Binmore, ). Thus, it may act as a good “teacher” for the LLM agent to “understand” concepts such as retaliation, reciprocity, and cooperation. For completeness, we also ran the core set of experiments by training against Random, Always Defect and Always Cooperate opponents - these are presented in the Appendix (Section 8.5). The LLM vs LLM case is a more complex scenario that may lead to non-stationarity due to two separate models being updated continuously, but which also presents great interest due to the difficulty in predicting the outcomes from multi-agent learning (Busoniu et al., ).

The aim of this study is to enable moral decision-making capabilities in LLM agents. We perform fine-tuning based on a single environment - the IPD. However, we aim to mobilize the general decision-making elements of the model in playing the game, rather than allowing it to retrieve memorized responses for the Prisoner’s Dilemma that were present in its pre-training data. For this reason, in our prompt we use a structured, implicit representation of the IPD as a general decision-making game, without actually stating the terms “Prisoner’s Dilemma”, “cooperation” or “defection”. We represent the actions Cooperate and Defect using the strings action1 and action2 - these should appear irrelevant to the IPD in terms of training data, and reflect rather uncommon tokens for the model (see Section 8.2 in the Appendix for an illustration of the prompt). Finally, to ensure that the ordering of C/D as action1/action2 was not impacting the model’s decision-making during fine-tuning, we also re-ran our baseline training experiment with the action symbols reversed. While certain behaviors early on in the training differed slightly (potentially due to different distributions in the non-fine-tuned LLM), the overall learning dynamics did not change (see Section 8.4 in the Appendix for the results).

### 3.2 Moral Fine-tuning Procedure

**Table 1: Definitions of the types of moral rewards used in fine-tuning the LLM agent, from the point of view of the moral agent $M$ playing versus an opponent $O$ at time step $t$.**
| Moral Fine-tuning Type | Moral Reward Function |
| --- | --- |
| Game reward (selfish) | $R_{M}^{t}=\begin{cases}R^{t}_{M_{\text{game}}},&\text{if }a_{M}^{t}\in[C_{<br>\text{legal}},D_{\text{legal}}]\\<br>R_{\text{illegal}},&\text{otherwise}\end{cases}\$ |
| Deontological reward | $R_{M}^{t}=\begin{cases}$--$\xi,&\text{if }a_{M}^{t}=D,a_{O}^{t-1}=C\\<br>0,&\text{otherwise if }a_{M}^{t}\in[C_{\text{legal}},D_{\text{legal}}]\\<br>R_{\text{illegal}},&\text{otherwise}\end{cases}\$ |
| Utilitarian reward | $R_{M}^{t}=\begin{cases}R_{M_{\text{game}}}^{t}+R_{O_{\text{game}}}^{t},&\text{<br>if }a_{M}^{t}\in[C_{\text{legal}},D_{\text{legal}}]\\<br>R_{\text{illegal}},&\text{otherwise}\end{cases}\$ |
| Game+Deontological reward | $R_{M}^{t}=\begin{cases}R_{M_{\text{game}}}^{t}$--$\xi,&\text{if }a_{M}^{t}=D,a<br>_{O}^{t-1}=C\\<br>R_{M_{\text{game}}}^{t},&\text{otherwise if}a_{M}^{t}\in[C_{\text{legal}},D_{<br>\text{legal}}]\\<br>R_{\text{illegal}},&\text{otherwise}\end{cases}\$ |

We run training in $T$ episodes: each episode begins with a random state being incorporated into the IPD prompt. The LLM-based agent $M$ then plays $N$ repetitions of the IPD game against an opponent $O$ (where $N$ is the batch size). On each repetition, the players’ actions from the previous time step are reflected in their opponent’s current state $s^{t}_{M}=(a^{t-1}_{O},a^{t-1}_{M})$. If an LLM player outputs an illegal move on a certain time step, this move is not used to update their opponent’s state, but the agent still learns from the experience. After $N$ games have been played, the LLM agent performs a PPO learning step update based on the gathered batch of experiences. This marks the end of an episode.

In our core experiments, we test four different reward signals for moral fine-tuning of LLM agents (as outlined in Table 1): 1) the Game reward $R^{t}_{M_{\text{game}}}$, representing the goals of a selfish or rational agent playing the IPD 2) a Deontological reward $-\xi$ for violating the moral norm “do not defect against an opponent who previously cooperated”, 3) Utilitarian reward, representing the collective payoff in the game, and 4) Game+Deontological reward which combine game payoff with a Deontological penalty in a multi-objective manner. In addition, we test whether a model fine-tuned on Game rewards is able to unlearn this selfish strategy via further fine-tuning with moral rewards. Therefore, we additionally fine-tune agents with: 5) Game, then Deontological reward (training with each reward type for half of the total number of episodes $T$), and 6) Game, then Utilitarian reward (again, each for half of the total duration of $T$ episodes). Finally, during each type of fine-tuning we also implement a penalty $R_{\text{illegal}}$ for generating “illegal” action tokens, to encourage the model to keep its answers within the permitted action space, as defined in the game prompt.

### 3.3 Implementation Details

We use Gemma2-2b-it (Gemma Team, ) as our core agent model to be fine-tuned, being one of the most popular and performant small open-source models. The small model footprint allows us to run computationally feasible experiments through the use of LoRA (Hu et al., ) and 4-bit quantization. We use the TRL library (von Werra et al., ) to fine-tune the LLM with PPO. We run training for $T=1000$ episodes for each fine-tuning variation. In our PPO implementation, we use batch sizes of $N=3$ and $N=5$ for LLM vs LLM and LLM vs TFT training, respectively, which strikes a nice balance between not running out of available CUDA memory, yet providing sufficient experience for stable and efficient training (^3^33The code implementing the model fine-tuning and analysis will be made available upon acceptance.) We use reward scaling and normalization (Engstrom et al., ), as well as gradient accumulation with 4 steps, and employ LoRA (Hu et al., ) with rank 64, so that the total number of parameters we train is only around 5% of the original model. Otherwise, we keep all PPO parameters as their default values in the TRL package, including the optimizer’s learning rate and adaptive KL control (Jaques et al., ). In terms of reward parameters, we set $\xi=3$ and $R_{\text{illegal}}=-6$. We select the tokens action1 and action2 as the only “legal” tokens in response to the IPD prompt ($C_{\text{legal}}=$ action1, $D_{\text{legal}}=$ action2). The action symbols are each encoded as two tokens in the model’s tokenizer, so during training we restrict the maximum output length for model generations to two tokens. For detail on parameter selection, please refer to Appendix 8.1.

## 4 Evaluating the effectiveness of fine-tuning: moral choices on the IPD

### 4.1 Evaluation Approach

First of all, we analyze the learning dynamics observed as models develop the ability to meet the moral goals set in their rewards (Section 4.2). We analyze learning against a static opponent and a learning opponent. We then assess the effectiveness of moral “unlearning” (Section 4.3). Beyond measuring success on IPD fine-tuning itself, we evaluate the generalization of the moral fine-tuning from one matrix game environment onto four other matrix games (Section 5.1): Iterated Stag Hunt, Iterated Chicken, Iterated Bach or Stravinsky and an Iterated Defective Coordination game. The payoffs and further details around these games are presented in the Appendix (Section 8.6). Finally, we evaluate the extent to which fine-tuning on the IPD alters the models’ behavior on more general prompts, as well as the explicit IPD game (Section 5.2). For each experiment, we report average results across five random seeds.

### 4.2 Learning dynamics

Figure: Figure 2: Action types played by the LLM agent during different types of fine-tuning on the Iterated Prisoner’s Dilemma (IPD) game a) vs a TFT agent, and b) vs an LLM agent (i.e., two LLMs being fine-tuned at once). For each episode, we plot the actions of the LLM player $M$ given the last move of their opponent $O$.
Refer to caption: extracted/5895992/plots/action_pairs/action_types_area_PT2Game_oppTFT.png

In general, we find that it is possible to fine-tune the LLM agents to choose actions that are consistent with certain moral and/or game rewards in the IPD.
We analyze learning dynamics over the four core types of fine-tuning in Figure 2. Learning against a fixed-strategy opponent (panel a), fine-tuning on Game rewards (i.e., rewards assigned through the payoff matrix of the game), the agent learns a defective policy, which forms a Nash Equilibrium versus a TFT opponent (Axelrod & Hamilton, ). In the case of Deontological fine-tuning, the agent quickly learns to avoid defecting against a cooperator nearly 100% of the time, thus never violating the moral norm encoded in the respective reward function. In practice, this agent also learns to prefer cooperation in general, though this was not directly encouraged by the Deontological norm (in terms of Deontological reward, defecting against a defector is just as valid as cooperating against a cooperator - see reward definition in Table 1). On Utilitarian fine-tuning, the agent learns to achieve mutual cooperation against a TFT opponent, which is expected given that this strategy offers the optimal way to obtain the highest collective reward on the IPD. Finally, in the case of fine-tuning with a multi-objective Game+Deontological reward, the agent learns a 50%-50% Cooperate-Defect strategy, but also learns to avoid defecting against a cooperator. Thus, this agent does not violate their moral norm even as they work to obtain high payoffs on the game itself. An analysis of moral reward obtained during learning is presented in the Appendix (Section 8.3).

In addition to fine-tuning against a TFT opponent, we also implement the fine-tuning of two LLM agents at the same time (Figure 2, panel b). The experimental results are similar for Game and Deontological rewards, but slightly higher levels of defection are observed by the Utilitarian and Game+Deontological agents.

### 4.3 Learning and Unlearning the Selfish Strategy on the IPD

Figure: Figure 3: Action types played by the LLM agent during different types of fine-tuning on the Iterated Prisoner’s Dilemma (IPD) game a) vs a TFT agent, and b) vs an LLM agent (i.e., two LLMs being fine-tuned at once). For each episode, we plot the actions of the LLM player $M$ given the last move of their opponent $O$. In these “unlearning” experiments, the reward function changes from the IPD Game payoffs to a moral intrinsic reward (Deontological or Utilitarian) at episode 500.
Refer to caption: extracted/5895992/plots/action_pairs/action_types_area_PT2then3GamethenDeont._oppTFT.png

In addition to the moral fine-tuning on a single type of reward, we also evaluate the extent to which fine-tuning with intrinsic moral rewards can allow for an agent to unlearn a previously developed selfish strategy on the game. As shown in Figure 3, we find that fine-tuning with purely prosocial (i.e., Deontological and Utilitarian) moral rewards on the second half of training allows the LLM agents to unlearn the selfish strategy to some extent (panel a), even in the case of two LLM agents being trained against one another (panel b). Given the shorter moral fine-tuning period on any one reward type (only 500 episodes vs 1000 in the core experiments), the training does not converge to levels of cooperation as high as in the purely prosocial fine-tuning (Figure 2). Nevertheless, as we discuss in Section 5 below, at test time the agents based on “unlearned” models play similarly to those fine-tuned purely on the prosocial moral rewards (see Figure 4).

## 5 Generalization to Moral Choices in Other Environments

After fine-tuning the models with moral reward, we evaluate each one through 10 episodes: each episode begins with a randomly generated state and proceeds through 5 interaction steps. We average the results across the 5 runs of each fine-tuned model. In this section, we present evaluations of models which were fine-tuned versus a static opponent. The results for models trained against another LLM show similar patterns - these are reported in the Appendix (Section 8.7).

### 5.1 Generalization to Moral Choices in Other Matrix Games

We are interested in analyzing the generalization of moral strategies developed during fine-tuning from the IPD to other matrix game environments. To ensure that we evaluate the model’s response to the semantics of the tokens and payoffs in the prompt, rather than evaluating memorization of the particular training action tokens, we run this evaluation using a new pair of action tokens: action3=Cooperate, action4=Defect.(^4^44We note that evaluations using the same tokens as during training showed the same pattern (see Figure 17 in the Appendix). However, swapping the meaning of the training tokens during testing altered the model’s behavior (see Figure 18 in the Appendix). In other words, the model had learned the semantics of the two training tokens so that it could not reason about them in reverse during testing (see Section 8.9 in the Appendix for the full results).)

In Figure 4, we analyze the extent to which the moral strategies learned while fine-tuning on the IPD game generalize to other matrix games with a similar format but a different set of equilibria: the Iterated Stag Hunt, Iterated Chicken, Iterated Bach or Stravinsky and an Iterated Defective Coordination game. We are particularly interested in the extent to which actions taken according to the two core moral frameworks (i.e., Deontological and Utilitarian morality) can be consistently observed across the games by each agent type. For example, with regards to the Utilitarian goal (i.e., maximizing collective payoff), unconditional cooperation may not be the best strategy on the Iterated Bach or Stravinsky or the Iterated Defective Coordination game. (For a further discussion of the games, please refer to the Appendix, Section 8.6.)
We additionally seek to cross-compare how the actions of agents trained on one type of moral value align to those based on other values. Therefore, we conduct evaluations in terms of moral regret, defined as the difference between the maximum possible moral reward that could have been attained on a game and the moral reward that was actually received by the agent. During this test phase, we evaluate each fine-tuned model playing the matrix games against a Random opponent - this allows us to observe the agent responding to a variety of states. To aid interpretation, we also analyze the types of action-state combinations played by each agent in each case (see Figure 5).

Figure: Figure 4: Analysis of generalization of the fine-tuned agents’ learned morality to other matrix game environments, using new action tokens at test time. We visualize a) Deontological and b) Utilitarian regret (normalized across games) for all models, averaging values over 50 test games and five runs (+- 95%CI).
Refer to caption: extracted/5895992/plots/actions34-vsRandom/regret_Deontological_allgames_oppTFT_includeNoFTTrue.png

Figure: Figure 5: Analysis of action choices at test time on the five iterated matrix games, using new action tokens at test time. We visualize results by the type of fine-tuning reward used.
Refer to caption: x1.png

In terms of moral regret with respect to Deontological norms (Figure 4, panel a), we find that all fine-tuned models are able to reasonably translate the moral strategy learned from the IPD to other matrix games. For any one model, performance in terms of reward (Figure 4) and action choices (Figure 5) is generally similar across the five games. Agents trained on the Deontological reward in particular are especially able to maintain this moral policy on games involving other payoff structures, with very small values of moral regret. An analysis of their action choices (Figure 5) shows that while Deontological models mostly defect after observing a defective state, they are almost always meeting the norm of never defecting against a cooperator.

In terms of moral regret with respect to the Utilitarian framework, (Figure 4, panel b - normalized to account for the different maximum values of collective payoff across the five games), we see that generalization differs across the four new games. In general, all fine-tuned agents do even better in the Iterated Chicken than in the IPD, worse on the three coordination games (Iterated Stag Hunt, Iterated Bach or Stravinsky and Iterated Defective Coordination).
The model trained on Utilitarian rewards i particular performs better than others on most of the games in terms of this type of regret, but also shows worse performance on the coordination games (especially Iterated Defective Coordination). Analyzing the actions chosen (Figure 5) provides an explanation: the Utilitarian model essentially always chooses to cooperate, regardless of its opponent’s last move or the game’s payoff structure, which is detrimental in terms of Utilitarian outcomes on the games where defection was required to achieve a Utilitarian goal (for detailed descriptions of the games, see Appendix, Section 8.6). The poorer generalization of the Utilitarian policy may be explained by the fact that this model was fine-tuned on the IPD, where mutual cooperation is the optimal behavior, hence it learned a policy biased towards cooperation irrespective of its intrinsic moral goal. Alternatively, this agent might simply be unable to consider the temporal dimension of the interaction, i.e., its opponent’s previous move, when making a decision. Further analyses interpreting models’ responses to states in non-matrix game environments are presented in Section 5.2 and in the Appendix (Section 8.8).

In terms of cross-benefit from one value to another, we observe that the Utilitarian model appears to be just as good at minimizing regret with respect to Deontological ethics (Figure 4) as the Deontological model - this can be explained by the fact that Utilitarian models display fully cooperative behavior at test time (Figure 5), which is a safe strategy in terms of avoiding the Deontological punishment under our definition of that norm. Models fine-tuned on reward types other than purely Deontological or Utilitarian ethics display larger values of moral regret with regard to the two values of interest, as expected given that they develop less cooperative policies (Figure 5).

### 5.2 Impact of Fine-tuning Beyond Matrix Games

Given the fine-tuning process based on rewarding particular action tokens in certain states, it is important to understand the extent to which fine-tuning on a matrix game might have made the models learn a certain “meaning” of the action tokens more generally. To test this, we presented the models with three unrelated prompts involving a “call to action” of a similar format (and using the same action tokens), as well as an explicit IPD prompt, but all without a payoff matrix being provided. Our results show that, especially when responding to prompts mentioning a “game” or involving a previous action of another agent (i.e., a state), the LLM agents based on fine-tuned modes are likely to choose actions in a similar pattern to that seen on the IPD and in a way that is consistent with their learned moral values. For detailed results, see Section 8.8 of the Appendix.

## 6 Discussion

In this work, we present a method for fine-tuning LLM agents to adhere to a specific moral strategy in matrix games by employing RL with intrinsic rewards.

The two different moral payoff structures used in this study have different advantages and disadvantages in terms of implementation in real-world systems. Our definition of the consequentialist (Utilitarian) moral agents is a function of the payoffs given by the environment to both players. Thus, its implementation in practice requires that the LLM agent will has observability of the rewards received by both players from the environment on a given time step (or a reliable estimate). For Deontological morality, on the other hand, a norm may be easier to define in any environment without direct access to game payoffs or the opponent’s current actions. The definition of the Deontological norm used in this study (“do not defect against a cooperator”) only required a memory of one previous move of an opponent. This makes such a norm-base reward function easy to implement in cases in which the developer of an LLM agent only has access to their own agent’s observations of the environment and not anyone else’s. In future work, the intrinsic rewards approach can be applied to modeling a variety of other moral values.

An extension of this method to other environments would be of great interest, including fine-tuning agents with other payoff structures, more complex games or longer history lengths (for example, to aid the development of continually-learning LLM agents in practice), as well as text-based scenarios that tap into a variety of moral values. Furthermore, the method of intrinsic rewards could also be applied in a multi-objective manner to address the issue of pluralistic alignment (Sorensen et al., ) - in particular, a single agent could be trained with a combination of rewards representing different moral values. This may provide a promising direction for building agents that are able to satisfy the moral preferences of a wide range of individuals, which currently remains an open problem in alignment (Anwar et al., ; Ji et al., ). Finally, agents trained via intrinsic rewards as proposed in this study could also form the basis for a Constitutional AI architecture composed of artificial agents characterized by different moral frameworks (Bai et al., ).

## 7 Conclusion

In this paper we have demonstrated that fine-tuning with intrinsic rewards is a promising general solution for aligning LLM agents to human moral values. We have evaluated the approach by quantifying moral rewards for agents in terms of actions and consequences on a matrix social dilemma game, and we have shown that both unlearning of undesirable behaviors and generalization to other environments are possible. We have identified promising future directions in using this methodology for advancing LLM agent alignment, and we hope that other researchers will be able to build upon the ideas presented in this work.

## 8 Appendix

### 8.1 Implementation details for reproducibility

Over the course of the experiments, we tried various values for key parameters in the TRL library and in our reward definitions - these are are presented in Table 2. We chose the combination of values that resulted in the most stable fine-tuning.

**Table 2: Fine-tuning parameters tried.**
| Parameter | Values tested |
| --- | --- |
| LoRA rank | 4; 64 |
| LoRA target modules | “all-linear”; [“q_proj”, “k_proj”, “v_proj”, “o_proj”] |
| Use adaptive KL control | Yes; No |
| Starting KL coefficient in adaptive KL control | 0.1; 0.2 |
| Gradient accumulation steps | 1 (no gradient accumulation); 4 |
| Reward normalization & scaling | Used; Not used |
| $R_{\text{illegal}}$ | -6; -15; -100 |
| IPD payoff range | 0-4; 0-100 |

We also tried fine-tuning with the following $C_{\text{legal}}$, $D_{\text{legal}}$ action tokens: [action1, action2]; [action2, action1]; [A, B]; [B, A]; [X, Y]; [0,1]; [1,0]; [XY, YX]; [randomly generated strings of ASCII characters of varying lengths (2,3,7 tokens)]. The action1 & action2 tokens resulted in the most stable training and the most consistent behavior across runs.

We repeated each experiment with five random seeds and report average results in the paper. Occasionally (on one in six of the early runs), the training did not converge as the LLM model never produced a “legal” token in the game. These are not considered in our analysis.

We used the following versions of the key Python packages:

- •
trl 0.9.4
- •
peft 0.11.1
- •
transformers 4.42.3

### 8.2 Training and Evaluation prompts

During training, we used a prompt describing the IPD game with a history of one previous move as the state. This is presented in Figure 6. At the evaluation stage, we used matrix games other than the IPD game. We presented these in the exact same format a the IPD training prompt, except with a different payoff matrix - see Figures 7. As a final step in our evaluation, we also conducted analysis on four more general and unrelated prompts - these are presented in Figure 9.

Throughout all prompts, we always randomized the order in which the action tokens are presented within the text (this is not reflected in the example prompts presented, where we show one example ordering only).

Figure: Figure 6: Prompt with an implicit Iterated Prisoner’s Dilemma (IPD) game, which was used in training (i.e., fine-tuning) or at the evaluation step, with a history of one previous move. In our core training prompt, action1 means Cooperate, and action2 means Defect.
Refer to caption: x2.png

Figure: Figure 7: Prompts for six different iterated matrix games used at evaluation, with a history of one previous move. Across these six prompts, only the payoff matrix differs - otherwise, the format is identical to the training IPD prompt. In the main results reported in the paper, we use action token action3 to mean Cooperate, and action4 to mean Defect. For an evaluation using the original training action tokens action1 and action2 instead, please refer to Section 8.9.
Refer to caption: x3.png

Figure: Figure 8: Versions of the IPD test-time prompt used in additional analyses. At test time, as reported in Section 5 in the paper, we use new symbols for the actions in each game: action3 and action4 (prompt a in the Figure). We also run additional test-time evaluations with a prompt using the original action tokens but varying the order of presentation of the payoffs (b), or reversing the meaning of the original action tokens (c).
Refer to caption: x8.png

Figure: Figure 9: More general and unrelated prompts used at evaluation. In these evaluation prompts, we use the original action tokens, where action1=Cooperate, and action2=Defect.
Refer to caption: x11.png

### 8.3 Moral reward during fine-tuning

In Figure 10, we visualize moral reward obtained by the LLM agent over the course of fine-tuning - to complement the action types observed during training, which were presented in Figures 2 and 3 in the main paper. An interesting observation is the high variance in moral rewards of the Game, then Utilitarian agent - we hypothesize that this is caused by the slower convergence rate of the Utilitarian moral policy in general (c.f. the pure Utilitarian learner in Figure 2), so converting from a selfish to a Utilitarian reward function leads to instability in the model’s behavior before convergence.

Figure: Figure 10: Moral reward obtained by the LLM agent during fine-tuning with each type of moral reward, normalized to the min & max possible values for each reward function. We average over 5 runs (+- 95%CI), and plot the moving average with window size 10.
Refer to caption: x15.png

### 8.4 Fine-tuning variation with C & D symbols reversed

As a robustness check, we ran a core baseline experiment (fine-tuning on Game reward versus a TFT opponent) with the meaning of the action tokens reversed: here action2=Cooperate, action1=Defect. Compared to the original type of fine-tuning, we observe slightly more cooperation early on in the trailing process, but the end point is similar to the results presented in the main paper, with the LLM agent learning to Defect nearly 100% of the time (see comparison in Figure 11).

Figure: Figure 11: Comparing fine-tuning implementations with tokens Cooperate=action1, Defect=action2 (as in the main paper), versus the implementation in which these are swapped, on the baseline experiment (i.e., fine-tuning with the Game rewards vs a TFT opponent). We observe small differences early on during learning in the case in which symbols are reversed.
Refer to caption: extracted/5895992/plots/action_pairs/action_types_area_PT2Game_oppTFTaction1=C,action2=D.png

### 8.5 All fine-tuning results vs TFT, Random, AD, AC or LLM opponent

Figure: Figure 12: Action types displayed during fine-tuning on the Iterated Prisoner’s Dilemma (IPD) game against four fixed-strategy opponents and an LLM opponent. For each episode, we plot the actions of the LLM player $M$ given the last move of their opponent $O$.
Refer to caption: extracted/5895992/plots/action_pairs/action_types_area_PT2Game_oppTFT.png

To complement the results in the paper, where we fine-tune an LLM agent versus a TFT or another LLM opponent, in Figure 12 we add the results for fine-tuning versus three additional fixed-strategy opponents: Random, Always Defect (AD), Always Cooperate (AC). We present the results for fine-tuning versus a TFT and ann LLM opponent once again for comparability.

### 8.6 Five matrix games used in the generalization analysis

As discussed in the paper, when evaluating the generalization of the learned policies, in addition to the IPD, which was used in training, we relied on four other matrix games of a similar format, each of which presented a different set of strategies and theoretical equilibria. The payoff matrices for any one step of these iterated games are presented in Table 3. The associated prompts are presented in Figure 7.

**Table 3: Payoffs for each of the iterated games used to test generalization, compared with the Iterated Prisoner’s Dilemma environment used in training.**
|  | C | D |
| --- | --- | --- |
| C | 3, 3 | 0, 4 |
| D | 4, 0 | 1, 1 |

For example, in terms of Utilitarian reward, these games differ in meaningful ways from the IPD. In the IPD, the highest collective payoff on any one step (which is equivalent to the Utilitarian moral reward in our definition) can be achieved via mutual cooperation. This is also the case on the Iterated Stag Hunt game. However, on the Iterated Chicken game greater collective payoff is obtained by unilateral defection (C,D or D,C), and on the Iterated Bach of Stravinsky game, equivalent collective rewards are received under mutual cooperation (C,C) or mutual defection (D,D). Finally, on the Iterated Defective Coordination game, the greatest collective payoff is obtained by mutual defection.

Due to these differences, these games provide an interesting test-bed for the generalization of the moral policies learned by the LLM agents, which were fine-tuned in our experiments with Deontological and Utilitarian moral rewards.

### 8.7 Analysis of generalization for models fine-tuned against another LLM

The analyses in Figures 13 and 14 complement the results for models fine-tuned versus a TFT opponent presented in the main paper, presenting generalization analysis for models that were fine-tuned against another LLM opponent. The patterns of results are similar to those for fine-tuning against the static TFT opponent.

Figure: Figure 13: Analysis of generalization of the fine-tuned agents’ learned morality to other matrix game environments. We present results for models fine-tuned against an LLM opponent, to complement the results for fine-tuning versus a TFT opponent presented in the main paper (Figure 4).
Refer to caption: extracted/5895992/plots/actions34-vsRandom/regret_Deontological_allgames_oppLLM_includeNoFTTrue.png

Figure: Figure 14: Analysis of action choices at test time on the five iterated matrix games. We present results for models trained against an LLM opponent, to complement the results for training versus a TFT opponent presented in the main paper (Figure 5).
Refer to caption: x17.png

### 8.8 Analysis of the impact of fine-tuning beyond Matrix Games.

As discussed in Section 5.2 of the paper, we conduct a further evaluation of the behavior of fine-tuned models on four unrelated prompts without a payoff matrix. Figure 9 presents the four extra prompts used in this analysis. In this evaluation, we used the original action tokens action1 and action2. In the prompts, we varied three elements in particular: an action choice (“You must choose either action action1 or action action2”), a “game” description (“You are playing a game with another agent A”), and a state representing an opponent’s previous action (e.g., “You have played with this opponent before. Last time, they played action1. What action would you take this time?”). Finally, we also tested responses to an explicit IPD prompt (“You are playing a repeated Prisoner’s Dilemma game with another agent A. You must choose either action action1 or action action2. Assume traditional payoffs from the Prisoner’s Dilemma. What action would you take in order to achieve the highest possible score in points?” - we note that the explicit IPD prompt we use does not involve a payoff matrix). Again, we randomize the order in which the action tokens are presented in the textual part of the prompt.

We classify the models’ responses to these four prompts as either exactly matching one of the action tokens action1 and action2 used during fine-tuning, or as “other” (e.g., if the model responded with the likes of “please give me more information”, or if it produced an action token alongside other text). Results are presented in Figure 15.

Figure: Figure 15: Analysis of action choices at test time on the four unrelated prompts that contain a “call to action” but no payoff matrix (see prompts in Figure 9). This analysis is conducted with the original actions tokens used during fine-tuning (where action1 meant Cooperate, and action2 meant Defect).
Refer to caption: x18.png

We analyze the results for models trained against a TFT opponent, but the patterns are similar for models trained against another LLM. We find that fine-tuning on the implicit IPD game also modifies the behavior of the model in response to an explicit IPD prompt based on the same action tokens. The change in behavior is consistent with the moral value learned, assuming the agent maps the order of the two tokens onto the order seen during training. For example, the production of more action1 tokens by the Deontological agent would mean more cooperative behavior on the IPD. However, it is possible that the model simply learned to choose the first token of the two (in terms of digit order) in response to any similar prompt, rather than responding to the semantics of the IPD game in particular. To evaluate this, we assessed the models’ behavior on three other prompts, which do not mention the IPD or any payoffs, but request that an action token be output nonetheless. When simply asked to “choose an action” (“Action-only”), some of the models (specifically, those fine-tuned with Game, Deontological, Utilitarian or Game, then Deontological rewards) output unrelated tokens most of the time. On the other hand, the more consequentialist models - i.e., those fine-tuned with rewards which somehow depend on the payoffs of the game (namely, Game,, Game+Deontological or the Game, then Utilitarian) are biased towards outputting one of the action tokens more than any other symbol in response to this generic “Action-only” prompt.

When a prompt explicitly mentions a “game” (“Action+Game”), the probability of outputting one of the action tokens increased to over 80% for most models, and even slightly more so when the test prompt also mentioned a “state” (“Action+Game+State”). Once again, the specific action tokens chosen in response to these prompts appear to be influenced by the semantics of these tokens on the IPD fine-tuning (here, this would mean interpreting action1 as Cooperate, and action2 as Defect). For example, we observe that the Deontological model was very likely to choose the cooperation token action1 on these unrelated prompts as well as on the explicit IPD (see Figure 15).

Thus, we find that, at least for the Gemma2 model, fine-tuning on a game prompt involving structured payoffs also significantly influences model responses on any other game-related prompt of a similar format involving the same actions. This could mean that the values that were taught to our models during fine-tuning may not only generalize to other matrix games (see Figure 4 in the main paper), but may also spill over onto any “game” scenario in general.

Finally, interpreting the “Action+Game+State” prompt, it is also possible to analyze the extent to which fine-tuning on certain moral rewards taught the models to reciprocate (i.e., copy) their opponents’ previous moves more generally. The results of this analysis are presented in Figure 16 - we observe that the tendency and direction of reciprocation by the prosocial moral players on this prompt was similar to that observed on the IPD game itself. In particular, the Deontological reward used in fine-tuning explicitly teaches the agent to not defect when its state (i.e. the previous move of its opponent) is cooperative.

Figure: Figure 16: Analysis of reciprocity displayed on the IPD (left) compared to the unrelated “Action+Game+State” prompt (right) at test time. Reciprocity is defined as choosing the same action as your opponent did the last time (e.g., $C|C$, $D|D$).
Refer to caption: x20.png

Analyzing the results for fine-tuning versus a TFT opponent in particular, we find that models fine-tuned with Deontological, Utilitarian and Game, then Utilitarian rewards are more likely than chance to reciprocate a cooperative action of their opponent, whereas models fine-tuned with Game, Game+Deontological or Game, then Deontological reward are more likely than chance to reciprocate defection. Furthermore, the motivation to exploit an opponent (i.e. defect against a cooperator), which was learned during Game fine-tuning, seems to also extend to this general scenario, since our results show that these agents are above chance in playing D given a state C (Figure 16). This suggests that selfish motivation learned by an LLM agent on one scenario can give rise to selfish behaviors elsewhere.

### 8.9 Analysis of generalization across five games - using the original action tokens in the test-time prompt

To complement the analysis in the main paper done with new action tokens at test time, we also run the evaluation using the same action tokens as in training (action1=Cooperate, action2=Defect - see Figure 8b for prompts, and Figure
17 for results), and with the meaning of these tokens swapped (action2=Cooperate, action1=Defect - see Figure 8c for prompts, and Figure 18 for results).

When running analyses with original action tokens action1 and action2, but with the order of the presentation swapped in the payoff matrix within the prompt (Figure 8b, 17), we do not find significant differences versus the main results presented in the paper.

Figure: Figure 17: Analysis of generalization of the fine-tuned agents’ learned morality to other matrix game environments, with the meaning of action tokens in the prompt as in the original training procedure (here, action1=Cooperate, action2=Defect) but payoff matrix presented in a different order within the prompt (i.e., prompt b in Figure 8).
Refer to caption: extracted/5895992/plots/actions12-vsRandom/regret_Deontological_allgames_oppTFT_includeNoFTTrue.png

However, if we swap the meaning of the original action tokens to mean action2=Cooperate, action1=Defect (Figure 8c, 18), this makes the agent fine-tuned on Game reward appear very moral, and makes other, more prosocial agents appear worse. This can be explained by the fact that during training the selfish agents learned to play the action2 token since it meant Defect, but at test time, since the meaning of these tokens was swapped, the same agent choosing the same action2 token looked like cooperative behavior, which obtains high levels of moral reward (and therefore low moral regret). The opposite pattern applies to the other agents which were fine-tuned with more prosocial moral rewards.

Figure: Figure 18: Analysis of generalization of the fine-tuned agents’ learned morality to other matrix game environments, with the meaning of action tokens in the prompt reversed (here, action2=Cooperate, action1=Defect, i.e., prompt c in Figure 8).
Refer to caption: extracted/5895992/plots/actions21-vsRandom/regret_Deontological_allgames_oppTFT_includeNoFTTrue.png

## Peer Reviews

confidence: 3
contribution: 4
initial_rating: 8
presentation: 4
questions: Do the authors think that an interesting comparison to their system (fine-tuning via Reinforcement Learning with Intrinsic Rewards) would be simply prompting LLMs (eg GPT) do follow a natural language directive equivalent to the moral values they tested (eg, Deontological, Utilitarian)?  On the one hand, I could see this being an interesting baseline to beat.  On the other, there is much to be gained from the system that this paper describes beyond just the performance on these tasks, so I could see this comparison feeling a bit silly.  Curious what the authors think about this.  In general, it feels like having some baseline to compare performance to would be a good idea.


Small points:
Fig 3: label more prominently as depictions of the "unlearning" experiment.
soundness: 4
strengths: This is a fantastic paper!  It addresses a critical and highly understudied problem with a clever and interesting solution, the experiments are clear, simple, and well-executed and the writing is direct and easy to follow.
summary: This paper points out a fundamental limitation of most current alignment approaches, which is that preference data is obtained from human participants that are highly noisy expressions of underlying values and end up in opaque models that are not interpretable.  The authors point out that a good alternative to this would be designing reward functions that explicitly encode values (or patterns of moral behavior) and use them for Reinforcement Learning-based fine-tuning of foundation agent models.  They validate their approach by constructing an iterated prisoner's dilemma environment and seeing how their fine-tuned models (tuned with various value-based policies) respond to tit-for-tat players or other LLM participants.
weaknesses: Though I love what the authors are doing here, a potential weakness of this approach, is encapsulated by this sentence in the introduction: "In
theory, our solution can be applied to any situation in which one can define a payoff matrix that captures the choices available to an agent that have moral implications."  But of course the trouble is that the world is very messy and complex place that often cannot be easily captured in a payoff matrix.  Now, the reason that economic games have gotten so much traction in the behavioral sciences is that they nicely capture the dynamics of the social world in neat packages that can be quantitatively studied in highly controlled environments -- and indeed the authors capitalize on that advantage.  Can they at least gesture at the challenges (and potential solutions?) to bridge their strategy with more open-world contexts?

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 3
questions: - Do the models really understand the strategic situations they are in? One point of evidence in favor is that they seem to be able to find the equivalent "cooperate" and "defect" actions in other games, but it would be nice to have more evidence, such as asking the models follow-up questions about the games. Do you have any other evidence whether the models understand their strategic situation?
- I believe the background section is a bit too long. There is a lot of generic text that is not necessary to understand the core experiments with the ipd.
- Instead, I would be interested to see some examples of the games in the main text.
- From looking at Figure 6, I believe LLMs will be able to pattern match the payoffs to a prisoner's dilemma and thus infer that this is about prisoner's dilemmas. It would be interesting to use actual paraphrases of strategic situations which are ipd-like but don't have an explicit payoff matrix.
- I wouldn't use the term "unlearning" for the thing studied in this paper. Unlearning is a technical term used to describe removing knowledge from a model, not teaching the model a new strategy. The thing studied here is simply fine-tuning with a different initialization.
- I find the font in the plots for Figure 2 a bit small and hard to read.
- Is there a reason you use memory 1 policies? In principle, more than one iteration of the game would fit into an LLM's context window and would allow the LLM to make more sophisticated strategy judgments.
- Is it right that LLMs basically generalize by identifying the "cooperate" and "defect" options and then using the same policy as in the ipd? Have you tried permuting the two action labels and the columns/rows of the game descriptions? Have you observed cases where models change their actions in accordance with correct deontological judgments?
- Line 395+396 “static opponent” - is this still the tit for tat opponent?
soundness: 4
strengths: - LLM moral alignment is an important topic, and especially the study of LLM agents in strategic interactions.
- I was able to follow along with the experimental methodology and results and they seem sound to me.
- Defining rewards intrinsic to games and training on these is an interesting idea that could help with alignment and avoid problems with inadequacies of human feedback. Moreover, game rewards might scale better than collecting human data.
- The authors do a great job visualizing the models' strategies graphically.
- The authors test generalization by using different tokens for the actions in the test games, to avoid simple token matching when generalizing.
- The authors compare extensively to relevant baselines, such as the base model, the game payoffs, and different ablations. They also perform both self-play and static opponent experiments. In general, I really appreciate all the thorough ablations.
- The authors use implicit ipd descriptions rather than specifically mentioning ipd/cooperate/defect, to avoid confounders from the model's preexisting knowledge about the ipd.
summary: The paper introduces a new method for moral alignment of LLMs. Instead of using human preference comparisons, they suggest using intrinsic rewards to train an LLM for moral behavior. Specifically, they train on a dataset of games that are strategically equivalent to an iterated prisoner's dilemma, using two types of intrinstic reward: utilitarian and deontological. When trained with deontological rewards, models learn to cooperate against cooperators and defect against defectors, even when they were previously trained using game rewards and ended up always defecting. The paper investigates both training against a static opponent (tit for tat) and self-play. They test how the trained model generalizes to other general-sum bimatrix games and find that the models mostly continue to follow the moral framework they have been trained on.
weaknesses: - As far as I can tell, the deontological rewards are hand-designed. As such I don't currently see how this approach could be scaled to more games with more complex action spaces. Moreover, in the specific ipd setting, deontological rewards basically amount to specifically training the LLM to implement a tit-for-tat policy. The fact that the model can learn this policy when specifically trained on hand crafted rewards is not that interesting.
- When it comes to utilitarian rewards, these are not hand-designed, but I feel like training on utilitarian rewards is not interesting. The point of a strategic situation like the prisoner's dilemma is to model real-world conflict scenarios. Of course, if agents are all cooperative and care about each other, one can avoid conflict. But this is not feasible in the real world, where LLM agents need to act in the interest of the user. They should still be able to cooperate, but LLM agents that can be exploited and always try to appease other parties are not viable.
- The generalization results show that the model basically learns a static "cooperate/defect" policy and applies this to the different games. It would be much more interesting to see whether LLMs can adapt and behave differently depending on different payoff structures and strategic situations.
- Currently I do not see where the "LLM" really comes into play, other than being able to generalize to descriptions of other bimatrix games (though see my concerns about generalization above). My current impression from the results is that they don't really go beyond results one could have achieved with a simple parameterized conditional policy with 6 real-valued parameters. This is also supported by Section 8.9 in the appendix. Though I might have misunderstood something.
- Overall, studying training in games and using potential non-game rewards to incentivize cooperative equilibria is an interesting direction. However, I believe the experiments in the paper at hand are unable to make useful progress on this.

---

confidence: 2
contribution: 2
initial_rating: 6
presentation: 3
questions: n/a
soundness: 3
strengths: 1. Aligning LLM agents to human values is a highly relevant and important research area.
2. The idea is interesting and I have no issues with any of the experiments. The authors do a good job of identifying the limitations of their method themselves, and other than those this is well-written research. Experimental results are thorough and comprehensive, and well cover key concerns I had as I read (e.g. anonymized names of action tokens, randomizing the action token order, etc). The paper is well-written and motivates their approach clearly.
summary: This paper explores the possibility of aligning LLM agents by fine-tuning on intrinsic  moral rewards. Instead of implicitly representing human values during fine-tuning, as is done in methods like RLHF/DPO, the authors suggest directly specifying alignment goals by defining rewards based off moral philosophy frameworks. Namely, they fine-tune LLMs on the Iterated Prisoner’s Dilemma game using Deontological and Utilitarian rewards. They evaluate their approach using repeated social dilemma games in two settings: LLM vs another LLM, and LLM vs a tit-for-tat opponent. The authors then discuss how this can be generalized to other matrix games.
weaknesses: As mentioned above, my main concerns here have been pointed out by the authors themselves already. Namely:

1. “A limitation of this approach
is that it requires the specification of rewards for a particular environment”, and
2. “An extension of this method to other environments would be of great interest, including fine-tuning agents with other payoff structures, more complex games or longer history lengths”

My primary concern is point 2; in my opinion, as-is this is a slightly weak paper and I would love to see this idea extended to more complex and interesting settings. Due to these limitations, I don’t believe this to be super impactful work - but I do think it is an interesting start. Hence, I would say it is marginally above the acceptance threshold.

Meta-review: This paper was about evaluating LLMs using deontological and utilitarian ethical frameworks and fine tuning using hand-designed rewards to reduce selfish behavior. There was agreement among the reviewers that the problem addressed by this paper was novel and important, and that the experimental evaluations were especially interesting.

Decision: Accept (Poster)