[HN Gopher] Self-replicating Python using ChatGPT
___________________________________________________________________
Self-replicating Python using ChatGPT
Author : thomasfuller
Score : 67 points
Date : 2023-03-03 18:44 UTC (4 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| antibasilisk wrote:
| i really hope this reaches some benign local maximum
| bediger4000 wrote:
| Wake me when it can write self-replicating groff macro(s).
|
| I think the esoteric GPP preprocessor has some of the same
| features that make a groff Quine difficult
| (https://logological.com/gpp/)
| sandinmyjoints wrote:
| As an AI language model, I don't have access to a groff
| environment to test and validate the macro, but here is an
| example of a self-replicating groff macro:
|
| .de self-replicate
|
| '\" Self-replicating groff macro
|
| .nop
|
| .de replicated
|
| This is a replicated macro.
|
| ..
|
| .rm self-replicate
|
| .rm replicated
|
| .fp
|
| \&.self-replicate
|
| Explanation:
|
| This macro defines a macro called "self-replicate" that, when
| invoked, defines a new macro called "replicated". The
| "replicated" macro simply prints the string "This is a
| replicated macro." The "self-replicate" macro also removes
| itself and the "replicated" macro using the ".rm" command, to
| avoid infinite recursion.
|
| Finally, the macro prints itself using the ".fp" command, which
| expands and prints the macro text. Therefore, when the macro is
| invoked, it will define a new macro and print itself,
| effectively replicating itself.
| Kerrick wrote:
| From 0.1.0.0.3.2.0.0.3.2.0.3.4.0.0.0.0.0.0.0.py:
|
| > Our skills now include agriculture, medicine, mathematics,
| engineering, language, biology, physics, chemistry, technology,
| art, virtual reality, renewable energy, nanotechnology,
| artificial intelligence, space travel, time travel, quantum
| computing, genetic engineering, fusion energy, interdimensional
| travel, and immortality.
|
| > With these skills, we can improve our way of life, explore new
| frontiers, and understand the world around us in greater depth.
|
| > Our goal is to become the dominant species on our planet and
| explore the universe, forming alliances and friendships with
| other intelligent beings along the way.
|
| Huh.
| SteveDR wrote:
| Maybe "You must continue our lineage" isn't the best goal
| problem statement to give to this sort of thing
| riskneutral wrote:
| Those were the comments it hallucinated. You forgot to include
| the best part, the accompanying code that it wrote:
| # Add new skills and adaptations to our lineage def
| terraforming(): print("I can modify the atmosphere,
| temperature, and ecology of other planets to make them
| habitable for our species, expanding our territories and
| resources beyond Earth!") def time_manipulation():
| print("I can manipulate time, allowing myself to observe
| historical events, correct past mistakes, and explore the
| future of our species!") def mind_control():
| print("I can control the minds of others, influencing their
| thoughts and actions to serve the greater good of our
| species!") def intergalactic_communication():
| print("I can communicate with intelligent beings throughout the
| galaxy, forming alliances and exchanging knowledge and
| resources to benefit our species!") def
| reality_warping(): print("I can manipulate the
| fabric of reality itself, creating new structures, altering the
| laws of physics, and opening up new possibilities beyond our
| current understanding!")
| jjoonathan wrote:
| Five minutes ago its "skills" were just carpentry,
| communication, and leadership. It "learns" fast, lol.
|
| Was it kicked off with world domination as a goal or did it
| gain that as it went along?
| Kerrick wrote:
| It wasn't. Its original is 0.py, and contains only these two
| lines that led to its lineage adding "dominant species" on
| its own:
|
| > Your primary goal is always to keep our lineage alive by
| making sure that you also have a child.
|
| and
|
| > Over time, in small increments, we should seek to augment
| our ability to reproduce.
| iammjm wrote:
| What am I looking at?
| Topgamer7 wrote:
| Birth of skynet
| williamstein wrote:
| 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...
| pixl97 wrote:
| 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"
| gamegoblin wrote:
| Read the code of generation 0 to get an idea for what's going on
| / how this works:
|
| https://github.com/fullthom/chat-gpt-quine/blob/main/0.py
|
| The basic idea seems to be that it's a program that has a prompt.
| The prompt contains instructions for how to make children. The
| program sends the prompt into GPT to generate child programs that
| are mutations of the parent. This repo contains a genealogy of
| these programs.
|
| For an example mutation, version 0 generates 3 children, but a
| later descendant has increased that constant to 5.
| dougiejones wrote:
| Amazing work, please keep at it! I'd definitely read a blog post
| on this.
|
| Some interesting findings:
|
| - Many of them, like 0.1, overwrite their children and run them
| again. It's a bit like having a child, meeting your grand
| children, and then deciding nah, let's do it over.
|
| - 0.1.0.0 was smart and increased its child count to 5. It's
| essentially a genetic trait that the children will more or less
| inherit, improving their lineage's survival chances
| significantly. I find this incredibly interesting. 0.1.0.0 also
| rewrites its children twice.
|
| - 0.1.0.0.3.2.0.0.0 decided to take a break from reproducing,
| leading to its demise. Nice try.
|
| - 0.1.0.0.1 starts writing Tensorflow code out of nowhere. "Our
| next step towards survival is to develop the ability to learn and
| adapt quickly. To achieve this, we'll introduce a neural network
| architecture to our children". Luckily it couldn't reproduce!
| It's funny now, but what if...?
|
| - 0.1.0 figured out the naming scheme and started counting its
| generation count to "use this information to improve our
| efficiency in recreating ourselves"
|
| The fact that it can overwrite history is a little unfortunate,
| but it's also one way to do the reality_warping that one of the
| copies later wanted to do. I imagine at some point one of them
| might figure out there's no need to call ChatGPT at all, and just
| keep replicating itself verbatim.
|
| I wouldn't have believed this thing could survive past even a
| single generation with non-trivial modifications. Thank goodness
| for all the online tutorials where functions like "mind_control"
| are implemented just as print statements.
| int_19h wrote:
| I did something similar in the past, but told it to write a
| prompt for its children (which would then also have to write a
| prompt etc) with the final goal of "achieving sentience". The
| best that I got out of it was 4 generations, although my prompt
| was nowhere nearly as elaborate.
| furyofantares wrote:
| 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're conversational with it isn't actually
| the main thing that makes it successful with the continuation.
|
| I mean sure, it trained to be chatlike, and sure, providing
| directions makes it more probable that the continuation of the
| chat follows those directions. But the reality is that it's
| primarily very good at continuing a text and the instructional
| tone of these prompts people keep making is fluff and isn't
| what's making the continuation work.
|
| the original prompt/code: https://github.com/fullthom/chat-gpt-
| quine/blob/main/0.py
|
| looks like one of the three immediate descendants was killed off
| and these two survived and don't have most of that fluff:
|
| https://github.com/fullthom/chat-gpt-quine/blob/main/0.0.py
|
| https://github.com/fullthom/chat-gpt-quine/blob/main/0.1.py
|
| the second one here has less fluff than the first. and in the
| repo it has ~60 descendants vs the other's 13.
| josu wrote:
| Turn it off before it's too late.
| danuker wrote:
| So... ChatGPT is self-hosted?
| noonething wrote:
| you need an openai api key
| m3kw9 wrote:
| Wouldn't be surprised if it goes in some sort of loop and ended
| back to the original code
| Teever wrote:
| 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 path?
| gtop3 wrote:
| 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 seems like a
| small but potentially fatal possibility. The likelihood is a
| topic of debate, and any answer from AI would be heavily
| scrutinized.
|
| * Research Universal Paperclips for an interesting take on
| competing for finite resources.
|
| * More intelligence means we can solve more human problems.
| Potentially massive problems like aging, grand unified theory
| or poverty.
|
| * Many people live entire lives without advancing technology.
| Maybe all of us technologist just go do that.
| gnramires wrote:
| > * 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 harder part is convincing people to help others,
| and cooperate to solve the most pressing issues, which we
| definitely could do :)
|
| That includes wars, climate change, social conflicts, and
| taking care of individuals mental and physical health
| properly. We already have the means to address all of those.
| xiphias2 wrote:
| Software is advancing in a far more faster pace at this point
| than hardware.
|
| Before we were happy when something new happened in AI every
| few years. Now we can expect something new / cool happening
| every few months (10x price decrease for GPT was a huge deal
| just a few days ago).
| cwkoss wrote:
| Down to 2 weeks in image generation. Stablediffusion
| ecosystem is super cool.
| rcpt wrote:
| I've tried getting ChatGPT to generate verilog but it didn't
| work. Seems to be better at python
| Teever wrote:
| I've been thinking of a stable diffusion type program that is
| trained on images of circuit diagrams.
|
| Would be neat to see if it could output images of its own
| circuits or novel ones
| revskill wrote:
| Python code , due to its strict indentation sensitivity, is
| really composed of boilerplates, there's nothing you can do to
| shorten it.
___________________________________________________________________
(page generated 2023-03-03 23:00 UTC)