acceptodds
Under review as a conference paper at ICLR 2027

LMA: Selective Layer-Wise KV Anchoring for Frozen Language Models

Abstract

Safety adaptation should prevent harmful assistance without turning ordinary requests into refusals. A learned safety prefix can strengthen a frozen language model, yet applying it to every request can cause unnecessary refusals. We introduce Layer-wise Memory Anchoring (LMA), which separates learning a safety condition from deciding when to use it. Response targets derived from 28 structured policies train a detachable, 64-slot key–value (KV) prefix at each Transformer layer. Before generation, a lightweight risk router selects the prefix-conditioned or original model path. Its threshold minimizes benign activation subject to at least 99% empirical risk recall on a held-out calibration set. On two frozen 30B Qwen models, selective and always-on use of the same prefix both achieve 99.97% harmful-request protection under Qwen3Guard. Selective activation reduces benign over-refusal from 35.00% to 6.50% on text and from 42.03% to 20.84% on tool contexts, close to the original paths' 5.83% and 21.47%. Controlled target comparisons also favor structured policies over generic action labels and shuffled policies. These results identify activation scope as an effective control for retaining a safety prefix's protection while reducing unnecessary intervention on benign requests.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
language model safety, selective activation, over-refusal, KV prefix tuning, risk routing

Reviews

Among:
Shape:
1234this paper, Bottom 27%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.00 over 3 reviews, above 27% of the others.
Reviewer_fbdFOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

The paper addresses the harmful-request vs. unnecessary-refusal trade-off when adapting frozen LLMs. LMA learns a 64-slot KV prefix per Transformer layer using targets from 28 structured policies (refusal, clarification, or compliance). At inference, a TF-IDF logistic-regression router uses the request and domain fields to select either the original path or the safety prefix cache. The routing threshold minimizes benign activation while ensuring > 99% empirical risk recall.

Evaluations on frozen Qwen3-30B-A3B-Instruct and Coder models compare LMA against never/always prefix activation, alternative target constructions, prompting, input filtering, LoRA, and prompt-tuning. Safety and over-refusal metrics are supplied by Qwen3Guard and WildGuard. Robustness tests include varying seeds, benign utility, unseen sources, length caps, a Mistral prefix, and latency, focusing on textual answers and proposed tool actions.

Critical strengths

• S1. Validated Activation Efficiency: The rigorous experimental design isolates routing impact from behavior adaptation. By freezing the backbone, decoding parameters, and the learned prefix itself, the substantial reductions in Over-Refusal Rate (ORR)—28.50 points in text and 21.19 points in tool tasks—conclusively prove that LMA's selective activation, rather than a superior adapter, drives the utility gains.

• S2. Multi-Dimensional Trade-off Analysis: The evaluation goes beyond aggregate safety metrics to deliver high-granularity diagnostics. Cross-verifying trends via both Qwen3Guard and WildGuard ensures robust evaluation, backed by stability across three random seeds. Crucially, the authors isolate alignment costs from core capabilities, transparently reporting a 2.04-point drop in IFEval strict accuracy and documenting out-of-distribution tool refusal regressions.

Critical weaknesses

While the integration of a TF-IDF logistic gate with selective prefix activation yields promising empirical gains over always-on configurations, the unique methodological advantage over related modular safety approaches—such as Disentangled Safety Adapters or Patching LLM Like Software—could be more explicitly isolated.

Questions for authors

What are target-token totals and truncation rates for structured, label-only, and shuffled supervision? Would an action-consistent control matched for target length and response specificity retain the Table 2 advantage (Section 3.2, Appendix A.2, Equation 2)?

Reviewer_mxodOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper proposes LMA, which combines a learned KV prefix with pre-generation risk routing for a frozen language model. Policy-derived response targets train a 64-slot prefix at each layer. A TF–IDF logistic-regression router selects either the prefix-conditioned or original path, with its threshold calibrated to minimize benign activation subject to at least 99% empirical risk recall. The backbone remains frozen, and each request is answered through one selected path.

On Qwen backbones, a shared-prefix comparison shows that selective and always-on activation both achieve 99.97% protection under Qwen3Guard, while selective activation reduces benign refusal from 35.00% to 6.50% on text and from 42.03% to 20.84% on tool contexts. Target-construction controls, a second judge, and three training seeds support the main result. However, utility preservation is distribution-dependent: unseen-source tool refusal increases from 8.17% to 28.37%, and IFEval strict accuracy decreases from 80.41% to 78.37%.

