Long-Context Language Decision Transformers and Exponential Tilt for Interactive Text Environments

Nicolas Gontier, Pau Rodríguez, Issam H. Laradji, David Vázquez, Christopher Pal · DOI

Introduction

Interactive text environments, such as classic adventure games, present a formidable challenge for standard Reinforcement Learning (RL). Unlike environments with discrete, low-dimensional action spaces, text games require navigating compositional action spaces where billions of combinations are possible (e.g., "open the wooden chest with the rusty key"). Furthermore, these environments are characterized by sparse rewards and long-range dependencies. This work introduces Language Decision Transformers (LDTs), shifting the paradigm toward offline RL to leverage the pre-existing world knowledge in Large Language Models (LLMs).

Methodology

LDTs treat reinforcement learning as a sequence modeling problem. The architecture utilizes a LongT5 backbone to manage the extensive text histories typical of long-form games, which standard Transformers often struggle to process.

A core innovation is the Exponential Tilt mechanism. Traditional Decision Transformers require a manually specified target return. LDTs instead predict the distribution of future scores and apply an exponential tilt—weighting goal probabilities by $\exp(\alpha \cdot \text{goal})$. This allows the agent to "aim high" and bias its policy toward maximum rewards without prior knowledge of the game's ceiling. Additionally, the model is trained with an auxiliary loss to predict the next observation ($o_{t+1}$), effectively serving as a world model that understands environmental consequences.

Data Generation and Training

To facilitate offline learning, the authors developed a "noisy walkthrough" dataset using the Jericho benchmark. By taking expert human trajectories and injecting random actions at various breakpoints, they generated a diverse dataset of 1,005 trajectories per game. This variety ensures the model learns from both expert-level play and failures.

The data generation pipeline creates a diverse training set from expert walkthroughs, while the inference loop utilizes the LDT to predict goals and actions.

Key Results

LDTs achieved state-of-the-art performance on several challenging Jericho games, including Enchanter and Spellbreaker. Empirically, LDTs outperformed established online RL baselines like DRRN and KG-A2C by approximately 30% on average across all environments.

The effectiveness of the exponential tilt is particularly noteworthy. As shown in the performance metrics, increasing the tilt parameter $\alpha$ allows the model to match the performance of an agent provided with the "optimal" goal conditioning, proving the model can effectively navigate toward high rewards autonomously.

Comparison of LDT performance across different exponential tilt (alpha) values against online RL baselines and optimal goal conditioning.

Discussion and Limitations

While LDTs represent a significant step forward, they remain dependent on the presence of at least one high-quality walkthrough in the training data to define the "golden path." Current models also struggle with zero-shot generalization to entirely new games. Future work will focus on scaling datasets and improving the handling of stochastic environments to enhance the robustness of language-based decision agents.

Summary updated

Abstract

Text-based game environments are challenging because agents must deal with long sequences of text, execute compositional actions using text and learn from sparse rewards. We address these challenges by proposing Long-Context Language Decision Transformers (LLDTs), a framework that is based on long transformer language models and decision transformers (DTs). LLDTs extend DTs with 3 components: (1) exponential tilt to guide the agent towards high obtainable goals, (2) novel goal conditioning methods yielding significantly better results than the traditional return-to-go (sum of all future rewards), and (3) a model of future observations. Our ablation results show that predicting future observations improves agent performance. To the best of our knowledge, LLDTs are the first to address offline RL with DTs on these challenging games. Our experiments show that LLDTs achieve the highest scores among many different types of agents on some of the most challenging Jericho games, such as Enchanter.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Jericho · All 33 Jericho gamesLDT (Return-To-Go goal condition)Average normalized score (based on best human score)42.35%offline · seeds=5 · game-count=33 · goal-condition=return-to-go · training-steps=60000 · auxiliary-next-observation-loss=0.5
Source quote
L420: Avg. Norm. │ 42.35% │ 66.16% │ 43.99% │ 61.00% │ 45.40% │ 59.84% │ 35.37% │ 52.56%
Jericho · All 33 Jericho gamesLDT (Immediate Reward goal condition)Average normalized score (based on best human score)43.99%offline · seeds=5 · game-count=33 · goal-condition=immediate-reward · training-steps=60000 · auxiliary-next-observation-loss=0.5
Source quote
L420: Avg. Norm. │ 42.35% │ 66.16% │ 43.99% │ 61.00% │ 45.40% │ 59.84% │ 35.37% │ 52.56%
Jericho · All 33 Jericho gamesLDT (Final Score goal condition)Average normalized score (based on best human score)45.40%offline · seeds=5 · game-count=33 · goal-condition=final-score · training-steps=60000 · auxiliary-next-observation-loss=0.5
Source quote
L420: Avg. Norm. │ 42.35% │ 66.16% │ 43.99% │ 61.00% │ 45.40% │ 59.84% │ 35.37% │ 52.56%
Jericho · All 33 Jericho gamesLDT (Avg. Return-To-Go goal condition)Average normalized score (based on best human score)35.37%offline · seeds=5 · game-count=33 · goal-condition=average-return-to-go · training-steps=60000 · auxiliary-next-observation-loss=0.5
Source quote
L420: Avg. Norm. │ 42.35% │ 66.16% │ 43.99% │ 61.00% │ 45.40% │ 59.84% │ 35.37% │ 52.56%
Jericho · All 33 Jericho gamesLDT without auxiliary next-observation prediction loss (λ=0.0)Average normalized score (based on best human score)32.78%offline · seeds=5 · game-count=33 · training-steps=60000 · auxiliary-next-observation-loss=0.0 · goal-conditioning-methods-averag=4
Source quote
L472: \multicolumn{2}{c|}{Average Normalized} │ 32.78% │ \multicolumn{1}{l}{} │ 54.45% │ 50.78% │ \multicolumn{1}{l}{} │ 73.78%
Jericho · All 33 Jericho gamesLDT with auxiliary next-observation prediction loss (λ=0.5)Average normalized score (based on best human score)50.78%offline · seeds=5 · game-count=33 · training-steps=60000 · auxiliary-next-observation-loss=0.5 · goal-conditioning-methods-averag=4
Source quote
L472: \multicolumn{2}{c|}{Average Normalized} │ 32.78% │ \multicolumn{1}{l}{} │ 54.45% │ 50.78% │ \multicolumn{1}{l}{} │ 73.78%
BibTeX
@misc{gontier2023long,
  author = {Nicolas Gontier and Pau Rodríguez and Issam H. Laradji and David Vázquez and Christopher Pal},
  title = {{Long-Context Language Decision Transformers and Exponential Tilt for Interactive Text Environments}},
  year = {2023},
  eprint = {2302.05507},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.05507},
}
Figure