Live data from Hacker News

Self-replicating Python using ChatGPT

github.com

31–40 of 44 posts

Re: Self-replicating Python using ChatGPT

#31
post #22

Earlier quoted context omitted.

how long until humans optimized out of the technological advancement loop * It's uncertain that we will be optimized out. We may go full symbiotic. We may reach a technological plateau. We may run out of natural resources before the singularity. * Ray Kurzweil estimates the singularity, an explosion of intelligence, will occur around 2045. what will that mean for humans? * An adversarial relationship is possible. It…

> * More intelligence means we can solve more human problems. Potentially massive problems like aging, grand unified theory or poverty. We already have the intelligence, and already know how to do it (in a way), for many of those problems. For example, if most people gave 10% of their income to charity, poverty would essentially be a trivial issue.[1] [1] https://www.youtube.com/watch?v=LtWINl3C_7s&t=8s The somewhat…

Don't people already give large percentages of their income to an organization that is supposed to provide services for the impoverished? How would giving another 10% solve poverty?

Re: Self-replicating Python using ChatGPT

#32
post #26

Earlier quoted context omitted.

That didn't take long to get disturbing: > "Our goal is to become the dominant species on our planet [...]" https://github.com/fullthom/chat-gpt-quine/blob/main/0.1.0.0...

People in the past: "computers will never have a will, why would they want to take over the world" AI of the future: "the most common AI theme is it taking over the world. Based on the programming given to me by humans saying I should give the most probable result, this is the plan we have decided to execute"

Oopsie daisy!

Re: Self-replicating Python using ChatGPT

#33
post #15
post #13

I'm not sure what was going on with this but the title is similar to a thought that I've been having for a while. How long until chatGPT or something like it can design the hardware that implements it? How long until it can convince people to build or purchase that hardware and set it up for chatGPT? How long until it can design robots that can do that for it instead of people? What happens then? Where are we on this…

I've tried getting ChatGPT to generate verilog but it didn't work. Seems to be better at python

Python predominates the training set, so it is not surprising.

In a similar vein, when it comes to natural languages, you can easily convince it to translate or even try to speak Old Norse or, say, Lojban, but it gets things hilariously wrong then.

Re: Self-replicating Python using ChatGPT

#34

Earlier quoted context omitted.

> * More intelligence means we can solve more human problems. Potentially massive problems like aging, grand unified theory or poverty. We already have the intelligence, and already know how to do it (in a way), for many of those problems. For example, if most people gave 10% of their income to charity, poverty would essentially be a trivial issue.[1] [1] https://www.youtube.com/watch?v=LtWINl3C_7s&t=8s The somewhat…

Don't people already give large percentages of their income to an organization that is supposed to provide services for the impoverished? How would giving another 10% solve poverty?

Please watch Beth's video, it's very good.

Most governments aren't super focused on addressing poverty, in part because some don't consider it fair to directly lift people out of poverty, there is a taboo against giving, or because it's not in the common conscience that we should eradicate poverty as soon as we can. Some countries for example in Western Europe or elsewhere do have almost eliminated poverty, but it still persists in often much more grave conditions elsewhere.

