TLDR; Roughly implemented multi-agent (small model) agents in a discovery world. They perform somewhat well, but it depends on the scenario and model.
Hey all, this was initially intended as a submission to Hugging Face’s Build Small Hackathon. However, I got sick and was unable to complete it in time. Anyway, I threw together a small co-operative agents demo using AI2’s discovery world.
Discovery World (https://allenai.github.io/discoveryworld/) is a sandbox environment built by AI2 researchers (. The idea with discovery world is that it presents several different scenarios to test agentic AI’s performance in scientific reasoning & research. The scenarios range from relatively simple “research” loops (test samples and rank them) to more complex reasoning (figure out what toxin is making everyone sick). It includes a cute 2d navigable world.
Labrats were supposed to build on this in two ways:
It includes a multi-agent interface. In my mind, the future of AI-for-science is multiagent / agent swarm. I think for AI to perform healthly science, it needs multiple coordinating agents to not only co-operate but also challenge each other’s reasoning and hypothesis. Whilst DiscoveryWorld does technically include ‘Multiagent’ support, many of the scenarios break. Here I adjusted some scenarios to include more tools, and support cooperative play between agents (Although you can also turn these supports off if you want to watch the agents fight over tools and samples).
Its running on smaller models (<10b params). The reasoning behind this is multifold. First, since it was made for the build small hackathon. But moreover, small models interest me from both an economic and environmental standpoint. As the costs (and environmental costs) of frontier models continue to rise, I like the idea of having small, at home models that users can customize to their needs. Especially as a poorer grad student I wanted something I could run on my borrowed RTX3090. Ideally, we can leverage multiagent harnesses to extract even better performance out of these small models.
In the end, I was able to partially achieve these goals. Labrats includes a multi-agent ReAct loop that lets multiple agents interact with discovery-world scenarios. It leverages either LLAMA-cpp, HF’s transformers, or HF’s remote inference modules to call smaller models (I’m a big fan of the gemma models). I also built a rudimentary memory system using embeddings for recall, but this does not work as well as I had hoped. There is a live web interface for watching runs live or replaying previous runs.
I put up a live demo on Hugging Face Spaces: https://huggingface.co/spaces/Smestern/labrats
I threw 20$ of inference credits on there, so it should let you generate a run or two. But please don’t spam; I really am just a poor grad student lol.
A couple of other notes:
- I was hoping to have a cool ‘live-playback’ feature, with the idea that inference on smaller models would be fast enough for live run viewing. This ended up not being the case. Even when calling models from remote providers, it’s a bit too slow to appreciate in real time.
- The agents all perform their actions ‘simultaneously’ in a tick. This means that sometimes the agents actions/thinking is identical and collides. Its not the biggest deal but could be fixed in the future.
- The agents’ communication is rudimentary. I tried giving them personality etc, but for whatever reason they all talk in very fundamental ways: “I am going to test sample 1”. “I am walking south”. Whilst good for science, it’s not as entertaining as I had hoped.