T ext W orld E xpress: Simulating Text Games at One Million Steps Per Second (2023)

Abstract: Text-based games offer a challenging test bed to evaluate virtual agents at language understanding, multi-step problem-solving, and common-sense reasoning. However, speed is a major limitation of current text-based games, capping at 300 steps per second, mainly due to the use of legacy tooling. In this work we present TextWorldExpress, a high-performance simulator that includes implementations of three common text game benchmarks that increases simulation throughput by approximately three orders of magnitude, reaching over one million steps per second on common desktop hardware. This significantly reduces experiment runtime, enabling billion-step-scale experiments in about one day.

## introduction one of the long standing goals of artificial intelligence is to create agents that can work and reason in embodied environments. toward this goal, a variety of virtual environments have been created that allow simulated robots the opportunity to learn to a variety of tasks, in settings from household environments @xcite to @xcite . because highfidelity 3d virtual environments are challenging and resource intensive to develop, simpler 2d environments have also been proposed (e.g. @xcite that allow agents to focus on learning skills such as search or navigation in graphically simpler environments. recently, text games -or environments rendered entirely in natural language -have emerged as an alternate research methodology for embodied agent research, centrally due to their low barrier to entry compared to 3d games, coupled with their ability to easily model complex tasks at a high-level (see 1 code: github.com/cognitiveailab/textworldexpress 2 video: youtu.be/hlfanrkutle 3 demo: marccote-textworldexpress.hf.space ## environments textworldexpress offers high-speed versions of three popular benchmark environments frequently used in text game research, as well as a number of newer environments for evaluating specific reasoning competencies: cookingworld: the cookingworld environment @xcite tasks agents with preparing meals by following the instructions in a recipe that is provided in the environment. 6 agents must first collect required food ingredients (e.g. milk, bell pepper, flour, salt) that can be found in the environment in canonical locations (e.g. kitchen, pantry, supermarket, garden) and containers (e.g. fridge, cupboard). randomly generated recipes require agents to first use a knife to prepare food by slicing, dicing, or chopping a subset of ingredients, then additionally using an appropriate heating appliance to fry, roast, or barbeque the ingredients. if all ingredients are prepared according to the recipe, the agent can use an action to prepare the meal, and finally eat the meal to complete the task successfully. task complexity can be controlled by varying the number of locations in the environment, the number of ingredients required for the recipe, and the number of distractor ingredients randomly placed cookingworld game north of house you are in the kitchen. in one part of the room you see a fridge that is closed. there is also a dining chair, that has nothing on it. you also see a dishwasher that is closed. in another part of the room you see a trash can that is closed. in one part of the room you see an oven. there is also a cutlery drawer that is closed. you also see a stove. in another part of the room you see a counter that has a cookbook, a green apple, and a red hot pepper on it. in one part of the room you see a kitchen cupboard that is closed. to the south you see the backyard. to the west you see the pantry. > read cookbook gather all following ingredients and follow the directions to prepare this tasty meal. ingredients: purple potato, yellow bell pepper. directions: dice the purple potato, fry the purple potato, roast the yellow bell pepper, prepare meal. > open cutlery drawer you open the cutlery drawer. the cutlery drawer contains a knife. > take knife you take the knife. > move south you are in the backyard. in one part of the room you see a barbeque. there is also a patio chair, that has nothing on it. you also see a clothes line, that has nothing on it. in another part of the room you see a garden that has a raw purple potato, and a yellow bell pepper on it. in one part of the room you see a workbench, that has nothing on it. there is also a patio table, that has nothing on it. to the north you see the kitchen. ## conclusion we present textworldexpress, a fast simulator for text-game research that reimplements three benchmark environments while running three orders of magnitude faster than their original implementations. new games can be added using existing games as templates, and four new games benchmarking specific reasoning competencies like arithmetic and navigation have been added since its initial release. the simulator supports common features (such as valid action detection), while providing new enabling features, such as quickly precrawling entire game state trees. this work is released as open source.