OpenViSTAI · Agents · Blockchain · Crypto
Menu
Agent Frameworks

Thought Cloning

Thought Cloning is a Python research implementation of an imitation-learning method that trains agents to reason while acting from human-thought demonstrations. It applies the method to BabyAI's partially observable 2D gridworld and includes scripts for generating synthetic demonstrations, training models and evaluating them on out-of-distribution environments.

Independent OpenViST project profile, based on linked sources.

Thought Cloning — OpenViST project profile in Agent Frameworks.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use the repository when you want code and experiment scripts for training and evaluating BabyAI agents from synthetic thought demonstrations.

Who it is for

  • AI researchers studying imitation learning and agent reasoning
  • Developers reproducing the repository's BabyAI training and evaluation experiments

Documented uses

  • Generate synthetic thought demonstrations for a selected environment.
  • Train a Thought Cloning model on BabyAI demonstrations.
  • Evaluate a trained model on out-of-distribution BabyAI levels.
  • Explore adaptations to another partially observable task, accounting for required integration and validation.
Before you choose

Requirements & limits

The repository is public and lists an MIT license. Its documented setup is local Python installation.

  • The included environment is BabyAI's partially observable 2D gridworld.
  • The README specifies older versions of Gym, NumPy and gym-minigrid and warns that higher versions may be incompatible.
  • BossLevel demonstrations, trained weights and out-of-distribution testing environments are linked for reproducing experiments.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Set up the Thought Cloning Python environment

Create the documented virtual environment, install the project and configure its output directory.

Before you start

  • Python 3.6 or later
  • PyTorch 1.7.1 or later
  • OpenAI Gym 0.9.6
  • NumPy 1.19.5
  • gym-minigrid 1.0.0

Steps

  1. Create and activate a virtual environment using python-venv or conda.

  2. Install PyTorch 1.7.1 or later using the PyTorch installation instructions.

  3. Clone the repository, enter its directory, upgrade pip and install the project in editable mode with pip3.

  4. Set the output directory in storage_dir in babyai/utils/__init__.py to the path of the project.

Expected outcome

A configured local installation of the repository, ready for its documented experiment scripts.

Guide limitations

  • The README warns that higher versions of Gym, NumPy or gym-minigrid may not be compatible.
  • If the project directory is moved after installation, the README says to run the editable install command again.
Source-based practical guide

Generate a synthetic thought-demonstration dataset

Use the repository's demonstration-generation script to create synthetic demonstrations for a specified environment.

Before you start

  • The repository installed in a Python environment with the documented dependencies
  • A chosen episode count and environment name

Steps

  1. Run scripts/make_agent_demos.py with --episodes, --env and --noise-rate 0.01.

  2. Provide the desired episode count and environment name for the placeholder values.

Expected outcome

A synthetic thought dataset generated by the repository's demonstration script.

Guide limitations

  • The README provides the command pattern but does not specify an output path or detail the generated files.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
14 October 2026
Original website title
ShengranHu/Thought-Cloning · Official homepage title · retained in its source language