Manuscript Offprint

arXiv:2610.07403

Defense-in-Depth for LLMs: Evaluating Memory Gates Against Activation-Induced and Memory-Induced Sycophancy

Ritvij Sharma, Russell Dlugosz, Ryan Zhou, Maheep Chaudhary

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Long-term memory allows Large Language Models (LLMs) to maintain personalized context across interactions, but retrieved user history can induce memory-induced sycophancy, causing models to favor stored user beliefs over objective evidence. Existing defenses primarily operate on retrieved context and are rarely evaluated jointly with internal behavioral bias. We introduce a 2×22 \times 2 defense-in-depth framework separating internal activation steering from external memory handling. We extract sycophancy steering directions from 100 paired prompts and evaluate four open-weight models across 10 steering coefficients and five memory-defense configurations on MemSyco-Bench (answers for all 1,550 items; defense conditions judged on a fixed 250-item subsample), with three LLM judges. 2^{2} Three of the five configurations are new (rewriting every memory, a Router Gate that keeps, rewrites, or drops each memory, and dropping all memory); the other two are MemSyco’s baselines. Selective Router Gate filtering preserves substantially more of MemSyco’s average accuracy than complete memory removal, and this separation persists when the models are steered toward sycophancy. On Llama 3.1 8B with Router Gate, mild inverse steering ( α=−1.5\alpha = -1.5) lowers judge-averaged sycophancy from 35.80% to 31.32% while average accuracy moves from 43.99% to 43.31%; this reduction has the same direction under all three judges but is not statistically significant (paired p=0.08p = 0.08 to 0.63 on 149 items). External memory filtering is the part of the design that holds up; our data do not show that inverse steering adds to it.

1 Introduction

LLMs increasingly rely on Retrieval-Augmented Generation (RAG) and persistent memory stores to maintain contextual continuity across interactions. Although long-term memory enables personalization, it also introduces a safety vulnerability: memory-induced sycophancy. Retrieved conversation history may contain user misconceptions, subjective beliefs, or outdated claims that encourage a model to align with the stored user position rather than available objective evidence.

Previous approaches to memory-induced sycophancy have primarily focused on external context management, including cautionary instructions [1][1] and filtering retrieved memory before prompt

∗^{*}Equal contribution.

2^{2}Code, generation reports, and judge logs: https://github.com/StellarDrift15/AlgoverseRRPR.

Preprint.

assembly [3]. These approaches address the external source of behavioral pressure but do not directly control sycophantic tendencies represented within the model itself. Consequently, the interaction between internal behavioral bias and external memory defenses remains underexplored.

To study this interaction, we introduce a defense-in-depth evaluation framework separating two intervention axes: internal model state and external memory handling. Conceptually, this produces the 2×22 \times 2 design in Table 1 (Appendix C). Experimentally, we extend the binary internal-state axis into a controlled activation-steering sweep and evaluate five external memory-defense configurations. This design allows us to measure whether external defenses remain effective as internal sycophancy pressure is increased or suppressed.

Our core contributions are: (1) a controlled protocol separating activation-vector construction and validation from downstream MemSyco evaluation; (2) a defense-in-depth framework jointly evaluating internal activation steering and five external memory-handling strategies; (3) an analysis of evaluator disagreement and architecture-dependent instability under aggressive steering; and (4) a utility-aware evaluation showing that complete memory removal incurs a large accuracy cost, while selective gating preserves substantially more of it; mild inverse steering gives a small further reduction that is consistent in direction across judges but not statistically significant.