vgel / repeng

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

Vector arithmetic #6

Closed vgel closed 5 months ago

vgel commented 5 months ago

Adds support for adding and subtracting control vectors, as well as multiplying and dividing them by scalars. coeff in model.set_control(..., coeff) now defaults to 1.0, so you can do model.set_control(2 * happy_vector) instead. Adds a new example notebook demonstrating arithmetic. (Needs README update but going to do that later.)