Skip to content

Latest commit

 

History

History
177 lines (107 loc) · 8.32 KB

File metadata and controls

177 lines (107 loc) · 8.32 KB

🧠 The CyberLoop Whitepaper

Artificial Intelligence Control Loop (AICL)

Current Version: v2.1 (2025-12) - Semantic Kinematics & Physiological AI

Author: Jay / Fienna Liang · 2025

Reference Implementation: CyberLoop Framework

Core Philosophy: PHILOSOPHY.md (Immutable principles)

Architecture Spec: Architecture Guide

Previous Versions: v0.3 | v2.0


"Your agent doesn't need a bigger brain. It needs a better body."


1. Abstract

The fundamental flaw in modern AI Agent development is a category error: We are attempting to solve physiological problems with psychological solutions.

When an LLM agent drifts off-topic, hallucinates, or enters an infinite loop, the industry standard response is "Prompt Engineering"—telling the model to "think harder." This is akin to telling a pilot suffering from vertigo to "just focus." It ignores the systemic cause of the failure: the lack of sensory feedback.

CyberLoop asserts that a Transformer-based model is effectively a "Brain in a Vat"—stateless, brilliant, but devoid of proprioception (the sense of self-movement). Without a feedback mechanism to regulate its trajectory, even the smartest model inevitably accumulates error until system collapse.

CyberLoop is the "Body" for that Brain. It introduces a Physiological Control Layer—using Semantic Kinematics, PID Controllers, and Reflexive Guards—to give agents a sense of balance, direction, and homeostasis. This allows them to navigate complex knowledge graphs using pure mathematics, operating autonomously over long horizons without semantic drift.


2. The Problem: The Thermodynamics of Reasoning

In an open-loop system (standard Agent architecture), every step depends on the probability distribution of the previous step. This creates a compounding error effect:

  • Step 1: 99.9% semantic alignment.
  • Step 2: 99.9% alignment (relative to Step 1).
  • Step 100: The agent is now miles away from the original intent, despite every individual step appearing "logical" in isolation.

We call this Semantic Entropy. As the context window grows and the task duration lengthens, the signal-to-noise ratio inevitably degrades. The agent doesn't "fail" abruptly; it slowly, confidently hallucinates its way into irrelevance.

To fix this, we must move from Optimization (getting the best answer once) to Regulation (maintaining a viable state continuously).


3. The Architecture: Mind & Body

CyberLoop replaces the flat "Chain-of-Thought" loop with a hierarchical System 1 / System 2 architecture, inspired by biological systems.

3.1 The Biological Metaphor

We map engineering components to physiological organs:

Biological System Agent Component Function Cost
The Brain (Cortex) Planner (LLM) Strategic planning, reasoning, and creative problem solving. Expensive ($$$)
Vestibular System Kinematics (EKF/PID) Maintains balance and direction. Detects "Semantic Drift" in vector space. Free
Reflexes Guards / Reflexes Immediate, deterministic reactions (e.g., "Line of Sight", "Boredom Penalty"). Free
Endocrine System Ladder (Actuator) Regulates exploration intensity (Adrenaline/Cortisol) based on stress levels. Free

3.2 Inner vs. Outer Loop

Most agents run on a single, expensive loop. CyberLoop runs on two gears:

1. Inner Loop (The Body)

  • Role: Fast, reflexive navigation and exploration.

  • Mechanism: Pure TypeScript logic + Vector Math. Zero LLM calls.

  • Components:

  • Probes: "Is the result set empty?" (Sensors)

  • Policy: "Calculate Cosine Similarity and pick top 3." (Reflexive Decision)

  • Guards: "Block this link if we've seen it 3 times." (State Hygiene)

  • Frequency: 10-50 steps per task.

2. Outer Loop (The Mind)

  • Role: Strategic planning and final synthesis.

  • Mechanism: LLM (GPT-4o / Claude 3.5).

  • Components:

  • Planner: Parses user intent into a start/end state.

  • Evaluator: Summarizes the journey and decides if the goal is met.

  • Frequency: Only when the Inner Loop budget is exhausted or stable state is found.


4. Technical Deep Dive: Semantic Kinematics (v2.1)

In v2.1, we treat the agent's thought process not as a text generation task, but as a physical object moving through high-dimensional embedding space.

4.1 The Sensor: Extended Kalman Filter (EKF)

An LLM's output is noisy. A single "creative" token can spike the embedding vector. We use a simplified EKF to separate Signal (Intent) from Noise (Jitter).

  • Result: A smooth flight path, ignoring momentary turbulence.

4.2 The Guardrail: Heading Hold

Instead of a fixed radius (Anchoring), we project a Cone. We calculate the Angular Deviation () between the current heading and the goal trajectory.

  • If the agent moves forward (even miles away), . Allowed.
  • If the agent suddenly pivots to an unrelated topic without a connecting logic, spikes. Correction Triggered.

4.3 The Actuator: Backtracking & Blacklisting

When drift is detected, the PID Controller doesn't just "warn" the agent. It exerts a Correction Force:

  1. Stop: The current action is rejected.
  2. Backtrack: The state is rolled back to the previous stable point.
  3. Blacklist: The drifting path is blocked to prevent re-entry.

5. Performance & Validation

We validated CyberLoop v2.1 with Project Ariadne: an agent tasked with navigating from "Coffee" to "French Revolution" on Wikipedia using only embeddings (no LLM reasoning in the inner loop).

Benchmark Results

Metric Pure LLM Agent (Typical) CyberLoop v2.1 (Actual) Impact
Decision Mechanism Reasoning (LLM) Sensing (Vector + Reflex) Physiological
Latency per Step ~3,000ms ~50ms 60x Faster
Cost per Step ~$0.01 ~$0.0001 99% Cheaper
Behavior Stochastic Controlled Reproducible

The "Hero Run" Trajectory

graph LR
    Coffee --> American_Revolution
    American_Revolution --> Portuguese_Revolution_1910
    Portuguese_Revolution_1910 -.->|Line of Sight Reflex| French_Revolution
    style French_Revolution fill:#bbf,stroke:#333,stroke-width:4px

Loading

The agent successfully associated Coffee -> American Revolution -> 1910 Revolution, and then used a Line-of-Sight Reflex to instantly capture the French Revolution link, bypassing expensive calculations.

🔗 Full Benchmark: docs/benchmarks/wikipedia/benchmark-wikipedia-navigation.md


5.1 Developer API: The Assistive SDK (v2.2)

In v2.2, the reference implementation introduces cyberloop() — a lightweight wrapper that applies the control loop principles described above to any agent, without requiring users to build inside the Orchestrator.

import { cyberloop } from 'cyberloop'
import { kinematicsMiddleware } from 'cyberloop/advanced'

const controlled = cyberloop(myAgent, {
  budget: { maxSteps: 50 },
  middleware: [kinematicsMiddleware({ embedder, goalEmbedding, ... })],
})
const result = await controlled.run('Coffee -> French Revolution')

The Orchestrator remains available for full inner/outer loop control. See EVOLUTION.md for the rationale behind this evolution.


6. Vision: From Prompting to Systems Engineering

We believe the era of "Prompt Engineering" is ending. We are entering the era of Semantic Systems Engineering.

Future AI systems will not be judged solely on their IQ (Benchmark Accuracy), but on their AQ (Agency Quotient)—their ability to maintain homeostasis, manage their own resources, and survive long enough to solve problems that humans cannot.

CyberLoop is the open-source foundation for this future. It is not just a tool; it is a standard for Controlled Intelligence.


End of AICL Whitepaper v2.1 © 2025 Fienna Liang. Licensed under Apache-2.0.