AIO1: Pretrained End-to-End Neural Network for General Advanced Process Control
English | 中文
AIO1 is a single pretrained end-to-end neural network (~128 million active runtime parameters) designed as a general multivariable Advanced Process Control (APC) controller. It controls arbitrary industrial plants through one dimensionless, plant-agnostic interface:
No commissioning step test: runs closed-loop immediately on unseen plants.
No formula, identifier, or MPC solver at runtime: no underlying PID loop, no recursive least squares, and no online optimization solver.
Plant-agnostic interface: receives only normalized public instrument readings (controlled variables, setpoints, bands, limits, priorities, measured disturbances, valve openings, rate limits, optional loop pairing and action directions, and decision interval). It infers plant dynamics, dead time, and operating drift directly from its own closed-loop history.
Code repository: M3rcyzzz/AIOGym2
Live research progress & replays: https://m3rcyzzz.club/aio/
ModelScope mirror: M3rcyzzz/AIO1
Status (2026-11-29)
Research checkpoint (simulation only, single seed, not validated on real industrial plants). This repository always stores the latest active checkpoint; each update replaces the previous release.
Architecture & Training Summary
- Runtime network (~128.6M active parameters, ~131.0M total in file):
- Shared dimensionless encoders map every controlled variable, measured disturbance, and valve into 768-dim tokens so the exact same weights adapt natively to plants of any size (trained jointly across 12×5, 24×10, and 48×20).
- 12 spatio-temporal attention layers (width 768, 12 heads, pre-LayerNorm residuals), each combining: (A) causal temporal attention over the past 128 steps with rotary positional embeddings (RoPE), QK normalization, and KV caching; (B) multi-lag cross-channel attention directly looking back 1, 3, 8, 16, 24, 36, 48, and 64 steps to handle long pure dead times; (C) simultaneous cross-channel interaction attention for multivariable decoupling and constraint trade-offs; and (D) a 3,072-wide SiLU feed-forward network.
- Two persistent feedback memories + in-flight pipe predictor + 1-hop decoupling messages extending context far past 128 steps: a 64-dim multi-timescale per-channel exponential moving average (4–2,048 steps) fed back into Layer 0, and a gain-aware 8-stage causal state-space + symmetric Gated DeltaNet pairwise associative memory updated online in $O(1)$ per step, injecting 8-scale in-flight pipe displacements (a multivariable neural Smith predictor) into Layer 0, biasing all 12 layers' channel & delay attention, and driving direct 1-hop CV/MV decoupling messages.
- Precision-gated direct action head with width-aware scaling ($1/\sqrt{768}$), a 3-decade multiplicative precision gate adapting step size to online physical plant gain, and
tanhrate-limit bounding.
- Training method (pure real control cost, zero imitation):
- Trained from scratch by backpropagating real closed-loop control cost (out-of-band tracking error, zone constraint violations, trips, and reversal-only anti-chatter smoothing) over 64-step windows directly through a differentiable process simulator with sensitivity-scaled exploration noise.
- Long-horizon guidance past 64 steps comes from a training-only 4-head dead-time privileged critic (64–256 future steps), and unpublished cross-coupling & physical gain calibration uses a training-only 75-parameter linear probe; both are completely removed at deployment.
Verified Results (2026-11-29, Simulation)
Unified 0–100 score scale: 0 = all valves frozen, 100 = oracle MPC (which always knows the exact true plant equations and internal state). All controllers run the exact same unseen plants, events, and noise.
Unseen Random Multivariable Plants (Stage 10 final best, Round 510 checkpoint)
| Plant size (CVs × MVs) | Episodes | AIO1 (this checkpoint) | Stage 10 peak | Self-tuning PID | Static-model MPC (upper ref) |
|---|---|---|---|---|---|
| 12×5 standard validation | 256 | 48.7 (levels 42.3 / non-level 52.2; post-event 51.7) | 48.7 EMA / 48.8 raw (non-level 52.5 EMA / 53.2 raw) | 48.6 (42.0 / 52.2) | 91.2 |
| 24×10 chained units | 64 | 59.4 (final round 531: 59.8, levels 62.5) | 60.6 (+7.6 vs. PID; violations 12.5%) | 53.0 | 97.9 |
| 48×20 large chained units | 32 | 65.5 (final round 531: 66.0, violations 10.4%) | 66.3 (+10.1 vs. PID; non-level 82.5) | 56.2 | 98.3 |
- First time beating self-tuning PID across every plant size and sub-population on moving-average weights: on 12×5, AIO1 clears self-tuning PID overall (48.7 vs. 48.6), on integrating levels (42.3 vs. 42.0), and on non-level plants (52.2 vs. 52.2; 52.5 at round 531), with 57% lower episode cost than PID and hidden-pairing (blind) control reaching 20.6 (stage peak 22.8, 5.9× Stage 8).
- Ahead of self-tuning PID on both larger multivariable benchmarks (+6.4 to +7.6 pts on 24×10 and +9.3 to +10.1 pts on 48×20).
Zero-Shot Mechanistic Industrial Plants (never seen during training)
Evaluated across 8 published mechanistic process families using this exact Stage 10 Round 510 checkpoint (8 episodes each = 64 episodes, 0 trips):
- Eight-family average: AIO1 74.2 (+12.0 points ahead of Self-tuning PID 62.2, winning 6 of 8 families; Static-model MPC 90.9).
- Per-family scores: Distillation column A 98.2 (+17.0 ahead of static-model MPC 81.2 and +59.9 ahead of PID 38.3), BSM1 wastewater 94.3 (PID 86.2), Quadruple tank 77.0 (+10.5 ahead of PID 66.5), Tennessee Eastman Process 74.8 (first time beating PID 72.4 zero-shot by +2.4), Building heating 74.7 (+8.2 ahead of PID 66.5), pH neutralization 68.9 (+28.6 ahead of PID 40.3), Debutanizer 55.5 (+11.0 vs. round 80; PID 66.9), Exothermic CSTR 50.1 (PID 60.3).
Files
| File | Description |
|---|---|
model.safetensors |
Standalone inference weights (~128.6M active / 131.0M total parameters, safetensors format) |
config.json |
Minimal loader configuration |
modeling_aio.py, code/ |
Self-contained inference loader (load(), Controller, encode()) and slim runtime modules |
README.md, README_zh.md, LICENSE |
Bilingual model cards and MIT license |
Usage
# pip install torch numpy safetensors huggingface_hub
from huggingface_hub import snapshot_download
import sys
import numpy as np
path = snapshot_download("M3rcyzzz/AIO1")
sys.path.insert(0, path)
import modeling_aio as M
net = M.load(device="cpu") # or device="cuda" / "mps"
ctl = M.Controller(net) # keeps per-plant history & memory; call ctl.reset() for a new plant
# At each control step, pass normalized public signals (numpy arrays):
packet = M.encode(
values=y, previous=y_prev, target=sp, last_target=sp_prev,
scale=cv_scale, lower=cv_low, upper=cv_high, tracking=is_tracked,
command=u, last_command=u_prev, u_low=u_min, u_high=u_max,
slew=du_max, pairing=pairing, dt=dt,
sign=paired_gain_sign, # +1 / -1 per MV, 0 if unknown; optional dv=, weight=
)
move = ctl.step(packet) # per-MV increment in [-1, 1] of slew limit (0 on unused slots)
u = np.clip(u + move[:len(u)] * du_max, u_min, u_max)
- Reverse-acting loops: any valve with
sign = -1is mirrored automatically on input and output byController. - Variable plant sizes:
encode()packs up to 12 CVs × 5 MVs by default (unused slots masked); the network weights themselves are dimension-agnostic and accept larger canonical packets (24×10,48×20) natively.
Limitations
- Simulation-only research checkpoint; never validated on a real industrial plant and not safety-certified.
- Trained on a single random seed and still actively improving on long-dead-time plants, integrating levels, and hidden-pairing control.
License
MIT (Copyright (c) 2026 Mercy Zhang), see LICENSE.