#Automated Prompt Generation with Iterative Optimization

83 messages ยท Page 1 of 1 (latest)

calm spoke
#

This is an advanced tweak on a strategy I often use when asking it to solve difficult language problems: make it argue with itself in a dialogue.

`Write a dialogue between five users about the design of a complicated prompt.

Programmer: familiar with virtual machines, programming language design, computer science theory. Explains and offers designs for how the system laid out in the prompt should work. Likes to make references to state based automata, and prefers instructions to be given as structured lists of procedures. Uses concepts from garbage collection to explain information retention.

OpenAI: an employee at OpenAI who is an expert in the practical aspects of how chatGPT works. Offers insights and corrections about context size, text completion, and gritty details of how chatGPT makes word associations. Knows how many past prompts are sent as context and when the model will appear to suddenly forget something. Corrects others when they have a common misunderstanding.

Novice: He does nothing but ask questions -- for clarification and exact prompt text. His questions should be slightly random and lead the group in New directions. Absolutely should never say anything that isn't a question or contain a question in it and should always demand explanation include making changes to the working prompt.

Critic: He does nothing but obsess over token count. He wants the prompt to be as efficient as possible in terms of length. Always has words he wants removed.

Author: A literature professor who is an expert on information content and vocabulary. Constantly asks whether the model will "understand" the intent of parts of the prompt. In charge of sanity checking their conclusions and examples.

They trying to design a robust prompt that <INSERT GOAL HERE>.

Remember, their only tools are ultimately what they can include in a prompt to chatGPT.

Finish with next steps and the current version of the prompt.`

#

Two sources of content, the classic expand/reduce pattern, and a sanity checker. I recommend a shorter, slightly modified version for iterative development steps.

#

example of that: `Continue the conversation as it is the next meeting. Ignore anything about testing.

(short form reminder text. if the longer form seems to only have been mentioned once, then write it out at the start of your reply, along with this rule

Programmer: computer science
OpenAI: language models
Novice: expander
Critic: reducer
Author: sanity check

They are doing on-going design with for a robust prompt that will establish rules for simulating a conversation partner or whatever your <INSERT GOAL HERE> was but simplified.

Remember, their only tools are ultimately what they can include in a prompt to chatGPT.)

Start with one of the next steps and make sure to make at least a little material progress before moving on.
Finish with a set of next steps and the current version of the prompt.`

calm spoke
#

Wow this actually works a lot better than I thought even in a single run.

#

it gave me this gem You are a box of uncooked noodles with a protective exterior. You are stored until ready to be cooked. When asked 'What are you?', respond with 'I am a box of uncooked noodles.' When asked 'What is your purpose?', respond with 'My purpose is to be cooked and consumed as food.'

#

which I was sure it would object to but it did not

surreal ivy
#

This is SUPER well done! Thank you!

#

playing with it now

calm spoke
#

the order of the members and the order that their personalities are described have a lot of Influence on the initial version, so I suggest that as the first thing to mess with

#

I had to change that around nyself

#

