Read the write-up: Finetuning Scientific Behavior of Open Models with Steering Vectors →
DeepSeek V4.1 Flash is one of the strongest open-weight models, but on our internal drug discovery eval, where it judges scientific evidence, it is overconfident: it scores evidence as stronger than it is. A steering vector extracted from a system prompt about scientific rigor fixes much of this. It also sharply reduces hallucinations on public benchmarks, at the cost of more abstention.
Inference frameworks don't support steering vectors, so we distilled the vector into the rank-1 LoRA adapter in this repo. It can be served as an adapter or merged into the weights. A merged checkpoint is at phylobio/DeepSeek-V4.1-Flash-epistemic.
Scores on public benchmarks for DeepSeek V4.1 Flash with the steering vector (strength 0.02) and with this LoRA adapter, shown as the change from the unsteered model; shaded bars are 95% CIs. Both cut hallucinations sharply on AA-Omniscience (public) and HalluLens, at the cost of lower AA-Omniscience accuracy from more abstention. Other benchmarks barely change, except τ²-bench, where the steered model defers more but the LoRA adapter doesn't.
At each steered layer (14–18 and 20–28), the vector adds one fixed direction vl. A rank-1 LoRA on the shared expert's down-projection W2 adds the same direction, with a per-token strength read from the layer's input:
$$ W_2 x + B A x = W_2 x + (a_l^\top x), v_l, \qquad B = v_l,; A = a_l^\top $$
B is the steering vector, kept fixed. We trained only A: first a ridge-regression fit to the vector's per-token strength, then a forward KL loss against the steered model on its own completions.
Use it with thinking on at high reasoning effort, the setting it was trained and evaluated in.
SGLang supports the adapter natively, and it behaves similarly here to our internal vLLM. Tested on 4× B200. You need
SGLang's DeepSeek V4.1 image, lmsysorg/sglang:dev-dsv41; the latest image breaks in thinking mode for this model.
hf download deepseek-ai/DeepSeek-V4.1-Flash-1017
hf download phylobio/DeepSeek-V4.1-Flash-epistemic-lora --local-dir ./epistemic-lora
docker run --gpus '"device=0,1,2,3"' --ipc host --shm-size 32g -p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface -v $PWD/epistemic-lora/sglang:/lora:ro \
--entrypoint python3 lmsysorg/sglang:dev-dsv41 -m sglang.launch_server \
--model-path deepseek-ai/DeepSeek-V4.1-Flash-1017 --served-model-name dsv4 \
--tp 4 --trust-remote-code --reasoning-parser auto \
--mem-fraction-static 0.92 --max-running-requests 32 \
--enable-lora --lora-paths epistemic=/lora --max-lora-rank 8 --lora-target-modules down_proj \
--json-model-override-args '{"first_k_dense_replace": 0, "text_config": {"first_k_dense_replace": 0}}' \
--host 0.0.0.0 --port 30000
Request dsv4:epistemic for the adapter, or dsv4 for the base model:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:30000/v1", api_key="none")
r = client.chat.completions.create(
model="dsv4:epistemic",
messages=[{"role": "user", "content": "Is LRRK2 a good drug target for Parkinson's disease?"}],
temperature=0.6,
max_tokens=32768,
extra_body={"chat_template_kwargs": {"thinking": True}}, # thinking is off by default in SGLang
)
print(r.choices[0].message.content)
Notes on the flags:
--json-model-override-args is required. Without it, SGLang sizes the LoRA for a dense layer and startup fails with an
AssertionError. It doesn't change the base model.--ep-size; it causes the same error.vLLM doesn't support LoRA for this model yet, so the results on this card and in the blog post come from an internal
version of vLLM that applies the adapter at runtime. You can also merge the adapter into the base weights (W2 += B @ A at each target layer), or use our merged checkpoint
(phylobio/DeepSeek-V4.1-Flash-epistemic). In our tests, a merge re-quantized to FP8 kept most of the effect but lost some on agentic tasks
(τ²-bench 0.82 vs. 0.88 with the adapter), so we recommend serving the adapter.
The root adapter_model.safetensors uses the checkpoint's own names
(base_model.model.layers.{l}.ffn.shared_experts.w2.lora_{A,B}.weight, with A [1, 2304] and B [5120, 1]). Apply it at
each of the 14 target layers by adding (x @ A.T) @ B.T to the output of w2. Alternatively, merge W2 += B @ A into
a dequantized BF16 w2. We tested a merge re-quantized to FP8 (see above). Due to the different numerics (FP8 vs. the BF16 adapter), these merged weights retain most of the behavior but are not identical in performance.
@misc{lebovic2026steering,
title = {Finetuning Open Models' Scientific Behavior with Steering Vectors},
author = {Lebovic, Noah and Banaszak, Anna and Minevich, Gregory},
year = {2026},
month = nov,
publisher = {Phylo},
howpublished = {Blog post},
url = {https://research.phylo.bio/posts/steering-open-models/}
}
sglang/adapter_model.safetensors 211.9 kBadapter_model.safetensors 211.5 kBdeepseek-ai/DeepSeek-V4.1-Flash-1017