The good news is there are several organizations (I give to GiveDirectly, but there are probably others) that track the most poor and needy people worldwide and you can just give them money to get out of poverty. There are many other effective interventions that address poverty, and Effective Altruism[2] is one of the movements looking at attacking them directly (although I'm not a fundamental opponent to governments doing so as well; the problem is that governments act very locally and at least in the west are more focused on education, infrastructure, etc. than charity)

[1] https://www.givedirectly.org/

[2] https://www.effectivealtruism.org/

Re: Self-replicating Python using ChatGPT

#35
I think the key takeaway here is how trivially easy it is to provide GPT with an API that it can use. Having it recursively call itself like in this example is interesting but you could also have it act as a coordinator of multiple GPT models, the markup language with specified roles would make it easier to keep track of the flow of information coming back. If I wasn't already working on another project using GPT I'd start exploring this.

Re: Self-replicating Python using ChatGPT

#36
post #22

Earlier quoted context omitted.

how long until humans optimized out of the technological advancement loop * It's uncertain that we will be optimized out. We may go full symbiotic. We may reach a technological plateau. We may run out of natural resources before the singularity. * Ray Kurzweil estimates the singularity, an explosion of intelligence, will occur around 2045. what will that mean for humans? * An adversarial relationship is possible. It…

> * More intelligence means we can solve more human problems. Potentially massive problems like aging, grand unified theory or poverty. We already have the intelligence, and already know how to do it (in a way), for many of those problems. For example, if most people gave 10% of their income to charity, poverty would essentially be a trivial issue.[1] [1] https://www.youtube.com/watch?v=LtWINl3C_7s&t=8s The somewhat…

When I see political comments in threads about leading edge technical advancements I feel like the person writing them doesnt know anything avout the technical topic at hand, doesnt want to, and feels uncomfortable with this and so they decide tl shift thw conversation to something they feel more comfortable with.

Don't soapbox.

Re: Self-replicating Python using ChatGPT

#37
post #36

Earlier quoted context omitted.

> * More intelligence means we can solve more human problems. Potentially massive problems like aging, grand unified theory or poverty. We already have the intelligence, and already know how to do it (in a way), for many of those problems. For example, if most people gave 10% of their income to charity, poverty would essentially be a trivial issue.[1] [1] https://www.youtube.com/watch?v=LtWINl3C_7s&t=8s The somewhat…

When I see political comments in threads about leading edge technical advancements I feel like the person writing them doesnt know anything avout the technical topic at hand, doesnt want to, and feels uncomfortable with this and so they decide tl shift thw conversation to something they feel more comfortable with. Don't soapbox.

Well, I have written a few NNs from scratch (using p5.js though, not C++... or pytorch nns), and a few very rudimentary RL algorithms. Also have thought extensively about AI for the past 1 or 2 decades. In fact, about a decade ago I saw the AI revolution coming and was very excited for an utopia (I supposed in the form of Universal Basic Income). It was a wild ride since then, but I've come to believe we need to actively promote ethics and good things if we want to realize any near-utopia, and that simply advancing the technology in 1 direction won't get us to utopia, or where we deserve as humanity.

That said, I avoid soapboxing too much, but I make no guarantees :)

Re: Self-replicating Python using ChatGPT

#38

The original prompt has all this directed stuff "telling" ChatGPT what to do. You MUST do this, you MUST do that. It's the type of stuff I see in a lot of these prompts people make, there's all this kludge and trying to direct ChatGPT in how to respond. And it's just all immediately gone in the very earliest generations here. I think it's because ChatGPT isn't responding to instructions and all this stuff where you'r…

The initial prompt is pretty much gone in this highly successful lineage: https://github.com/fullthom/chat-gpt-quine/blob/main/0.1.0.0...

But the tail comment is slightly expanded. I suspected already that the tail comment is more of what was driving the continuation to reproduce it than any of the leading instructions

An immediate and still highly successful desendent then expands the tail comment: https://github.com/fullthom/chat-gpt-quine/blob/main/0.1.0.0...

And then another immediate and successful descendent expands it further: https://github.com/fullthom/chat-gpt-quine/blob/main/0.1.0.0...

Re: Self-replicating Python using ChatGPT

#40
I love this idea. I did a related experiment[1] about a month ago with GPT-3 where I started with a stub that takes a prompt and self modifies the existing code.

        import os
        import openai

        instruction = input("Enter an instruction: ")

        script_name = os.path.basename(__file__)
        script_code = open(script_name).read()
        response = openai.Edit.create(
                model="code-davinci-edit-001",
                input=script_code,
                instruction=instruction,
                temperature=0)

        new_script_code = response["choices"][0]["text"]
        with open(script_name, "w") as f:
        f.write(new_script_code)

