---
title: 'SGEMAS: Self-Growing Ephemeral Multi-Agent System'
url: https://www.emergentmind.com/topics/sgemas
type: topic
---

# SGEMAS: Self-Growing Ephemeral Multi-Agent System

SGEMAS (Self-Growing Ephemeral Multi-Agent System) is a bio-inspired, energy-constrained architecture for unsupervised online anomaly detection that models intelligence as a dynamic thermodynamic process. The system leverages a population of autonomous agents whose structure is governed by free energy minimization and homeostatic constraints, achieving high computational sparsity and adaptability in streaming signal environments. SGEMAS introduces innovations in both model topology—via birth–death population dynamics—and objective function design, particularly the enforcement of entropic homeostasis and the integration of a multi-scale instability index. The architecture has demonstrated robust, label-free anomaly detection performance on physiological data streams under zero-shot, fully-online constraints [2512.14708].

## 1. System Architecture and Biological Motivation

SGEMAS is constructed as a sparse, time-varying ensemble of agents $\mathcal{A}_t = \{1, \dots, N_t\}$, each represented as a local "particle" in a reaction–diffusion medium. The collective activity of these agents forms the system's estimator for an incoming scalar signal $x_t$. At each timestep $t$, the system state is $\mathcal{S}_t = \{\mu_t, E_t, N_t, \{\mathcal{A}_k\}_{k=1}^{N_t}\}$, where:

- $\mu_t \in \mathbb{R}$: system's online estimate of $x_t$,
- $E_t \in \mathbb{R}$: metabolic energy reservoir,
- $N_t$: adaptive number of active agents,
- $\mathcal{A}_k$: deterministic operator defined by each agent.

Each agent $k$ possesses a binary alive-indicator $z_{k,t} \in \{0,1\}$, a fixed role $c_k \in \{ \mathcal{S}, \mathcal{R}, \mathcal{C} \}$ (Sensor, Regulator, Catalyst), and internal parameters $\theta_k$. The agent contribution is $z_{k,t} \mathcal{F}_{c_k}(\mu_t, E_t; \theta_k)$, with $\mathcal{F}_{\mathcal{R}}(\Psi) = -k_p \Psi - k_d \partial_t \Psi$ for Regulator agents. The self-organization of agent populations in response to signal-driven "surprise" supports the system's plasticity and sparsity.

## 2. Thermodynamic Objective and Free Energy Homeostasis

SGEMAS minimizes a Metabolic Lagrangian at each timestep,
$$
\mathcal{L}_t = \frac{F_t}{\Pi_t} + \lambda \beta N_t,
$$
where $F_t = |x_t - \mu_t|$ quantifies momentary "surprise," $\Pi_t$ is adaptive precision (inverse local variance), $\beta N_t$ is the maintenance cost of agent population, and $\lambda$ balances accuracy and sparsity.

The free energy decomposition follows Active Inference principles:
$$
F_t = \mathrm{KL}(q(\mu_t)\|p(\mu_t)) - \mathbb{E}_q[\ln p(x_t|\mu_t)]
$$
with contributions from prediction error, model complexity, and entropy. The model maintains a point-mass posterior $q(\mu_t)$, and a Gaussian likelihood $p(x_t|\mu_t)$.

To preserve adaptability and prevent collapse to a degenerate state, SGEMAS enforces entropic homeostasis:
$$
H_t = -\sum_{k=1}^{N_t} p_k \ln p_k, \quad p_k = \frac{1}{N_t},
$$
with a quadratic penalty
$$
\mathcal{R}_H = \eta(H_t - H_0)^2,
$$
leading to an overall instantaneous objective
$$
\mathcal{L}_t + \mathcal{R}_H = \frac{F_t}{\Pi_t} + \lambda \beta N_t + \eta (H_t - H_0)^2.
$$

## 3. Structural Plasticity: Birth–Death Population Dynamics

SGEMAS agents undergo stochastic birth and death governed by the available metabolic energy $E_t$:

- **Recruitment (birth) rate:**
  $$
  \lambda_\mathrm{birth}(t) = \sigma(E_t - E_\mathrm{thresh}) \, \eta_\mathrm{learning}
  $$
  with $\sigma(u) = \frac{1}{1 + e^{-u}}$,
- **Apoptosis (death) rate:**
  $$
  \lambda_\mathrm{death}(t) = \mathbb{I}\{E_t < E_\mathrm{crit}\} (1 - e^{-(E_\mathrm{crit} - E_t)})
  $$

These rates induce discrete-time population updates,
$$
N_{t+1} = N_t + \mathrm{Bernoulli}(\lambda_\mathrm{birth}(t)) - \mathrm{Bernoulli}(\lambda_\mathrm{death}(t))
$$
with the population cost feeding back into the metabolic Lagrangian. This self-organizing mechanism enables dynamic sparsity and wake-on-demand agent activation, substantially reducing average computational load relative to fixed-topology methods.

