How to Modify Agent Behavior

 I got to wondering, “How do you change Agent behavior?” And initially, I came to the conclusion that the only way to change Agent behavior is by:

1) Changing the training. The foundational training establishes the weights within the neural network and creates a multi-dimensional vector map. Specialized fine-tuning gives them the ability to do specialized tasks.

2) Changing the context. The model’s behavior is shaped by what you put in the context window. The prompts give instructions on how to behave (“you are a helpful research assistant”. It also can include examples of expected answers, session memory, and retrieval augmented generation (RAG).

It seemed like a neat little package. If I was looking at ways to distribute intelligence by combining smaller LLMs, I just needed to focus on how to change the context that the Agents work within.

After some more research, I realized there was a third way.

3) Changing the sampling parameters. Sampling parameters such as Temperature, Top-P and Top-K, changes how the model explores possibilities.

Something is Still Missing

I put together a prototype of the distributed model I discussed in my previous post, which I am calling LoCAL (Loosely-Coupled Agent Language model). It is a multi-agent system where Agents communicate with each other using a publish and subscribe message bus.

Some of the things I implemented include:

· All parameters for the Agents are configurable via a YAML file, including the prompts and the parameters.

· Agents have a skills card that they use to determine confidence of their ability to answer.

· Agents have their own personal memory that are injected into the context to shape their behavior.

· They all communicate with each other using ZeroMQ publish and subscribe messaging.

The system is working relatively well and it is kind of fun to see a half-dozen Agents talking to each other to solve a problem. Although the memory and interactions do shape behavior, the differences are subtle. The Agents modify their context with different prompts, individual memories, specialized skill sets, and different temperatures, however, the overall behavior still seemed fundamentally one dimensional, flat, dare I say boring?

Where’s the Problem?

Where is the flattening happening?

Here is what I think is going on. Even though the Agents have the mechanics to communicate with each other on the bus, the architecture requires them to flow everything through the Core orchestrator.

Following the message flow, it seemed to me that the system didn’t capture distributed cognition; it was a single cognition that used different tools.

I think the model got the mechanism of the interactions correct but got the architecture wrong. It seems to me that to get more interesting behavior, the agents need to be able to communicate with each other, influence each other, and dynamically create structures. I’m still working out what is the best way to do this.

But if this is correct, maybe there is a fourth way to change Agent behavior:

4) Changing the architecture.

You can think of training as ‘what people know’. Context as ‘what’s on their mind’. Sampling as ‘what is their mood’. However, people behave differently depending on the society around them. The same person may act differently at home, at the office, at the baseball game. The structure of interactions changes the behavior that emerges. Can we get this type of change in LoCAL?

Comments

Popular Posts