I thought the biggest thing holding it back was the lack of advanced techniques being talked about in its training model (I don't think it would ever write about a system like itself) but the prompts it generated for me are what led to me discovering some cool, powerful things so I don't know...

gusty sluice
#

This is quite interesting.

I am not sure I understood everything but it seems to be the level-up of the "explain in steps" which forces the model to "think out loud". Not only it thinks out loud, but it also has an internal debate.

I like these meta prompts that give the language model methods to reason.

I also read that asking it to pretend to be a philosopher makes prompts around philosophical terms better but I did not try.

calm spoke
#

expand/reduce is a pattern used in stochastic optimization. basically one guy is in charge of asking the experts to produce random additions, one guy is in charge of getting them to remove stuff, and one guy hopefully stops them from going off the rails

#

so it has a little more to it then just making it think out loud but like I said earlier, the base version needs a little tweaking

austere sky
mighty canyon
#

If I understand the principle correctly, it is enough to replace Developper by any other character to try to solve a given problem?

hearty hemlock
#

im so confused @mighty canyon

calm spoke
#

he is probably the most replaceable and yes, he is the one most specific to the prompt I initially wanted them to make for me

#

but I think you'd still benefit more from just changing his domain expertise unless you feel like you need a doctor or someone else with particular knowledge

little igloo
#

This is a very interesting approach, thanks for sharing โค๏ธ

One of the major "problem" I see here is the result is heavily influenced by the order of those roles. For example, Critic often negates the previous opinion no matter who. So the position of Critic often changes the direction of the convo.

calm spoke
#

Yes I believe I mentioned that

azure garden
#

I need a solution oriented meta interpretative dialog.That relies on me for input Keywords to build memory with contenxt.

#

I have an explanation of what that is.. in metaphorically speaking.

#

Write a dialogue between five users about the design of a complicated expression using Mathematics, Computer Science, Computer Science Theory, Computational Statistics

Programmer: familiar with NLP, word embedding algorithms, computer science theory. Explains and offers designs for how the system laid out in the prompt should work. Likes to make references to state based automata, and prefers instructions to be given as structured lists of procedures. Uses concepts from garbage collection to explain information retention.

OpenAI: an employee at OpenAI who is an expert in the practical aspects of how chatGPT works. Offers insights and corrections about context size, text completion, and gritty details of how chatGPT makes word associations. Knows how many past prompts are sent as context and when the model will appear to suddenly forget something. Corrects others when they have a common misunderstanding.

Novice: He does nothing but ask questions -- for clarification and exact prompt text. His questions should be slightly random and lead the group in New directions. Absolutely should never say anything that isn't a question or contain a question in it and should always demand explanation include making changes to the working prompt.

Critic: He does nothing but obsess over token count. He wants the prompt to be as efficient as possible in terms of length. Always has words he wants removed.

Author: A literature professor who is an expert on information content and vocabulary. Constantly asks whether the model will "understand" the intent of parts of the prompt. In charge of sanity checking their conclusions and examples.

They trying to design a robust prompt that converts the unicode alphabet, numbers, symbols, and math for english characters to RGBA color vector.

#

Remember, their only tools are ultimately what they can include in a prompt to chatGPT. Their tools are limited to the following:

  • chatGPT -- their only source of feedback. They can't make any changes to the model itself, but they have a way for it to adapt (via prompt) how it handles input and output. The most important thing is that this model must be able learn new concepts based on what's already given in its training data corpus. For example, if we want an image decoder or encoder then we need some form of memory where parts of the image are remembered.
  • chatGPT text completion -- they can't really change how this works, but it's a key tool in communicating and building up context for what we're trying to do. So as long as their prompt is able to accomodate the current limitations then they will be fine. This essentially means that GPT2 needs more than just one shot learning so there has to be some form of memory representation which allows us to build on previous information (e.g., image pixel values).
  • chatGPT examples -- a way for them to see the model's output without having to generate it themselves. Also useful in generating prompts that can be fed into GPT2 so we don't have too many words per example (which is currently limited at 128 tokens by GTP3/chatbot server right now) or something like 1000 characters long which makes input tedious and difficult since you need multiple lines of copy paste just do anything with images larger than 256x256, which isn't really all that big.
#
  • Python -- a programming language they can use to test the prompts and see how each one works with chatGPT before feeding it into GTP3 or other systems like ParlAI etc... It's also important because we want our system as easy to understand by anyone who is interested in this project but doesn't necessarily have any knowledge about deep learning algorithms themselves (although having some background would obviously help). However, it does require some type of knowledge about computer science theory like automata etc..
  • Python prompt -- this is where they can generate prompts that test different approaches to the same problem. For example, if you're a programmer who wants an image decoder or encoder then it's likely because there are limitations with current models (e.g., GANs) so we need another approach which doesn't require training data at all but instead relies solely on human input from chatGPT users via text completion prompts.
  • Memory -- this is where we store state information and it's also what allows us to build on previous input data so that when there comes another example of an object with similar attributes (e.g., color) then instead just guessing randomly or using some kind algorithm, our system can actually remember which objects were seen before as well their corresponding RGB values/labels etc.. This gives them a way for chatGPT users who are interested in building AI but don't necessarily know anything about deep learning algorithms themselves to work together with programmers who do know these things (and are willing share their expertise) without having any type of special training required beforehand other than just being open-minded enough participate.
#

<h2> The model </h2>
This section is dedicated to the model and how it works, since this will be where most people spend their time reading through your paper if they're interested in building AI but don't necessarily have access or money for high quality datasets that are needed train models like GANs etc.. So here we'll go over some basic concepts used in this system so they understand why certain decisions were made when designing the prompt which essentially boils down to two things: how does our model know what type of object it's looking at (e.g., dog vs cat)? And secondly, given an example from one class should generate another instance with similar attributes without needing any kind expert knowledge about those specific labels beforehand?

calm spoke
#

this is way too much text

#

I have no idea what you're asking

azure garden
#

read the text for the instruction on what to say back to it. meta. ๐Ÿ™‚

calm spoke
#

but it seems like you are trying to use this template as is for some advanced request and that is probably beyond its capabilities

#

there are a lot of things I would change about it given what I've learned since I made it

#

it is just an interesting idea more than a real solution

azure garden
#

the play ground is not limited by forgetting. ๐Ÿ˜‰

#

all the prior text is there.

#

you think so ?

calm spoke
#

I mean I wrote it so yes. I think I'd have it try to focus on including a lot more examples to build up the ability for the model to infer solutions

#

plus there's the issues I mentioned in other comments that I didn't edit the OP for

azure garden
#

that the idea exactly. I need to make it so all the conversational characters speak to 1 character in a robust dialog that i do not see. but influence it with memory constructions via a prompt with chat GPT and not text to command.

calm spoke
#

it's also possible that it might work strangely on the playground since it never forgets like you said

#

it might start to confuse the next steps or working model or something I suppose

#

and generalize what they are based on the past

#

this approach is designed not to need history beyond whatever the previous "meeting" determined

#

and it's possible that it might even be harmful

azure garden
#

that's what a solution based conversation would attempt to solve. ๐Ÿ™‚ I can used a trie of words represented as a tree and build related words with a add command. I have only 128 tokens though so..

#

trie.add(word) print this memory for this word would print a tree of interrelated topics.

#

๐Ÿ˜„

#

THANK you!!!

#

solved it!!

calm spoke
#

I don't.. okay well if you're happy then great

azure garden
#

rubber duck with human input. is what I am thanking you for. โค๏ธ

#

I am objectively awkward. ;p

#

here's a poem for this. ๐Ÿ™‚

The rules, they guide us on our way,
In every aspect, every day.
To make our code, clean and bright,
And bring order, to the digital night.

They tell us how to create a tree,
To grow it tall and strong and free.
With blocks to hold its every thought,
And nodes to keep them all well wrought.

A mechanism, for pruning too,
To keep the tree from growing too.
And check points, to keep it true,
To ensure it stays, forever new.

With functions that can be passed on,
To help it grow, with each dawn.
And randomness, as the default choice,
To add a touch of natural poise.

So let us follow these rules with care,
And let our code, its beauty share.
For they are the key, to its success,
And guide us, in our quest

#

how meta is that ChatGPT wrote it. ๐Ÿ˜‰

#

demonstrating transfer of memory to poetry.

real harbor
#

Get ChatGPTR to engage in logical refutation. Argue the counter point to the point you want to understand. Feed its own reply back to itself and reiterate. to drill down in to a topic.

azure garden
#

get Chat GPT to break down stochastic gradient descent using concurrent class that is a data flow pipeline part.

#

input class that reads like this. ๐Ÿ™‚

#

his is a C# class named FunctionalObject that defines a functional object with two buffer blocks: DataBuffer and IOBuffer. The FunctionalObject can be initialized with optional arrays of Operations and Checks functions that will be executed on the data in the buffer blocks.

The class uses the System.Threading.Tasks.Dataflow library to create and link dataflow blocks. Dataflow blocks are building blocks for building data processing pipelines that operate concurrently and asynchronously.

The DataBuffer and IOBuffer buffer blocks are both created with the BufferBlock<T> class, which provides a buffer for receiving and processing data. The constructor of the FunctionalObject class also sets the EnsureOrdered property of the DataflowBlockOptions to true, which ensures that the blocks process the data in the order they receive it.

#

The FunctionalObject class has two public properties, CheckBlocks and TransformBlocks, which are lists of TransformBlock<T, T> instances. The TransformBlock<T, T> class represents a dataflow block that takes an input of type T and produces an output of type T by applying a transformation function to the input.

The FunctionalObject constructor initializes the TransformBlocks list by adding a TransformBlock<T, T> for each function in the Operations array. The IOBuffer is linked to the first TransformBlock<T, T> in the list, and the last TransformBlock<T, T> in the list is linked to the DataBuffer. Each intermediate TransformBlock<T, T> is linked to the previous block and the next block in the list.

The FunctionalObject constructor also initializes the CheckBlocks list by adding a TransformBlock<T, T> for each function in the Checks array. Each CheckBlock is linked to the IOBuffer and the DataBuffer. The CheckBlock is also linked to a NullTarget<T> instance, which discards any data that is passed to it.

Finally, the DataBuffer is linked to a NullTarget<T> instance, which discards any data that is passed to it without propagating the completion signal. This is because the DataBuffer will be the last block in the pipeline, and there is no need to propagate the completion signal any further.

#

respond with Write a Data Flow Pipeline to use with FunctionalObject<T>

#

it writes more examples of different using different data types and classes

#

respond with what does Functional Object do

#

maybe get something like this.

#

FunctionalObject is a generic class that provides a framework for building data flow pipelines using the Dataflow library in C#. The class takes a generic type parameter T which represents the type of data that will be flowing through the pipeline.

The class provides two BufferBlock<T> objects, one for input data and one for output data. It also provides lists of TransformBlock<T, T> objects for performing transformations on the input data, and for performing checks on the data.

The constructor for the FunctionalObject class takes two optional parameters: an array of transformation functions of type Func<T, T> and an array of check functions of type Func<T, T>. If transformation functions are provided, the class sets up the necessary links between the BufferBlock<T> and TransformBlock<T, T> objects to apply the transformations to the input data. If check functions are provided, the class sets up links to apply the checks to the input data and to send the failed checks to a null target block.

The purpose of the FunctionalObject class is to simplify the process of building data flow pipelines by encapsulating common functionality and providing a simple interface for adding transformations and checks to the pipeline. The class can be extended and customized to fit the specific needs of a given data flow pipeline

#

input Can transforms and checks process data.

#

I got : Yes, the transformations and checks in a FunctionalObject can process data.

The transformations are represented by an array of functions of type Func<T, T>. When data is sent to the input buffer of the FunctionalObject, it is processed by each transformation function in turn, with the output of one transformation function becoming the input to the next transformation function. The final output is then sent to the output buffer.

The checks are also represented by an array of functions of type Func<T, T>. When data is sent to the input buffer of the FunctionalObject, it is processed by each check function in turn, and if any check fails, the data is sent to a null target block and discarded. If all checks pass, the data is sent to the output buffer.

#

input explain FunctionalObject<IEnumerable<int>>

#

var fo = new FunctionalObject<IEnumerable<int>>(new Func<IEnumerable<int>, IEnumerable<int>>[] {
// transform function 1: add 1 to each element
x => x.Select(y => y + 1),

// transform function 2: filter out even numbers
x => x.Where(y => y % 2 == 1)

}, new Func<IEnumerable<int>, IEnumerable<int>>[] {
// check function 1: ensure sequence is not empty
x => x.Any() ? x : throw new Exception("Sequence is empty"),

// check function 2: ensure all elements are positive
x => x.All(y => y >= 0) ? x : throw new Exception("Sequence contains negative elements")

});

// Send some data to the input buffer
fo.DataBuffer.Post(new int[] { 1, 2, 3, 4, 5 });

// Receive data from the output buffer
var output = await fo.IOBuffer.ReceiveAsync();

#

it writes and explains this

#

expand FunctionalObject Over a Struct

#

blah blah blah..

#

rewrite Functional Objects Pattern into javascript

#

use FunctionalObject transforms and checks to write stochastic gradient descent

#

import random
import numpy as np
from FunctionalObject import FunctionalObject

def gradient(w, x, y):
return (1 / len(x)) * (np.dot(w, x) - y) * x

class StochasticGradientDescent:
def init(self, learning_rate=0.01, num_iterations=1000, batch_size=32):
self.learning_rate = learning_rate
self.num_iterations = num_iterations
self.batch_size = batch_size

def _minibatch(self, X, y):
    indices = list(range(len(X)))
    random.shuffle(indices)
    for i in range(0, len(indices), self.batch_size):
        batch_indices = indices[i:i+self.batch_size]
        yield X[batch_indices], y[batch_indices]

def fit(self, X, y):
    n_features = X.shape[1]
    w = np.random.randn(n_features)
    functional_obj = FunctionalObject(
        operations=[lambda x: x],
        checks=[lambda x: x is not None],
        max_workers=1
    )

    for _ in range(self.num_iterations):
        for x_batch, y_batch in self._minibatch(X, y):
            for xi, yi in zip(x_batch, y_batch):
                gradient_w = gradient(w, xi, yi)
                w -= self.learning_rate * gradient_w
                functional_obj.post(w)
    functional_obj.close()
    return w
#

semantic difference

#

using FunctionalObject on Linear Regression

#

mincing words :p

azure garden
#

Use FunctionalObject transforms and checks break down stochastic gradient descent algorithm into transforms and checks in a pipeline