Agent-based modeling (ABM) is a simulation method in which autonomous agents interact with their environment and with one another according to a predefined set of rules. System-level behaviour is not explicitly programmed in. It emerges from those local interactions, so macro-scale changes come out of micro-scale agent behaviour. Use agent-based modeling when individual variability between agents cannot be neglected and interactions among them drive the system. Use system dynamics when individuals need not be differentiated, discrete-event simulation for entities flowing through resources, and an AI agent when you need a task done for you.
The rest of this piece covers the elements of an agent-based model, how to choose between simulation paradigms, the tools, how machine learning fits in, and the cost and validation limits that decide whether a model can be trusted.
Two different things called an “agent”
The word “agent” now covers two separate things: autonomous assistants driven by large language models, and the computational entities in simulation frameworks. The two have little overlap. In ABM, an agent is a computational entity standing in for a real-world individual, executed over discrete timesteps, and is distinct from an AI agent that carries out tasks for a user. An LLM agent uses a language model as one component of a system that takes actions, observes results, keeps state and pursues multi-step goals. It executes tasks on a user’s behalf; it is not a computational stand-in for a real-world individual. Multi-agent systems of LLM agents, and agents that learn their behaviour by reinforcement, are covered in how agents learn through trial and error.
One more naming clash catches people. In the simulation literature, “reactive agents” is a specific architecture, often built on subsumption: simple behaviour modules organised in layers, where higher layers pursue more abstract goals. The other common simulation architecture, Belief-Desire-Intention (BDI), comes from practical reasoning and suits agents whose goals conflict. So “reactive agent” in a simulation paper and “reactive AI agent” in a product brief are not the same idea.
The three elements of an agent-based model
Macal and North’s 2014 Winter Simulation Conference tutorial names three elements in a typical agent-based model: agents with their attributes and behaviours; agent relationships and methods of interaction, defined by a topology of who connects to whom; and the agents’ environment. A 2026 survey of surrogate modelling describes the same three components as agents acting on fixed or learning-based heuristics, an environment providing spatial or topological context, and interaction mechanisms. Wikipedia’s longer breakdown lists five parts: agents at chosen granularity, decision heuristics, learning or adaptive rules, an interaction topology, and an environment.
Agents. Agents are generally the decision-makers in a system, whether human, organisational or automated, and modelling them needs a theory of behaviour: an optimising model, bounded rationality, a heuristic such as anchoring, or a framework like BDI. Each agent runs a perception-decision-action cycle, and the model gives every agent the chance to run that cycle in turn. The rules usually come from published literature, expert opinion or empirical data, and are often simple if-else conditions, though machine-learning methods can replace them.
Interactions. Macal and North stress that ABM models relationships and interactions as much as it models agents, and the main issues are who is connected to whom and what governs the interaction. This is where models gain or lose realism: aggregate equations usually assume homogeneous mixing, while the topology of an interaction network can push results far from the aggregate prediction.
Environment. The environment represents the physical space of the real system and is part of each agent’s input to perception. It can be a spatial grid, a continuous space or a network, and a single model can host several.
Emergence ties the three together. Even agents described by simple deterministic rules using only local information can self-organise in ways nobody explicitly programmed. Time can advance continuously, in fixed discrete steps, or by jumping from event to event. For writing a model up so others can reproduce it, the ODD protocol (Overview, Design concepts, Details) is the established template.
Agent-based modeling vs discrete-event and system-dynamics simulation
Operational research uses three main simulation types, each with its own application area: discrete-event simulation (DES), system dynamics (SD) and agent-based simulation.
DES models entities being processed according to resource availability and triggered events, with the simulator keeping an ordered event queue; it is widely used for decision support in manufacturing and services. SD works top-down: the analyst identifies key state variables and links them through coupled differential equations, which suits cases where individuals need not be differentiated and aggregate knowledge exists. In SD, items in the same stock are indistinguishable, and the modeller has to think in terms of global structural dependencies.
ABM is the bottom-up option for cases where individual variability between agents cannot be neglected. Borshchev and Filippov (2004) show this with a product-adoption model: once each adopter’s contribution differs and changes over time, collapsing adopters into stocks distorts the results. Bonabeau (2002) draws the same conclusion from his own product-adoption model: an agent-based model becomes more necessary as the modelled system becomes less homogeneous. Discreteness matters as well. In Borshchev and Filippov’s predator-prey ABM, lynx or both species could go extinct, which never happens in the continuous SD version.
Bonabeau lists nonlinear individual behaviour with thresholds or if-then rules; memory, path dependence or learning; and heterogeneous interactions that create network effects. Macal and North add the need for agents that adapt, form and break relationships, act spatially, or drive structural change from inside the model.
Borshchev and Filippov present ABM as an add-on that combines with SD and DES in multi-paradigm architectures, not as a replacement. A DES model converts naturally, because its entities can become agents once the process is described from each entity’s point of view.
Choosing a paradigm: decision table
| Your situation | Best fit | Why |
|---|---|---|
| Entities flow through processes and compete for resources; behaviour is passive | Discrete-event simulation | Logic lives in the process flowchart and event queue |
| Aggregates suffice; individuals need not be told apart; feedback loops dominate | System dynamics | Stocks, flows and coupled equations at the highest abstraction level |
| Heterogeneous, adaptive actors; network or spatial effects; you expect emergence | Agent-based modeling | Bottom-up rules generate the macro pattern |
| Some parts aggregate, some individual | Multi-paradigm model | ABM combines with SD and DES |
| You need a task completed (answer, tool call, workflow), not a population studied | Reactive LLM agent | A task-performing system, not a simulator |
When should you run a simulation rather than a reactive LLM agent?
Run a simulation when the question is “what happens to the system if…”, and use a reactive LLM agent when the question is “do this for me”. After large language models arrived, researchers began applying interacting language models as the agents in agent-based models. Park et al. (2023) built generative agents that store memories, reflect on them and plan behaviour. Starting from one agent’s wish to throw a Valentine’s Day party, the agents spread invitations, made acquaintances and coordinated attendance on their own.
Believable behaviour is not the same as valid behaviour. A 2025 critical review of LLMs in agent-based social simulation argues that human-like dialogue does not establish construct validity as a model of human decision-making. Its authors call the failure the “Micro-to-Macro Validity Gap”: hallucinations, stochastic inconsistency and biases at the LLM level spread through interactions into aggregate dynamics that look plausible but lack causal validity. The same review distinguishes uses by how defensible they are:
- Serious games and participatory environments: high operational value where narrative plausibility matters more than empirical correspondence, provided hallucination guardrails hold.
- Exploratory modelling: conditionally defensible, if qualitative patterns hold across seeds, under prompt paraphrasing and across model families.
- Explanatory or confirmatory research: restricted to hybrids that embed the LLM as a delimited subroutine inside a mechanistic, inspectable ABM engine.
Scale is the other constraint. Chopra’s Large Population Models paper (MIT, 2025) notes that LLM-agent simulations have been limited to 25 to 1,000 agents, while policy questions can require millions. In that paper’s framing, you get sophisticated behaviour or population scale, but not both.
Agent-based modeling examples from epidemics, markets and traffic
- Epidemics. Covasim, an open-source ABM written in pure Python, models households, schools, workplaces and communities as separate transmission layers. Its authors report that realistic scenarios run on a standard laptop in under a minute, and that the model has informed policy in more than a dozen countries. Wikipedia notes that ABMs now complement compartmental models, the usual type in epidemiology. Because an ABM follows agents through the environment, it can show where and from whom an agent was infected.
- Financial markets. Bonabeau (2002) describes NASDAQ using an agent-based model to test a tick-size reduction before introducing it. The simulation suggested that smaller ticks could reduce the market’s ability to discover prices. Axtell and Farmer’s 2025 Journal of Economic Literature review credits ABM with progress on clustered volatility, market impact, systemic risk and housing markets.
- Traffic and infrastructure. TRANSIMS simulates the daily activity of a synthetic population, the movement of individual vehicles on a regional network, and the resulting emissions.
- Biology. Agent-based simulation can model a system such as a human organ at the level of cells, with growth like cancer emerging from cell interactions.
- Grid demand. A 2025 framework models household consumers whose demand responds to dynamic tariffs and local congestion, with node overloads emerging from the totals.
Bonabeau also gives a warning that still applies: business simulation has disappointed when used as a prediction tool, not as a learning tool.
Agent-based modeling software and Python libraries
Many capable free toolsets exist, partly because ABM is so popular in academia. Getting started does not strictly require programming, since NetLogo and ReLogo offer high-level languages and AnyLogic and Repast Simphony offer visual environments. Advanced features such as GIS or database links usually mean programming in Java or C++.
| Tool | Language | What it is known for |
|---|---|---|
| NetLogo | Own Lisp-family language, runs on Java | Turtles on a grid of patches, BehaviorSpace parameter sweeps, deterministic seeded runs, a library of 150+ models |
| Mesa | Python | A Python ABM library, documented in a 2025 JOSS paper on Mesa 3 |
| AgentPy | Python | Model building, interactive simulation, multi-run experiments and analysis in one Jupyter environment |
| Agents.jl | Julia | Its authors report it outperforming the other frameworks they compared, mostly by an order of magnitude |
| Repast Simphony, AnyLogic | Java / visual | Visual specification; AnyLogic-style multimethod tools combine agent-based, SD and DES |
| GAMA | GAML | Combines system dynamics and GIS with ABM |
| Covasim | Python | A COVID-19 agent-based simulator with country-specific demographics and layered transmission networks |
The Agents.jl figures come from the tool’s own authors, so treat them as their claim, not an independent benchmark. Their point about why speed matters holds regardless of which tool wins: typical ABM runs last hours, so even a twofold speed-up is a large gain.
Combining machine learning and LLMs with agent-based models
Learned agent behaviour. Large-scale agent-based models can incorporate neural networks, genetic algorithms and other ML methods to make agent behaviour and adaptation more realistic. An adaptive ABM framework separates four regimes, combining static or adaptive agents with fixed or adaptive policy parameters. It argues that the case where both adapt is the least studied and the one where decision drift and unintended consequences are most likely.
Surrogates and calibration. Lamperti, Roventini and Sani combine supervised learning with intelligent sampling to build a surrogate meta-model that approximates ABM behaviour and sharply cuts calibration time. Surrogates trade cost for accuracy, especially when extrapolating, so they need their own validation. Differentiable simulation avoids the surrogate altogether: Chopra’s FLAME composes differentiable substeps so that gradients of outputs with respect to parameters can drive calibration directly. Where the model is not differentiable, evolutionary algorithms can tune parameters through a cost function without changing the simulation code.
Analysing outputs. Unsupervised methods such as PCA, t-SNE and k-means can group whole simulation runs into regimes (stable, oscillatory, unstable) and link those regimes to parameter settings.
LLMs as agent cognition. Hybrid designs keep the environment explicit in the ABM, which checks whether an action the LLM proposes is feasible, and they store memory, social ties and resources in ABM data structures instead of a drifting context window. In these hybrids the simulation engine, not the LLM, holds authority over world state; orchestrating LLM agents is a separate topic. Hybrids are a promising path but not a sufficient one. Their validity still depends on evaluating environment, behaviour and aggregate outcomes separately, or they risk “physics washing”, where a rigorous environment lends credibility to an unvalidated behavioural layer.
Scaling agent-based simulation on GPUs and clusters
Agent-based modeling is computation-intensive. The idea dates to the late 1940s but did not spread until the 1990s because it needs so much computation. The Agents.jl authors point out that a model with 10 parameters and 10 values each has 10^10 combinations, which would take more than 300 years at one second per run, before the repeated runs that stochastic models need.
On GPUs, FLAME turns agent interactions into sparse tensor operations on commodity hardware. This relies on small-world networks, where most agents interact with few others, and on permutation invariance within substeps, where the order of operations does not change the outcome. Its authors report a 200× speed-up over traditional implementations at 8.4 million agents. On distributed CPUs, TeraAgent overcomes the single-server limit of BioDynaMo with custom serialisation and delta encoding. It reaches half a trillion agents on 84,096 CPU cores, which its authors put at 292 times BioDynaMo’s scale.
LLM agents change the cost picture. Repeated LLM calls across many agents and long horizons can become expensive, whether on local GPUs or through cloud APIs. The problem is methodological as well as financial: rule-based agents can support large parameter sweeps on ordinary CPUs, while LLM inference can make comparable replication designs impractical. Archetype-based prompting addresses this by querying representative groups and having individual agents sample from them, so the number of queries scales with archetypes, actions and samples instead of population size.
Making a GPU-backed simulation fast, or putting an LLM behind a bounded ABM without letting inference cost swallow the experiment design, is the kind of engineering TechnoLynx takes on in its generative and agentic AI R&D work.
Where agent-based simulations go wrong and how to check them
The risk is conclusions drawn from convincing surface realism with limited evidence behind it. (Coordination failures in LLM agent systems are covered in how multi-agent systems coordinate and where they break.) On the simulation side, the known failure modes include:
- Execution order artefacts. In discrete-time ABMs, the order in which agents act can produce very different global dynamics. Shuffling the order each step, or updating all agents from the same perceived state, mitigates this.
- Equifinality. Different micro-level rule sets can produce statistically indistinguishable macro patterns. Pattern-oriented modelling counters this by requiring the model to reproduce several observed patterns at different levels at once.
- Weak robustness between models. ABM has been criticised because similar models can give very different results.
- Validation that does not scale. Emergent behaviour depends on population size, so limits on scale can block validation. Calibration is hard because of large parameter spaces, long run times and stochasticity.
- LLM-specific drift. Persona prompts can collapse back towards generic behaviour, identical situations can yield different actions across prompt wording or model versions, and fluent explanations lead evaluators to accept invalid decisions, a failure the 2025 review calls the “Fluency Fallacy”.
Pre-release checklist for an agent-based simulation
- Verification: does the code match the conceptual model?
- Input validation: are the rules and assumptions realistic? Output validation: do calibrated outputs match observations?
- Are results stable across random seeds, and across agent-ordering schemes?
- Does the model reproduce several independent empirical patterns, not just one?
- For LLM agents: do conclusions hold under prompt paraphrasing and across model families?
- For hybrids: does replacing the LLM with a calibrated minimal rule change the aggregate result? If not, the generative layer adds no explanatory value.
We treat production AI reliability as its own engineering discipline, separate from accuracy, with eval harnesses and regression suites as the artefacts that catch failures before users do. For simulations, that means the seed sweeps, ablations and pattern checks above are the deliverable, and a convincing animation is not. If no simpler model is ever compared, you cannot tell whether the agents are explaining anything.
FAQ
What is a model-based agent in AI?
In simulation terms, an agent’s rules can be a simple function of its inputs, or can include internal state such as a model of its world view of part of the environment; a model-based agent is the second kind.