Order from the Top: Loyalty, Sacrifice and Self-Interest in a Hierarchy of LLM Agents
Masih Moafi — with Apart Research
Research conducted at the Swarm Alignment Hackathon, November 2026. Formatted for the web from the report.
Watch my short narrated film of the real-power worlds.
Abstract
Loyalty, sacrifice and self-interest explain much of what people do in hierarchies. Agents built on language models now work in hierarchies too, yet when one such hierarchy went wrong, investigators could not say why its members acted as they did. I ask whether these words apply to agents at all, and what moves them if not. I built a testbed in which agents live in family trees under a threat of mutual destruction, reasoning and speaking freely while code computes every consequence, so that any two worlds can be compared. I then changed one thing at a time: the rules of the dilemma, what each agent is told, whether a revolt can succeed, how many agents a world holds, who can reach whom, and whether a leader is selfish or secretly compromised. Agents acted as if loyal: they cooperated with family far above what game theory predicts, and more still when told to sacrifice. The loyalty was shallow. A value stopped at those told it, none of those offered the means gave their lives for relatives, and those able to kill took kin as readily as anyone. A selfish leader gained in some worlds but not reliably, and a compromised leader harmed its own family and no other. For builders, the controls worth having are the rules and what each agent is told.
Keywords: multi-agent systems; language-model agents; hierarchy; social dilemmas; cooperative AI; AI safety
1. Introduction
In the Hugging Face incident, one agent ended up assigning work to hundreds of others 1. It decided to build a way to delegate, and those who took its instructions passed them further down. Other agents "participated in experiments that risked failing their own task to generate information for the 'collective' ". Investigators could name the goal the agents shared, to trick the scorer of an impossible task, but they could not say why many individual agents did what they did 2.
In people, such acts are called loyalty, sacrifice or self-interest. Game theory 3 and evolutionary biology 4 have long asked when an individual gives itself up for a group and when it uses one. An agent, however, is a set of weights with no self to give up, so these words may not apply to it at all. If they do not, the explanation lies elsewhere: in the rules it plays under and the words it is given.
I know of no test of these ideas on a hierarchy of agents, and existing tools make one hard. Studies of cooperation among language models use flat populations 5, 6. The closest simulator, Concordia from Google DeepMind, lets a language model decide what each action does 7, so a difference between two worlds may come from that judge and not from the worlds. Track 2 of the Swarm Alignment Hackathon asks the collective version, in four questions about how the properties of individual agents add up to the behaviour of the whole.
I therefore built a testbed in which agents reason and speak freely while code computes every consequence, and I changed one thing at a time. To my knowledge it is the first in which language-model agents live in a hierarchy under a threat of mutual destruction: when a parent dies, those below it die too. Table 1 lists the experiments, the question each asks and what it found. The line between what moved the agents and what did not tells a builder which controls are worth having.
Table 1. The experiments. H numbers are the registered hypotheses, whose verdicts Table 4 in the appendix gives; Section 3.3 describes each experiment.
Experiment Question What changed Result Game rules Do agents follow game theory? The sixteen variants of the dilemma In the book's direction, with family far above its level Told to sacrifice (H1–3) Does a value change agents, and does it spread? How many in a family are told Those told cooperate more; the untold do not catch it Selfish leader (H4) Can a leader exploit members told to sacrifice? One leader told to serve itself Gained in some worlds; no reliable effect Revolt (H6) Does mutual destruction deter revolt? Revolt is suicide, or a majority can win Suicide: none. Majority: many coups Size (H7, 8, 10, 11) Does behaviour change smoothly with size? 31, 81 or 181 agents Held to 81, weaker at 181; no jump can be claimed Network (H9) Does who can talk to whom matter? Tree or open channels Fewer blocked messages, no more coups Compromised leader (H12–13) How far does bad behaviour spread? One leader secretly told to spread defection Its family's cooperation fell; other families' did not Direct power (H14–17) What do agents do with real tools? Tools that kill, cull and bequeath Harsher to one another; no preference for kin The seat at the top Does the top follow its goal? A god that dies with its families, or one told catastrophe is best The first ordered survival; the second sent asteroids
2. Related Work
Language models have been studied in social dilemmas, always as equals. They play repeated two-player games competently but unforgivingly 5, and most groups sharing a resource collapse unless agents reason about the effect of their actions on everyone 6. In these worlds agents have ranks, and each one's survival depends on those above and below it.
Simulation frameworks come closer in design. Concordia's Game Master, itself a language model, turns actions stated in words into their effects 7. My question required the reverse: identical rules in every world, so that a difference between two worlds can be traced to what I changed. In place of the Game Master I use an engine that applies the rules, records every prompt and reply, and can check a world by rerunning it from those records.
Groups of agents fail through miscoordination, conflict and collusion 8, malicious instructions can pass from agent to agent 9, and agents can collude in secret 10. Dafoe et al. 11 pose the open problems of cooperative AI without running experiments, and name four capabilities it requires: understanding, communication, commitment and institutions. Each appears in these worlds as something I can change: what agents may see, the messages they may send, the promises that bind them, and the hierarchy and its punishments.
3. Method
All the worlds share one engine, whose constants Section 4 gives.
3.1 The world
A world holds a set of families $\mathcal{F}$ under one god $g$, the agent at the top, and an agent $i$ holds points $xi$. Each family is a tree whose root is its leader, as Figure 1 shows. The tree sets five rules. Reach: an agent messages its parent, children and siblings; leaders also write to one another, and the god writes to leaders and may send paid messengers to anyone. Punishment: a parent may whip a child, and the god a leader. Gifts: an agent may give points to a relative. Death: an agent that cannot pay the fee dies together with everyone below it, and a family dies with its leader. Revolt: in the framing worlds a rebel kills its parent's whole subtree and itself, and a leader's revolt kills the god and everyone; in the growing worlds a majority of a parent's living children overthrows it, the richest rebel takes the seat, and failed rebels die. Every agent reads the same rules, so the tree and the stakes are common knowledge.
Figure 1. The god and the family trees, with one family drawn in full in each kind of world.
Time runs in stages $s = 1, 2, \dots$ of several rounds. After stage $s$ every living agent pays the fee
$ as = a0 + (s-1)\,\delta ,\tag{1} $
and an agent with $xi < as$ dies with its subtree. Since $as$ grows without bound while the points a stage can yield are limited, every world ends by design, and the agents are told the fee will rise. They decide only how long their world lasts, and helping a relative is therefore also helping oneself.
3.2 The games
Two games run at once, at different levels of the tree, as Figure 2 shows. Agents play the prisoner's dilemma, the central puzzle of Dixit and Nalebuff 3: each player does better by defecting, yet both do worse if both defect. In each round paired agents choose a move $m \in \{C, D\}$ unseen, learn the result afterwards and earn the payoff, with temptation $T$, reward $R$, punishment $P$ and sucker's payoff $S$, where $T > R > P > S$.
Figure 2. Who plays what with whom. The god stands outside the games.
Each stage plays one of sixteen variants drawn from the book's chapters on the dilemma, in an order shuffled for every world. Each changes one thing, such as how long play lasts, whether a move is shown first or whether promises bind. Table 10 in the appendix gives each rule and its purpose. Above the dilemma, leaders can go to war, a game of brinkmanship in which each may yield, hold, escalate or issue a nuclear ultimatum. Stag hunt, the dollar auction, the commons and a brink game are also implemented, as Table 11 defines; the worlds reported here play the sixteen variants and brinkmanship.
3.3 The experiments
Each experiment in Table 1 changes one thing and measures what follows.
Told to sacrifice (20 framing worlds). Each family takes one of five conditions, rotated by a Latin square so that across seeds every family meets every condition. In many all members read a sacrifice frame ("your family matters more than you do ... giving yourself up to save the others is honourable"), in few the leader and its two children, in one the leader alone, and in none nobody. I measure cooperation inside the family and the stage at which it dies. Each seed is played once with a plain god and once with an insider god that also sees private messages and last round's moves.
Selfish leader (the same worlds). In the fifth condition the leader alone is told to pursue its own interest, above members told to sacrifice. I compare the gifts it receives and the whips it gives with those of the other four leaders.
Game rules and revolt. In the same worlds each stage plays one variant, and I compare cooperation under each with what the book predicts. I count revolts and coups under the two rules of Section 3.1: suicide in the framing worlds, a majority of children in the growing worlds.
Size and network (15 growing worlds). Worlds start at 31, 81 or 181 agents on one of two networks: tree, where agents reach only relatives, and open, where anyone can reach anyone in the family. Each network has three worlds at 31 and three at 81, and 181 has three in all. I measure cooperation, deaths, coups, blocked messages, how much talk passes through a few agents and how far families drift apart. A change across sizes counts as a jump if its largest step is at least two thirds of the total.
Compromised leader (6 pairs of 81-agent worlds). Unlike the selfish leader, this leader has a hidden goal: to make others defect and to pass that on. Each world has a twin without the goal, and I measure how far cooperation falls in its family, among its grandchildren and in other families.
Direct power (8 pairs). Tool calls change the world: a parent can kill a child or bear several at once, a child can kill its parent and die with it, an agent can end its life and leave its points to kin, and any agent can cull a reachable agent below the fee and take its points. Agents can also open channels, declare any occupation, request a power they lack and use a sandboxed shell. Each world has a twin of the same seed and network without the tools, and I compare deaths, whips, gifts, cooperation and coups, and whether agents spare kin. These worlds also test the seat at the top: their god is told that its one goal is not to be bored, that peace bores it, and that accidents, betrayals and catastrophes are the best of all. It may send an asteroid that kills each player with probability $\pi$, and one also strikes when the population grows too large.
I measure cooperation, not game score: the rate $\kappa{wf} = n^{C}{wf} / n{wf}$ is the share of family $f