当前位置: 首页 > news >正文

企业网站推广的方法有哪几种discuz 科技网站模板

企业网站推广的方法有哪几种,discuz 科技网站模板,网站排名5118,沧州做网站多少钱代理#xff08;Agent#xff09;指能自主感知环境并采取行动实现目标的智能体。基于大语言模型#xff08;LLM#xff09;的 AI Agent 利用 LLM 进行记忆检索、决策推理和行动顺序选择等#xff0c;把Agent的智能程度提升到了新的高度。LLM驱动的Agent具体是怎么做的呢Agent指能自主感知环境并采取行动实现目标的智能体。基于大语言模型LLM的 AI Agent 利用 LLM 进行记忆检索、决策推理和行动顺序选择等把Agent的智能程度提升到了新的高度。LLM驱动的Agent具体是怎么做的呢 什么是AI Agent 代理Agent这个词来源于拉丁语“agere”意为“行动”。现在可以表示在各个领域能够独立思考和行动的人或事物的概念。它强调自主性和主动性 [1][1]。智能代理/智能体是以智能方式行事的代理Agent感知环境自主采取行动以实现目标并可以通过学习或获取知识来提高其性能 [8][8]。 可以把单个Agent看成是某个方面的专家。 一个精简的Agent决策流程 AgentP感知→ P规划→ A行动 感知Perception是指Agent从环境中收集信息并从中提取相关知识的能力。 规划Planning是指Agent为了某一目标而作出的决策过程。 行动Action是指基于环境和规划做出的动作。 其中Policy是Agent做出Action的核心决策而行动又通过观察Observation成为进一步Perception的前提和基础形成自主地闭环学习过程。 类 LangChain 中的各种概念 [4][4] Models也就是我们熟悉的调用大模型API。 Prompt Templates在提示词中引入变量以适应用户输入的提示模版。 Chains对模型的链式调用以上一个输出为下一个输入的一部分。 Agent能自主执行链式调用以及访问外部工具。 Multi-Agent多个Agent共享一部分记忆自主分工相互协作。 LangChain 中 Agent 和 Chain 的区别 The core idea of agents is to use an LLM to choose a sequence of actions to take. In chains, a sequence of actions is hardcoded (in code). In agents, a language model is used as a reasoning engine to determine which actions to take and in which order. 背景知识 做决策的过程中一个很重要的信息来源是 记忆Memory。作为重要的背景知识下面简单介绍下都有哪些种类的记忆 [2][2]。 记忆Memory[2][2] 记忆可以被定义为获取、储存、保留以及后来检索信息的过程。人脑中有几种类型的记忆。 感觉记忆Sensory Memory这是记忆的最早阶段提供在原始刺激结束后保留感官信息视觉、听觉等的印象的能力。感觉记忆通常只持续几秒钟。子类别包括视觉记忆iconic memory、回声记忆echoic memory和触觉记忆haptic memory。 短期记忆Short-Term Memory, STM或工作记忆Working Memory它储存我们当前意识到的信息以执行复杂的认知任务如学习和推理。短期记忆被认为有大约7个项目的容量Miller 1956并持续20-30秒。 长期记忆Long-Term Memory, LTM长期记忆可以储存信息很长一段时间从几天到几十年其储存容量基本上是无限的。LTM有两个子类型 显性 / 陈述记忆Explicit / declarative memory这是对事实和事件的记忆指的是那些可以被有意识地回忆的记忆包括情景记忆事件和经验和语义记忆事实和概念。隐性 / 程序记忆Implicit / procedural memory这种记忆是无意识的涉及自动执行的技能和例行程序如骑自行车或在键盘上打字。 可以大致考虑以下对应关系 将感觉记忆视为学习原始输入包括文本、图像或其他模式的嵌入表示 将短期记忆视为在上下文中prompt学习。它是短暂且有限的因为它受到Transformer的上下文窗口长度的限制。 将长期记忆视为代理在查询时可以注意到的外部向量存储可以通过快速检索访问。 怎么写好PromptReAct Home: ReAct: Synergizing Reasoning and Acting in Language Models LangChain中的ReActhttps://python.langchain.com/docs/modules/agents/agent_types/react.html ReAct 指Reason and Act 。 特色 CoT 只是在prompt加入了静态的 “Let’s think step by step”。ReAct 的prompt是动态变化的。 CoT 只调用LLM一次即可ReAct是多次迭代调用LLM。 ReAct 可能是当前Agent中使用最多的prompt结构少样本 Thought, Action, Observation 。也是调用工具、推理和规划时常用的prompt结构。 ReAct 中迭代使用3个元素Thought, Action, Observation。其中 Thought, Action 由 LLM 生成Observation 是执行 Action 后获得的返回结果。 Step 1 中LLM基于 Question 先thinkreasoning然后再决定采取什么行动。这样LLM就会生成 Thought 1 和 Action 1 。执行 Action 1 获得 Observation 1。 Step 2 中LLM基于 QuestionThought 1 Action 1 和 Observation 1汇总所有信息先thinkreasoning然后再决定采取什么行动。这样LLM就会生成 Thought 2 和 Action 2 。执行 Action 2 获得 Observation 2。 Step 3 中LLM基于 QuestionThought 1 Action 1 Observation 1Thought 2 Action 2 和 Observation 2汇总所有信息先thinkreasoning然后再决定采取什么行动。这样LLM就会生成 Thought 3 和 Action 3 。执行 Action 3 获得 Observation 3。 以此类推直到 Action 表示结束。 具体代码可以参考以下 def webthink(idxNone, promptwebthink_prompt, to_printTrue):question env.reset(idxidx)if to_print:print(idx, question)prompt question \nn_calls, n_badcalls 0, 0for i in range(1, 8):n_calls 1thought_action llm(prompt fThought {i}:, stop[f\nObservation {i}:])try:thought, action thought_action.strip().split(f\nAction {i}: )except:print(ohh..., thought_action)n_badcalls 1n_calls 1thought thought_action.strip().split(\n)[0]action llm(prompt fThought {i}: {thought}\nAction {i}:, stop[f\n]).strip()obs, r, done, info step(env, action[0].lower() action[1:])obs obs.replace(\\n, )step_str fThought {i}: {thought}\nAction {i}: {action}\nObservation {i}: {obs}\nprompt step_str # 之前的 Thought, Action, Observation 都加进来了if to_print:print(step_str)if done:breakif not done:obs, r, done, info step(env, finish[])if to_print:print(info, \n)info.update({n_calls: n_calls, n_badcalls: n_badcalls, traj: prompt})return r, info https://github.com/ysymyth/ReAct/blob/master/hotpotqa.ipynb 上面函数输入的参数 webthink_prompt 长如下样子 Solve a question answering task with interleaving Thought, Action, Observation steps. Thought can reason about the current situation, and Action can be three types: (1) Search[entity], which searches the exact entity on Wikipedia and returns the first paragraph if it exists. If not, it will return some similar entities to search. (2) Lookup[keyword], which returns the next sentence containing keyword in the current passage. (3) Finish[answer], which returns the answer and finishes the task. Here are some examples.Question: What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into? Thought 1: I need to search Colorado orogeny, find the area that the eastern sector of the Colorado orogeny extends into, then find the elevation range of the area. Action 1: Search[Colorado orogeny] Observation 1: The Colorado orogeny was an episode of mountain building (an orogeny) in Colorado and surrounding areas. Thought 2: It does not mention the eastern sector. So I need to look up eastern sector. Action 2: Lookup[eastern sector] Observation 2: (Result 1 / 1) The eastern sector extends into the High Plains and is called the Central Plains orogeny. Thought 3: The eastern sector of Colorado orogeny extends into the High Plains. So I need to search High Plains and find its elevation range. Action 3: Search[High Plains] Observation 3: High Plains refers to one of two distinct land regions: Thought 4: I need to instead search High Plains (United States). Action 4: Search[High Plains (United States)] Observation 4: The High Plains are a subregion of the Great Plains. From east to west, the High Plains rise in elevation from around 1,800 to 7,000 ft (550 to 2,130 m).[3] Thought 5: High Plains rise in elevation from around 1,800 to 7,000 ft, so the answer is 1,800 to 7,000 ft. Action 5: Finish[1,800 to 7,000 ft][More Examples]... 更多prompt结构可以参考 [7][7] 。 有了上面的基本知识后我接下来会介绍几篇Agent的代表性工作。本文Part 1介绍来自斯坦福的工作其中主要文字都是原论文直译。 来自斯坦福的虚拟小镇 Generative Agents: Interactive Simulacra of Human Behavior, 2023.04, Stanford 代码已开源GitHub - joonspk-research/generative_agents: Generative Agents: Interactive Simulacra of Human Behavior 虚拟小镇一个agent就是一个虚拟人物25个agents之间的故事。 架构 代理Agents感知他们的环境当前代理所有的感知完整的经历记录都被保存在一个名为记忆流memory stream中。基于代理的感知系统检索相关的记忆然后使用这些检索到的行为来决定下一个行为。这些检索到的记忆也被用来形成长期计划并创造出更高级的反思这些都被输入到记忆流中以供未来使用。 1. 记忆流与检索 记忆流Memory Stream记录了代理Agent的所有经历。它是一个内存对象列表其中每个对象包含自然语言描述创建时间戳和最近访问时间戳。记忆流的最基本元素是观察Observation这是代理直接感知的事件。常见的观察包括代理自己执行的行为或者代理感知到的其他代理或非代理对象执行的行为每个Agent都有自己独立的记忆流。 检索功能以代理的当前情况作为输入检索出一部分记忆流以传递给语言模型。 排序打分包括三个部分 近期性Recency为最近访问的记忆对象分配更高的分数因此刚刚发生的事件或今天早上的事件可能会保留在代理的注意力范围内。在作者的实现中将近期性视为一个指数衰减函数衰减的对象是自上次检索记忆以来的沙盒游戏小时数。衰减因子是0.99。 重要性Importance通过为代理认为重要的记忆对象分配更高的分数区分了平凡记忆和核心记忆。例如一个平凡的事件如在房间里吃早餐会产生一个低重要性分数而与重要的他人分手则会产生一个高分。重要性分数的实现方式有很多种作者直接使用LLM打分输出一个整数分数。 prompt: On the scale of 1 to 10, where 1 is purely mundane (e.g., brushing teeth, making bed) and 10 is extremely poignant (e.g., a break up, college acceptance), rate the likely poignancy of the following piece of memory.Memory: buying groceries at The Willows Market and Pharmacy Rating: fill in 相关性Relevance为与当前情况相关的记忆对象分配更高的分数。使用常见的向量检索引擎即可。 最终的检索分数是上面三项的加权平均 2. 反思Reflection 挑战仅配备原始观察记忆的代理往往难以进行概括或推理。 示例用户问 Klaus Mueller“If you had to choose one person of those you know to spend an hour with, who would it be?” 仅通过观察记忆代理简单地选择 Klaus 交互最频繁的人Wolfgang他的大学宿舍邻居。但是Wolfgang 和 Klaus 只是偶尔见面没有深入的互动。一个更理想的回答需要代理从 Klaus 花费数小时在研究项目上的记忆中概括出 Klaus 对研究的热情并同样认识到 Maria 也在她自己的研究中付出努力尽管是在不同的领域从而反映出他们有共同的兴趣。使用下面的方法当问 Klaus 要与谁共度时间时Klaus 会选择 Maria 而不是 Wolfgang。 作者引入了第二种类型的记忆称之为反思Reflection。反思是由代理生成的更高级别、更抽象的思考。因为反思也是一种记忆所以在检索时它们会与其他观察结果一起被包含在内。反思是周期性生成的在作者的实现中当代理感知到的最新事件的重要性评分之和超过一定阈值时就会生成反思。在实践中代理大约每天反思两到三次一日三省吾身。 反思的第一步是让代理确定要反思什么通过确定代理最近的经历可以提出哪些问题。作者用代理记忆流中最近的100条记录例如“Klaus Mueller is reading a book on gentrification”, “Klaus Mueller is conversing with a librarian about his research project”, “desk at the library is currently unoccupied”查询LLM使用prompt“Given only the information above, what are 3 most salient high-level questions we can answer about the subjects in the statements?”生成候选问题例如“What topic is Klaus Mueller passionate about?” 和 “What is the relationship between Klaus Mueller and Maria Lopez?” 第二步将这些生成的问题作为检索的查询收集每个问题的相关记忆包括其他反思。然后使用LLM从中提取洞见insight并引用生成洞见对应的特定记录。下面是完整的提示 这个过程生成了一些洞见比如“Klaus Mueller is dedicated to his research on gentrification (because of 1, 2, 8, 15).”。解析并将这个洞见存储为记忆流中的一个反思包括指向被引用的内存对象的指针。 反思Reflection明确允许代理不仅反思他们的观察结果还可以反思其他的反思例如上面关于Klaus Mueller的第二个陈述是Klaus之前的反思而不是他从环境中得到的观察。因此代理生成了反思树树的叶节点代表基础观察非叶节点代表的思考越往树上越抽象和高级。 图中包含了3种 MemoryObservation、Reflection、Plan。 3. 计划与响应 计划Plan是为了做更长时间的规划。 像反思一样计划也被储存在记忆流中第三种记忆并被包含在检索过程中。这使得代理能够在决定如何行动时同时考虑观察、反思和计划。如果需要代理可能在中途改变他们的计划即响应reacting。 为了创建这样的计划作者的方法是从上到下递归地生成更多的细节。 第一步是创建一个大致概述一天行程的计划。为了创建初始计划使用代理的摘要描述例如名字特征和他们最近经历的总结和他们前一天的总结来提示语言模型。下面是一个完整的示例提示底部未完成由LLM完成 Name: Eddy Lin (age: 19) Innate traits: friendly, outgoing, hospitable Eddy Lin is a student at Oak Hill College studying music theory and composition. He loves to explore different musical styles and is always looking for ways to expand his knowledge. Eddy Lin is working on a composition project for his college class. He is also taking classes to learn more about music theory. Eddy Lin is excited about the new composition he is working on but he wants to dedicate more hours in the day to work on it in the coming days. On Tuesday February 12, Eddy 1) woke up and completed the morning routine at 7:00 am, [. . . ] 6) got ready to sleep around 10 pm.Today is Wednesday February 13. Here is Eddy’s plan today in broad strokes: 1) 这会生成代理一天计划的大致草图分为五到八个部分 1) wake up and complete the morning routine at 8:00 am, 2) go to Oak Hill College to take classes starting 10:00 am, [. . . ] 5) work on his new music composition from 1:00 pm to 5:00 pm, 6) have dinner at 5:30 pm, 7) finish school assignments and go to bed by 11:00 pm. 代理将此计划保存在记忆流中然后递归分解它以创建更细粒度的动作首先是一小时长的动作块——例如Eddy从下午1点到5点的工作计划 “work on his new music composition” 变成“1:00 pm: start by brainstorming some ideas for his music composition [...] 4:00 pm: take a quick break and recharge his creative energy before reviewing and polishing his composition”。然后我们再次递归分解这个计划变成5-15分钟的动作块例如“4:00 pm: grab a light snack, such as a piece of fruit, a granola bar, or some nuts. 4:05 pm: take a short walk around his workspace [...] 4:50 pm: take a few minutes to clean up his workspace.”。这个过程可以根据需要的粒度进行调整。 3.1 响应和更新计划Reacting and Updating Plans。代理执行动作循环中的动作每个时间步骤它们感知周围的世界这些感知到的观察结果被存储在它们的记忆流中。这些观察结果输入到LLM让LLM决定代理是否应该继续他们现有的计划或者做出响应reacting。例如站在画架前画画可能会触发对画架的观察不太可能引发响应。然而如果艾迪的父亲约翰记录下他看见艾迪在房子的花园里短暂散步结果就不同了。下面是prompt其中 [Agent’s Summary Description] 代表了一个动态生成的、长达一段落的对代理总体目标和性情的总结 [Agent’s Summary Description] It is February 13, 2023, 4:56 pm.John Lin’s status: John is back home early from work.Observation: John saw Eddy taking a short walk around his workplace.Summary of relevant context from John’s memory: Eddy Lin is John’s Lin’s son. Eddy Lin has been working on a music composition for his class. Eddy Lin likes to walk around the garden when he is thinking about or listening to music.Should John react to the observation, and if so, what would be an appropriate reaction? 通过两个prompts “What is [observer]’s relationship with the [observed entity]?”和“[Observed entity] is [action status of the observed entity]”来生成上下文摘要并将它们的答案一起总结。输出建议 “John could consider asking Eddy about his music composition project”。然后从响应发生的时间开始重新生成代理的现有计划。最后如果行动指示了代理之间需要互动使用以下方式生成他们的对话。 3.2 对话。代理在互动时进行对话。根据它们对彼此的记忆来生成代理的对话。例如当John开始和Eddy对话时通过使用他对Eddy的总结记忆以及他决定询问Eddy关于他的composition project时的预期响应来生成John的第一句话。 [Agent’s Summary Description]It is February 13, 2023, 4:56 pm.John Lin’s status: John is back home early from work.Observation: John saw Eddy taking a short walk around his workplace.Summary of relevant context from John’s memory: Eddy Lin is John’s Lin’s son. Eddy Lin has been working on a music composition for his class. Eddy Lin likes to walk around the garden when he is thinking about or listening to music.John is asking Eddy about his music composition project. What would he say to Eddy? 结果“Hey Eddy, how’s the music composition project for your class coming along?” 从Eddy的角度看John发起的对话被视为一个他可能想要回应的事件。因此就像John做的那样Eddy检索并总结了他与John的关系记忆以及可能与John在对话中的最后一句话相关的记忆。如果他决定回应我们会使用他的总结记忆和当前的对话历史来生成Eddy的话语 [Agent’s Summary Description] It is February 13, 2023, 4:56 pm.Eddy Lin’s status: Eddy is taking a short walk around his workplace.Observation: John is initiating a conversation with Eddy.Summary of relevant context from Eddy’s memory: Jonn Lin is Eddy Lin’s father. John Lin is caring and is interested to learn more about Eddy Lin’s school work. John Lin knows that Eddy Lin is working on a music composition.Here is the dialogue history:John: Hey Eddy, how’s the music composition project for your class coming along?How would Eddy respond to John? 这生成了Eddy的回应“Hey Dad, it’s going well. I’ve been taking walks around the garden to clear my head and get some inspiration.” 这个对话的延续是使用同样的机制生成的直到两个代理中的一个决定结束对话。 分享视频 Youtube Bilibili References 大模型下半场关于Agent的几个疑问LLM Powered Autonomous Agents | LilLogGenerative Agents: Interactive Simulacra of Human BehaviorAgentOpenAI的下一步亚马逊云科技站在第5层ReAct: https://react-lm.github.ioGenerative Agents: Interactive Simulacra of Human Behavior2023年新生代大模型Agents技术,ReAct,Self-Ask,Plan-and-execute,以及AutoGPT, HuggingGPT等应用LLM-based Agents survey 基于大语言模型多智能代理简单综述及展望 原文地址基于大语言模型的AI Agents—Part 1 | Breezedeus.com
http://www.yayakq.cn/news/5429/

