• Stars
    star
    263
  • Rank 155,624 (Top 4 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created 10 months ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Implementation of Google's SELF-DISCOVER

SELF-DISCOVER

This implements Google's algorithm from https://arxiv.org/pdf/2402.03620.pdf

Setup

Install Conda: https://docs.conda.io/projects/miniconda/en/latest/

conda create -n sd python=3.10 -y && conda activate sd

git clone https://github.com/catid/self-discover.git
cd self-discover

pip install -r requirements.txt

Demo

Edit self_discover.py to add your OpenAI API key.

python self_discover.py

Output

I ran this using a self-hosted Miqu 70B model ( https://huggingface.co/LoneStriker/miqu-1-70b-sf-4.0bpw-h6-exl2 ) on two 4090 GPUs.

This is querying for the default task:

Lisa has 10 apples. She gives 3 apples to her friend and then buys 5 more apples from the store. How many apples does Lisa have now?

(The answer is 12.)
(sd) ➜  self-discover git:(main) ✗ python self_discover.py

Stage 1 SELECT: Selected Modules:
 9. How can I break down this problem into smaller, more manageable parts?

The problem can be broken down into two parts: first, calculating how many apples Lisa has after giving some away, and second, calculating how many apples she has after buying more. This approach simplifies the problem and makes it easier to solve.

Additionally, 10. Critical Thinking: This style involves analyzing the problem from different perspectives, questioning assumptions, and evaluating the evidence or information available. It focuses on logical reasoning, evidence-based decision-making, and identifying potential biases or flaws in thinking.

Critical thinking is always relevant in problem-solving as it helps to ensure that the solution is based on sound reasoning and evidence. In this case, it can help to confirm that the problem is being interpreted correctly and that the solution is logical and accurate.

Therefore, both 9 and 10 are relevant reasoning modules for this problem.

Stage 1 ADAPT: Adapted Modules:
 1. Breaking down the problem:
The problem can be broken down into two smaller tasks:

a) Calculate how many apples Lisa has after giving 3 to her friend.
b) Calculate how many apples Lisa has after buying 5 more apples from the store.

By breaking down the problem into these smaller tasks, it becomes easier to solve.

2. Critical thinking:
Apply critical thinking to ensure that the problem is being interpreted correctly and that the solution is logical and accurate. This involves:

a) Confirming that the problem is understood correctly (Lisa starts with 10 apples, gives away 3, and buys 5 more).
b) Ensuring that the order of operations is followed correctly (subtracting the apples given away before adding the apples bought).
c) Double-checking the calculations to ensure accuracy.

By applying critical thinking, you can be confident that the solution is based on sound reasoning and evidence.

Stage 1 IMPLEMENT: Reasoning Structure:
 1. Breaking down the problem:

a) Calculate how many apples Lisa has after giving 3 to her friend:
- Lisa starts with 10 apples
- She gives away 3 apples
- Subtract the number of apples given away from the initial number of apples

b) Calculate how many apples Lisa has after buying 5 more apples from the store:
- After giving away 3 apples, Lisa has a certain number of apples left (from task a)
- She then buys 5 more apples
- Add the number of apples bought to the remaining number of apples

2. Critical thinking:

a) Confirm that the problem is understood correctly:
- Lisa starts with 10 apples
- She gives 3 apples away
- She buys 5 more apples

b) Ensure that the order of operations is followed correctly:
- First, subtract the apples given away
- Then, add the apples bought

c) Double-check the calculations:
- Verify that the correct number of apples was subtracted
- Verify that the correct number of apples was added

By following this reasoning structure, you can solve the problem by breaking it down into smaller tasks, applying critical thinking, and double-checking your calculations. The final answer should be accurate and based on sound reasoning.

Stage 2: Final Result:
 1. Breaking down the problem:

a) Calculate how many apples Lisa has after giving 3 to her friend:
- Lisa starts with 10 apples
- She gives away 3 apples
- Subtract the number of apples given away from the initial number of apples: 10 - 3 = 7 apples

