Code Monkey home page Code Monkey logo

c-rasp's Introduction

C-RASP

This is an implementation of the compilation from C-RASP programs into transformer encoders, as specified in the paper. More details to come... :)

TODO items

Implement Bools

  • And
  • OR
  • Comparison...

Implement Counts

  • Conditional
  • Addition
  • Subtraction
  • Min
  • Max
  • Constants
  • Design choices: Hide BOS. Also need another FFN to ensure the BOS count is always 0, otherwise it screws with the rest

Utilities

  • When pretty-printing, mask out the counts that have been overwritten by LayerNorm during Comparison
  • Make a more user-friendly interface for writing programs - a parser?
  • Make it very streamlined to use as language acceptor/rejector
  • Companion program to just simulate C-RASP programs

Language Modeling

  • I said we could define simple language models using C-RASP, so we should test it out
  • Presumably this can be used to edit existing language models. For instance, we can force it to never generate X if it has not seen at least 3 Y's. This can be done by adding fresh dimensions and inserting a C-RASP program which checks whether or not there have been 3 Y's or not. Then we can add a huge coefficient to this Boolean value and add it to the dimension which stores the probability of X being the next token. We'd also have to muck around with the final layer, but depending on how the language model is defined this is maybe ok.

More

  • How much of this can be applied to S-RASP?
  • Experiments -- initialize a C-RASP transformer and fine-tune on something

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.