arXiv(opens in a new tab)cs.CLOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.09772

Decoupling Logic from Persona: Structural Immunity of Edge LLM Agents to Context Pollution

Masaaki Nakatsu, Reno Wang

Abstract

Small language-model agents that run on edge devices are expected to hold a persona and to reason correctly at the same time, inside one context window that fills with conversational history and persona instructions. We study what happens to the logical part of such an agent when that history is long, misleading and persona-heavy, a failure mode we call persona-logic interference, and we present a Decoupling Architecture (AO-DA) that separates logical inference ("What") from persona expression ("How") into two inference paths on one INT4-quantized base model with hot-swappable LoRA adapters. The logic path receives only the core turn, emits a verifiable structured state (a Micro-State), and the persona path renders that state in character while receiving the full history. In same-base-model ablations on consumer edge hardware (Apple M2, 24 GB; Llama-3.1-8B-Instruct and Gemma-3-4B-it, both 4-bit; 480 runs over 4 pollution levels × 3 arms × 2 tasks × 2 personas × 5 seeds) we find three things. (i) The decoupled logic path is structurally invariant to pollution: its prompt stays at 180 tokens (Llama) or 167 tokens (Gemma) while the mixed single-pass prompt grows from 242 to 1,203 tokens, and its outputs are byte-identical across all pollution levels (40/40 pairs). (ii) The mixed single-pass configuration degrades monotonically (composite logic score 0.669 → 0.150 on Llama, 0.487 → 0.150 on Gemma; Spearman ρ=−0.74\rho = -0.74 and -0.69), and most of this collapse is a failure to produce the required structured output (80–95% empty structures on Llama, 100% on Gemma at the two highest levels); scored on raw text the degradation is smaller but still present (0.78 → 0.38 on Llama). (iii) When the same pollution is deliberately fed into the decoupled logic path, the dedicated-adapter, dedicated-format path is still more robust than the single pass on the 8B model (structured-output failure 0–20% vs 80–95%; paired Δ\Delta in composite score +0.30 to +0.50, Cliff's δ\delta 0.50–0.85, Holm-adjusted p≤0.03p \leq 0.03), but not on the 4B model, where both collapse. Separation costs one extra decode on the first turn of a topic (28.2 s vs 18.2 s on Llama) and buys persona hot-swapping in 1.7 ms (median, warm) without re-running the logic path, with memory fixed at a single resident base ( ≈\approx4.3 GB active, ≈\approx5 GB peak for the 8B model). We release the experiment code, scoring rubric, pollution fixtures, adapters and all run logs; the proprietary orchestration internals are described only at the level of their effects.

1 Introduction

An edge agent that speaks as a character and advises on a task carries two jobs in one context window. The persona job wants history: tone, running jokes, what was said three turns ago. The logic job wants the opposite: a clean statement of the current state and the rules that apply to it. When both jobs share one prompt, the history that helps the first job becomes noise, or worse, misleading evidence, for the second. Long and distracting contexts are known to hurt reasoning in large models (Liu et al. 2024; Shi et al. 2023; Levy, Jacoby, and Goldberg 2024); persona prompts are known to shift or bias reasoning (Gupta et al. 2024; Zheng et al. 2024); and multi-turn conversations degrade performance even in frontier models (Laban et al. 2025). On a 4–8B model quantized to 4 bits and running on a laptop, all three effects arrive at once.

We call the resulting degradation persona-logic interference: the loss of task-logic quality that occurs when persona expression and logical inference compete inside one accumulating context. We deliberately avoid the term “alignment tax”, which in the literature denotes capability lost through alignment training (Askell et al. 2021; Ouyang et al. 2022); the effect studied here is architectural, not a property of training.

Our proposal is to stop sharing the context. The Decoupling Architecture (AO-DA) runs two inference paths on the same quantized base model: a What path that carries a task-logic adapter, receives only the core turn and the observable signals (vitals, profile, intent), and emits a compact, schema-checked Micro-State; and a How path that carries a persona adapter, receives the Micro-State together with the full conversation history, and renders the reply in character. The two paths never share a context window. Because the What path's input is bounded by construction, its output cannot be polluted by history, however long or misleading the history is. This paper reports what that buys, what it costs, and what remains open.

Contributions. In same-base-model ablations on an M2 MacBook Pro we show:

  1. Structural invariance of the logic path. The What prompt stays at 180 tokens (Llama-3.1-8B) or 167 tokens (Gemma-3-4B) across all pollution levels, while the mixed single-pass prompt grows from 242 to 1,203 tokens; the What outputs are byte-identical across levels for every (task, persona, seed) triple (40/40). This is a design consequence, not a statistical finding, and we treat it as such (no test is applied to it).

  2. Characterization of the single-pass collapse. Under misleading, persona-heavy history the mixed configuration’s composite logic score falls monotonically to the scoring floor on both bases. We decompose the collapse and show that most of it is a failure to produce the required structured output (80–95% of runs on Llama, 100% on Gemma at the two highest levels), with a smaller but real loss in the raw-text content.

  3. Empirical robustness of the two-stage logic path under the same pollution. When the history is deliberately routed into the What path (an ablation that the architecture forbids), the dedicated-adapter, dedicated-format path still fails far less often than the single pass on the 8B model (0–20% vs 80–95%) and scores higher on every polluted level (paired Δ+0.30\Delta +0.30 to +0.50 in composite score). On the 4B model it collapses like the single pass. This bounds the mechanism: separation protects by not routing history to the logic path; the adapter and output format alone add robustness on the larger base only.

We also report, as single-run system measurements, persona hot-swapping on a single resident base (1.7 ms median, warm), Micro-State cache reuse that avoids re-running the logic path on a persona switch, a deterministic router that matches an LLM classifier at six orders of magnitude lower latency, and the first-turn latency cost of a second decode. All experiment code, rubrics, pollution fixtures, adapters and logs are released (Appendix G).

References (26)