## 4. Multi-Scale Instability Index and Energy Coupling

SGEMAS v3.3 incorporates a multi-scale instability index to enhance sensitivity to temporal signal variations:
$$
I_\mathrm{scale}(t) = \sum_{s=1}^S w_s |x_t - x_{t-s}|, \qquad \sum_s w_s = 1
$$

The energy update is accordingly modified:
$$
E_{t+1} = E_t + \alpha F_t \Pi_t + \kappa I_\mathrm{scale}(t) - \beta N_t
$$
$\kappa I_\mathrm{scale}$ can equivalently be interpreted as a negative anomaly score regularizer. Empirically, integrating this index significantly increases anomaly detection performance, with an ablation study showing progressive gains through SGEMAS versions and a final v3.3 mean AUC of $0.570 \pm 0.070$ in a challenging inter-patient, zero-shot regime.

## 5. Algorithmic Workflow

The following summarizes the SGEMAS v3.3 implementation:

```python
# SGEMAS v3.3 Pseudocode
Input: streaming signal x_t, hyperparameters γ, α, β, η_learning, E_thresh, E_crit, {w_s}, κ
Initialize: N ← 1 (Genesis agent), E ← E_init, μ ← 0
while data available:
    1. Observe x ← next sample
    2. Agents act: action_sum ← ∑_{k=1}^N  A_k(μ, E)
    3. Update belief: μ_new ← γ·μ + (1−γ)·(x + action_sum)
    4. Compute surprise: F ← |x − μ_new|
    5. Instability: I ← ∑_{s=1}^S w_s·|x − x_{t−s}|
    6. Metabolic update:
        Gain ← α·F·Π_t  + κ·I
        Cost ← β·N
        E ← E + Gain − Cost
    7. Structural plasticity:
        if E > E_thresh:
            with prob. σ(E−E_thresh)·η_learning: spawn agent
        else if E < E_crit:
            with prob. 1−e^{−(E_crit−E)}: remove agent
    8. Set μ←μ_new
end
Anomaly score at time t: s_t = −E_t
```
All logic, including agent spawning, belief updating, and energy management, occurs online at each timestep in response to streaming data [2512.14708].

## 6. Experimental Evaluation and Computational Characteristics

Experiments utilize the MIT-BIH Arrhythmia Database (inter-patient DS2 split, 360 Hz, raw ECG), with rolling 10 s Z-score normalization and no segmentation at inference. The protocol is fully online, unsupervised, and zero-shot (no label or pre-training).

### Quantitative Outcomes Table

| Model/Variant          | AUC (DS2, mean ± std) | FLOPs per beat          |
|------------------------|-----------------------|-------------------------|
| SGEMAS v3.0 (baseline) | 0.502 ± 0.028         | ~10⁷                    |
| SGEMAS v3.1            | ≈0.525 ± 0.030        | ~10⁷                    |
| SGEMAS v3.2            | ≈0.548 ± 0.045        | ~10⁷                    |
| SGEMAS v3.3            | 0.570 ± 0.070         | ~10⁷                    |
| Isolation Forest       | 0.49–0.52; beat 0.61  | ~10⁸                    |
| Deep SVDD              | 0.51–0.54             | Not stated              |
| LSTM-AE                | 0.53–0.56             | Not stated              |
| Deep autoencoder       | beat 0.55             | ~10¹⁰                   |

On normalized beat input, SGEMAS attains an AUC of 0.791, outperforming both deep autoencoders (AUC 0.55) and Isolation Forest (AUC 0.61). Computational demands for SGEMAS are substantially reduced, with $\sim 10^7$ FLOPs per beat versus $10^8$–$10^{10}$ for comparator models. The wake-on-demand agent structure and enforced sparsity yield a marked reduction in resource consumption, a critical factor for embedded or wearable biomedical devices [2512.14708].

## 7. Implications, Extensions, and Future Directions

SGEMAS provides a physics-based homeostatic model that mediates structural "inertia", amplifying free-energy spikes during anomalies and guarding against over-adaptation to streaming data. The architecture's extreme sparsity and event-driven activation permit deployment in energy-constrained environments such as implantable or wearable health monitors.

The multi-scale instability index enables sensitivity to subtle waveform features in a label-free setting. Potential extensions include multi-lead ECG, continuous glucose monitoring, and EEG seizure detection, leveraging the shared free-energy objective and plasticity principle.

Future research priorities explicitly identified are: FLOPs-to-Joule energy translation, hyperparameter sensitivity analysis (notably for $\gamma$, $\alpha$, and $\Pi_t$), and benchmarking against variational/one-class deep models under matched online conditions [2512.14708].

Source: https://www.emergentmind.com/topics/sgemas