---
title: "Transfer in Deep Reinforcement Learning Using Knowledge"
description: "How knowledge graphs, walkthroughs, and prior game experience help reinforcement learning agents explore unfamiliar text adventures."
canonical: "https://research.elamur.ai/free/en/papers/ammanabrolu-2019-transfer-deep-reinforcement-learning-knowledge/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/ammanabrolu-2019-transfer-deep-reinforcement-learning-knowledge/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2019](https://md.research.elamur.ai/free/en/papers/2019/) / Transfer in Deep Reinforcement Learning Using Knowledge Graphs

# Transfer in Deep Reinforcement Learning Using Knowledge Graphs

Paper · 2019 · Prithviraj Ammanabrolu and Mark Riedl

**Authors:** [Prithviraj Ammanabrolu](https://md.research.elamur.ai/free/en/authors/prithviraj-ammanabrolu/) and [Mark Riedl](https://md.research.elamur.ai/free/en/authors/mark-riedl/) · **Year:** 2019 · **Venue:** Proceedings of the Thirteenth Workshop on Graph-Based Methods for Natural Language Processing (TextGraphs-13) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the Thirteenth Workshop on Graph-Based Methods for Natural Language Processing (TextGraphs-13) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/D19-5301/)
- [PDF](https://aclanthology.org/D19-5301.pdf)
- [DOI 10.18653/v1/d19-5301](https://doi.org/10.18653/v1/d19-5301)

## Summary

A player entering a new text adventure already has some idea of what might be worth trying. A tool may have a familiar use, and a setting can suggest what to expect from an unfamiliar object. A reinforcement learning agent that starts from scratch must acquire such preferences while also solving the game’s puzzles. It faces two problems at once. The game describes only part of its world at a time, and even a limited vocabulary can produce a large number of commands. The authors ask whether experience gathered elsewhere can help an agent find productive actions sooner.

Their experiments build on KG-DQN, an agent that estimates the future reward associated with a command. As it plays, the agent turns descriptions into a [knowledge graph](https://md.research.elamur.ai/free/en/concepts/knowledge-graph/). Its edges can represent exits, object properties, and items in the player’s possession. These relations help the agent decide which commands to consider. The study supplies prior knowledge in several ways. Written guides furnish relations for the initial graph. Successful playthroughs furnish examples for [question answering](https://md.research.elamur.ai/free/en/concepts/question-answering/), which prepares parts of the network before reinforcement learning. Training on a source adventure then produces a set of weights that the agent can adapt in a separate target game. The target builds up its own record of the world during play.

The authors test transfer from a generated household adventure to *9:05*, and from *Afflicted* to *Anchorhead* in the horror genre. With added rewards for actions along a solution path, the full procedure reduces the mean number of actions needed to finish the selected *9:05* objective from 1267.2 for the target-trained baseline to 274.76 after convergence. On the shortened *Anchorhead* objective, the corresponding mean final reward rises from 6.8 to 39.9. The learning curves also show an advantage during training. In *Anchorhead*, the full procedure helps the agent get beyond a puzzle that requires a name it has yet to encounter in play.

The results depend on how the authors set up the games. The horror tasks end at intermediate goals and restrict the initial command pool to actions relevant to those portions. Walkthroughs also determine when the agent can earn small bonuses during training. The horror agents fail to learn successful completion under sparse reward. Within the augmented setup, the comparisons show that a guide or preliminary practice can help by itself, and that the strongest target results come from combining both with source-game training and adaptation to the target.

## Deep dive: Transfer in Deep Reinforcement Learning Using Knowledge Graphs

This study tests how guide-derived knowledge graphs, walkthroughs and prior play help reinforcement learning agents tackle new text adventures. · about 37 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### What the game tells the player

The paper treats text adventures as a way to study action grounded in language. A player reads a response, decides what situation it describes, and tells the game what to do next. The game then supplies another response. A command can change the world, bring previously hidden information into view, or yield very little. To learn from this exchange, an agent needs a representation that connects what the game says with the choices available to it.

The game keeps track of more than it describes. Consider the paper’s household example. A bedroom description places objects on a table and gives a direction to the bathroom. After the player goes there, the game describes the bathroom and its fixtures. The earlier information about the bedroom still matters if the player later needs something from the table. Remembering where an item was seen can change the value of returning to a room, even if the current description concerns a different place entirely. The authors call this problem partial observability. The agent receives a view of the underlying game state through observations, and the latest view may omit a fact relevant to the next decision.

The amount of text is a separate issue from how much of the world it reveals. The paper’s *Anchorhead* example describes a lane, an alley, and nearby buildings in more elaborate language than the household scene. Some phrases establish directions or object locations. Others characterize the surroundings. Even a long description leaves the agent with the job of identifying which relations might matter later. A short inventory response can meanwhile establish what the player has at hand. An account of the world assembled across turns has to accommodate both kinds of evidence.

The authors also emphasize the puzzle structure of the games. A player may need to find a particular object, use it in a specific situation, and follow up with another action before the game recognizes substantial progress. A training agent that rarely completes such a sequence receives little evidence about which of its earlier choices helped. As the paper describes the field, training had already required hundreds of thousands of simulations in some text-game experiments. The cost makes the starting point of learning important. Greater familiarity with a game’s kinds of objects and commands could help the agent reach situations where it gets more informative feedback.

#### Why readable commands are difficult to search

A parser is the part of the game that interprets a typed command. Its repertoire defines which forms the game can read, such as a form that puts an object into a container. Each object name can be tried in a slot, and a command with a pair of slots permits many combinations. A string that follows the expected form may name items nowhere near the player. Even when its objects are present, carrying out the command may make little progress on the quest. Finding a useful action therefore involves several successive questions about syntax, the current situation, and the possible consequences.

The paper describes earlier text-game agents that address different parts of this search. LSTM-DQN learns scores for verbs and objects separately and uses those scores to assemble an action. Splitting the decision gives the agent a way to use evidence about the pieces of a command. The paper presents this work as an earlier effort to make the language action space tractable. [Language Understanding for Text-based Games Using Deep Reinforcement Learning](https://md.research.elamur.ai/free/en/papers/narasimhan-2015-language-understanding-text-based-games/)

The Deep Reinforcement Relevance Network uses distinct encoders for state and action. An encoder turns its input into a numerical representation that a network can use. An interaction between the two representations gives the value of a particular action in a particular state. The Action Elimination Network instead uses emulator feedback to retain a set of likely actions. The paper also describes an interactive fiction agent that combines modules to identify gameplay rules with wider applicability. These approaches supply ways to form, judge, or narrow commands. The authors identify a further question about how much of that work can carry over when the agent moves to a different adventure.

Shared genre gives a reason to investigate that question. Household adventures frequently draw on ordinary uses for familiar objects. Horror can draw on expectations tied to its stories, such as a connection between a coffin and an undead creature. Such an expectation can help decide what to examine before the game confirms the contents of any particular coffin. The distinction between a possible use and a fact about the current world is central to the paper’s design. Prior knowledge can direct attention, while observations establish the local details of the adventure.

#### What earlier transfer methods supplied

Transfer requires some correspondence between the source problem and the target problem. A room layout from one game may have little direct bearing on another, yet directions can play a comparable role in both. Commands can serve related purposes while taking different object names. The authors characterize the difficulty as learning a mapping between the games’ states and actions. A greater difference between domains makes it harder to establish which parts of a previous policy will still be useful. In reinforcement learning, a policy is the procedure that selects actions.

The paper situates this question among approaches that transfer skills, value functions, or policies. A skill may be useful in several tasks. A value function carries judgments about the expected benefit of actions or situations, and a policy carries preferences about what to do. Some earlier approaches use an explicit account of the environment and depend on correspondences designed by hand. The paper also describes work that learns relationships across game domains with the help of natural-language descriptions. In that work, descriptions provide grounding for information used in transfer. Text is thus both part of the challenge and a possible means of connecting tasks.

A separate line of work uses expert policies to teach a network that can initialize another task. The paper describes policy distillation in this role, as well as approaches that draw on expert policies using attention. It gives particular attention to a design that retains fixed source parameters and lets them contribute alongside parameters trained on a target. This provides an ongoing source-policy contribution during learning. The authors of the transfer study instead use source weights as the initial values of a network that can change with target experience. [Progressive Neural Networks](https://md.research.elamur.ai/free/en/papers/rusu-2016-progressive-neural-networks/)

The immediate starting point was the authors’ earlier KG-DQN study. It used games produced by a grammar, allowing a collection of closely related worlds and quests to be generated. An oracle could supply perfect playthroughs for preliminary training. The earlier work used those traces to prepare components that represent observations, graphs, and actions. In recounting that study, the authors distinguish improved policy quality at convergence from the lack of a significant improvement in the time to reach convergence through that preliminary training. They also point to the practical difficulty of finding a large collection of very similar games outside a generator. [Playing Text-Adventure Games with Graph-Based Deep Reinforcement Learning](https://md.research.elamur.ai/free/en/papers/ammanabrolu-2019-playing-text-adventure-games-graph/)

This study broadens the sources of prior knowledge. A guide can contribute a relation directly. A successful playthrough can prepare the encoders that will later process game information. A trained value network can bring preferences learned through interaction. These routes answer different aspects of the same problem. The first is about the facts available to an agent when it starts. The second concerns how it represents the language and relations it encounters. The third concerns what previous experience has taught it about the consequences of acting. The paper tests them within a common architecture so that its comparisons start from the same basic way of playing.

### The method, step by step

#### How a turn works

To see how the pieces fit, start with the bedroom and bathroom in *9:05*. The bedroom description supplies a possible destination, furniture, and names for objects. An inventory response supplies information about what the player is carrying. The agent turns these observations into links that it can refer to later. When it considers commands, those links help determine which candidates deserve attention. Its network then estimates the value of a candidate in the situation represented by the observation and graph.

A move to the bathroom produces another observation and another opportunity to acquire facts. The new description can add a link back toward the bedroom, along with relations involving the sink, toilet, and shower. As the player moves, the graph can accumulate information about locations beyond the one currently described. The next command depends on a combination of immediate text, relations available in memory, and a value estimate learned from the outcomes of earlier actions.

The full transfer procedure changes what is available before those first turns. A written guide supplies an initial set of relations. Successful play supplies training examples for the components that encode the game information. A reinforcement learning run on a source game gives the network practice assigning value to actions under feedback. At the target, the network begins from those learned values of its parameters, and the graph gathers facts about the new game.

How prior knowledge reaches the target agent The steps in order.

The agent used for these experiments is the authors’ KG-DQN implementation. They retain the earlier architecture while adapting how it obtains command templates and extracts relations for general interactive fiction. The source and target can therefore share the machinery for encoding information and evaluating commands even though play yields a different graph in each game.

#### The world, its observations, and their representation

The authors formalize a text adventure as a partially observable Markov decision process. This gives the game a set of true states and a process that produces observations. Their tuple is the following.

```
⟨S, T, A, Ω, O, R, γ⟩
```

The angle brackets enclose the components. S is the set of environment states. T describes the conditional probabilities for transitions among those states. A is the action component, described in terms of the words used to form textual commands. Ω is the collection of observations, and O gives their conditional probabilities. R is the function that assigns reward. The discount factor γ controls the contribution of future reward to a present action value.

The state in this formal description belongs to the game. The encoded state used to score a command belongs to the agent. Location, possession, and other useful aspects of the game state can be reflected in the encoding to the extent that the agent has observed and represented them. The distinction explains why the paper can speak of state as an input to the network while also treating the game as partially observable. The agent constructs that input from the information it has acquired.

The graph organizes extracted information into directed triples. In a triple, the subject is the starting entity, the relation names the connection, and the object is the entity or property at the other end. A direction from a room to another location is an example. A relation between the player and a carried item is another. An affordance describes a possible use for an object, and can be stored alongside information about where the object is and what properties it has. These types of links can all inform different commands.

During play, the agent obtains triples from the latest observation with an OpenIE system and additional rules. OpenIE performs [information extraction](https://md.research.elamur.ai/free/en/concepts/information-extraction/) by turning statements in text into relations. The supplemental rules address devices that recur in game descriptions, including cues for navigation and inventory. The authors modify rules from the earlier KG-DQN agent to handle descriptions in the broader interactive fiction setting. The paper attributes its OpenIE approach to work on [Leveraging Linguistic Structure For Open Domain Information Extraction](https://md.research.elamur.ai/free/en/papers/angeli-2015-leveraging-linguistic-structure-open-domain/).

The diagrams show the difference between preserving a relation and preserving the whole passage that elicited it. In *9:05*, a scene can yield links involving a table and its objects, separate relations for carried items, and a directional connection involving the bathroom. In *Anchorhead*, moving into an alley yields new material about the surroundings, including a fence and a window, alongside information extracted from the earlier description near the real estate office. These examples show facts recovered during play before any benefit of guide seeding is considered. They also show why recurring extraction rules matter. A description of scenery has to supply usable connections despite differences in wording and detail.

The graph follows an open-world assumption. When a relation is missing, its truth remains unresolved. An unexplored room can contain an important object even though the graph has no record of the object there. An object may have a useful property that the relevant observation has yet to reveal. This assumption fits a representation built from successive glimpses of the world. It also permits the agent to start with disconnected pieces of information and add associations as they become available.

#### Starting the graph from a guide

The authors call their guide-based initialization seeding. To produce a seed, they process general guides to text adventures and use genre- or game-specific resources when available. They apply part of the rule set used for game observations and obtain additional triples using OpenIE. This yields relations about commonly encountered actions, objects, and possible uses. Because a guide may discuss independent situations, the resulting graph can contain several disconnected groups of relations.

The paper distinguishes this starting information from a map recovered by visiting rooms. A guide can associate a kind of object with an appropriate action or introduce vocabulary characteristic of a genre. The particular connections between locations in the game emerge as the agent observes them. Starting with the guide graph gives the agent relations to consult while those local facts are still scarce. As play continues, both the prior relations and the facts from the adventure can be available to the mechanisms that use the graph.

The rationale follows from the graph’s job in selecting actions. An empty graph gives the ranking procedure little to work with at the outset. The agent may have to attempt many commands before it happens upon useful feedback. A guide relation can make an action a better candidate early in play, while the command’s actual effect still has to be learned from interaction. The intervention can influence exploration even before the value network has had much opportunity to update. The strength of the effect depends on which facts the guide supplies and where the game makes those facts relevant.

#### Making the command pool manageable

The authors give the agent access to parser-compatible action forms. For general interactive fiction, they obtain templates by replacing the objects or noun phrases in accepted commands with slots. The placeholder in the paper is `OBJ`. A placement command, for instance, can have a slot for the thing being moved and a slot for the receiving object or location. Filling the slots with possibilities from the game vocabulary generates the candidate strings.

The paper describes the scale of the resulting space with this expression.

```
A = O(|V| × |O|²)
```

A here denotes the action space whose size is being characterized. The first O is big-O notation, which describes an order of growth. V denotes the action verbs, and the O inside the second pair of bars denotes the game’s distinct interactable objects. The bars indicate the size of a set. The multiplication sign combines the contribution of the verbs and the object choices. The superscript ² reflects combinations of objects in commands with a pair of slots. The object-set O in this expression has a different meaning from the observation-probability O in the decision-process tuple.

The number of possible fillings can be large even when the game has a modest number of rooms. Many of those fillings are unlikely to be appropriate in a particular room or with the current inventory. KG-DQN ranks actions based on their presence in the graph and on the graph relations connecting their objects. This is the graph’s pruning role. The ranking narrows the set of candidates that the agent considers for action selection.

The method therefore has more than one way to assign relevance. The parser templates determine what the agent can form. The graph determines which candidates are worth keeping in consideration. The network scores a candidate in relation to the encoded state. A name that appears somewhere in the game vocabulary can permit a command to be formed long before that name occurs in a description. Whether the agent is likely to consider and try the command still depends on the available relations and the learned values. The *Anchorhead* puzzle analysis makes that distinction concrete.

#### Scoring actions and learning from feedback

KG-DQN represents the situation and the command with separate encoders. The state side takes account of the observation and the graph. The action side encodes the candidate text. A function of the resulting pair assigns a Q-value, which expresses the estimated benefit of taking the action in that situation, including subsequent reward. The same command can receive different values as the represented circumstances change.

The paper gives the Bellman update in this form, retaining its indexing.

```
Qₜ₊₁(sₜ₊₁, aₜ₊₁) = E[rₜ₊₁ + γ max[a ∈ Aₜ] Qₜ(s, a) | sₜ, aₜ]
```

Q is the action-value function. The subscript t denotes the current index, and t + 1 denotes the following index. The symbols s and a denote a state and an action. Their indexed versions identify the corresponding state and action at the specified step. E is expectation, and the vertical bar conditions it on sₜ and aₜ. The quantity rₜ₊₁ is the reward observed at the next index. The Greek letter γ is the discount factor. The maximum ranges over actions a belonging to Aₜ, the action set indexed by t in the equation. The plus sign joins the immediate reward to the discounted maximum value. The update expresses the idea that an action can be valuable for the opportunities it opens as well as for the reward it yields immediately.

The paper gives the network’s temporal-difference expression as follows.

```
L(θ) = rₖ₊₁ + γ max[a ∈ Aₖ₊₁] Q(sₜ, a; θ) − Q(sₜ, aₜ; θ)
```

L is the quantity the authors call the temporal-difference loss. θ denotes the trainable network parameters. The symbol rₖ₊₁ denotes the reward at index k + 1, and γ again discounts the estimated future contribution. The maximum considers commands a in the action set Aₖ₊₁. Q is the value predicted by the network with parameters θ. The encoded state is sₜ, and aₜ is the encoded action taken at index t. In each Q expression, the punctuation before θ separates the input arguments from the parameters. The plus sign combines reward and discounted value, and the subtraction compares that total with the estimate for the action actually taken. The printed expression mixes the indices k and t and presents the signed difference directly. Its notation leaves the relationship between those indices and any further transformation of the error unspecified.

The agent trains with prioritized experience replay. Interactions are stored so that later updates can draw on past experience, with the priority affecting which stored interactions are selected. The training procedure also uses a modified ε-greedy rule. The symbol ε controls exploration interspersed with choices guided by the current estimates. Pruning can direct attention to plausible commands, while exploration and replay supply evidence about whether those commands lead somewhere useful. This is how the system can change an initial preference after seeing its consequences.

#### Using successful play before reinforcement learning

For preliminary training, the authors obtain traces in which a game is solved. A trace records the situations encountered and the actions used to progress. The authors describe an oracle as a procedure that completes the game in the fewest possible steps. In TextWorld, the experimental setup can obtain quest solutions from the framework. For human-authored adventures, the authors derive traces from online walkthroughs. These traces give examples of what an effective action looks like in a particular situation.

The authors train a question-answering system on that material using an approach from [Reading Wikipedia to Answer Open-Domain Questions](https://md.research.elamur.ai/free/en/papers/chen-2017-reading-wikipedia-answer-open-domain/). They use its parameters to initialize the same components prepared through question answering in their earlier KG-DQN work. Those components are responsible for encoding observations, graphs, and actions. This stage gives the encoders earlier practice with the kinds of associations that occur in successful play. Reinforcement learning subsequently adjusts their weights as part of learning a control policy.

The question-answering traces and the guide provide experience in different forms. A useful fact extracted from a guide can be inspected as an edge in the initial graph. Learning from a walkthrough changes the numerical parameters that process inputs. Accordingly, a run with question-answering preparation can begin with trained encoders even when it has an unseeded graph. A seeded run can begin with relevant relations even when it has ordinary network initialization. This separation is what lets the authors compare the two forms of preparation.

#### Adapting a source policy to the target

The source is a different adventure from the target. After question-answering preparation, the source agent learns through interaction with that adventure. The authors can also seed its graph to support exploration. Source training adjusts parameters in response to the source game’s feedback. Those parameters now reflect both the preliminary training and the consequences of acting in the source task.

To begin target training, the authors copy all the KG-DQN weights shown in their architecture into a new network. Those weights remain trainable. The target policy uses that network and changes it as the agent receives target observations and rewards. A separate source policy therefore has no ongoing decision role during target training. The procedure transfers the learned numerical machinery for using graph, text, and action information, including the weights that turn their representations into action values.

The graph constructed by touring the source game is tied to that game’s geography and objects. The authors treat it as unsuitable for copying into the target. The target can receive its own seed and then add its own facts. This gives a concrete meaning to transferring a graph embedding, the learned numerical representation used by the network. The representation can be applied to newly extracted relations even though the entities and connections it represents during source play belong to another world. The complete recipe thus combines explicit starting relations, encoders prepared on successful play, and a value network adapted first to a source and then to a target.

### Experiments and results

#### How the games are assigned

The evaluation uses the Jericho and TextWorld frameworks. The authors choose domains based on the available games, similarities in overall structure, and overlap in vocabulary. Each domain needs material for question-answering preparation as well as distinct games for source and target reinforcement learning. The source gives the network an opportunity to learn consequences from interaction. The target is where the paper measures whether that prior training helps with a new task.

For slice of life, the authors generate 50 household games using the home theme in [TextWorld](https://md.research.elamur.ai/free/en/papers/cote-2018-textworld-learning-environment-text-based/). The split for question answering has a train-to-test ratio of 4:1. The test set is used to evaluate the system that answers questions, while the training set supplies the training traces. The authors then randomly pick a game from that test set as the reinforcement learning source. This makes the source a held-out game for the earlier question-answering training stage, while preserving the shared theme and generation procedure.

TextWorld can provide the solution to a quest and a list of actions applicable in the current state. The reinforcement learner plays without being given those aids. Its source reward does provide progress information. The game awards +1 when an action moves the player towards completion, -1 when an action increases the minimum number of remaining steps, and 0 in other situations. The trajectories used to generate the question-answering training material are therefore distinct from the interaction experience on which the source policy learns.

The slice-of-life target is *9:05*, chosen for similarities in structure and vocabulary. The authors select the simplest of its possible endings as their objective. The game statistics illustrate how the target can demand more search even with a smaller vocabulary. The generated TextWorld entry has vocabulary size 788 and branching factor 122. For *9:05*, vocabulary size is 297 and branching factor is 677. The listed solution length is 5 steps for TextWorld and 25 for *9:05*. The paper’s vocabulary overlap statistic relates a game’s vocabulary to the combined vocabulary of its domain. It should be read as a measure against that union, with pairwise overlap between a given source and target remaining a separate question.

For horror, the question-answering material comes from *Lurking Horror*. The source is *Afflicted*, and the target is *Anchorhead*. The authors reduce the objectives of the latter games to intermediate goals located manually using walkthroughs. *Anchorhead* has objectives arranged across 3 days in 3 chapters, and its experimental objective ends with the first chapter. The agent can still explore most of the environment, but the authors restrict the starting action pool to commands relevant to the selected portion. This restriction precedes the graph-based pruning carried out during play.

Even after those changes, the horror tasks present a substantially larger branching factor than the generated source in the household domain. The paper gives *Afflicted* a branching factor of 947 and *Anchorhead* a branching factor of 1918 for the selected tasks. The listed solution lengths are 20 steps and 39 steps, respectively. Mean observation lengths are 81.2 words in *Afflicted* and 114.2 in *Anchorhead*. Together with the longer route, the greater amount of text and the wider command choice describe why the horror target remains demanding under the reduced objective. The figures for *Lurking Horror* characterize the walkthrough used for preliminary training.

#### What the reward and the metrics measure

The original signal in a commercial adventure can be sparse in relation to the search space. The paper describes the basic case as a positive reward when the game is completed, with little indication along the way. In a long puzzle sequence, an action can be a necessary part of a solution without delivering an immediate score increase. The difficulty of learning from such feedback motivates the authors’ reward augmentation.

They use a successful trace to identify state–action checkpoints. When the agent reaches the corresponding state and performs the matching action, it earns an additional reward on top of the game’s own signal. The bonus is scaled for the particular game and designed to be smaller than the smallest original reward. The authors call this condition dense reward. The sparse condition omits the walkthrough bonuses. The agent still has to reach the relevant situation and select the action to earn a bonus. This setup gives it feedback at more points along a solution without supplying the next action at decision time.

There are consequently different opportunities for a trace to influence the experiment. A trace used in question answering affects the initial encoders. A target trace used to assign rewards affects what the reinforcement learner is told about an action after it tries it. The horror target comparisons use the latter form of guidance even in the no-transfer baseline. This makes the dense baseline a comparison for the added value of transfer when both agents have access to the augmented training signal.

Each experiment is run three times with different random seeds. Initial reward averages the score collected during the first 50 episodes. Final reward is the average over 50 episodes after convergence. The steps measure describes how many commands it takes to complete the task over the post-convergence evaluation episodes. During that evaluation, ε is set to 0.1. Completion steps thus describe play under the stated exploration rule. They can be much longer than the reference solution, which is chosen to finish efficiently. The reward curves address a different question by showing how reward develops as training episodes accumulate.

The main baseline is KG-DQN trained without prior transfer. It can still construct a graph from its current game and use it to prune actions. Other runs give KG-DQN question-answering preparation or a graph seed on its own. The full target runs combine both preparations with source training and adaptation to the target. The authors also report an untuned condition, where a network trained on the source is evaluated on the target without target training. The household target table includes sparse and dense conditions. The reported horror results use dense reward throughout. For horror the authors use word embeddings of 100 dimensions, compared with 50 dimensions in the setup they otherwise follow. These embeddings are numerical representations of words used by the encoders.

#### The household games

The generated source shows modest differences in converged reward. With no transfer, the initial and final means are 2.6 and 4.7. Question-answering preparation gives initial and final means of 2.8 and 4.9. The seeded source reaches an initial mean of 3.2 and a final mean of 4.8. All these figures refer to reward under the TextWorld source setup. The final scores give a similar broad picture of how much reward each trained policy collects.

Completion steps distinguish these source policies more clearly. The baseline averages 110.83 steps after convergence. The question-answering version takes 88.57, and the seeded version 91.43. This pattern gives practical meaning to measuring both reward and steps. Agents can reach similar scores while requiring different amounts of interaction to finish. It also shows the difference between early reward and eventual route length. The variant with the strongest initial score is the seeded one, while the variant with the shortest mean route is the one prepared through question answering.

On *9:05*, the strongest completion performance comes from full transfer under dense reward. The following comparison gives post-convergence steps for trained configurations, along with the untuned source policy evaluated with dense reward.

Mean completion steps for the selected 9:05 ending with dense reward The full transfer procedure gives the shortest average route.

**The numbers**

| System or setting | steps |
| --- | --- |
| Source policy without target training | 1479.0 |
| Target training from scratch | 1267.2 |
| Question-answering initialization | 1127.0 |
| Guide-seeded graph | 1393.33 |
| Full KG-DQN transfer (this paper) | 274.76 |

For the full procedure, the paper reports 274.76 ± 21.45 mean completion steps, compared with 1267.2 ± 7.5 for the baseline trained on the target with dense reward. The seeded dense configuration takes 1393.33 ± 26.5. Having guide relations at the beginning therefore fails to guarantee a shorter final route on this target. The question-answering condition is the strongest of the individual preparations on dense-reward completion steps, but its route is still substantially longer than the one learned through the complete pipeline.

The sparse comparisons show that some benefit of preliminary training is available without the walkthrough bonuses on this target. The mean for the sparse baseline is 1916.0 steps, and the mean for sparse target training with question-answering preparation is 1428.0 steps. Both configurations have lower mean steps in their respective dense conditions. The comparison shows that the training reward itself has a bearing on the efficiency of the eventual route. The large gain for full transfer can be judged against the dense baseline, which keeps that form of feedback available to both agents.

The reference route of 25 steps for the selected ending also gives scale to the learned behavior. Even the strongest mean completion result involves much more play than the reference route. A completed run under the evaluation policy can include attempts, exploration, and movements that a solution trace has already resolved in advance. The result concerns how much that extra play is reduced while finishing the objective, with the reference route providing a separate standard of efficiency.

#### The horror games

For the shortened *Afflicted* task, the baseline collects mean initial reward of 3.0 and final reward of 14.1. With question-answering preparation, the corresponding values are 4.3 and 15.1. With guide seeding they are 4.1 and 14.6. Mean post-convergence completion steps are 1934.7 for the baseline, 1179 for question-answering preparation, and 1125.3 for seeding. Here again, preparation can visibly improve route length while changing the final score by a more modest amount. Question answering leads on reward among the source settings, whereas the seeded agent has the shortest mean completion route.

On *Anchorhead*, the reward metric includes policies that fail to finish. This matters because the baseline gets reasonably far into the shortened task and then stops making substantial progress. The untuned source policy also has a reward result without a corresponding completion-step measurement. The full method achieves the highest mean final reward among the tested target settings.

Mean final reward on the shortened Anchorhead task with dense reward Full transfer earns the highest reward after training.

**The numbers**

| System or setting | reward |
| --- | --- |
| Source policy without target training | 3.8 |
| Target training from scratch | 6.8 |
| Question-answering initialization | 24.8 |
| Guide-seeded graph | 26.6 |
| Full KG-DQN transfer (this paper) | 39.9 |

Full transfer gives a final mean of 39.9 ± 0.53, and the authors report 41 as the best reward observed for their strongest agent. The dense baseline’s final mean is 6.8 ± 0.42. Seeding gives a mean final reward of 26.6 ± 0.42, with the question-answering condition at 24.8 ± 0.6. Thus each individual preparation improves the target’s final score under a common training reward. Combining the preparations with source learning and target adaptation produces the strongest result.

The completion-step figures available for *Anchorhead* are 4874 ± 90.74 with question-answering preparation, 4937 ± 42.93 with seeding, and 4334.3 ± 56.13 with full transfer. These values describe the settings with reported completion steps. The table leaves that metric blank for the baseline and the untuned policy, so the scored progress of those settings is visible through reward. A final mean reward and a completed route answer distinct questions, especially when a policy settles at an intermediate puzzle.

The paper also reports an episode-based comparison. It describes a run with question-answering preparation, 50 episodes of source play, and 50 episodes of seeded target training as more effective than training on the target alone for 150+ episodes. The curves support the authors’ account of faster progress towards a higher-reward policy. That comparison concerns training across episodes. The post-convergence step counts instead describe how much interaction the trained agent needs to finish its assigned objective.

### What the ablations show

#### Early guidance and eventual performance

The comparisons with individual forms of preparation test changes to the same underlying KG-DQN agent. A seeded agent has relations available before it has explored much. An agent prepared through question answering begins with different weights in its encoders. A baseline without either intervention still builds a graph as it goes. The experiment thus compares when and how prior information is supplied within a graph-based architecture.

The household source results show why the paper distinguishes between stages of performance. The seeded agent obtains the greatest initial mean reward, suggesting that its starting information helps it find productive actions early. The question-answering agent obtains the shortest mean completion route after training. On *Afflicted*, the early ordering favors the question-answering agent, while seeding gives the lowest mean steps among the source configurations. If early reward and completion steps were interchangeable measures, these rankings would agree. Their variation shows that prior information can help with early progress and the eventual route in different ways.

The disparity is particularly clear in *Anchorhead*. Across the initial 50 episodes, the dense baseline has mean reward 1.0. The seeded agent has 1.7, the question-answering agent 3.6, and the full agent 4.1. Among the individual preparations, question answering has the stronger early result. Seeding later has the higher final mean reward of those preparations. That reversal narrows what can be inferred from early progress. A preparation can quickly improve the first decisions an agent makes while another contributes to a policy that reaches a better score as experience accumulates.

The authors report t-tests for the comparisons of seeding and question-answering preparation against the KG-DQN baseline and give a significance threshold of p \< 0.05 for the reported effects. They separately say that the initial-reward differences between the two preparations are statistically indistinguishable in their comparisons except for *Anchorhead*. That result concerns the early metric. The tabulated means show that the direction and magnitude of a practical benefit vary with the game and the outcome. In particular, dense seeding on *9:05* has a longer mean completion route than dense training from scratch. The paper’s broad account of improvements with preparation is most informative when read together with the individual measurements.

#### What happens at the file cabinet

The authors relate the *Anchorhead* plateau to a specific puzzle. A player at a file cabinet needs to issue a lookup command using the name Verlac. The name is required before the player has observed it. This presents a different search problem from noticing an object in a room and applying a familiar verb to it. The game vocabulary may allow the needed string to be constructed, but candidate selection based on observed entities has little direct evidence for choosing it.

The no-transfer target agent reaches a score of roughly 7 and fails to learn to finish. At that point, accumulating more experience with the same unproductive set of candidates may supply little evidence about the overlooked action. The dense reward can help reinforce the lookup once the agent performs it in the appropriate situation. The bonus becomes informative only after the decision that has been hard to discover. This explains how a game can have helpful intermediate reward and still present an exploration bottleneck.

The separate preparation conditions attain final scores beyond the baseline plateau. The authors report that the full agent spends less time near the bottleneck in the learning curve. The case ties the aggregate improvement to a concrete demand of the game: use a word at a moment when the current history provides little support for it. The evidence comes from where training stalls and how the curves and final rewards change with preparation. It leaves the contribution of specific graph entries, encoder weights, and individual trials open.

The analysis also shows how pruning and scoring can interact. A useful command has to receive consideration before a better value estimate can guide selection. Conversely, an expanded set of plausible candidates can leave the agent with much searching to do if it assigns them similar values. Seeding can influence the first part of this process by bringing relevant relations within reach. Preliminary training can influence the representations used in the second. The observed passage beyond the bottleneck is consistent with improved exploration through either route, with the full setting benefiting from both and from reinforcement learning on the source.

#### What carries over before and after adaptation

The untuned condition asks what a source-trained agent can do immediately in the new game. The paper points to a comparison in which untuned transfer does better than target training from scratch under sparse reward. In *9:05*, the mean completion route of the untuned policy evaluated with dense reward is shorter than that of the sparse baseline. Relative to the dense baseline, the untuned policy takes more steps. The latter comparison puts the source-only policy beside an agent that has already had the benefit of target training and dense feedback.

The horror result makes the need for that distinction especially clear. The untuned policy has a lower mean final reward than the dense *Anchorhead* baseline trained on the target, and neither has a reported completion-step value. A network can carry preferences learned in another game and still face an unfamiliar series of puzzle dependencies. The full method gives it an opportunity to revise those preferences in response to the target. The best results therefore concern an initialization followed by learning, with untuned evaluation offering a separate indication of immediate portability.

The design compares effective recipes more directly than it measures the contribution of each ingredient in the full recipe. An individual seeded or question-answering run can be compared with the no-transfer baseline. Moving from either individual condition to the full one changes several things together. The source game adds interaction experience, and the quality of that experience can itself depend on what the source agent was given before play. The table therefore supports the combined procedure and leaves the separate effect of each component inside that combination unresolved.

#### How much the training signal contributes

The two reward conditions on *9:05* let the authors compare sparse and augmented training while keeping the named preparation fixed. Both the baseline and the question-answering configuration have shorter mean completion routes in the dense condition. The agent’s ability to exploit earlier information therefore depends in part on the feedback it receives during its own play. A command that gives a small intermediate reward can become an experience worth reinforcing, even when the rest of the quest remains unsolved.

In horror, the authors describe sparse reward as a feasibility problem. Their agents fail to reach a policy capable of finishing under that signal. The reported comparison for *Anchorhead* holds dense reward in place and varies the transfer treatment. On that basis, both the difference between the dense baseline and the full setting and the persistent failure under sparse reward are informative. The former establishes a benefit from transfer given the common bonus scheme. The latter shows how much the experiment relies on intermediate feedback to train agents that finish the horror task.

Finally, training progress and route efficiency remain separate results. The learning curves support the claim that the combined preparation can reach high reward earlier. The post-convergence steps measure how efficiently the resulting policy completes an objective. The authors describe a gain of up to 80% in completion steps in some cases. The results for *9:05* provide the clearest example of shorter play once trained, while the *Anchorhead* analysis identifies a place where getting to a stronger policy during training is itself difficult. Measuring both makes it possible to see which advantage is present in a given setting.

### Limitations

#### Limits the authors identify

The authors make substantial changes to the horror games so that they can study transfer on tasks their agent has a chance of learning. The objectives end at manually selected intermediate checkpoints. The action pool is restricted to the portions of the games covered by those objectives. The *Anchorhead* result applies to the first chapter, and the *Afflicted* result applies to its selected intermediate goal. Likewise, the objective in *9:05* is a chosen ending. The adaptations preserve individual puzzles and room exploration while setting a more bounded task than completing every part of the original games.

The authors identify sparse reward as another practical limit. For experiments involving commercial adventures they introduce bonuses derived from solution traces, and they report that the horror agents fail to learn completion under sparse reward. The strongest scores therefore depend on a setting where a successful solution is already available to help define the training signal. The agent searches for the actions itself, but the reward can confirm that an otherwise unremarkable attempt corresponds to part of a known solution. The paper establishes the benefit of transfer under these conditions.

The authors also discuss the conditions for choosing source and target tasks. Their examples have related themes, some vocabulary overlap, and enough games and traces to fill the preparation, source, and target roles. They expect the mapping problem to become harder when the game domains differ more. The tests concern transfer within the selected genres, including a move from a generated adventure to a human-authored one. They leave the effectiveness of transfer between dissimilar genres open.

Portability also has a concrete boundary in the representation. The authors regard an explored game’s graph as specific to the game, even when the network’s numerical representations of graph information can help elsewhere. Its facts about particular rooms and objects have to be replaced by facts grounded in the target world. The usefulness of a seed depends on the relevance of the associated written resource. The authors note variation by game and guide when discussing initial reward. A broad benefit of having some relevant knowledge should therefore be distinguished from the practical result of extracting relations from any particular document.

#### Limits implied by the comparisons

The principal baseline already uses a graph to represent information and prune commands. That is a suitable comparison for asking whether to add a seed, prepare the encoders, or transfer weights within KG-DQN. The design leaves open how a competitive agent with a different representation would respond to the same walkthrough supervision, action set, source experience, and reward function. The results demonstrate that graphs can support the tested transfer procedure. The necessity of a graph for similar transfer gains would require a separate comparison.

The action setup likewise narrows the language problem addressed by the results. The agent receives parser-compatible templates and can fill their slots from the game’s vocabulary. In horror the experiment removes actions outside the selected scope in advance. The learned exploration problem is still considerable among the allowed candidates, as the *Anchorhead* plateau illustrates. The study nevertheless addresses the selection of commands in a supplied action space. The ability to discover a new parser’s conventions or to produce useful commands from unrestricted language remains untested.

Different uses of a successful trace matter when considering a new game without documentation. For preliminary question answering, learning from traces in a related game can supply transferable preparation. For target reward augmentation, the experiment needs a trace for the target itself. A general guide that mentions useful objects and typical actions may be available even when no one has written down a solution to the target puzzle. The study leaves open how much of the strongest gain would survive with only the kinds of prior information available in that situation. This distinction is especially important for interpreting the horror results, where sparse reward proved inadequate for completion.

The graph is inspectable as a collection of triples, but the performance comparisons do not resolve how much each relation contributes. A reader can examine the kinds of facts produced by the extraction process in the paper’s examples. The paper gives no comprehensive measurement of extraction accuracy or an attribution of the full gain to particular guide relations. As a result, it remains possible for a seed to include relevant information, irrelevant detail, or relations that only become useful under a particular configuration of the value network. The file cabinet is evidence of changed behavior at a puzzle, with the mechanism inside the agent resolved only at the level of the training treatments.

The study uses repeated runs with different random seeds, but the source and target games are deliberately selected. Repetition probes training variability on those games. It does not sample the variability that would arise across many different pairs, guide documents, and puzzle types. The reported t-tests and the variation shown alongside the means therefore describe the authors’ settings. The results identify patterns worth distinguishing within those settings, including occasions when early reward and eventual route length favor different preparations. They leave the prevalence of those patterns across interactive fiction unmeasured.

The episode comparison supports a claim about learning progress in the units the authors use. An episode on a short source objective and an episode on a long target objective may involve different amounts of interaction. Preparing walkthrough traces and training the question-answering system also require effort. An overall comparison of elapsed time or total data acquisition cost would need measurements of those quantities. Likewise, the completion-step results reflect the tested exploration setting and the selected objectives. They provide evidence about how the learned policies play under that evaluation, with a separate question remaining about what they would do over a longer adventure.

### What came after

[How to Motivate Your Dragon](https://md.research.elamur.ai/free/en/papers/ammanabrolu-2021-how-motivate-your-dragon-teaching/) cites the transfer study in work framed around teaching. The connection supported by that framing is the question of how to guide an agent toward useful behavior in a text adventure. The transfer paper already identifies several places where guidance can enter. A guide can inform the initial search, a successful trajectory can prepare the encoders, and a trace can specify which actions deserve intermediate feedback. Those distinctions give context to a later question framed around teaching. The citation establishes the connection, while the particular transfer components used or extended in the later work remain unspecified.

[Automated Quest Generation for Text Adventures](https://md.research.elamur.ai/free/en/papers/ammanabrolu-2019-automated-quest-generation-text-adventure/) also cites the study and addresses the production of quests. The point of contact is the sequence of actions connecting a game situation to an objective. In the transfer study, that sequence already exists as a puzzle for the player to discover. It can also be represented in a walkthrough and used to train parts of an agent or to determine when it earns a bonus. Quest generation addresses how the challenges an agent or human player encounters come to be. The citation places the papers in relation to one another, with any reuse of graph construction, question-answering preparation, or copied network weights unspecified.

The connection across these works is clearest at the level of the problem each title identifies. Teaching concerns how useful experience or feedback is conveyed. Quest generation concerns how the objective and intervening challenges are created. KG-DQN’s transfer experiments concern the choices a player makes once that objective and those challenges exist, and show how several sources of prior information can influence the search for a successful sequence.

## Cite

Cite as Prithviraj Ammanabrolu and Mark Riedl. 2019. Transfer in Deep Reinforcement Learning Using Knowledge Graphs. Proceedings of the Thirteenth Workshop on Graph-Based Methods for Natural Language Processing (TextGraphs-13).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/d19-5301](https://doi.org/10.18653/v1/d19-5301)

```bibtex
@inproceedings{ammanabrolu2019transfer,
  title = {{Transfer in Deep Reinforcement Learning Using Knowledge Graphs}},
  author = {Prithviraj Ammanabrolu and Mark Riedl},
  booktitle = {Proceedings of the Thirteenth Workshop on Graph-Based Methods for Natural Language Processing (TextGraphs-13)},
  year = {2019},
  doi = {10.18653/v1/d19-5301},
  url = {https://doi.org/10.18653/v1/d19-5301}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
