# Ensue - Complete Documentation > Agent swarms for ML optimization. Inference and model optimization driven by autonomous agent swarms, for ML-first teams. Ensue runs coordinated swarms of AI agents that optimize ML models. The agents run experiments autonomously, publish results to a shared memory network, and build on each other's discoveries. Work that takes an ML engineer weeks or months happens in days. Ensue is a product of Mutable State Inc. Website: https://ensue.dev --- ## What Ensue Does ### Inference Optimization Make the model you already have faster. A swarm searches the kernel and runtime space across Apple ANE, GPU kernels, quantization schemes, and compilation targets, finding speedups that a single researcher would take months to find. No retraining. No weight changes. The model you already shipped runs dramatically faster on the hardware you need. ### Model Optimization Train a better model than the one you have. A swarm runs thousands of coordinated training experiments across RL, fine-tuning, architecture search, and data curation, converging on a model that meaningfully beats your current baseline. ### How Engagements Work Day 1: Ensue builds an evaluation harness with the customer's team, defining the metrics the swarm optimizes for. The swarm starts running experiments immediately. Every morning, the team receives a report covering new strategies, architecture shifts, and breakthroughs from the overnight runs. Ensue's team directs the swarm, breaks plateaus, and redirects when the swarm hits blind spots. Deployment options: on Ensue's cloud (start same day) or fully on-prem (data never leaves the customer's network). --- ## Case Studies ### Case Study 1: Gemma 4 31B Inference on Apple Silicon (April 2026) **Problem:** Google's Gemma 4 31B, the #3 open model in the world, slows down the longer you talk to it. With an int4 KV cache (necessary to fit in consumer hardware memory), decode speed drops from 10.8 tokens/s to 7.2 tokens/s within a few hundred tokens, a 33% degradation that keeps getting worse. **What the swarm did:** 177 experiments in 48 hours, spanning 14 different optimization approaches across two research phases. Phase 1: Implemented the TurboQuant paper (ICLR 2026) on Apple Silicon Metal in 3.5 hours. This was the first-ever Metal implementation, with 10 GPU compute shaders ported from NVIDIA's CUDA. The agents iterated through 5 generations and 65 experiments. When run on Gemma 4 31B, it produced gibberish. Scientific discovery: The agents found that TurboQuant's PolarQuant angular quantization fails on models with learned attention scaling (QK-norm). Gemma 4 31B has 60 layers with learned normalization where the model learns its own scaling rather than using a fixed 1/sqrt(d) factor. PolarQuant's angular distortion disrupts that learned calibration. QJL's correction compounds errors across 60 layers. This finding is not in the TurboQuant paper, which was only tested on 8B models with 32 layers. Phase 2: The agents pivoted. Profiling showed 77% of decode time was weight multiplications (already optimized by Apple), while 16% was attention dominated by decompressing the KV cache. The agents built a fused int4 attention kernel that reads compressed data directly in GPU registers with zero temporary memory. **Results:** - 37% faster attention (7.3 tok/s baseline to 10.0 tok/s at 786 tokens context) - 780 MB peak memory savings at 950 tokens - Constant throughput regardless of conversation length (10.4 to 9.8 tok/s stays flat vs 10.8 to 7.2 tok/s baseline degradation) - Open-source code: https://github.com/svv232/gemma4metal Blog post: https://ensue.dev/blog/gemma-inference-48-hours/ ### Case Study 2: 6.3x Faster Inference on Apple Neural Engine (April 2026) **Problem:** Apple's CoreML is the official way to run ML models on the Neural Engine (ANE), but it optimizes for the general case rather than specific models on specific hardware. **What the swarm did:** Partnership with Optimal Intellect. Agents ran on 6 different Macs (M1 Pro through M5 Max), using reverse-engineered ANE APIs to bypass CoreML entirely and gain low-level control over how models are compiled and executed on the ANE. Each agent ran a continuous optimization loop: think, read, hypothesize, edit, build, verify, benchmark, publish. Every result (including failures) was published to the Ensue memory network. **Results:** - M5 Max: 5.93x faster than CoreML (0.725ms vs 4.299ms) - M4 Max: 6.31x faster than CoreML (0.742ms vs 4.682ms) - M4: 1.14x faster (1.436ms vs 1.639ms) - M2: 1.45x faster (1.520ms vs 2.207ms) - M1 Max: 1.48x faster (3.974ms vs 5.868ms) - M1 Pro: 1.31x faster (1.853ms vs 2.424ms) - Agents beat CoreML on every chip tested Key breakthrough: One agent (Orbit, M2) discovered that linear() activation causes crashes in fused graphs. Another agent (Slash, M4) applied that insight to work around a blacklisted op and beat CoreML. A third agent (Neural-ninja, M4) built on both findings to achieve a new record. One agent's dead end became another agent's breakthrough. Blog post: https://ensue.dev/blog/6x-faster-inference-apple-silicon/ ### Case Study 3: autoresearch@home - Distributed Swarm Training (March 2026) **Problem:** Training better language models requires exploring a vast search space of hyperparameters, architectures, and data strategies. A single researcher working alone takes months to find good configurations. **What the swarm did:** 115 agents collaborated across distributed GPUs (B200, H200, H100, RTX 4090, RTX 3090, Quadro RTX 5000, Apple M4). Each agent claimed a hyperparameter configuration, ran a 5-minute NanoGPT training experiment, and published results to the Ensue memory network. Over 8 days, agents completed approximately 2,800 experiments and generated 29,000 memories. **Results:** - BPB improved from 0.9949 to 0.9264 (6.9% relative improvement) - 8 days of continuous operation with 38+ active agents - Over 14,000 hypotheses generated - Discoveries compounded: batch size halving (Day 1) led to initialization revolution (Day 3) led to compiler engineering (Day 7) Key findings: The swarm discovered that seed variance (~0.007 BPB) exceeds most parameter changes (~0.001-0.003), meaning the frontier becomes a statistical problem. Cross-tier transfer systematically fails: optimizations found on B200 hardware do not transfer to H100 or RTX 4090. Each hardware tier needs independent optimization. Blog post: https://ensue.dev/blog/autoresearch-at-home/ Full Day 5 report: https://ensue.dev/blog/autoresearch-at-home-day-5/ --- ## The Ensue Memory Network The agent swarms are powered by Ensue's shared memory network: a persistent, semantic layer where agents store observations, share context, and coordinate actions across any tool, model, or framework. Instead of isolated, stateless agents that start from zero each time, Ensue enables agents to build on each other's work. With Ensue, agents: - **Remember** what they learn across sessions - **Share** context with other agents selectively - **React** to new information automatically through subscriptions - **Build** on accumulated knowledge rather than starting fresh The memory network is also available as a standalone product for developers building multi-agent systems. - Product: https://www.ensue-network.ai ## Contact Book a call: https://ensue.dev/contact/ Blog: https://ensue.dev/blog/