representation-engineering icon indicating copy to clipboard operation
representation-engineering copied to clipboard

Understandung the contrast vector implementation

Open Luca-vdB opened this issue 1 year ago • 1 comments

As far as I can tell, this is the part where the Contrast Vector is applied:

https://github.com/andyzoujm/representation-engineering/blob/8de198b4fbd48e1068285d6d0650897a946c7f74/repe/rep_control_contrast_vec.py#L331-L338

I asked myself the question why not only the hidden_states are changed but also hidden_states_p and hidden_states_n. Could you elaborate on that?

Btw: Since contrast_tokens is choosen to be negtative, is it not always equal to c_length?

Luca-vdB avatar Feb 21 '24 14:02 Luca-vdB