Table of Contents
Fetching ...

AMBER: A Columnar Architecture for High-Performance Agent-Based Modeling in Python

Anh-Duy Pham

TL;DR

AMBER tackles the bottleneck of Python-based agent-based modeling by replacing per-agent Python objects with a columnar state stored in a Polars DataFrame, enabling vectorized execution in Rust-backed code while preserving Pythonic abstractions. The framework demonstrates speedups from 1.2× to 93× and 38–45% peak memory reductions across three canonical benchmarks, with the largest gains for models dominated by population-wide attribute operations. AMBER supports rich ABM infrastructure—spatial environments, experiment management, and optimization—through a cohesive columnar abstraction that maintains accessibility via an object-like Agent interface. This work validates columnar state management as a viable architectural foundation for high-performance ABM in interpreted languages and outlines a design space guide for researchers and developers. The practical impact includes enabling larger-scale simulations, more extensive parameter sweeps, and memory-efficient experimentation in Python ABM ecosystems.

Abstract

Agent-based modeling (ABM) has emerged as an indispensable methodology for studying complex adaptive systems across the natural and social sciences. However, Python-based ABM frameworks face a fundamental tension between the accessibility that has made Python dominant in scientific computing and the performance requirements of large-scale simulations. This paper introduces AMBER, a framework that resolves this tension through a novel architectural approach: replacing the conventional object-per-agent representation with columnar state management using the Polars DataFrame library. We analyze the computational characteristics of both paradigms, present the architectural design of AMBER including its core abstractions, spatial environments, experiment management, and optimization capabilities. Empirical evaluation on three canonical benchmarks demonstrates that AMBER achieves speedups of 1.2x to 93x depending on workload characteristics, with the greatest advantages for models dominated by population-wide attribute operations. Memory profiling reveals 30-50% reduction in peak usage compared to object-oriented frameworks. Our results establish columnar state management as a viable architectural foundation for high-performance ABM in interpreted languages.

AMBER: A Columnar Architecture for High-Performance Agent-Based Modeling in Python

TL;DR

AMBER tackles the bottleneck of Python-based agent-based modeling by replacing per-agent Python objects with a columnar state stored in a Polars DataFrame, enabling vectorized execution in Rust-backed code while preserving Pythonic abstractions. The framework demonstrates speedups from 1.2× to 93× and 38–45% peak memory reductions across three canonical benchmarks, with the largest gains for models dominated by population-wide attribute operations. AMBER supports rich ABM infrastructure—spatial environments, experiment management, and optimization—through a cohesive columnar abstraction that maintains accessibility via an object-like Agent interface. This work validates columnar state management as a viable architectural foundation for high-performance ABM in interpreted languages and outlines a design space guide for researchers and developers. The practical impact includes enabling larger-scale simulations, more extensive parameter sweeps, and memory-efficient experimentation in Python ABM ecosystems.

Abstract

Agent-based modeling (ABM) has emerged as an indispensable methodology for studying complex adaptive systems across the natural and social sciences. However, Python-based ABM frameworks face a fundamental tension between the accessibility that has made Python dominant in scientific computing and the performance requirements of large-scale simulations. This paper introduces AMBER, a framework that resolves this tension through a novel architectural approach: replacing the conventional object-per-agent representation with columnar state management using the Polars DataFrame library. We analyze the computational characteristics of both paradigms, present the architectural design of AMBER including its core abstractions, spatial environments, experiment management, and optimization capabilities. Empirical evaluation on three canonical benchmarks demonstrates that AMBER achieves speedups of 1.2x to 93x depending on workload characteristics, with the greatest advantages for models dominated by population-wide attribute operations. Memory profiling reveals 30-50% reduction in peak usage compared to object-oriented frameworks. Our results establish columnar state management as a viable architectural foundation for high-performance ABM in interpreted languages.
Paper Structure (36 sections, 4 equations, 2 figures, 2 tables)

This paper contains 36 sections, 4 equations, 2 figures, 2 tables.

Figures (2)

  • Figure 1: Comparison of state management approaches. Left: Object-oriented representation where each agent is a Python object with scattered memory layout. Right: AMBER's columnar representation where agent attributes form contiguous columns in a Polars DataFrame. The columnar layout enables vectorized operations and cache-efficient access patterns.
  • Figure 2: Execution time versus agent population size for three benchmark models. AMBER demonstrates consistently better scaling, with the advantage most pronounced for Wealth Transfer where vectorization is most applicable.