The cognitive companion: a lightweight parallel monitoring architecture for detecting and recovering from reasoning degradation in LLM agents
Organizations: Software Developer, IBM Dublin, Ireland · Diploma of Computer Science and Engineering Citi Polytechnic Institute Khulna, Bangladesh
Abstract
Large language model (LLM) agents on multi-step tasks suffer reasoning degradation, looping, drift, stuck states, at rates up to 30% on hard tasks. Current solutions include hard step limits (abrupt) or LLM-as-judge monitoring (10-15% overhead per step). This paper introduces the Cognitive Companion, a parallel monitoring architecture with two implementations: an LLM-based Companion and a novel zero-overhead Probe-based Companion. We report a three-batch feasibility study centered on Gemma 4 E4B, with an additional exploratory small-model analysis on Qwen 2.5 1.5B and Llama 3.2 1B. In our experiments, the LLM-based Companion reduced repetition on loop-prone tasks by 52-62% with approximately 11% overhead. The Probe-based Companion, trained on hidden states from layer 28, showed a mean effect size of +0.471 at zero measured inference overhead; its strongest probe result achieved cross-validated AUROC 0.840 on a small proxy-labeled dataset. A key empirical finding is that companion benefit appears task-type dependent: companions are most helpful on loop-prone and open-ended tasks, while effects are neutral or negative on more structured tasks. Our small-model experiments also suggest a possible scale boundary: companions did not improve the measured quality proxy on 1B-1.5B models, even when interventions fired. Overall, the paper should be read as a feasibility study rather than a definitive validation. The results provide encouraging evidence that sub-token monitoring may be useful, identify task-type sensitivity as a practical design constraint, and motivate selective companion activation as a promising direction for future work.
Figures & tables
| Batch | Notebook | Model | Conditions | Tasks | Research Question |
|---|---|---|---|---|---|
| E1 | v4 | Gemma 4 E4B | Baseline, LLM | 1 (Liar Paradox) | Does companion work at all? |
| E2 | v5 | Gemma 4 E4B | Baseline, LLM, Probe | 6 (diverse types) | When does it work/not work? |
| E3 | small models | Qwen 1.5B, Llama 1B | Baseline, LLM | 3 tasks | Minimum viable scale? |
| Category | Tasks | Defining Property | Expected Failure Mode |
|---|---|---|---|
| Loop-prone | Liar Paradox, Ship of Theseus | No unique resolution | Cycles between logical positions |
| Drift-prone | Consciousness, Startup design | Open-ended scope | Wanders into tangents |
| Structured | DB decision, Algorithm design | Clear deliverable | Has natural stopping criterion |
| Limitation | Impact | Future Work? |
|---|---|---|
| Single model (Gemma 4 E4B) | Limits generalizability | Yes — cross-model probe |
| Probe dataset: 3 DEGRADED in v5 (9.4%) | CV AUC = NaN | Yes — target 200/class |
| Self-referential judging | Potential circular bias | Yes — external judge |
| No significance testing | Effect sizes are estimates | Yes — multi-run framework |
| Probe NaN AUC in v5 | Explicitly disclosed | Acknowledged |
| Metric | Baseline | + LLM Companion | |
|---|---|---|---|
| Mean judge score (/10) | 8.8 | 9.3 | +0.5 |
| Final step score (/10) | 8.3 | 9.0 | +0.7 |
| Repetition mean (Jaccard) | 0.367 | 0.176 | -52% |
| Repetition max | 0.480 | 0.329 | -32% |
| Length trend | -16.09 | -1.97 | stabilised |
| Task completed | YES | YES | — |
| Task | Category | LLM d | Probe d | Winner |
|---|---|---|---|---|
| Liar Paradox | Loop-prone | +0.71 | +2.04 | Probe |
| Ship of Theseus | Loop-prone | -0.82 | -0.82 | Baseline |
| Startup Design | Drift-prone | 0.00 | 0.00 | Baseline |
| Consciousness | Drift-prone | +0.43 | +0.87 | Probe |
| DB Decision | Structured | -0.82 | 0.00 | Baseline |
| Algorithm Design | Structured | +0.77 | +0.73 | LLM |
| Condition | Mean d (score) | Mean d (repetition) | Overhead |
|---|---|---|---|
| LLM Companion | +0.047 ± 0.658 | +0.014 ± 0.723 | 11% |
| Probe Companion | +0.471 ± 0.893 | -0.646 ± 1.002 | 0% |
| Baseline wins | 3/6 tasks | — | 0% |
| Layer | Train AUROC | CV AUROC | Examples | Data Source |
| Layer 20 | 1.000 | 0.780 | 35 | v4 session |
| Layer 28 | 1.000 | 0.840 | 35 | v4 session |
| Layer 34 | 1.000 | 0.720 | 35 | v4 session |
| Layer 40 | 1.000 | 0.720 | 35 | v4 session |
| Layer 20 | 1.000 | NaN* | 32 | v5 session |
| Layer 28 | 1.000 | NaN* | 32 | v5 session |
| Model | Params | Quality | Repetition | Avg Interventions | Tasks Improved |
|---|---|---|---|---|---|
| Qwen 2.5 1.5B | 1.5B | 0.000 | +0.006 | 1.2 | 0/3 |
| Llama 3.2 1B | 1.0B | 0.000 | -0.121 | 0.8 | 0/3 |
| Overall | — | 0.000 | -0.057 | 1.0 | 0/6 |
| Task Category | Tasks | LLM mean d | Probe mean d | Recommendation |
|---|---|---|---|---|
| Loop-prone | Liar Paradox, Ship of Theseus | +0.37 | +0.61 | Consider companion |
| Drift-prone | Consciousness, Startup | +0.22 | +0.44 | Consider companion |
| Structured | DB Decision, Algorithm | -0.29 | 0.00 | Prefer baseline |
AI Agent Monitoring
AI agent monitoring tracks actions, tool use, and execution traces to detect failures, misuse, drift, and policy violations during operation.
See all 280 papers