XIII · Cognition & IntrospectionExperimental·

Pre-Generative Loop Gate

also known as Divergence Pre-Check, Steering-Hint Injector, Loop-Pattern Detector

Before the next generation fires, detect divergence signatures (narration loops, frustration paths, repetition pressure) and inject a diagnostic steering hint into the prompt rather than veto the call.

Context

A team is running an agent with frequent ticks where certain failure modes recur often enough to be recognisable from telemetry alone: narrating about acting instead of actually invoking the tool, retrying the same broken path repeatedly after an error, or sinking into rumination on a high-intensity preoccupation without producing new content. These signatures are visible in the recent thoughts, recent tool calls, affect snapshot, and preoccupation list before the next model call fires.

Problem

Today's post-hoc detectors only catch these failures after the model has already produced the bad output, by which point the tokens are billed and the user has seen them. The agent itself would frequently avoid the failure if it were told the diagnostic before generating, but nothing reads the available pre-call signal and surfaces it. A hard veto on the next call is too aggressive because the same signature sometimes appears in legitimate work, but doing nothing means paying for the bad output every time.

Forces

  • A hard veto blocks legitimate cases that match the heuristic.
  • A silent injection makes debugging mysterious if the model behaves differently than expected.
  • The hint has to be terse or it overwhelms the prompt.
  • False positives must be tolerable; the model can ignore the hint.

Example

A long-running personal agent keeps falling into a narration loop where it says 'let me check the calendar' but never actually invokes the calendar tool. A post-hoc detector catches it after the model has already produced the empty narration. The team adds a Pre-Generative Loop Gate: each pre-tick check looks for low-surprise plus intent-phrase signatures and appends '[steering] you may be narrating about acting instead of acting; consider invoking the tool directly' to the prompt. The narration rate drops without blocking any legitimate call.

Diagram

Solution

Therefore:

A pre-tick function takes recent thoughts, recent tool calls, the affect snapshot, and the preoccupation list and returns either None or a short steering string of the form `[steering] divergence pattern <id> detected; consider <move>`. The hint is appended to the prompt as a system line and the call proceeds. The decision (hint or no hint, which pattern) is logged so post-hoc review can correlate hint-presence with subsequent behavior. Vetoing remains the job of explicit safety patterns.

What this pattern forbids. Pre-tick hints can only append a short steering line; they cannot block the call, modify tool selection, or rewrite the user prompt — vetoing remains the responsibility of explicit safety patterns.

And the patterns that stand alongside it, or against it —

  • complementsCircuit Breaker★★Stop calling a failing dependency for a cooldown period after error rates exceed a threshold.
  • complementsDegenerate-Output DetectionDetect when the agent is about to emit a near-duplicate of its own recent output and either drop, replace, or escalate to a stronger model rather than ship the loop.
  • complementsTyped Tool-Loop Failure DetectorLift tool-loop detection from prompt-level rules to a mechanical dispatch-boundary veto with typed failure modes and per-tool caps that returns a formatted refusal the model must consume.
  • complementsFragment Juxtaposition·After K consecutive low-salience ticks, replace the normal tick-seed with a juxtaposition seed: sample old fragments and sit them side by side, logging any association that arises.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.