YecoAI

Anti-Loop Layer

Mini-LLM cognitive layer that detects and stops infinite agent loops (~12ms).

Abstract

As LLMs move from chat to agentic loops (Thought → Action → Observation), stochastic failure modes — thank-you loops, semantic collapse — become catastrophic. Anti-Loop Layer is a deterministic exogenous monitor that watches the agent from outside the model and intervenes early.

Design

A second frontier LLM monitoring the first is cost-prohibitive and slow. Anti-Loop Layer is built on Mini-LLMs: highly specialized, quantized models that run on CPU with minimal latency (~12ms typical, ~38.85 MB peak).

Results

  • Loop detection: catches repetitive and semantically collapsed trajectories
  • Reported F1 up to 0.90 / 0.71 / 0.63 across detection regimes
  • CPU-only, no GPU required, drop-in around existing agent loops

Availability

Open source under Apache 2.0: pip install yecoai-cognitive-layer. Technical whitepaper and reference implementation published for research and production use.

Related content