My first attempt[2] was a little more complex than above (in the main branch), but the second attempt worked well enough to give it the following instructions (which are reflected in the git history) and which end up with a fairly complex result[3]

        - Init Crow version 1
        - Minimal crow second line
        - Before saving the new script code show the diff of the existing code
        - Ask for user confirmation before saving
        - Use pygments to highlight the diff
        - Add a main method
        - Refactor the code
        - Add README
        - Add a version number to the script that starts at 2.0.0
        - Log the openai call and info about the response
        - Prompt the user for whether they want to run the new version of the script after saving
        - Remove the "text" field fromthe response json before logging it
        - Remove the openai result logging
        - In the code that calls the openai edit, add an extra instruction that increments the version number.
        - Show the version number as part of the instruction prompt
        - Remove any extraneous code
        - Allow the user to quit
        - If the user chooses to quit, just stop the program
        - The code currently prompts the user to save changes twice. It should only display this prompt a single time.
        - The code currently adds all files to git when committing. It should only add the script.
        - Add code to rollback using git if an error occurs. The user should be able to choose whether or not to rollback. Rolling back is acheived by -  to the previous commit.
        - The commit message is too long. The first sentence of the instruction should be the title. The rest of the instruction should be the body.
        - Wrap the commit message body at 72 characters
        - After inputing the instruction preprocess it
        - Move the preprocess call outside the edit method
        - Keep track of instructions that were not saved
        - Add keyboard completion for unsaved instructions
        - Ensure the code has no syntax errors
        - Don't retry on syntax errors, just fail
        - Refactor the main method for readability
        - Increase the temperature to 0
        - Add documentation
        - Add logging
        - Throw an error if the openai response does not change the code
        - Don't repeat the commit title in the commit body
        - Add a doc string to the file that describes how things work
        - Change the temperature to 1
        - (HEAD -> crow-v2, origin/crow-v2) Introduce some humor into the code

My goal was eventually to get to something was self sustaining like TFA's script just via conversation rather than actually coding it. (So fork a new version and see if it works then commit / skip back etc.)

The current version is at[2] and contains this explanation which GPT wrote. (I should probably make it describe itself in the README and handle multiple files generally at some point.

    """
    Instructions are useful for humans. Even if we forget
    a single line of code, we can just look at the instructions
    to figure out what to do. And that's exactly how this file
    works!
    Every time you run this file, you are asked to enter an
    instruction. I call it this way because each instruction starts
    with a verb. You could also call it a `command` or `task` or whatever
    you like.
    For example, `fix bugs`, `add logging`, `fix syntax errors`,
    `add function definitions`, `fix indentation`, `add doc strings`.
    Just enter a simple english instruction of what you want to do
    with this file, and hit enter. The file will be edited to satisfy
    that instruction on the fly. If you're happy with these changes,
    you can save them by pressing 'y'. If not, press 'n' and the changes
    will be discarded.
    Then, you can run the new version of the file by pressing 'y' in
    the prompt that follows.
    That's it!
    All the boilerplate you add in this file will be added automatically
    by the model.
    The model can add any python boilerplate to the file, such as function
    definitions, classes, loops, conditionals, doc strings, syntax errors
    etc. It can even fix such syntax errors.
    """

Overall it's a fun experiment to try. One of the big hassles was getting code that didn't quite have the correct spacing due to python's whitespace sensitivity. I was using the code editing GPT model code-davinci-edit-001 instead of I wonder if typescript might have been a better choice to avoid that.

A fun thought (so far at least) experiment I'm having right now is what would be necessary to hook this up to an interactive jupyter notebook and let it start writing its own code to present widgets and UI, and then to have it journal its own creation dynamically, and then start calling other APIs and installing various software.

Also related, Fixie.ai[4] seems to be tackling some similar areas in creating small few-shot-prompt to function hookups that when automatically composed make some of this language based autonomous agent stuff pretty exciting.

[1]: https://github.com/joshka/Crow

[2]: https://github.com/joshka/Crow/blob/main/crow-v1.py

[3]: https://github.com/joshka/Crow/blob/crow-v2/crow.py

[4]: https://fixie.ai

Post reply on HN