Skip to the content.

Manufacturer-Executor-Evaluator: A General LLM Agentic Pattern for Collective Intelligence

Contact me


The idea of Collective Intelligence is widely used in the AI area, like reward and action in Reinforcement Learning, the voting mechanism in the ensemble learning, generator and discriminator in Generative Adversarial Networks (GAN), mixture of experts in the recent llm models, etc. Multi-agent systems draw much attention with the development of latest LLM trends, in this article, we will introduce a general agentic pattern for Collective Intelligence, which has three agents: Manufacturer, Executor, and Evaluator (MEE), it will mimic the human iteration to optimize the solution performance and can be extended to many multi-agent systems as a general framework. With this framework, we can build pipeline instances to automatically learn from examples then generate and optimize target solutions leveraging the LLM reasoning ability, human can also supervise the whole process to ensure the optimization direction.

Introduction

Generative Adversarial Networks (GAN) and Reinforcement Learning (RL) are two popular paradigms in the AI area used to optimize the performance of target solution by adversarial process or action reward, they have some common characteristics。

For GAN:

  1. Generator and Discriminator are two agents, Generator is the final product solution.
  2. Generator generates fake data, and Discriminator distinguishes real data from fake data.
  3. The two agents interact with and learn from each other, and the system can learn and perform better.

For RL:

  1. Agent and Environment are two agents, Agent is the final product solution.
  2. Agent takes actions, and Environment gives rewards.
  3. The two agents interact with each other, and the system can learn and perform better.

We argue that these paradigms are a subset of collective intelligence, it decouples the direct function optimization problem to adversarial process or long reward propagation, finally iterates on the agents system. These systems are collectively improved by each component and eliminating the human interaction to toward an automatic solution optimization. However, for the GAN and RL learning process, it requires expert knowledge to design the objective function to mimic the optimization direction. There are some researches focusing on the mimic instead of hard defined the objective function, latest example is RLHF from OpenAI to learn the human preference to optimize the LLM performance.

Inspired by that, for multi-agent systems, we can leverage the Manufacturer-Executor-Evaluator (MEE) pattern to design the system to learn directly from the task examples or human actions to optimize the solution. We will discuss a general agentic pattern Manufacturer, Executor, and Evaluator (MEE):

The three agents interact with each other, and the system can learn and perform better, the process can be under the supervision of human or not. The system is agnostic to the task, it can be applied to many multi-agent systems as a general framework.

Manufacturer-Executor-Evaluator (MEE)

The basic idea of Manufacturer-Executor-Evaluator (MEE) is to mimic the human working process by adapting the agent’s interaction mechanism from GAN and RL. MEE has three agents: Manufacturer, Executor, and Evaluator.

Manufacturer

As the first step, Manufacturer generates task specification based on these:

Executor

Manufacturer will generate the task specification and feed to Executor, Executor will actually act based on these specification to generate the result for task input. Intuitively Manufacturer is more powerful and intelligent than the Executor. Executor is set up by the task specification, then it takes the input X and map X to Y. Y is the Executor result and this process can be done in parallel.

Executor is the target specification consumer which means it should be configured just what you want to use in the production.

Evaluator

Evaluator is responsible for evaluating the Executor result based on the criteria, ideally criteria is provided by user, but this can be enriched by Evaluator from user interaction during the process.

Evaluator takes these as input:

MME Example for Prompt Generation

Prompt engineering is a hot topic in the latest LLM models, it requires expert knowledge to design the prompt for the model. Commonly, human experts design the prompt for the model, evaluating the model performance, then adjust the prompt to get better performance. The process is time consuming and requires expert knowledge. We can leverage the Manufacturer-Executor-Evaluator (MEE) pattern to design the prompt for the model to learn directly from the task examples to ease human effort.

For example, we want the model to answer questions with these requirements:

  1. The answer should be polite.
  2. The answer should be in json format with the key “answer”.
  3. The answer should be in English.
  4. The answer should be in a single sentence. …

We can provide the task examples to the Manufacturer. The Manufacturer writes the prompt for the Executor, the Executor takes the prompt with examples input to generate the answer, the Evaluator evaluates the answer based on the requirements, the Evaluator gives feedback to the Manufacturer, the Manufacturer adjusts the prompt based on the feedback, the system will find the optimal prompt for the Executor. Just like the human working process, the system can learn and perform better.

Compared with traditional model training, the MEE pattern does not require expert knowledge to design the objective function, reward function, etc. It can learn directly from the task examples or human actions that can ease human effort and be applied to many scenarios.

Conclusion

We proposed Manufacturer-Executor-Evaluator (MEE) pattern which provides a robust framework for collective intelligence in multi-agent systems. By mimicking human iterative processes, MEE enhances the optimization of solutions through the interaction of its three agents: Manufacturer, Executor, and Evaluator. This pattern not only simplifies the design of objective functions but also allows for direct learning from task examples or human actions, reducing the need for expert knowledge. The MEE pattern’s adaptability makes it applicable to various scenarios, offering a general framework for improving system performance and efficiency.