遇见数据集

DeepSeek-R1-Distill-Qwen-1.5B-pts-steering-vectors

收藏
魔搭社区2026-04-28 更新2026-07-19 收录
官方服务:

资源简介:

# PTS Steering Vectors Dataset A dataset of activation-based steering vectors created using the Pivotal Token Search (PTS) technique. ## Details - **Source:** Generated using the [PTS](https://github.com/codelion/pts) tool - **Model:** deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B ## Dataset Structure This dataset contains: - `steering_vectors.jsonl`: The main file with token-level steering vectors ## Usage These steering vectors can be used for activation-based steering during inference to guide language models toward particular reasoning patterns. ### OptiLLM Integration You can use these steering vectors with the open-source [OptiLLM](https://github.com/codelion/optillm) library for optimizing inference via the `autothink` approach. OptiLLM provides a proxy server that can apply steering techniques to improve model performance. ### Example Python Code ```python import json import torch from transformers import AutoModelForCausalLM, AutoTokenizer # Load model model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B") tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B") # Load steering vectors directly from Hugging Face from datasets import load_dataset dataset = load_dataset("codelion/DeepSeek-R1-Distill-Qwen-1.5B-pts-steering-vectors") vectors = [json.loads(example) for example in dataset["train"]] # Define a hook to apply steering def steering_hook(module, input, output): # Add steering vector to activation # Implementation depends on your specific use case return output # Register hook on appropriate layer model.transformer.h[LAYER_NUM].register_forward_hook(steering_hook) # Generate text with steering input_text = "Your prompt here" input_ids = tokenizer.encode(input_text, return_tensors="pt") output = model.generate(input_ids, max_length=100) result = tokenizer.decode(output[0]) print(result) ```

提供机构:
maas
创建时间:
2025-10-22
二维码
社区交流群
二维码
科研交流群
商业服务