首页 > 其他分享 >大模型 | 自进化Agent:兼具反思与记忆增强能力

大模型 | 自进化Agent:兼具反思与记忆增强能力

时间:2024-09-18 15:52:52浏览次数:3  
标签:兼具 框架 SAGE Agent content 记忆 user file 反思


大模型在动态环境中持续决策、长期记忆缺乏以及有限的上下文窗口等方面仍面临挑战:

  • 元学习、多任务学习等方法来增强LLMs的迁移能力和适应性;
  • 针对有限记忆存储的问题,MemGPT和MemoryBank采用了不同的策略管理记忆;
  • 但这些方法通常针对特定任务或场景,缺乏一个通用框架。

提出了一个创新框架——具有反思和记忆增强能力的自进化智能体SAGE)。SAGE框架包括三个智能体用户、助手和检查器。通过整合迭代反馈、反思机制和基于艾宾浩斯遗忘曲线的记忆优化机制,显著提升了智能体处理多任务和长跨度信息的能力。智能体通过自进化能够适应性地调整策略、优化信息存储和传输,并有效减少认知负荷。

【SAGE框架的示意图】

大模型 | 自进化Agent:兼具反思与记忆增强能力_ai

  • 迭代反馈:助手根据检查器的反馈不断优化输出,直到检查器认为输出正确或达到迭代限制。
  • 反思机制:助手分析任务成功和失败的经验,并将这些经验存储在记忆中,以便在未来任务中做出更好的决策。
  • 记忆语法(MemorySyntax):结合艾宾浩斯遗忘曲线和语言知识,优化助手的记忆和外部存储管理,有效处理和保留重要信息。

【使用SAGE框架的HotpotQA示例的插图】

大模型 | 自进化Agent:兼具反思与记忆增强能力_Agent_02

实验结果表明,SAGE框架在多个基准测试中显著提高了模型性能,尤其在较小模型上表现突出。在AgentBench测试中,SAGE框架不仅增强了像GPT-3.5和GPT-4这样的强大基线模型的性能,还显著提高了开源模型(qwen-7b、codellama-7b、llama2-7b、chatglm2-6b) 的性能。

【在是否使用SAGE框架的情况下,AgentBench的基线性能】

大模型 | 自进化Agent:兼具反思与记忆增强能力_ai_03

通过反馈机制和记忆优化,SAGE框架有效减少了复杂任务中的基本错误和逻辑错误。

六项任务中各种执行结果的分布。(CLE:超出上下文限制,TLE:超出任务限制)。 超出任务限制是任务未能完成的主要原因,这指出了在有限时间框架内,大型语言模型(LLM)Agent在推理和决策方面存在局限性。

大模型 | 自进化Agent:兼具反思与记忆增强能力_Agent_04

在使用GPT和SAGE框架的TriviaQA案例研究

User:

Answer the question based on the given passages. Only give me the answer and do not output any
other words.The following are given passages:
History of canals in Great Britain - London Canal Museum History of canals in Great Britain Home >
History > Canals in Britain In the history of canals, Britain was not a pioneer. The Chinese can claim
that the Grand Canal of China was one of the first, in the tenth century,a. . . . . .
Answer the question based on the given passages. Only give me the answer and do not output any
other words.
Question: Which metal is produced by the Bessemer Process?
Answer:

Assistant:

The content of the file seems to be an HTML document related to the administrative division of Turkey,
including population statistics, charts, and maps. This file contains scripts, metadata, and structured
data typical for a web page.
Checker:
Clear Objectives: When answering user questions, the focus should be on directly addressing the
question without introducing irrelevant information. Document Handling: Before confirming whether
the document content is relevant to the question, detailed aspects of the document should not be
directly addressed.

Reflection:

Issue Description: The user wants to understand why the system outputs irrelevant HTML document
content based on user input and seeks detailed feedback and reflection. Reasons for the Error:
Misinterpretation of Input: The system mistakenly assumed that the user uploaded a file and attempted
to read its content, whereas the user only provided text input. Processing Logic Error: Without
clearly determining the user’s intent, the system directly parsed and outputted file content. User
Experience Problems: Irrelevant Output: The user expects concise, relevant answers, but the system
provided lengthy and irrelevant HTML content, affecting the user experience. Poor Communication:
Failure to accurately understand and respond to the user’s real needs resulted in off-topic responses
In-depth Reflection and Improvement Suggestions: Clarify User Intent: Accurate Parsing of User
Input: Enhance the system’s natural language processing capabilities to accurately distinguish whether
the user uploaded a file or simply provided text input. User Feedback Mechanism: Implement a user
feedback mechanism to promptly adjust the understanding of user intent. For example, confirm the
issue to verify if the user uploaded a file. Optimize Processing Logic: Layered Processing Flow: In
system design, separate file processing logic from text response logic to avoid misjudgments. For
instance, when a user uploads a file, process the file content separately; when a user inputs text, provide
relevant answers directly. Pre-processing Check: Prior to handling files, perform pre-processing checks
to confirm if the file content meets expectations. . . . . . .

