Skip to content

Adding topic steering on layers  #5119

Closed
@benxh1995

Description

@benxh1995

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [ x ] I am running the latest code. Development is very rapid so there are no tagged versions as of now.
  • [ x ] I carefully followed the README.md.
  • [ x ] I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • [ x ] I reviewed the Discussions, and have a new bug or useful enhancement to share.

Feature Description

Add the ability to set/apply steers on a layer by layer basis in order to ensure alignment with specific concepts, tokens or words.

Motivation

Based on recent papers and research on LLM steerability through applying steers on specific layers, I believe that llama.cpp would greatly benefit from incorporating a feature like this.

The colab in the section below should provide a very interesting application which results in far higher reasoning abilities, for example from a 3B.

Possible Implementation

Links to known implementations:
https://github.com/Mihaiii/llm_steer
https://colab.research.google.com/github/Mihaiii/llm_steer/blob/main/demo/llm_steer_demo.ipynb

And

https://github.com/nrimsky/LM-exp/tree/main/steering

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions