Giter Club home page Giter Club logo

latent_space_activation's Introduction

Latent Space Activation

There have been many papers such as "Take a Deep Breath" "Step Back" and "Let's think through this step by step" and I noticed that no one has yet generalized what's going on with the models. Why do these techniques work and how can you generalize them more broadly?

This repo is here to demonstrate a few techniques that you can use to activate latent space (embedded knowledge and abilities within the models).

The first thing to know is that LLMs have vast amounts of knowledge and capabilities embedded in the networks. Most people seem to expect them to magically pop out correct answers and abilities on the first go with inadequate context. But this is setting the bar way higher than human intelligence. What most ML scientists don't know about the brain is that there are hundreds (if not thousands) of parallel processes and sequences that spool up correct answers. Not only that, the longer you work on a problem, the more relevant information gets recruited into "working memory". This can be approximated with iterative retrieval or activation of latent knowledge. Furthermore, the LLM "knows" how to tackle many problems, but like humans, it helps to stop and think for a moment about how to address a problem.

This is the nature of my work on cognitive architecture - how to create patterns that can do all this automatically without needing manual prompts. However, in order to get consistent performance in a more straightforward manner, you can also use static prompts.

Technique 1: Iterative Dialog

Ever "talk through a problem" to yourself? Either out loud or in your head? What you're doing here is using several neurocognitive techniques to prime your brain to recall relevant facts and procedures to solve a problem or answer a question. Let's lay out a series of possible questions that you might use to approach any such problem and then demonstrate how you can use the ChatGPT API, with it's intrinsic dialog handling capabilities, to approximate the same:

Main Question: Who was emperor during the absolute apogee of Roman power?

Dialog 1: Well, first I need to think about Rome in general. What do I know about Rome that is relevant?

Dialog 2: Next, maybe I need to figure out how I define the answer. What criteria am I looking to judge on?

Dialog 3: Based on all this, what can I answer?

You can see this method implemented in the first experiment technique01_dialog.py. To use this, just run it, ask a question, and you will see the internal dialog process. This is aided by system01_dialog.txt which is not strictly necessary - you could simply use prompt chaining and an ordinary conversation to achieve the same or similar results.

latent_space_activation's People

Contributors

daveshap avatar

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.