AI Glossary / Graphs and symbolic AI / Intermediate
Tit-for-tat
Definition
Tit-for-tat is a strategy for a repeated two-player interaction: cooperate on the first round, then copy the other player's action from the preceding round. It is especially associated with the iterated prisoner's dilemma and research on cooperation.
What it means
The strategy is simple but conditional. It does not cooperate regardless of the other player's behavior, and it does not continue punishing forever after one uncooperative move. If the other player returns to cooperation, tit-for-tat follows on its next move.
The repeated setting matters. The possibility of future interactions gives present behavior consequences beyond the current round. In a single encounter, there is no later opportunity for the strategy to reciprocate.
In AI, tit-for-tat is useful as an understandable baseline for agents in repeated games. Its historical tournament success does not make it universally optimal. Results depend on the payoffs, opponents, number of rounds, observation errors and what participants know about the interaction.
How it works
Represent the two available actions as C for cooperate and D for defect. Tit-for-tat selects C at round one. At round t greater than one, it selects the opponent's action at round t minus one. In a simultaneous game, it does not know the opponent's current action when choosing its own.
Against another error-free tit-for-tat player, both begin with C and continue cooperating. Against a player that always defects, it cooperates once and then defects on subsequent rounds. Against an alternating opponent, it follows that alternation with a one-round delay.
Noise changes the dynamics. If an intended cooperative move is executed or observed as defection, literal copying can produce continuing retaliation. Variants introduce different forms of forgiveness or error handling, but those variants should not be silently labeled as the basic rule. A simulation also needs an explicit payoff matrix and match-ending rule.
Three practical examples
- A multi-agent course uses tit-for-tat as a baseline against always-cooperate, always-defect and random strategies.
- A research simulation varies observation noise to study whether reciprocal agents recover from misunderstandings.
- A negotiation training exercise examines how repeated encounters change incentives, while acknowledging that real agreements have more than two actions.
Think of it this way
Think of two neighbors taking turns helping with a shared chore, with one deciding today's help from whether the other helped last time. The rule responds to recent behavior and permits a return to cooperation.
The analogy is deliberately narrow. Human relationships involve communication, constraints, intentions and unequal opportunities that a two-action game omits. The mathematical strategy is not a universal prescription for how people or organizations should handle conflict.
Worked example
Following the one-round delay
Use invented payoffs: mutual cooperation gives each player three points; mutual defection gives each one point; unilateral defection gives the defector five and the cooperator zero. The opponent's five actions are C, D, C, C, D.
Tit-for-tat's actions are C, C, D, C, C. Its first move is cooperative, and every later move copies the opponent's previous action. The resulting pairs are (C,C), (C,D), (D,C), (C,C), (C,D).
Tit-for-tat therefore receives 3 + 0 + 5 + 3 + 0 = 11 points. The opponent receives 3 + 5 + 0 + 3 + 5 = 16. This match demonstrates that tit-for-tat does not necessarily outscore its opponent in a particular encounter. If a sixth round occurred, its next action would be D. The example is a hand calculation, not a reproduction of a historical tournament.
Illustrative case study
Fictional case: Maple Agent Lab models two software agents deciding whether to share a useful resource in repeated rounds. The team includes tit-for-tat because its decisions are easy to audit.
An initial test with perfect observations produces sustained cooperation between two copies of the strategy. The team then introduces a simulated communication error. One agent interprets a cooperative action as defection, and the ensuing copying pattern differs sharply from the clean run.
Rather than describing reciprocity as a guaranteed coordination solution, the report separates error-free and noisy conditions. It compares recovery behavior and total payoffs under the same match lengths. The exercise shows why an understandable baseline remains useful even when a more suitable policy is eventually chosen. No real deployment outcome is claimed.
Common misconceptions and mistakes
- Tit-for-tat copies the opponent's current move. In the standard simultaneous repeated game it copies the previous move.
- It never forgives. Cooperation by the opponent is followed by cooperation on the next round.
- Winning a tournament proves universal optimality. A tournament evaluates a strategy against a particular set of opponents and rules.
Business use
For business-oriented AI work, the useful lesson is to examine repeated incentives and the reliability of behavioral observations. A reciprocal policy can behave differently when a missed action reflects a technical fault rather than deliberate non-cooperation.
Use the strategy as a transparent simulation baseline, with clear boundaries around what the game represents. Report payoff assumptions, horizon, opponent mix and noise conditions. Avoid translating a favorable toy-game score directly into a policy for customers, employees or commercial partners.
People also ask
Does tit-for-tat need a long memory?
The basic rule needs only the opponent's previous action, plus whether this is the first round.
Is tit-for-tat the same as grim trigger?
No. Grim trigger switches permanently to defection after a triggering defection; tit-for-tat follows subsequent cooperation.
Can a more complex strategy perform better?
Yes, under some opponents and conditions. Simplicity and historical success are not proofs of dominance in every repeated game.
Check your understanding
The opponent's first three moves are D, C, D. What are tit-for-tat's first four moves if a fourth round is played?
Answer: C, D, C, D. It starts with cooperation, then copies each previous opponent move.
Related terms
- Game theory
- Reciprocity
- Repeated game
- Strategy
- Iterated prisoner's dilemma
- cooperation
- multi-agent system
Learn next
Read repeated game and prisoner's dilemma. Write two short action sequences and calculate both players' payoffs. Then introduce one mistaken observation and trace how later actions change.
More in Graphs and symbolic AI
- Time and tense - Time and tense concerns how language describes when events or states hold, and how an AI system represents that temporal meaning.
- Time line - A time line, usually written timeline, is an ordered representation of events, states or activities in time.
- Time to answer - Time to answer is the elapsed time a user needs to obtain a satisfactory answer to an information need.
- Topological sort - A topological sort is an ordering of every vertex in a directed acyclic graph such that each directed edge goes from an earlier vertex to a later one.
- Total functions - Total functions assign exactly one output to every input in their stated domain.
- Total Turing Test - The total Turing Test is an expanded behavioral test that includes perceptual and physical interaction as well as conversation.
Sources
Axelrod and Hamilton, The Evolution of Cooperation, Science, 1981, author-hosted paper: https://public.websites.umich.edu/~axe/research/Axelrod%20and%20Hamilton%20EC%201981.pdf
Axelrod research software, strategy reference: https://axelrod.readthedocs.io/en/stable/reference/strategy_index.html
Relevant primary-paper passages and the strategy reference were consulted. Numerical sequences and the fictional case are original. Historical results are not presented as proof of universal optimality.
Previous: Timestep Next: Toeplitz matrix