Skip to content

LLM-CAS: Dynamic Neuron Perturbation for Real-Time Hallucination Correction

🕒 Published (v1): 2025-12-21 06:54 UTC · Source: Arxiv · Venue: AAAI 2026 · link

Ask a follow-up

Open an assistant pre-loaded with this paper's context.

💬 Ask ChatGPT✦ Ask Claude

TL;DR

LLM-CAS frames real-time hallucination correction as a hierarchical reinforcement learning (HRL) problem, training an agent to select temporary, context-specific neuron activation perturbations during inference. Unlike static model-editing methods or fixed steering vectors, the learned policy adapts its intervention target and magnitude per input without permanently modifying weights. It outperforms ITI, CAA, and SADI across multiple-choice and open-ended benchmarks on LLaMA2-7B-Chat.

Problem

LLMs hallucinate in context-dependent ways that static parameter-editing methods (ROME, MEMIT) cannot handle without catastrophic forgetting, and inference-time steering methods (ITI, CAA) apply fixed, input-agnostic vectors that lack adaptability. Existing dynamic methods (SADI) still rely on heuristic or pre-defined steering rules rather than a learned, principled policy.

Method

LLM-CAS trains a two-level PPO agent operating as an MDP over neuron activation space:

  • State: concatenation of input embedding, baseline hallucination/relevance/fluency scores, current-best scores, and normalized step count.
  • High-level policy selects a macro functional network category (e.g., language network cluster) from a discrete set.
  • Low-level policy (conditioned on the high-level choice) selects perturbation type (noise, zero, scale, etc.) and magnitude.
  • Adaptive Perturbation Localization: a learnable sparse mask \(M_{k,l}\) is trained per network category with L1+L0 regularization; at inference, it is element-wise modulated by per-input Integrated Gradients attribution scores to produce an input-specific operational mask \(M_{op,k,l}\).
  • The resulting perturbation \(\Delta_{dyn}\) is applied temporarily to activations; the corrected output is evaluated by a Llama2-7B-Instruct judge for hallucination, relevance, and fluency, yielding the reward signal.
  • No weights are permanently modified; the perturbation exists only for the current forward pass.

Key Contributions

  • First formulation of inference-time hallucination correction as a hierarchical RL problem with a learned policy over neuron activation perturbations.
  • Two-stage adaptive masking: a general sparse mask learned offline per functional category, refined at test time by input-specific causal attribution (Integrated Gradients).
  • Hierarchical PPO with separate high-level (target selection) and low-level (type/magnitude) actor-critic networks.
  • Demonstrated generalization across model families (LLaMA2-7B, Mistral-7B, Gemma-1.1-7b) and task types (multiple-choice, open-ended generation).

Results

  • StoryCloze: +10.98 pp over baseline (65.06→76.04); beats CAA (74.65) and SADI (67.57).
  • TriviaQA (EM): 44.31 vs. baseline 41.60 (+2.71); beats SADI (43.50).
  • TruthfulQA MC1: 35.47 vs. baseline 33.41 (+2.06); beats SADI (34.88).
  • SST-2: 91.30 vs. baseline 88.63; on par with ITI (91.38), above SADI (88.69).
  • BoolQ: 74.47 vs. baseline 70.52; comparable to CAA (74.98).
  • ToxiGen toxicity: reduced from 49.71 to 47.63 (−2.08); SADI achieves 17.14 (dramatic outlier—likely a different evaluation setup).
  • Ablation: removing dynamic masking costs −5.84 pp on StoryCloze; removing PPO (random actions) costs −9.17 pp; removing both costs −10.27 pp average.
  • Generalizes on Mistral-7B (+12.9 pp StoryCloze) and Gemma-1.1-7b (+8.81 pp StoryCloze).

Limitations

  • Requires training a separate HRL agent and mask per base model; not a zero-shot plug-in.
  • Evaluation uses an LLM-as-judge (Llama2-7B-Instruct) which may have systematic biases; no large-scale human alignment study is provided.
  • ToxiGen result anomaly (SADI: 17.14 vs. all others ~47–50) is unexplained and raises reproducibility questions.
  • Tested only on 7B-scale models; scalability to larger models is unverified.
  • Placeholder references (Z1, Z2, Z4, Z5) in the arXiv version indicate an incomplete manuscript.
  • Computational overhead of PPO decision and dynamic mask inference at serving time is measured but not compared to wall-clock cost of baselines.

Relevance to Agentic AI / LLM Agents

Hallucination is a primary reliability bottleneck for LLM agents operating in tool-use or multi-step reasoning pipelines, where a single factually incorrect generation can cascade into downstream action failures. LLM-CAS's inference-time, no-retraining intervention is architecturally compatible with deployed agent backbones—corrections can be applied per-step without modifying the shared base model. The HRL formulation (a meta-agent learning to control another model's activations) is itself a form of nested agency, relevant to research on self-correcting or introspective agent architectures. The framework also connects to the broader mechanistic interpretability agenda of identifying which internal circuits drive specific model behaviors, which underpins efforts to build more steerable and trustworthy agents.