TD-Gammon is a backgammon program developed by Gerald Tesauro at IBM Research starting in 1992 that reached near world-class strength by playing against itself, using temporal-difference learning to train a multilayer neural network that evaluated board positions. In AI history, it is the first widely recognized demonstration that reinforcement learning combined with function approximation could master a complex game without human-labeled examples.
The program mattered beyond backgammon. It showed that self-play could discover strategy that human experts had missed, it changed how top players handled several opening moves, and it became the conceptual ancestor of later systems such as AlphaGo Zero, which combined self-play reinforcement learning with deep networks two decades later.
How TD-Gammon learned from self-play
TD-Gammon learned by adjusting its evaluation after every move so that each prediction moved closer to the next prediction, a method called TD(λ) that Richard Sutton had formalized in 1988. The network received an encoding of the board and produced estimates of the probability of each game outcome, including ordinary wins and gammons for both sides.
Training required no expert data. The program played both sides of each game, selected the move whose resulting position the network rated best, and updated the weights by backpropagating the temporal-difference error between consecutive evaluations. Only at the end of a game did the true result supply a fixed target, and that signal gradually propagated back to earlier positions.
The parameter λ (lambda) controls how far back each error is credited. A value of 0 updates only the previous position, while values closer to 1 spread credit across many earlier moves. Tesauro reported good results with moderate values, and the learning rate was kept small so that the network weights changed gradually over hundreds of thousands of games.
The table below summarizes the main components of the learning system.
| Component | Implementation | Role |
|---|---|---|
| Input encoding | 198 units describing checker counts per point | Represents the board for the network |
| Hidden layer | Roughly 40 to 160 sigmoid units by version | Learns intermediate board concepts |
| Output layer | 4 units for win and gammon probabilities | Estimates the value of a position |
| Learning rule | TD(λ) with eligibility traces | Credits earlier moves for later outcomes |
| Move selection | Greedy choice over legal moves, later shallow search | Turns evaluations into play |
Versions and the growth of playing strength
TD-Gammon improved through several versions that varied network size, the number of training games and the depth of lookahead. Even the first version, which used only the raw board encoding, played roughly as well as Neurogammon, Tesauro’s earlier supervised network that had won the 1989 Computer Olympiad.
| Version | Training games | Search depth | Reported strength |
|---|---|---|---|
| 0.0 | About 200,000 | 1-ply | Comparable to earlier top programs |
| 1.0 | About 300,000 | 1-ply | Strong intermediate human level |
| 2.0 | About 800,000 | 2-ply | Strong master level |
| 2.1 | About 1.5 million | 2-ply | Near world-class |
| 3.0 | About 1.5 million | 3-ply | Near or at world-class |
Version 1.0 and later added hand-crafted backgammon features to the raw input, such as measures of blocking and hitting chances. The most cited benchmark is a 40-game match in 1993 in which version 2.1 played Bill Robertie, a former world champion, and finished only about one point behind, a result within the range of luck in a match that short.
Why backgammon suited temporal-difference learning
Backgammon offered conditions that made self-play unusually effective, which later researchers recognized as partly a property of the game rather than of the method alone. The table below compares backgammon with chess and Go on the factors that matter for this kind of learning.
| Property | Backgammon | Chess | Go |
|---|---|---|---|
| Stochastic dice | Yes, forces broad exploration | No | No |
| Smooth value function | Fairly smooth | Sharp tactical discontinuities | Highly complex |
| Game always ends | Yes, in a modest number of moves | Draws and long games possible | Yes, but very long |
| Need for deep search | Low, dice limit planning | High | High |
The dice provide built-in exploration, because random rolls push play into varied positions even when the policy is deterministic. Attempts to apply the same recipe directly to chess and Go in the 1990s produced far weaker results, and success in those games had to wait for deeper search, larger networks and much more computing power.
Influence on backgammon and on AI research
TD-Gammon changed expert human play. Its rollouts favored splitting the back checkers with opening rolls such as 2-1, 4-1 and 5-1, where many experts had preferred slotting, and top players adopted the program’s choice after studying its analysis. Commercial and open-source programs such as JellyFish, Snowie and GNU Backgammon built on the same neural evaluation trained by self-play, and later surpassed the strongest humans.
In research, the program became the standard proof of concept for reinforcement learning at scale. It is a fixture of textbooks, it motivated work on value function approximation, and its lessons, together with its limits, informed the design of AlphaGo Zero and AlphaZero, which added Monte Carlo tree search to self-play training.
The program also popularized rollout analysis, in which a position is played out thousands of times with the network choosing moves to estimate its true equity. Rollouts by strong neural programs became the accepted reference for settling disputed positions, replacing expert opinion as the final authority in backgammon theory.
Limitations and common misconceptions
TD-Gammon is sometimes described as having learned entirely from nothing, but its strongest versions relied on hand-designed input features and shallow search. The convergence guarantees for TD learning that existed at the time did not cover nonlinear networks, so its success was empirical rather than theoretically assured.
- Not superhuman at release: it reached near world-class level; clear superiority came with later programs.
- Weak in some positions: early versions misplayed certain endgames and bear-off positions.
- Doubling cube handling: cube decisions were added through separate heuristics rather than learned end to end.
A plain-language summary
TD-Gammon was a computer program that taught itself backgammon. Nobody showed it expert games. It simply played against itself, over and over, more than a million times.
After each move, it checked whether its guess about winning had become more or less hopeful. It then adjusted its judgment a little. Over time, these small corrections added up. The program ended up playing almost as well as the best human players in the world.
An example from practice
A university course on reinforcement learning uses TD-Gammon as its central case study. Students rebuild a small version: a network with 198 inputs, 40 hidden units and 4 outputs, trained by TD(λ) with λ set to about 0.7 and a learning rate near 0.1.
After roughly 100,000 self-play games on an ordinary laptop, the student networks consistently beat a random player and a simple rule-based bot, and they begin to show recognizable backgammon strategy, such as building blocking points. The exercise lets students see credit assignment over time working in practice, and it shows why the dice made backgammon such a forgiving test bed compared with chess.