相关文章:

  • 做网站绿标电脑培训班
  • 公司为什么要建立网站南通网站公司网站
  • 电子拜年贺卡在线制作网站全网推广推荐
  • 建设一个网站论坛要多少钱电子商务网站模板
  • 凡科建设网站图片怎么删除发软文的平台
  • 用meteor框架做的微博网站招聘网最新招聘
  • 建网站程序工具下载软件的应用app
  • 搜索引擎网站的搜素结果有何区别深圳企业网站制作推广运营
  • 上海备案证查询网站彩视网站建设策划
  • 建立能网上交易的网站多少钱wordpress 提交插件
  • 福建省住房和城乡建设厅网站首页江苏网站开发公司
  • 微信开发网站制作企业名录搜索
  • 创建网站的免费软件国内个人网站首页布局
  • 网络商城网站怎样做关键词优化网站的交流的功能怎么做
  • 建设网站必备条件手机商城积分兑换
  • 低代码建站平台网站建设创新互联
  • 广州市萝岗区做网站设计服务全国十大猎头公司
  • 荣耀手机商城官方网站下载优秀网文
  • 网站建设中 页面源代码简单游戏开发
  • 音乐网站建设视频教程汶上网站建设公司
  • 网站建设公司的正反免费素材哪个网站比较好
  • 广州建站模板厂家区域教育联盟网站建设
  • 十堰做网站的公司可以做网站头像的图片
  • 怎么做北京赛车网站app界面设计模板免费下载
  • 互联网定制网站找建筑图纸的网站
  • 北京建设网站合同下载wordpress中国可以用吗
  • 网站开发技术可行性分析微信公众号和小程序开发需要涉及
  • 网站建设售后服务合同网站建设怎么样
  • 网站科技感页面设计做网站的像素是多少钱
  • 东莞网站优化一般多少钱室内装修设计软件哪个好用