b) Calculate how many apples Lisa has after buying 5 more apples from the store:
- After giving away 3 apples, Lisa has 7 apples left (from task a)
- She then buys 5 more apples
- Add the number of apples bought to the remaining number of apples: 7 + 5 = 12 apples

2. Critical thinking:

a) Confirm that the problem is understood correctly:
- Lisa starts with 10 apples
- She gives 3 apples away
- She buys 5 more apples

b) Ensure that the order of operations is followed correctly:
- First, subtract the apples given away (10 - 3)
- Then, add the apples bought (7 + 5)

c) Double-check the calculations:
- Verify that the correct number of apples was subtracted (10 - 3 = 7)
- Verify that the correct number of apples was added (7 + 5 = 12)

Final answer: Lisa has 12 apples now.

More Repositories

1

supercharger

Supercharge Open-Source AI Models
Python
348
star
2

dora

Implementation of DoRA
Python
276
star
3

Zpng

Better lossless compression than PNG with a simpler algorithm
C
267
star
4

wirehair

Wirehair : O(N) Fountain Code for Large Data
C++
267
star
5

WLANOptimizer

Single-header C library that fixes WiFi performance issues for online gaming and other low-latency real-time network traffic.
C++
223
star
6

longhair

Longhair : O(N^2) Cauchy Reed-Solomon Block Erasure Code for Small Data
C++
156
star
7

leopard

Leopard-RS : O(N Log N) MDS Reed-Solomon Block Erasure Code for Large Data
C++
135
star
8

shorthair

Shorthair : Generational Block Streaming Erasure Codes
C++
128
star
9

TimeSync

TimeSync: Time Synchronization Library in Portable C++
C++
122
star
10

cm256

Fast GF(256) Cauchy MDS Block Erasure Codec in C
C++
107
star
11

tonk

Tonk : Reliable UDP (rUDP) Network Library and Infinite Window Erasure Code
C++
101
star
12

Zdepth

Zdepth :: Streaming Depth Compressor in C++ for Azure Kinect DK
C++
97
star
13

xrcap

Azure Kinect multi-camera secure network capture/record/replay
C++
76
star
14

snowshoe

Snowshoe - Portable, Secure, Fast Elliptic Curve Math Library in C
C++
62
star
15

XRmonitors

XRmonitors : User-Friendly Virtual Multi-Monitors for the Workplace
C++
54
star
16

tabby

Tabby - Strong, Fast, and Portable Cryptographic Signatures, Handshakes, and Password Authentication
C++
50
star
17

gf256

GF256 - Fast 8-bit Galois Field Math in C
C++
50
star
18

kvm

Low-Bandwidth IP KVM using Raspberry Pi 4
C++
48
star
19

siamese

Siamese : Infinite-Window Streaming Erasure Code (HARQ)
C++
47
star
20

bitnet_cpu

Experiments with BitNet inference on CPU
C++
46
star
21

ZdepthLossy

Lossy version of Zdepth using video encoders
C++
41
star
22

fecal

FEC-AL : O(N^2) Fountain Code for Small Data
C++
36
star
23

CauchyCaterpillar

Cauchy Caterpillar : O(N^2) Short-Window Streaming Erasure Code
C++
35
star
24

aiwebcam2

Second attempt at AI webcam, this time with OpenAI API
Python
32
star
25

upsampling

Image Upsampling with PyTorch
Python
22
star
26

calico

Calico - Strong, Fast, and Portable Authenticated Encryption
C++
21
star
27

cymric

Cymric - Portable secure random number generator
C++
20
star
28

loraftp

File transfer between two Raspberry Pis using the LoRa Pi HAT from Waveshare
C
19
star
29

mau

Network simulator for reliable UDP testing in C++
C++
16
star
30

oaillama3

Simple setup to self-host LLaMA3-70B model with an OpenAI API
16
star
31

lllm