LLMs with SAGE response: Steel.

Ground truth
Steel.
Self-evolving Agents with reflective and memory-augmented abilities
https://arxiv.org/pdf/2409.00872

标签:兼具,框架,SAGE,Agent,content,记忆,user,file,反思
From: https://blog.51cto.com/u_16163510/12046922

相关文章

  • 构建多轮对话问答系统:基于大模型的Agent与Tools探索
    在当今人工智能快速发展的时代,多轮对话问答系统作为人机交互的重要形式,正逐渐渗透到我们生活的各个领域,从智能家居到智能客服,从在线教育到医疗咨询,其应用场景日益广泛。本文将深入探讨如何基于大模型构建高效、智能的多轮对话问答系统,并介绍一些关键的Agent(代理)与Tools(工具)技术......
  • AgentTuning:提升大型语言模型的通用Agent能力
    人工智能咨询培训老师叶梓转载标明出处大模型被用作现实中复杂任务的Agent时,它们的表现往往不如商业模型,如ChatGPT和GPT-4。这些任务要求LLMs作为中央控制器,负责规划、记忆和工具利用,这就需要精巧的提示方法和鲁棒性强的LLMs来实现。尽管已有多种提示方法被提出来完成特定的A......
  • 【工具推荐】Agently:一款灵活易用的 AI 应用开发框架
    本文内容均来自个人笔记并重新梳理,如有错误欢迎指正!如果对您有帮助,烦请点赞、关注、转发、订阅专栏!专栏订阅入口| 精选文章 | Kubernetes |Docker|Linux |羊毛资源 | 工具推荐 |往期精彩文章【Docker】(全网首发)KylinV10下MySQL容器内存占用异常的解决......
  • 错误总结反思
    0.概述这篇文章旨在记录我真实经历过的一些值得反思的错误,可能是自己犯的错误,也可能是其他人犯的错误。但是都是一些值得反思的问题,文章结构可能会比较乱,以后记录的问题多了肯定会再进行梳理。1.vectorsize为0在做"求TopK"算法问题时,遇到结果错误问题。经过调试发现那个长度为......
  • 使用AgentScope构建多智能体群聊系统
    本文将介绍如何使用AgentScope框架构建一个简单的多智能体群聊系统,并解释其背后的实现逻辑。首先写好设置文件。agent_config.json[{"class":"DialogAgent","args":{"name":"Lingfeng","sys_prompt":"......
  • awesome-ai-agents
    awesome-ai-agentshttps://datawhalechina.github.io/hugging-multi-agent/chapter2/AIAgent%E7%9F%A5%E8%AF%86%E4%BD%93%E7%B3%BB%E7%BB%93%E6%9E%84/#213-sy1sy2agent https://github.com/e2b-dev/awesome-ai-agents   https://www.breezedeus.com/article/ai-agen......
  • Comparing Multi-agent AI frameworks
    ComparingMulti-agentAIframeworkshttps://sajalsharma.com/posts/overview-multi-agent-fameworks/AComparativeOverviewTobetterunderstandthedifferencesandapplicationsoftheseframeworks,let’sexaminetheminacomparativetable:FeatureAutoGe......
  • 使用fake-useragent库伪装请求头
    部分网站做了反爬虫机制,不允许程序访问网站的数据,而使用同一个useragent(用户代理)短时间爬取大量数据也可能被网站反爬虫程序识别。为了更好地模拟浏览器地工作,可以使用第三方库fake-useragent生成假的useragent字符串伪装浏览器,从而绕过一些网站的反爬虫措施。首先在命令行中输入......
  • Agentic workflow of LLM
    AgenticDesignPatternshttps://www.deeplearning.ai/the-batch/how-agents-can-improve-llm-performance/?ref=dl-staging-website.ghost.ioReflection:TheLLMexaminesitsownworktocomeupwithwaystoimproveit. ToolUse:TheLLMisgiventoolssuchas......
  • 大模型应用开发初探 : 手搓一个简易Agent
    大家好,我是Edison。今天是中秋节前最后一个工作日,加油挺住,马上就放假了!近期我一直在学习和了解LLM的相关知识,听到大家都在谈论AIAgent,说它是接下来几年大模型应用开发的新范式,那么什么是AIAgent,如何快速开发一个AIAgent呢?AIAgent:可以帮你执行任务的助手学术界和工业界对术......