Andrew Ng’s Post

View profile for Andrew Ng, graphic
Andrew Ng Andrew Ng is an Influencer

Founder of DeepLearning.AI; Managing General Partner of AI Fund; Founder and CEO of Landing AI

Multi-agent collaboration has emerged as a key AI agentic design pattern. Given a complex task like writing software, a multi-agent approach would break down the task into subtasks to be executed by different roles -- such as a software engineer, product manager, designer, quality assurance engineer, and so on -- and have different agents accomplish different subtasks. Different agents might be built by prompting a LLM to carry out different tasks. For example, to build a software engineer agent, we might prompt: "You are an expert in writing clear, efficient code. Write code to perform the task …". It might seem counterintuitive that, although we are making multiple calls to the same LLM, we apply the programming abstraction of using multiple agents. I'd like to offer a few reasons: - It works! Many teams are getting good results with this method, and there's nothing like results! Ablation studies (for example, in the AutoGen paper cited below) show that multiple agents give superior performance to a single agent.  - Even though some LLMs today can accept very long input contexts, their ability to truly understand long, complex inputs is mixed. An agentic workflow in which the LLM is prompted to focus on one thing at a time can give better performance. - It gives us a framework for breaking down complex tasks. When writing code to run on a single CPU, we often break our program up into different processes or threads. This lets us decompose a task -- like implementing a web browser -- into subtasks that are easier to code. Multi-agents roles is, similarly, a useful abstraction. In companies, managers decide what roles to hire and then how to split complex projects into smaller tasks to assign to employees with different specialties. Using multiple agents is analogous. Each agent implements its own workflow, has its own memory (itself a rapidly evolving area in agentic technologies -- how can an agent remember enough of its past interactions to perform better on upcoming ones?), and may ask other agents for help. Agents themselves can also engage in Planning and Tool Use. While managing people is hard, it's a sufficiently familiar idea that it gives us a mental framework for how to "hire" and assign tasks to our AI agents. Frameworks like AutoGen, Crew AI, and LangGraph provide rich ways to build multi-agent solutions. If you're interested in playing with a fun multi-agent system, check out ChatDev, an open source implementation of a set of agents that run a virtual software company. While it may not always produce what you want, you might be amazed at how well it does! To learn more, I recommend:  - Communicative Agents for Software Development, Qian et al. (2023) (the ChatDev paper) - AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation, Wu et al. (2023)  - MetaGPT: Meta Programming for A Multi-Agent Collaborative Framework, Hong et al. (2023) [Original text: https://lnkd.in/g7gShRnf ]

AI Agents With Low/No Code, Hallucinations Create Security Holes, and more

AI Agents With Low/No Code, Hallucinations Create Security Holes, and more

deeplearning.ai

Mohamad Amirtaheri

AI Engineer Specializing in Building Intelligent AI Agents, Prompt Engineering & LLMs | Python Developer

2mo

The issue arises when multiple agents, all operating from a single LLM, such as in a software development scenario, share the same level of knowledge. This results in both the feedback loop and the forward path operating at this identical knowledge level. For instance, if a software engineer agent, powered by GPT-4, encounters a challenge in implementing a complex algorithm, the quality assurance engineer agent or the test agent, also based on GPT-4, would not be equipped to resolve the issue due to their shared knowledge constraints. This limitation persists unless one of the agents leverages the internet to seek a more effective solution or another agent, based on a different LLM (for example, Mistral), steps in as the quality assurance engineer agent or the test agent. The essence of a multi-agent system should be to function as an ecosystem where each agent compensates for the deficiencies of the others. Furthermore, this inter-agent communication should be characterized by high bandwidth to ensure efficient information exchange. This approach would enhance the overall effectiveness and efficiency of the multi-agent system.

Olesia Stetsiuk

Yet another AI/ML Engineer | Interested in AI Reliability and Security | Tech Recruitment Company Owner | M.Sc. Physics, M.Sc. Economics

2mo

A small story 🤓A year ago I experimented testing out GPT for cognitive biases, inspired by an analogy of fast and slow thinking by prof Kahneman. And it played a role of project manager for ML PoC, making estimates, assessing tasks. And … the regular stuff of understanding the workflow and typical stages was quite alright, but estimates were over optimistic. But it is the same as for us for people. It is our typical optimistic bias, even the digital trace we produce is biased towards initial goals, achievements and planned happy path, not a lot material is generated on the failures and actual progress done. So how could an agent be better than that? Eventually (under pressure) it was able to produce a reasonable timeline which was named as pessimistic 😩 So, my worries lie on the innate and not evident agents limitations as described. There are other “treasures” and Easter eggs in the training data based on our “cognitive biases”. So long road ahead of debugging! Soon we will be having psychoanalysis for agents as a preliminary step before handing them something even slightly important 🤪

We found that agentic collaboration wasn't as straightforward as we'd hoped. Why? They were too accepting of each other's ideas. Good ideas come from the right mix of skepticism and open mindedness. In our limited experiments the bots wanted to accept each other's ideas without question. It was like having your product manager tell your engineer, "Make a round square", and the engineer says, "Absolutely, no problem!" Instead of saying, "That's impossible. What problem are you trying to solve?" Instead of continuing down this path, we decided to minimize the agentic approach and focused more on innovating on one-shot prompt engineering and human-in-the-loop. With great success! For anyone who does pursue agentic collaboration, we highly recommend encouraging each agent to question the others - surely with some ingenuity this could be a powerful approach.

Doesn’t feel like it’s quite there yet based on my trying this concept out on a “dummy” product. I created an org with individual roles in different context windows. Being the human intermediary was quite exhausting with ideas and approaches flying in all directions. It requires some serious prompting chops combined with competent domain knowledge on the human’s part. I see how this can involve with future GPTs though.

Ron Chan

Co-Founder at Inference Labs | Enabling trustless Decentralized AI with Proof-of-Inference

2mo

Agentic AI design patterns represent an incredibly exciting development in our field of AI, and I strongly believe they could pave the way for more decentralized and distributed AI systems. However, the security implications are terrifying. While zk-ML and other technologies aimed at ensuring computational integrity are critical, they are just the beginning of what needs to be a comprehensive security framework. These architectures might face numerous threats ranging from data privacy breaches to adversarial attacks from malicious models scaling up additional adversarial agents, there is the need for highlighting robust protective measures.

Uchenna Arinze

System Integration Engineer at Aspentech

2mo

Your idea provides a comprehensive exploration of the benefits and rationale behind multi-agent collaboration in AI systems, particularly in tackling complex tasks like software development. Your analogy of using multiple agents akin to managing roles in a company effectively illustrates the concept's applicability and utility in breaking down tasks into manageable subtasks. The inclusion of empirical evidence from ablative studies and real-world examples such as AutoGen highlights the practical success and superiority of multi-agent approaches compared to single-agent models. Furthermore, the discussion on agentic workflows, memory management, and the evolution of AI technologies demonstrates a nuanced understanding of the challenges and advancements in AI systems. I think it's something I'd love to play with.

Elijah ben Izzy

Co-creator of Hamilton; Co-founder @ DAGWorks (YC W23, StartX S23)

2mo

This is one of the reasons we built Burr! https://github.com/dagworks-inc/burr It is conceptually similar to langgraph, but less tied to langchain and has a host of customizations to add it it. Designed for human-in-the-loop tooling as well. Looking for OS users, contributors, and feedback!

This is from 2018 and "ML" but the overall approach has its place today: how to combine AI itself, the engineers designing and implementing the AI system, and the specialists working in the factory or other organization where AI is implemented. With multi-agent approach it would then mean that it should include human resources in the scheme. We might update this. https://gotepoem.wordpress.com/2018/04/23/triad-model-of-learning-in-ml-implementation/

Taddeus Buica

Senior Computer Scientist | Software, ML & MLOps | Fin-Tech & Bio-Tech Researcher | Exploring Tech & Finance, One Experiment at a Time

2mo

Very insightful! I would add to this MemGPT as context length is a limitation of a lot of agents. With this, you could use your archival memory based on query similarity search to get useful information in the context window and use it effectively (for example code from the project). https://memgpt.readme.io/docs/index This integrates well with Autogen, and you can include in each team an expert with specific knowledge around a subject, which will also help avoid hallucinations. Example use case: You're integrating with an open-source library and want the agents to write the integration given specific requirements that are compatible and use the library correctly. Add review and executor agents to run the code, and you have a nice feedback loop going on.

Albert Maloof Berdellans III

Managing Director, Artificial Intelligence (AI)

2mo

Andrew Ng you are missing a very important piece and I am beginning to suspect that you keep avoiding mentioning it because your investments aren't properly placed to capitalize... BLOCKCHAIN is a virtually mandatory component to keeping even one large-scale LLM and/or AI agent under control. There must be immutable references to reduce the search vector for answers within data sets that are both large and dynamic. Moreover, for a multi-Agent environment (especially multiple noncooperative Agents), an immutable framework is a critical component to making sure the more powerful (or more crafty) model does not either trick or overpower the others.

See more comments

To view or add a comment, sign in

Explore topics