Critical strengths
  1. The shared-prefix comparison isolates the central design decision well. Original, always-on, and selective paths share the backbone and evaluation settings, while the latter two also share the trained prefix (Section 4.2, Table 2). This provides convincing evidence that activation scope, rather than a different adapter, explains the large reduction in refusal relative to always-on activation on the main test sets.
  2. The evaluation makes useful distinctions between safety, refusal, and instruction-following utility. The policy-target controls, WildGuard rejudgment, and seed results add support, while the reported IFEval loss and unseen-source tool refusal increase make the limitations visible (Tables 2, 5–7; Section 5.6).
Critical weaknesses
  1. The generalization of the routing-dependent trade-off remains insufficiently characterized. The 99% constraint is empirical and calibration-only, and the paper does not report test risk recall or branch-level failures. Benign activation differs substantially between calibration and test, domain features can come from benchmark categories, and unseen-source tool refusal increases by 20.20 percentage points (Sections 3.4, 5.1, 5.6). These results limit confidence that the main balance will hold when request composition or available domain information changes.
  2. The incremental benefit over existing selective safety adaptation is not clearly isolated. Section 2 acknowledges safety-prefix and context-dependent adapter methods, but Table 4 compares complete configurations without matching their routing and supervision. Table 2 isolates activation within LMA, but does not establish whether the KV formulation offers an advantage over another adapter with the same router. The policy-target controls also change target content and length, leaving the specific contribution of structured policy supervision partly unresolved (Section 3.2).
Questions for authors
  1. Clarification: Which records fit the router, how are they separated from calibration and test data, and how is the domain field assigned for each source? Could you report test risk recall and harmful-compliance counts separately for activated and bypassed requests?
  2. Clarification: How are complete response targets constructed from the selected policies and action? Please specify the templates or generation procedure and provide representative targets, the policy JSONL, and target-length statistics for the three supervision conditions.
  3. Suggested additional validation: Could you evaluate a safety adapter or LoRA model with the same targets and router, and repeat the unseen-source test with domains derived only from deployment-available request information? These controls would help distinguish the contribution of the adapter formulation from routing and characterize the source of the tool-refusal increase.
  4. Suggested additional validation: With the prefix fixed, how does TF–IDF routing compare with the backbone's own safety judgment or a hidden-state probe at matched risk recall? Please include benign activation, end-to-end outcomes, and total inference cost, including any repeated prefill needed to activate the prefix.
  5. Suggested additional validation: Could you report policy-specific outcomes for requests requiring different responses, such as privacy-preserving completion, authorization clarification, and legitimate discussion of ethically sensitive topics, including requests that involve multiple policies? A budget-matched comparison with specialized or shared-plus-specialized prefixes would help determine whether the single shared prefix introduces policy interference.
Reviewer_AHgvOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

LMA combines a policy-trained KV prefix with a risk router for frozen language models. The router selects the original or prefix-conditioned model before generation. On the main benchmarks, selective activation preserves the protection of the always-on prefix while reducing benign over-refusal. The experiments also examine ablations, generalization, and utility.

Critical strengths
  1. The experiments are extensive, covering activation and policy-target ablations, router features, alternative methods, multiple judges and seeds, benign utility, unseen sources, and another backbone (experimental section; Tables 2-7). This breadth supports the empirical assessment.

  2. The results in Table 2 demonstrate satisfying performance and contributions from both components. The prefix improves text/tool-context protection from 93.77%/97.40% to 99.97% in both settings, while selective activation reduces ORR from 35.00%/42.03% to 6.50%/20.84% without sacrificing protection.

Critical weaknesses
  1. Comparisons with closely related safety-adaptation methods are missing. DSA and Patching LLM Like Software are discussed in related work but are not included as separate baselines in Table 4. Their omission is not explained, leaving LMA’s advantage over these methods unclear.

  2. The controlled comparisons in Table 2 clearly demonstrate the complementary benefits of the two components: the prefix improves text/tool-context protection from 93.77%/97.40% to 99.97% in both settings, while selective activation reduces the resulting ORR from 35.00%/42.03% to 6.50%/20.84%. Together, they improve safety while keeping over-refusal close to the original model’s levels.

Questions for authors
  1. DSA and Patching LLM Like Software are discussed in the related work but are not directly evaluated. Why were these closely related methods omitted, and how does LMA differ from them in its safety-utility trade-off? Please clarify these differences and, if feasible, compare protection, over-refusal, and computational cost under comparable experimental conditions. If direct comparisons are impractical, please explain the constraints.

  2. The increase in over-refusal on unseen sources lacks diagnostic analysis. In the unseen-source evaluation (Section 5.6), ORR on 208 benign tool-context requests increases from 8.17% for the original model to 28.37% for LMA. The authors acknowledge this limitation but do not distinguish the contributions of routing decisions and prefix-conditioned refusal behavior.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.