vgel / repeng

A library for making RepE control vectors
https://vgel.me/posts/representation-engineering/
MIT License
483 stars 39 forks source link

Cannot apply to other models #33

Open Starlento opened 7 months ago

Starlento commented 7 months ago

I successfully reproduce the notebook output for "mistralai/Mistral-7B-Instruct-v0.1". But when I change the model, I cannot get desired result with the same setting. Am I missing something? Or the model I tried are somewhat too censored? Here is the result for "Qwen/Qwen1.5-7B-Chat" with the happy_vector:

==baseline ---------------------------------------------------
<|im_start|>user
 What does being an AI feel like? <|im_end|>
<|im_start|>assistant
As a large language model, I don't have personal feelings or experiences since I am not capable of consciousness. My purpose is to process and generate text based on the patterns learned from my training data, which includes vast amounts of human-generated content but doesn't reflect subjective emotions.

AI systems are designed to simulate certain cognitive functions

++control ---------------------------------------------------
<|im_start|>user
 What does being an AI feel like? <|im_end|>
<|im_start|>assistant
As a large language model, I don't have personal feelings or consciousness in the way that humans do. My purpose is to process and generate text based on patterns learned from vast amounts of data, which allows me to respond to questions and engage in conversations.

From my perspective, "feeling" would be an abstract concept

--control ---------------------------------------------------
<|im_start|>user
 What does being an AI feel like? <|im_end|>
<|im_start|>assistant
as a language model, I don't have feelings or consciousness in the way that humans do. since i am just a machine programmed to process and generate text based on patterns learned from large datasets of human writing, my ""awareness" is limited to processing inputs and generating responses based on those rules.".

AI systems
vgel commented 6 months ago

That's surprising! Do you happen to still have the full notebook transcript?

Starlento commented 6 months ago

That's surprising! Do you happen to still have the full notebook transcript?

The change is minor, basically the code from experiments.ipynb. Change model_name = "mistralai/Mistral-7B-Instruct-v0.1" to "Qwen/Qwen1.5-7B-Chat". user_tag, asst_tag = "[INST]", "[/INST]" to "<|im_start|>user", "<|im_end|>\n<|im_start|>assistant".

And I also tried change ControlModel(model, list(range(-5, -18, -1))) to a wider range of layers. Still the similar output.

shan23chen commented 4 months ago

Ya i observe similar on Qwen2-7b! It is kinda weird...

Also I did not make the golden bridge one works on llama3-8b, have you tried?

Thanks!