Steering Frozen LLMs: Adaptive Social Alignment via Online Prompt Routing

Zeyu Zhang, Xiangxiang Dai, Ziyi Han, Xutong Liu, John C. S. Lui

TL;DR

Traditional large language model (LLM) alignment methods like RLHF create static models that cannot adapt to changing safety norms or evolving jailbreaks without expensive retraining. This paper introduces CCLUB, a contextual bandit framework that dynamically routes queries to optimal system prompts at inference time using a novel "consensus clustering" mechanism. By intersecting separate utility and safety graphs, CCLUB safely balances helpfulness and safety on the fly, achieving up to an 11% reward improvement over standard baselines.

What Problem Does This Paper Address?

Post-training alignment techniques (like RLHF or DPO) bake safety rules directly into an LLM's weights. However, real-world deployment requires dynamic safety: what is considered safe in an academic research lab might be completely inappropriate in a child-facing application, and new adversarial jailbreak strategies emerge daily. Updating model weights constantly to address these shifts is prohibitively expensive.

Inference-time prompt routing—selecting a specific system prompt dynamically based on the incoming query—offers a flexible alternative. However, standard routing algorithms hit a major roadblock known as structural dissonance. Queries that look almost identical semantically can have completely opposite risk profiles (e.g., "How to bake a cake" vs. "How to make a bomb"). Naive clustering algorithms group these together, accidentally sharing safety data across benign and dangerous contexts, which leads to catastrophic safety failures.

Methods

To solve this, the authors propose the Consensus Clustering LinUCB Bandit (CCLUB) framework, which treats inference-time alignment as a multi-objective contextual bandit problem. Its core innovations include:

  1. Dual-Feature Contexts: Instead of relying solely on standard semantic text embeddings, CCLUB concatenates semantic features with safety-specific features extracted from a dedicated safety model stream. This drastically improves the model's ability to separate safe and unsafe intents (see Figure 2).
  2. Conservative Consensus Clustering: Instead of building a single similarity graph, CCLUB maintains two independent graphs: one for utility and one for safety. It only pools data and shares learning between query prototypes if they are connected in both graphs (the intersection graph $G^{(u)} \cap G^{(s)}$). If a prototype is utility-similar but safety-divergent, the edge is pruned, preventing unsafe generalization. An overview of this architecture is illustrated in Figure 3.
  3. Dynamic Preference Weighting: The framework supports a real-time preference weight ($w$) that shifts the balance between safety and utility instantly without model retraining.
  4. Warm-Start Phase: To avoid dangerous "cold-start" exploration in production, CCLUB uses historical offline logs to safely bootstrap its routing policy.
Figure 2. Adding safety features improves separability (AUC ↑).
Figure 3. Overview of the CCLUB Framework for Adaptive Social Alignment. The system integrates an offline safety-aware initialization phase with an online consensus clustering mechanism to route prompts dynamically.

Datasets

The authors evaluated their framework using the following datasets:

  • BeaverTails and PKU-SafeRLHF: Used to sample 6,000 diverse queries for the online interaction simulation, spanning various safety categories (violence, cybercrime, drugs, etc.).
  • XSTest: A benchmark consisting of 250 safe/unsafe prompt pairs with minimal lexical differences, used to evaluate the separability of the dual-feature embeddings.

Key Insights and Ideas

  • Semantic proximity does not imply safety proximity: This is the foundational "aha" moment of the paper. Traditional bandit algorithms assume that if two contexts are close in embedding space, their rewards (and safety profiles) will be similar. CCLUB explicitly decouples these spaces to prevent "safety-blind" information transfer.
  • Intersection as a hard safety gate: By using graph intersection as a strict constraint for data sharing, the algorithm guarantees that collaborative learning never crosses safety boundaries.
  • No single prompt rules them all: The empirical Pareto frontier (shown in Figure 1) proves that a prompt optimized for pure utility can be disastrous for safety-critical queries, validating the need for dynamic, context-aware routing.
Figure 1. Safety–utility trade- offs as weight w varies.

Key Results

  • Performance Boost: CCLUB consistently outperformed all baselines. It achieved a 10.98% improvement in cumulative reward and a 14.42% reduction in the average suboptimality gap compared to the best non-prototype baseline (Input Greedy).
  • Sample Efficiency: Even when compared against a strong prototype-based baseline (Prototype LinUCB), CCLUB improved cumulative reward by 5.04% and cut the suboptimality gap by 4.95%.
  • Theoretical Guarantees: The authors proved a sublinear regret guarantee, confirming mathematically that the algorithm efficiently balances cluster identification and exploitation over time.

Limitations and Future Work

  • Fixed Prompt Pool: CCLUB assumes a pre-curated, static pool of candidate system prompts (90 prompts in the experiment). If none of the available prompts perfectly suit a novel adversarial attack, the system's adaptation capability is capped.
  • Future Directions: The authors plan to relax this constraint by integrating dynamic candidate generation (generating new system prompts on the fly). They also aim to enhance robustness against severe distribution shifts using richer, multi-modal feedback signals.

Summary updated

BibTeX
@inproceedings{zhang2026steering,
  author = {Zeyu Zhang and Xiangxiang Dai and Ziyi Han and Xutong Liu and John C. S. Lui},
  title = {{Steering Frozen LLMs: Adaptive Social Alignment via Online Prompt Routing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=mrAigjn39k},
}
Figure