RepoAmazon (Nova)Amazon (Nova)published Feb 28, 2025seen 5d

amazon-science/DiversityOfThoughts

Python

Open original ↗

Captured source

source ↗

amazon-science/DiversityOfThoughts

Language: Python

License: NOASSERTION

Stars: 11

Forks: 1

Open issues: 2

Created: 2025-02-28T19:01:30Z

Pushed: 2026-04-13T20:46:41Z

Default branch: main

Fork: no

Archived: no

README: Shield: [![CC BY 4.0][cc-by-shield]][cc-by]

[ICLR 2025] Enhancing Language Model Agents using Diversity of Thoughts

Official implementation for ICLR 2025 paper Enhancing Language Model Agents using Diversity of Thoughts.

Code adapted from Reflexion

Setup

1. Install required dependencies into your environment:

pip install -r requirements.txt

2. Set ``OPENAI_API_KEY`` environment key to your OpenAI API Key:

export OPENAI_API_KEY=

(optional) Setup for running LeetCodeHardGym experiments:

1. Follow these instructions to prepare the dataset: https://github.com/GammaTauAI/leetcode-hard-gym 2. Login to LeetCode on your browser and retrieve 'csrf' and 'LEETCODEHARD_SESSION' from your browser cookies and set environment variable:

export LEETCODEHARD_SESSION=

3. Replace csrf_token in line::40 of ``executors/leetcode_env/environment.py

Available Agents

  • dot`` - Diversity of Thoughts Agent
  • dot_bank`` -- Diversity of Thoughts Agent that uses a Task Agnostic Memory Bank
  • reflexion`` -- Reflexion Agent
  • simple -- Standard prompting. Set max_iters=1``.

Usage

We provide a sample script ``example_run.sh. Provide the output directory by changing the value for --root_dir`` and run:

sh example_run.sh
  • --max_iters``: maximum depth of search tree

Trajectories

We include the trajectories from our paper's experiments in ``Experiments_logs/

Cite

@inproceedings{
lingam2025enhancing,
title={Enhancing Language Model Agents using Diversity of Thoughts},
author={Vijay Lingam and Behrooz Omidvar Tehrani and Sujay Sanghavi and Gaurav Gupta and Sayan Ghosh and Linbo Liu and Jun Huan and Anoop Deoras},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=ZsP3YbYeE9}
}

This work is licensed under a [Creative Commons Attribution 4.0 International License][cc-by].

[![CC BY 4.0][cc-by-image]][cc-by]

[cc-by]: http://creativecommons.org/licenses/by/4.0/ [cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png

Notability

notability 3.0/10

Low stars, routine new repo.