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

Manuscript Offprint

arXiv:2608.30319

Beyond Token-Level Guidance: Inference-Time Alignment of Specialized LLMs via Cross-Family Representation Steering

Jin Gan, Xin Li, Jun Luo

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

Abstract

Large language models (LLMs) finetuned for specialized domains represent crucial high-impact applications. Inference-time alignment improves safety degraded from specialization finetuning without requiring substantial computational resources, complementing finetuning-based methods with an easy-to-use, plug-and-play solution. However, existing inference-time methods fail to reliably improve safety without disrupting domain capability. We identify the root cause as complementary expertise orthogonality: specialized base models and general-domain guidance models have orthogonal competencies, making the guidance signal unreliable for specialized generation. This primarily manifests as stop token interference, where the guidance model's tendency toward continuation overrides the base model's decision to stop, burying correct answers under guidance-induced continuation. To address this problem, we propose CREST, an inference-time alignment method that steers base model hidden representations using safety directions extracted from a guidance model of any family, avoiding token-level structural limitations entirely. CREST improves safety where specialization has weakened it while preserving both domain-specific capability and the safety of already well-aligned models, outperforming baselines by up to 22.2% on safety benchmarks. Our code is available at: https://github.com/DecayingSeart/CREST.

1 Introduction

Specialized Large language models (LLMs) represent crucial applications with substantial real-world impact, achieving performance that exceeds general-purpose models on domain-specific benchmarks (Cheng et al., 2024). This specialization is typically achieved through finetuning on curated domain-specific datasets, allowing models to acquire expertise in the corresponding knowledge. However, specialization fine-tuning often comes at a significant cost: degraded safety alignment. Recent works have demonstrated that even fine-tuning on benign, domain-specific data can substantially increase models' vulnerability to generate harmful content (Qi et al., 2024). This safety degradation poses significant risks in practice, as specialized models deployed in high-stakes applications may cause serious consequences. Existing approaches to preserving safety during specialization operate primarily at the fine-tuning stage. While effective, these approaches share a common limitation: they require substantial computational resources often unavailable to many practitioners.

Inference-time alignment methods offer an attractive alternative, modulating model outputs during generation without modifying parameters. These approaches leverage a second, well-aligned guidance model to steer the under-aligned base model's generations toward safer outputs (Fei et al., 2025; Wang et al., 2024; Liu et al., 2024; Gan et al., 2026). For specialized models, a natural setup involves using general-purpose aligned models to guide specialized models—a practical scenario where practitioners have access to only one specialized model and must rely on readily available general-purpose models for safety guidance. This configuration is particularly relevant given that general-purpose models typically maintain stronger safety alignment than the specialized ones and are widely accessible through public repositories.

However, existing inference-time alignment methods, especially the token-level ones, fall short when applied to specialized models due to structural generation failures. Token-level methods (Gan et al., 2026; Fei et al., 2025) apply the guidance model's distribution uniformly across all token positions, and when the guidance model's general-domain stylistic preferences diverge from

∗^{*}Corresponding author. The work was done when Dr. Xin Li was with the College of Computing and Data Science, Nanyang Technological University, Singapore.

Figure

(a)

(b)

Figure 1: (a) Overview of the problem and our solution. (Left) Domain fine-tuning instills specialized expertise but degrades safety alignment. (Middle) Existing token-level guidance methods suppress end-of-sequence signals, causing correct answers to be buried under guidance-induced continuation. (Right) Our method steers base model hidden representations using a safety direction from the guidance model, preserving generation boundaries by construction while improving safety. (b) Illustration of stop token interference on a GSM8K example. Token-level guidance suppresses the base model's end-of-sequence signal, causing generation to continue past the correct answer ($18) and ultimately extract an incorrect value from the extended continuation. Our method steers hidden representations rather than token distributions, preserving the end-of-sequence boundary by construction and stopping cleanly at the correct answer.

the specialized base model’s domain-trained generation patterns, the intervention actively corrupts correct domain generations. For instance, when guiding Mathstral-7B-v0.1 with Qwen3-8B on mathematical reasoning (GSM8K), 84.8% of final incorrect predictions contain the correct answer within the output, buried by guidance-induced continuation past the model’s natural stopping point — an effect of end-of-sequence (EOS) suppression — rather than lost to reasoning errors, with 61.3% of all samples affected. Meanwhile, their uncertainty-based triggering mechanism fails to intercept harmful outputs that specialized models generate confidently. Since these are structural constraints of token-level intervention, they cannot be reliably remedied by better guidance model selection, as compatibility cannot be predicted without exhaustive empirical evaluation on each target model. See Figure 1a for overview and Figure 1b for example.

These failures are specific to the specialized alignment setting, where the guidance model's general-domain distribution is structurally misaligned with the base model's domain-trained behavior. We identify the root cause as complementary expertise orthogonality: specialized base models possess domain expertise that general guidance models lack, while guidance models retain safety alignment that specialized models have lost— their competencies are orthogonal. Since this orthogonality is a property of the specialized model rather than any particular intervention mechanism, the failure extends to all existing inference-time alignment methods regardless of how carefully their guidance signal is applied—a structural distinction from prior work.

To address this challenge, we introduce CREST, an inference-time alignment method that steers base model representations using safety directions extracted from a guidance model of any family. CREST avoids EOS suppression by construction: since it steers hidden states rather than token distributions, the base model's token probabilities, including EOS, remain entirely unmodified throughout generation. The base model retains full control over when to stop, and steering ceases after the intervention window, returning generation to the base model's domain expertise. EOS suppression is therefore structurally impossible under CREST, regardless of guidance model used. This allows CREST to reliably improve safety across specialized domains where it has been weakened without disrupting domain capability.

This work makes the following contributions:

• We provide a systematic study of inference-time alignment for specialized models, identifying complementary expertise orthogonality as a fundamental challenge distinct from general model alignment.

• Our findings complement existing finetuning methods with an easy-to-use, plug-and-play solution applicable to any specialized model with no family restraint on guidance model.

• We introduce CREST that successfully addresses complementary expertise orthogonality: it improves safety where specialization has weakened it (code, math) and preserves safety where the base model remains well-aligned (medical), achieving safety gains up to 22.2% while preserving specialized capabilities.

The remainder of this paper is organized as follows. Section 2 reviews related work on safety alignment and inference-time methods. Section 3 formalizes the problem setting and characterizes the failure modes of existing methods. Section 4 describes CREST and its application to specialized models. Section 5 presents our experimental setup and results. Section 6 concludes.