Abstract
Multi-Agent Reinforcement Learning (MARL) offers a robust methodology for modeling dynamic social systems, yet the complexity of existing software often excludes researchers from non-computational backgrounds. We present Sorrel (SOcial Recreations for REinforcement Learning), a Python-based framework designed with a modular, hierarchical architecture that mirrors psychological intuition. Sorrel simplifies the creation of custom gridworld environments, supports diverse observation modalities—including ASCII for Large Language Models—and facilitates human-agent interaction. This paper outlines the framework's design and demonstrates its utility through reference social dilemma environments.
Introduction
The study of emergent social behaviors, such as cooperation and norm formation, has increasingly leveraged Multi-Agent Reinforcement Learning (MARL). However, the technical overhead of current frameworks often creates a "black box" effect for social scientists. Sorrel is designed to bridge this gap by providing a flexible yet accessible tool for modeling complex choice ecologies without requiring advanced software engineering expertise.
Motivation
While high-performance libraries like JaxMARL prioritize speed and established suites like PettingZoo or Melting Pot offer powerful benchmarks, they can be intimidatingly complex or rigid for researchers wishing to build entirely new, custom environments. Social scientists require a framework that is simple enough to iterate on theoretical models while remaining flexible enough to capture the nuances of social interaction. Sorrel addresses this by prioritizing a "psychologically intuitive" design over raw computational throughput.
Framework Architecture
Sorrel's primary innovation is its nested, modular structure, which organizes the components of a simulation in a way that aligns with how researchers conceptualize social agents and their surroundings.
As shown in Figure 1, the framework is divided into several key layers:
- Environment: The top-level container responsible for orchestrating the experiment and managing the transition functions.
- World: A sub-component containing the spatial map and helper functions for managing entities.
- Entities & Agents: Modular objects within the world. Agents are further decomposed into three systems: observation, model specification (the "brain"), and action systems.
This modularity allows researchers to isolate variables, such as swapping perception systems while keeping decision logic constant, to observe the impact of specific cognitive constraints on social outcomes.
Reference Environments
To demonstrate its capabilities, Sorrel includes two primary environments:
- Treasure Hunt: A tutorial-focused environment where agents compete for gems, serving as a template for user-defined worlds.
- Cleanup: A port of the classic social dilemma from DeepMind’s Melting Pot. In this scenario, agents must navigate the tension between the individual cost of maintaining a public resource and the collective benefit of harvesting the resulting food.
Design Principles and Key Insights
Sorrel is built on several core principles that distinguish it from standard RL libraries:
- Psychological Intuition: The architecture centers on the agent's internal state and representational systems, making it easier to translate social science hypotheses into executable code.
- LLM Integration: By natively supporting ASCII string observations, Sorrel is optimized for the emerging field of LLM-based social simulations.
- Human-in-the-Loop: A dedicated class allows human researchers to interact with AI agents in real-time, a critical feature for qualitative debugging and studying human-AI social dynamics.
Results and Discussion
Qualitative evaluation of Sorrel highlights its accessibility and extensibility. The framework's built-in visualization utilities allow researchers to animate agent trajectories, facilitating the communication of findings through intuitive sprites rather than abstract reward curves.
However, Sorrel currently faces certain limitations. It is optimized for 2D gridworlds and does not support continuous 3D physics. Additionally, its focus on flexibility introduces computational overhead that may not match hardware-accelerated libraries for massive-scale training. Future work will focus on expanding the library of pre-built environments and providing comprehensive tutorials to help social scientists transition from traditional game theory to complex MARL simulations.
Conclusion
Sorrel provides a much-needed entry point for social scientists into the world of MARL. By lowering technical barriers and emphasizing modular, intuitive design, it empowers researchers to explore the dynamics of social systems in increasingly complex and realistic digital ecologies.
Summary updated