Decoder language models¶
For a decoder language model with a published SAE of an inner layer (SPLARE): muscari import-sae --layout qwen-scope --layer N brings in the SAE, --bidirectional lets every token attend to the whole text, and --lora-rank trains low-rank adapters instead of the model's weights (needs peft, the llm extra). The model is cut after the SAE's layer (muscari.heads.DecoderTransformer). examples/adapt_bidirectional.py adapts a decoder model to bidirectional attention beforehand, with masked next-token prediction as in LLM2Vec, and saves a model to start from.
The SPLARE recipe shows the commands in order. These parts have run on randomly initialised models only.