EleutherAI / elk

Keeping language models honest by directly eliciting knowledge encoded in their activations.
MIT License
178 stars 33 forks source link

Don't left truncate stuff anymore #239

Closed norabelrose closed 1 year ago

norabelrose commented 1 year ago

Left truncation was a terrible idea, idk why I ever thought it made sense.

Some models, in particular unifiedqa-t5-11b, have unusually short context lengths so that a significant fraction (e.g. 20%) of prompts just get truncated from the left, potentially removing important info about the task. This seems to be leading to degraded performance. image

This PR fixes the problem by simply skipping examples in extract_hiddens which exceed the max length indicated by the tokenizer.