Git Product home page Git Product logo

totexample's Introduction

What's in the Kitchen Sink? Creating LLM Agents with the Tree of Thoughts Framework

There are currently a number of well-known LLM "Agents" based on the ReAct framework. For these agents, problem-solving capabilities start with outlining a set of 'tasks' in the form of thoughts, following a linear path through a chain of thoughts until task completion. While interesting to observe, this approach rarely leads to a functional result on complex or multi-step problems.

Simple react agents like Auto-GPT and Baby-AGI lack the ability to self-supervise, correct course, or respond to new information and changing circumstances as a human would when solving a complex task. This project aims to develop a new type of agent, not based on ReAct or COT, but based off a more recent framework called "Tree of Thoughts" (ToT) as suggested in "Tree of Thoughts: Deliberate Problem Solving with Large Language Models" by Yao et. al.

The Tree of Thoughts Framework

ToT is essentially a chain of thought prompting with recursion. This more sophisticated method allows an agent to traverse down multiple branches of a complex problem, continually re-planning each node by further fleshing out and defining tasks before returning a result which is then passed to the next branch of action. Running memory is used to share the result of each node with downstream nodes.

The Kitchen Sink Agent

The Kitchen Sink agent uses all of these techniques, at various times, to tune the accuracy of LLM responses. It is not just one agent, but four, each running asynchronously as needed to complete tasks. These agent personas interact with each other, supervising each other's work and providing necessary process inputs.

Here are the four agent personas:

  1. The Supervisor - Reviews the current task (parent leaf) and defines the success criteria to determine if the goal is met.
  2. The Planner - Thinks about what to do and breaks each task into a set of thoughts preceded by "I Need To…"
  3. The Designer - Reviews the goal and creates N number of design options for a deliverable.
  4. The Executor - Creates output from a specification with a description of deliverables, success criteria, and steps to completion from the designer.

Does It Work?

Yes! Despite a few challenges related to using GPT 3.5 rather than GPT 4.0, the process happily returns usable code files.

Improvements and Next Steps

  1. Reduce the number of evaluation prompts.
  2. Add a UI to outline the visual form of the tree and its progress.
  3. Implement size limitations on the prompts to prevent token overflow errors.
  4. Expand the executor toolbox with more tools for deliverable evaluation.

Get Involved

All of the actual prompts and code for this agent are publicly available in this repository. Feel free to run this in Python if you'd like - the main process should be executed from "Plan" (run plan.py). The input is loaded in the "test_dictionary". If you'd like to help make it better, submit a PR and let's chat!

References

totexample's People

Contributors

marynels avatar smittysoup avatar

Stargazers

 avatar Lukasz Hanusik avatar Jason Wang avatar

Watchers

Mike N avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.