Home > Technology peripherals > AI > body text

Several design patterns that excellent agents must learn, you can learn them in one go

WBOY
Release: 2024-05-30 09:44:20
Original
733 people have browsed it

Hello everyone, I am Lao Du.

Yesterday I listened to the AI ​​Hospital Town shared by Tsinghua University Intelligent Industry Research Institute at the company.

Several design patterns that excellent agents must learn, you can learn them in one goPicture

This is a virtual world where all doctors, nurses, and patients are Agent intelligences driven by LLM , can interact autonomously. They simulated the entire process of diagnosis and treatment, and achieved a state-of-the-art accuracy of 93.06% on a subset of the MedQA data set covering major respiratory diseases.

An excellent intelligent agent is inseparable from excellent design patterns. After reading this case, I quickly read the four main Agent design patterns recently published by Mr. Andrew Ng.


Andrew Ng is one of the most authoritative scholars in the world in the field of artificial intelligence and machine learning


Then, quickly sort it out and share it with everyone.

Mode 1. Reflection

In this mode, the results generated for the first time by the large model are not directly output. Instead, the results are thrown back to the large model for inspection and evaluation.

It will produce a second version of the result that may work better than the first version.

In the words of Confucius, this is called "I examine myself three times a day."

The specific Prompt written in this mode can use several reasoning modes we shared before, such as: few-shot (Few-shot), chain of thought (CoT) ), Tree of Thinking (ToT), ReAct, etc.

The core purpose of this model is to maximize the reasoning capabilities of large models without resorting to external forces.

Mode 2. Tool Use

This mode allows the agent to use external tools to perform specific tasks.

To put it bluntly, it means "shake people and leave professional matters to professionals."

The essence of the large model is text prediction, and it does not have the ability to do arithmetic, code execution, etc. When encountering these tasks, we can let the large model generate equations and codes, and then call the calculator and code interpreter to complete them.

The Agent in this mode seems to become more powerful with external help.

Mode 3. Planning

This mode allows the agent to decompose a complex task into A series of simple small tasks and then solved one by one.

In fact, it means "How many steps do you need to put an elephant in the refrigerator?" When I first heard this question, I was confused, but when I saw the picture below, I thought It suddenly dawned on me.

Several design patterns that excellent agents must learn, you can learn them in one goPicture

Mode 4. Multiagent Collaboration

After the Agent in the previous mode breaks down complex tasks, it is natural that multiple Agents are required to perform their respective duties and cooperate with each other to complete complex tasks together.

Several design patterns that excellent agents must learn, you can learn them in one goPicture

We have shared an open source AI programmer GPT Pilot before. His design idea is multi-Agent mode, simulation He has played various roles such as product managers, architects, programmers, and testers to complete software development tasks.

The AI ​​hospital town introduced at the beginning of the article also has this model. I will also share practical cases of this model in the future.

The above is the detailed content of Several design patterns that excellent agents must learn, you can learn them in one go. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:51cto.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!