AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Implement reflection

Open mijhaels opened this issue 1 year ago • 11 comments

Context: Implement reflection, a technique that allows generating more coherent and natural texts using pre-trained language models.

Problem or idea: Reflection is based on two articles that propose different methods to incorporate world knowledge and causal reasoning in text generation. The articles are:

  1. ArXiv Article
  2. GitHub Repository

Solution or next step: I would like the Auto-GPT project to include reflection as an option to improve the quality of the generated texts. @Torantulino, what do you think of this idea?

mijhaels avatar Mar 30 '23 16:03 mijhaels

That it VERY interesting indeed. I've been playing about with getting Auto-GPT to improve itself and write it's own code, this might just be the ticket!

Executing unreviewed AI Generated code is a security risk though, so we'd have to think of the safest way to do this.

Submit a pull request!

Torantulino avatar Apr 01 '23 00:04 Torantulino

I code but only know about web programming, and I'm a junior too... sorry Haha

mijhaels avatar Apr 01 '23 04:04 mijhaels

No worries at all, and never let being a junior stop you, the absolute best way to learn is by trying and failing!

Torantulino avatar Apr 01 '23 05:04 Torantulino

Executing unreviewed AI Generated code is a security risk though, so we'd have to think of the safest way to do this.

Probably best to have it raise pull requests so that they can be reviewed manually.

NotoriousPyro avatar Apr 04 '23 22:04 NotoriousPyro

I kinda implemented this. In my implementation I let the agent reflect every N steps which can be quite interesting but requires more testing.

algopapi avatar Apr 05 '23 15:04 algopapi

Around weekend I will do a little bit of research around this topic. @algopapi would you mind sharing your implementation? Have you pushed it on your fork?

Bearnardd avatar Apr 11 '23 16:04 Bearnardd

Also, probably will have to create some kind of benchmarks so that the AI can know the direction it needs to go. "Improve itself" can be a bit vague

LeonardoLGDS avatar Apr 11 '23 20:04 LeonardoLGDS

@LeonardoLGDS I had no time to check the paper yet but I assumed there are some guidelines on benchmarking provided in paper

Bearnardd avatar Apr 12 '23 09:04 Bearnardd

If anyone can get me a GPT4 key, either directly via your org with prepayment or by getting me in touch with someone at OpenAI, I'm willing to implement it. I think it could be a lot of fun, and to add an edge, I'll do it on a fresh Linux w/ firewalled access to only the OpenAI API, and a USB chainsaw.

Jk, not the chainsaw.

aristotaloss avatar Apr 15 '23 19:04 aristotaloss

I'm planning to implement this over the weekend. Another best paper for self-reflection is this: https://arxiv.org/abs/2304.03442

They also have a way of evaluating the agents with some questions.

@Torantulino @Andythem23

younghuman avatar Apr 22 '23 05:04 younghuman

That it VERY interesting indeed. I've been playing about with getting Auto-GPT to improve itself and write it's own code, this might just be the ticket!

I guess, a starting point would be accepting actual constraints/restrictions, aka:

  • context window size (restrict to 8k, ideally much less, probably 50% of that)
  • restrict changes to a single isolated module (which would mean commands or even better plugins)
  • accept that the underlying architecture would then need to work analogous to message passing, and possibly via pipes - anything else won't scale or would change too many places in the source tree at once, basically any agent would consist of a list of other sub-agents, all of which would fork each other as needed (think makefiles/clustering)
  • alternatively, come up with a module that can deal with patches/diffs for features spanning multiple files/contexts initially
  • to provide sufficient surrounding context, freely use Python docstrings - basically reject PRs that don't have a ton of surrounding context in the form of comments and a ton of unit tests/test coverage
  • extend git_operations.py to add support for traversing commit logs (patches + log messages)
  • come up with a new plugin to handle github API integration, as per: https://github.com/Significant-Gravitas/Auto-GPT/issues/15#issuecomment-1527964511
  • have unit tests and benchmarks for regression testing purposes
  • improve docker integration for CI
  • use a custom local LLM to come up with a heatmap (query/idea -> location) that helps identify path/file name and line number based on querying the LLM for an idea/change, so that the agent can determine what set of files/places is likely to be relevant for certain changes, and then narrow down via git logs and commit history

Boostrix avatar May 01 '23 13:05 Boostrix

This issue was closed automatically because it has been stale for 10 days with no activity.

github-actions[bot] avatar Sep 17 '23 01:09 github-actions[bot]