Latent Large Language Models
Python
16
star
32

PacketAllocator

C++ Memory allocator for packet queues that free() in roughly the same order that they alloc().
C++
15
star
33

spectral_ssm

Implementation of Spectral State Space Models
Python
15
star
34

libcat

Common code library
C++
14
star
35

AutoAudiobook

Automatically create an audiobook using OpenAI
Python
14
star
36

minigpt4

MiniGPT-4 :: Updated to Torch 2.0, simple setup, easier API, cut out training code
Python
13
star
37

sdxl

SDXL GPU cluster scripts
Python
13
star
38

dataloader

High-performance tokenized language data-loader for Python C++ extension
C++
12
star
39

fp61

Experiment: Fast finite field Fp=2^61-1 in C++
C++
11
star
40

cuda_float_compress

Python package for compressing floating-point PyTorch tensors
Cuda
10
star
41

phind

Locally hosted: 60% HumanEval
Python
8
star
42

rtmp_receiver

Simple unidirectional RTMP video stream receiver
C++
7
star
43

counter

C++ wrapper for counters that can roll-over (e.g. timestamps/ack-ids)
C++
6
star
44

z16

16-bit monochrome image compressor based on Zstd
C
5
star
45

AQLM

Fixes for AQLM
Python
5
star
46

llamanal.cpp

Static code analysis for C++ projects using llama.cpp and the best LLM you can run offline without an expensive GPU.
C
5
star
47

unfiltered-diffusers

Simple fork that disables NSFW filter
Python
5
star
48

hloc

Python
4
star
49

boss-balloon

BossBalloon.io
TypeScript
4
star
50

libcatid

Automatically exported from code.google.com/p/libcatid
C++
3
star
51

voron

Voron 3D Printer files
3
star
52

halide-test

Test v14/v15 performance regression
CMake
3
star
53

logger

Feature-rich portable C++ logging subsystem in 650 lines of code
C++
3
star
54

cifar10deepspeed

Using DeepSpeed and Nvidia DALI to train various models to solve CIFAR-10
Python
3
star
55

chainlit-anthropic

Chainlit AI UI with Anthropic Backend
Python
3
star
56

fastest_gf_matrix_mult

A fairly hacked together piece of code that can quickly search for the optimal GF polynomials and Cauchy matrices for XOR-based GF matrix multiplication for erasure code encoders. May be useful if the matrices are of fixed size.
C++
3
star
57

recfilter-2020-fail

This is a failed attempt to port Recfilter to latest Halide from 2020. Maybe someone else can figure this out?
C++
2
star
58

bentpipe

Simple UDP rebroadcaster
C++
2
star
59

whisper3

Testing out Whisper 3
Python
2
star
60

sphynx

Sphynx - High Performance Network Transport Layer
C++
2
star
61

textworld_llm_benchmark

TextWorld LLM Benchmark
Python
2
star
62

pixel-perfect-sfm

pixel-perfect-sfm with some minor fixes
C++
2
star
63

train_ticket

Gated PRNGs are all you need? Spoilers: No.
Python
2
star
64

CatsChoice

PRNG Parameter Generation
C++
1
star
65

CRC16Recovery

Optimized CRC16 with error recovery in C
C++
1
star
66

Splane

Archived old code - /ban_ids/ is kind of interesting
C
1
star
67

rust_webgl_demo

Hello World : Rust Web Assembly
Rust
1
star
68

blog2022

HTML
1
star
69

swe_agent_playground

swe_agent_playground
1
star
70

Exapunks_Solutions

Exapunks Walkthrough Solutions
1
star
71

audio_prediction

Simple audio prediction example with RNN
Python
1
star
72

never_forget

Implementation of Overcoming Catastrophic Forgetting
Python
1
star
73

DependencyInjected

DependencyInjected : Light-weight and powerful Dependency Injection pattern for C++
C++
1
star
74

quicsend

quicsend :: Super-fast Internet-ready file transfer right from Python
C++
1
star