No. CoT has been around for several years (Jan 2022) https://arxiv.org/abs/2201.11903. And so has Reflection (March 2023) https://arxiv.org/abs/2303.11366. This approach that was taken by Reflection is nothing new.
Reflexion: Language Agents with Verbal Reinforcement Learning
Noah Shinn, Federico Cassano, Edward Berman
Show all 6 authors
Ashwin Gopinath, Karthik Narasimhan, Shunyu Yao
2023 · arXiv
- HN score
- 0
- Mentions
- 16
- Readers
- 12
- Months
- 8
From the abstract
Large language models (LLMs) have been increasingly used to interact with external environments (e.g., games, compilers, APIs) as goal-driven agents. However, it remains challenging for these language agents to quickly and efficiently learn from trial-and-error as traditional reinforcement learning methods require extensive training samples and expensive model fine-tuning. We propose Reflexion, a novel framework to reinforce language agents not by updating weights, but instead through linguistic feedback. Concretely, Reflexion agents verbally reflect on task feedback signals, then maintain their own reflective text in an episodic memory buffer to induce better decision-making in subsequent trials. Reflexion is flexible enough to incorporate various types (scalar values or free-form language) and sources (external or internally simulated) of feedback signals, and obtains significant improvements over a baseline agent across diverse tasks (sequential decision-making, coding, language reasoning). For example, Reflexion achieves a 91% pass@1 accuracy on the HumanEval coding benchmark, surpassing the previous state-of-the-art GPT-4 that achieves 80%. We also conduct ablation and analysis studies using different feedback signals, feedback incorporation methods, and agent types, and provide insights into how they affect performance.
Metadata: arXiv. Abstracts retain their original authors’ rights.
In the conversation
Original HN comments, with labels from simple text rules. A label describes the whole comment and may miss context or irony. Read the discussion to make up your own mind. About the labels
16 selected excerpts · 16 total mentions
I think you're 100% on the right track here. The key is memory, loops, and maybe a few other things like external interfaces which are just plain code and not deep learning voodoo. Many things do indeed run LLM's in a loop and attach external sources. See for example AutoGPT, the ReAct paper[1], and the Reflexion paper[2]. ReAct one line summary: This is about giving the machine tools that are external interfaces, integrating those with the llm and teaching it how to use those tools with a few examples, and then letting it run the show to fulfill the user's ask/question and using the tools available to do it. Reflexion one line summary: This builds on the ideas of ReAct,…
Read the full comment
and when it detects something has gone wrong, it stops and asks itself what it might do better next time. Then the results of that are added into the prompt and it starts over on the same ask. It repeats this N times. This simple expedient increased its performance a ridiculously unexpected amount. As a quick aside, one thing I hear even from AI engineers is "the machine has no volition, and it has no agency." Implementing the ideas in the ReAct paper, which I have done, is enough to give an AI volition and agency, for any useful definition of the terms. These things always devolve into impractical philosophical discussions though, and I usually step out of the conversation at that point and get back to coding. [1] ReAct https://arxiv.org/pdf/2210.03629.pdf [2] Reflexion https://arxiv.org/pdf/2303.11366.pdf
Reflexion can serve as good reference here: https://arxiv.org/abs/2303.11366 Essentially, AI’s output is fed into a checker, whose output is fed back into the AI for “reflexion”. Then the AI often corrects (leading to noticeable improvement in GPT-4 perf).
I don't know how we'd go about comparing reflection to human baselines but GPT-4 can reflect just fine https://arxiv.org/abs/2303.11366 GPT-4's emotional intelligence seems to be very high by the looks of things https://arxiv.org/abs/2304.11490 Empathy =/ Intelligence
Since I've been on a AI code-helper kick recently. According to the post, Claude 2 now 71.2%, a significant upgrade from 1.3 (56.0%). It isn't specified whether this is pass@1 or pass@10. For comparison: * GPT-4 claims 85.4 on HumanEval, in a recent paper https://arxiv.org/pdf/2303.11366.pdf GPT-4 was tested at 80.1 pass@1 and 91 pass@1 using their Reflexion technique. They also include MBPP and Leetcode Hard benchmark comparisons * WizardCoder, a StarCoder fine-tune is one of the top open models, scoring a 57.3 pass@1, model card here: https://huggingface.co/WizardLM/WizardCoder-15B-V1.0 * The best open model I know of atm is replit-code-instruct-glaive, a replit-code-3b…
Read the full comment
fine tune, which scores a 63.5% pass@1. An independent developer abacaj has reproduced that announcement as part of code-eval, a repo for getting human-eval results: https://github.com/abacaj/code-eval Those interested in this area may also want to take a look at this repo https://github.com/my-other-github-account/llm-humaneval-ben... that also ranks with Eval+, the CanAiCode Leaderboard https://huggingface.co/spaces/mike-ravkine/can-ai-code-resul... and airate https://github.com/catid/supercharger/tree/main/airate Also, as with all LLM evals, to be taken with a grain of salt... Liu, Jiawei, Chunqiu Steven Xia, Yuyao Wang, and Lingming Zhang. “Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation.” arXiv, June 12, 2023. https://doi.org/10.48550/arXiv.2305.01210.
Chain of thought: https://arxiv.org/abs/2201.11903 ReAct: https://arxiv.org/abs/2210.03629 Reflexion: https://arxiv.org/abs/2303.11366 Tree of thoughts: https://arxiv.org/abs/2305.10601 Good video on "Tree of thoughts" which also reviews / puts it in the context of other methods: https://www.youtube.com/watch?v=ut5kp56wW_4 Completion vs conversational interface is something you can read about in the OpenAI API documentation. For the remaining things I don't have single specific pointer at hand.
If performance is a concern, just re-prompt GPT if there are any performance concerns, and to propose fixes for them if there are. This is called reflexion and has been found to be an effective way to improve response accuracy and usefulness (also reduces hallucinations). https://arxiv.org/abs/2303.11366
There's a lot of work happening at the moment around self-reflection and getting LLMs to identify and correct their own hallucinations and mistakes. https://arxiv.org/pdf/2303.11366.pdf
The Reflexion paper (https://arxiv.org/abs/2303.11366) that came out recently shows how this kind of mistake might be overcome. Asking the model to think about the answer after it's generated a first draft greatly improves accuracy. Also, prompt engineering such as copying the generated code, pasting it in a new chat and saying "There's a bug in this code, please find it" can go a long way. There is so much low hanging fruit in harnessing the power of these models that is just being ignored because some even lower hanging fruit (RLHF, system messages, context window size, plugins, etc) is being released seemingly every few days.
Reflexion: an autonomous agent with dynamic memory and self-reflection, https://arxiv.org/abs/2303.11366 Add an interpreter as per this article, and we're basically there.
It was already trained like this, RLHF [0] is a loop that has ways to feed it the information to "move forward" - update its weights. It was fine-tuned like this. It certainly did ignite something - maybe sparks of AGI, maybe just sparks of pretending to be more liked by humans (hence Human Feedback in RLHF). My guess is that loops by itself (Reflexion [1], etc.) won't change much. ChatGPT massive logs - maybe. [0] https://huggingface.co/blog/rlhf [1] https://arxiv.org/abs/2303.11366
the paper: https://arxiv.org/pdf/2303.11366.pdf it reminds me of the thinking-fast vs. thinking-slow dichotomy. Current llms are the thinking fast type. Funnily people’s complains about its errors are reminiscent of this. It answers just to quick and only with its instant response neural net. A thinking slow answer would be more akin to a chain of thought answer. Allowing the llm a more flexible platform than CoT promptin might well be the next step. Of course it would als multiply compute cost. So it might not be in your 20$ subscription
>GPT cannot function in any environment on its own. Except in response to a direct instruction it cannot plan, it cannot take action, it cannot learn, it cannot adjust to changing circumstance. Sure it can. It's not default behavior sure but it's fairly trivial to set up, just expensive. Gpt-4 can loop on its "thoughts" and reflect, it can take actions in the real world. https://tidybot.cs.princeton.edu/ https://arxiv.org/abs/2304.03442 https://arxiv.org/abs/2210.03629 https://arxiv.org/abs/2303.11366
>Idk about “above average baseline” That's the minimum. It's far above average for most things. >Maybe, because quite a lot of people aren’t very smart. Lol okay..and ? >But even GPT4 struggles with complex logic problems So does everyone else >and when it makes logic errors it makes ones a human would spot people spot mistakes they're capable of making all the time and so can GPT-4 - https://arxiv.org/abs/2303.11366 https://twitter.com/johnjnay/status/1639362071807549446 >It also has trouble counting letters and words, though that’s largely due to its autoregressive nature. It sees tokens not words or letters and there aren't many instances of counting occurring in text…
Read the full comment
so it doesn't get learnt. >and I really think it’s emergent, but at its core it doesn’t seem very “intelligent” and we're back to the trust me bro argument. It's not intelligent because you say it isn't not because it doesn't perform a great many tasks intelligently. if you say so
>the systems operation are well understood That's like saying human behavior is well understood because we know how neurons communicate signals. It's too low level to be useful, hence psychology. >They don't have the ability to reason or reflect. Yes they do https://selfrefine.info/ https://arxiv.org/abs/2303.11366
That part on providing the opportunity to check its answers is called reflexion and has been shown to significantly improve accuracy and reliability of LLM responses. Very cool. https://arxiv.org/abs/2303.11366 https://evjang.com/2023/03/26/self-reflection.html
Keep following the thread.
More in Machine learningMore from the same topics.
Sparks of Artificial General Intelligence: Early experiments with GPT-4
Sébastien Bubeck, Varun Chandrasekaran, Ronen Eldan +11
Artificial intelligence (AI) researchers have been developing and refining large language models (LLMs) that exhibit remarkable capabilities across a variety of domains and tasks, challenging our understanding of learning and cognition.
Language Models are Few-Shot Learners
Tom B. Brown, Benjamin Mann, Nick Ryder +28
Recent work has demonstrated substantial gains on many NLP tasks and benchmarks by pre-training on a large corpus of text followed by fine-tuning on a specific task.
Understanding deep learning requires rethinking generalization
Chiyuan Zhang, Samy Bengio, Moritz Hardt +2
Despite their massive size, successful deep artificial neural networks can exhibit a remarkably small difference between training and test performance.
Talent vs Luck: the role of randomness in success and failure
A. Pluchino. A. E. Biondo, A. Rapisarda
The largely dominant meritocratic paradigm of highly competitive Western cultures is rooted on the belief that success is due mainly, if not exclusively, to personal qualities such as talent, intelligence, skills, efforts or risk taking.