You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When taking the suffix activations, in steering_vector.py, I noticed that the length of the tokenized suffix is calculated using suffixes[0][0], but the different suffixes in the list may be of different lengths. Wondering if this is intended behavior?
elif accumulate_last_x_tokens == "suffix-only":
if suffixes:
# Tokenize the suffix
suffix_tokens = tokenizer.encode(suffixes[0][0], add_special_tokens=False)
# Get the hidden states for the suffix tokens
suffix_hidden = batch_hidden[-len(suffix_tokens):, :]
accumulated_hidden_state = torch.mean(suffix_hidden, dim=0)
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Thanks for finding this! The code was implemented this way mostly because having a fixed length seemed more stable, and suffixes mostly had similar lengths for our setup.
When taking the suffix activations, in
steering_vector.py
, I noticed that the length of the tokenized suffix is calculated usingsuffixes[0][0]
, but the different suffixes in the list may be of different lengths. Wondering if this is intended behavior?Thanks in advance!
The text was updated successfully, but these errors were encountered: