
AI learns to write its own code by stealing from other programs - fragomatic
https://www.newscientist.com/article/mg23331144-500-ai-learns-to-write-its-own-code-by-stealing-from-other-programs/
======
kleiba
_“It could allow non-coders to simply describe an idea for a program and let
the system build it”_

This is not a new thought. The problem with it, however, is that such a
description would have to be very precise or else leave room for different
interpretations which in turn could lead to very different programs being
generated. In particular, as programmers know, it's often the edge cases that
pose the main difficulty not the typical case.

Describing what your program should do in sufficient detail will probably end
up being not very far from the actual program itself.

~~~
geophile
Doesn't TDD basically provide a spec? Write a test, then let the AI generate a
program that passes the test. If the program is still buggy, you didn't write
sufficient tests.

~~~
felixge
I don't think it's that simple. Imagine a simple add(int32, int32) int32
function. Unless you write a test for all 2^32 * 2^32 possible inputs and
their expected outputs, how could you guarantee that the AI will come up with
the "correct" implementation?

Automated tests are generally not practical for proofing program correctness.
Why would you expect them to be sufficient as a specification format?

~~~
geophile
Software produced by a typical business app developer is not provably correct
either. TDD of AI generated code could not hope to produce something more
correct. As your tests get better, so would the software produced both by the
human and the AI.

For your add(int32, int32) function: While an AI-generated implementation is
not provably correct unless the test contains 2^64 inputs, I think it's pretty
likely that a correct implementation would in fact be generated pretty
quickly.

~~~
spaced_out
I don't think it's as likely as you assume. Let's say you ask the computer to
implement your adder, and you feed it the results of a few dozen, or a few
hundred uint32 a + uint32 b = uint32 c operations. By coincidence, however, in
all of those operations, every time bit a[14] is zero, bit c[26] also happens
to be zero. The computer may produce an implementation which assumes this is
always the case. The computer may also reason it does not need to look at some
of the input bits, if say, for all of the tests, bit b[2] == bit b[16].

It may seem that a solution with assumptions like those are more complex than
a simple addition operation, and thus the computer will find the addition
solution first, but "simple" is a matter of perspective. Addition requires a
logic cascade through the entire number, since the carries of the lower bits
must be passed to the upper bits, which requires a critical path equal to the
entire length of the inputs/outputs. In searching for an implementation which
satisfies the few dozen/hundred test cases you feed it, making assumptions
like those in the first paragraph can drastically shorten the critical path,
and require far less logic since it's ignoring much of the input. Thus
algorithmically, the addition operation may be seen as more complex.

------
argonaut
A nuance that is underappreciated by a lot of people / the media is the degree
to which any of the AI generates X models (faces, drawings, fills in photos,
increases sharpness, etc.) simply copy and paste and interpolate from the
training set.

Unlike general supervised learning problems, for many of the deep learning
"generative" models that get posted to HN regularly, there is no objective
"test set" to measure generalization, so it's extremely easy to claim the
model has learned something. When we see a cool demo / audio sample /
pictures, how do we know the model hasn't just simply interpolated a bunch of
training examples? In many cases this is quite clear, like when you start
seeing cats everywhere in the generated imagery. It's very hard to ferret out
the BS with these models.

~~~
RugnirViking
Interesting how you consider interpolating from training data not learning.
Isn't that like exactly what learning is? If you get unintended repeating
patterns then there isn't enough diverse training data

~~~
ClassyJacket
I'm not an expert in deep learning (yet) so someone please correct me if I'm
wrong.

Technically I see no reason you couldn't say that meets the definition of
learning.

But perhaps that's asking the wrong question. Dictionaries aside, one might
decide that a useful standard of "learning" in certain contexts is to have a
level of _understanding_ of the subject. And then we ask, does the system have
understanding? What is understanding?

A system that _only_ interpolates training data can't logically become
consistently better at the task than the data it learns from. Whereas a a
sufficiently deep learning system (including, but not limited to, a human) can
defeat its master.

------
yetihehe
It will allow programmers to make errors much faster :D.

    
    
      Programmer: why is my program not working?
      AI: Strange, it's working for me.

~~~
darpa_escapee
Ah, but it will help us debug errors faster if we train it on a
troubleshooting dataset! :)

    
    
      Programmer: why is my program not working?
      AI: Have you tried turning it off and on again?

~~~
p1esk
I'm not sure if you're aware, but this has already been done, pretty much
literally:
[https://arxiv.org/abs/1506.05869](https://arxiv.org/abs/1506.05869)

~~~
peterclary
Very interesting, thanks! Partially trained based on subtitles from movies. Of
course, I think I'd want to be pretty careful about which movies I used to
train the system!

------
sumitgt
Reminds me of this old web comic:
[http://www.commitstrip.com/en/2016/08/25/a-very-
comprehensiv...](http://www.commitstrip.com/en/2016/08/25/a-very-
comprehensive-and-precise-spec/)

------
smdz
Link to the PDF:
[https://openreview.net/pdf?id=ByldLrqlx](https://openreview.net/pdf?id=ByldLrqlx)

The approach taken seems to be quite unique. Especially when compared to GPs
and GA evolved custom assemblies. Those approaches work too, but mostly fail
(or take too long) at solving slightly complex problems.

------
bdcravens
But is it asking questions and copying and pasting snippets from Stack
Overflow yet? Then it'll truly be sentient.

~~~
RugnirViking
Haha - 'Can you solve this homework problem my creator set me? :('

------
falcolas
A nit I'd like to pick.

No, _AI_ didn't write code. A program _explicitly built and trained to write
code_ , wrote code.

A bit too pedantic, perhaps, but there isn't some singular program out there
which first learned to play chess, then see and catalog pictures, create
creepy art, play Go, drive cars, and now write code. Which is what "AI learns
to X" seems to imply.

Of course, that's not as interesting of a headline.

~~~
nickdavidhaynes
Seeing an article refer to "AI" as if it's a monolith is a really good
indicator of the quality of that article.

------
bartread
_" AI learns to write its own code by stealing from other programs"_

Much like non-artificial intelligence, then.

~~~
danesparza
But with much, much less humor.

~~~
bartread
Well, that depends on the code (or perhaps whose code) it steals. :)

------
shultays

      This article appeared in print under the headline “Computers are learning to code for themselves”
    

And someone decided that the article is not click baity enough, lets make it
look like malevolent

------
owebmaster
When these journalists discover how compilers work, they will stop thinking
that computers writing code is something uncommon.

------
wimagguc
In the meanwhile, Mark Cuban says: _" I personally think there's going to be a
greater demand in 10 years for liberal arts majors than for programming majors
and maybe even engineering"_

(From this article: [http://www.inc.com/betsy-mikel/mark-cuban-says-this-will-
soo...](http://www.inc.com/betsy-mikel/mark-cuban-says-this-will-soon-be-the-
most-sought-after-job-skill.html?cid=cp01002fastco))

~~~
michaelmrose
I know he knows the business world and he obviously knows how to manage a
business but what does he know about tech? This prediction is beyond
nonsensical.

------
onion2k
I thought this would take longer. "Developer" will stick around as a job for
people who need new and unique things, or for apps that need speed, but if
your job is making forms to take in data, putting it in a database, performing
some sort of analysis on it, and then printing a report to the screen then you
should _really_ starting learning something else, because those jobs will not
exist in 10 years.

~~~
serndo4
i don't think so.

the problem is human computer interaction. to specify what is needed is harder
than the actual coding.

i would guess this will be implemented in an IDE and will reduce coding times
tremendously

~~~
zoul
Specifying exactly what is needed _is_ coding. The hope for some kind of high-
level language you would generate the actual code from is decades old, see
compilers. (And it does reduce coding times tremendously!)

~~~
serndo4
that's kind of what i meant.

someone has to tell the thing what to do, in a understandable way. and this
will not be the client/manager/whoeverneedssomething.

and that's not coding. that's software engineering. maybe codingmonkeys will
disappear but a "developer" is, imo, a guy who does more than code

~~~
onion2k
_someone has to tell the thing what to do, in a understandable way. and this
will not be the client /manager/whoeverneedssomething. _

To start with, sure. That's where we are now - even the best "AI" tool needs a
lot of help from the user giving it instructions in specific language. That
will improve very quickly though. _For a limited subset of apps_ , you will be
able to describe what you want in plain English and get something usable out
of it. That subset will start off being the sort of apps people have made in
VB for years, and now make in web languages.

If that's what you do then your job will be automated away over the next
decade. Learn to make something that can't easily be automated.

------
codr4life
At least when code monkeys copy-paste from Stack Overflow, there's a trace of
common sense in the loop. Yes, it's possible to copy-paste your way to working
software without having a clue. No, it's not a very good idea. How about if we
shut these clowns down and use the money for research that has a chance of
improving anything?

~~~
flippyfloppies
calm down, it's not coming for your job yet. soon, though.

~~~
codr4life
I'm not worried about that; computers will only ever copy, they are incapable
of creating anything new; much like management. What bothers me is the amount
of energy being sucked into this black hole, trying to mimic human
intelligence in computers. The sooner we get over this stupid hump and start
treating AI as a tool, the better.

------
SNBasti
Well, it's obvious that there will be an improvement in specifiying the syntax
for a computer program as it has been for the last decades.

e.g. Assembler -> C -> C++

There recently has been a post @ HN about the missing programming paradigm
([http://wiki.c2.com/?ThereAreExactlyThreeParadigms](http://wiki.c2.com/?ThereAreExactlyThreeParadigms)).
With the emerge of smarter tools, programming will get easier in one way or
the other, releasing the coder from a lot of pain ( as C or C++ did realse us
from tedious, painful assembler ). However, I am quite sure that it won't
replace programmers since our job is actually not to code but more to solve a
given problem with a range of tools. Smarter tools will probably boost
productivity of a single person to handle bigger and more complex
architectures or other kinds of new problem areas will come up. Research will
go faster. Products will get developed faster. Everything will kind of speed
up. Nevertheless, the problems to get solve / implement will remain until
there's some kind of GAI. If there's an GAI smart enough to solve our problems
probably most of the Jobs have been replaced.

------
kristiandupont
>It could allow non-coders to simply describe an idea for a program and let
the system build it

Well that's the thing, "describing" an idea to the point where you are
explicit enough to get the actual b behavior you want, you are basically
writing code. Granted, you might have to add superfluous constructs and syntax
to make it fit the programming languages we currently have, but that is a
different kind of problem.

------
homarp
Arxiv link
[https://arxiv.org/abs/1611.01989](https://arxiv.org/abs/1611.01989)

------
mdekkers
Just like real people!

~~~
ge96
People pay me... to use StackOverflow haha

On a serious note this could potentially suck for developers. Just like the
labor jobs and automation. You have a skill set? Well this computer can do
your job. I guess be the guy building the code writing the code.

I do wonder what will we do when computers do everything for us. I have this
motor that moves my neck to a look at a girl who also has a motor that moved
her neck to look at me haha.

~~~
jondwillis
>I do wonder what will we do when computers do everything for us.

Yeah, this is a pretty existential question that has been posed a lot around
here. What do you do if you do not have to do anything? It is like vacation,
forever. You are free to be lazy, or creative, or adventurous, or somewhere in
between, but will you be happier? I have been between significant work for a
few months and I am itching to do something consequential but I also really
enjoy the space to do anything, not that I take full advantage more often than
when I was working full time.

The ongoing basic universal income study at YC, blog.ycombinator.com/hiring-
for-basic-income/ I hope produces some more clarification.

~~~
darpa_escapee
> It is like vacation, forever.

I guess that's one way to look at death from malnutrition, exposure or
untreated illness.

We can wax optimistic about what post-automation life could be like, but let's
be honest: right now, unless you are an investor in companies that have
automated or provide automation solutions, you are in absolutely no position
to see 'vacation, forever' on the horizon for yourself or your children in a
post-automation world.

We should be frantically trying to do everything possible to fix that,
however, because automation will be competing against the wage-labor
relationship that the majority of people are dependent on.

~~~
fondry34
Either we fix that, true, or there will be just far less people after a while.
In the meantime, starvation may be a common "disease" in 1st world as well,
just as it is already in the 3rd world.

It's just that automation needs many people. It is to fix the problem of mass
production. If there are no consumer masses, there is no need for mass
production and thus no need for automation.

But maybe the masses are just turned from consumers into products. That is
what Google and Facebook already do today. Don't know If I would like to live
in such a world. Already now I don't like it to be a Google product. Is that
the choice, between starvation in freedom, or being nothing but a product, a
second order slave?

~~~
michaelmrose
If people are starving in the street they will just tear down the nation
around them on their way out sounds like a non survival strategy.

------
k_sze
This just goes to show that nobody's job is safe. The crux is that AI won't
get tired and won't balk at changing requirements. Many people will think it's
still very far, until it suddenly arrives. The horse buggy drivers never saw
the automobiles coming.

On the other hand, until that day arrives, we could take the technology into a
direction that actually helps users/customers and software engineers
communicate better. The software engineer could have the user feed
requirements to a bot, and systematically identify and explain issues in the
requirements, based on the bot's output.

------
jlebrech
programmer in future will just have to give an AI tests and the AI will try
and come with the fastest code that passes those tests.

~~~
michaelmrose
This actually sounds like more work than coding.

------
jackcosgrove
Programming is translation of requirements written in natural language,
graphical notation, and mathematical notation to a deterministic syntax. There
has been much improvement in making these syntaxes more closely match these
older forms of communication, and I'm sure this is one tool that will be used
in the future. However until AI can gather its own requirements, there will
always be a translation step that people must do. When this technology comes
to fruition, requirements gathering will become programming.

~~~
jononor
What we need are libraries of (automatically verifiable) requirements. As open
source components which can be compose together, like we do with the code
today. Then we, possibly assisted by "AI", can assemble a solution matching
the requirements.

------
clusmore
>AI learns to write its own code by stealing from other programs

I initially took this to mean that the AI learnt how to generate the source
code which makes up its own program, a bit like a quine I guess.

~~~
charliebk
Exactly. And this is being done by a science publication. Irresponsible. Let's
make people freak out and fear AI even more, and unecessarily, with a
clickbait title.

------
NSHippie
What If this AI (Deepcoder) manages to manipulate it's own code?

------
oriel
Original paper here:
[https://openreview.net/pdf?id=ByldLrqlx](https://openreview.net/pdf?id=ByldLrqlx)

This is more likely to vanish in the flood of AI-based applications, before
reappearing as a tool for coders akin to code snippets plus, or boilerplate
generation 2.0.

> and third, the neural network’s predictions are used to guide existing
> program synthesis systems.

------
muyuu
Any code or real results to show for it? I'm a bit sceptical about claims in
papers because I've found a lot of overstatements in them. Even in those with
easily reproducible algorithms, that when you go and execute them, they simply
don't pan out in any remotely realistic scenarios.

------
kolinko
Hm, I wonder if the past ACM problems or TopCoder problems and solutions could
be fed to a deep learning network...

------
warpig
"DeepCoder uses a technique called program synthesis: creating new programs by
piecing together lines of code taken from existing software" \- So essentially
just copying others code as opposed to generating the logic on its own?.

~~~
TheOtherHobbes
I'm not sure the journalist even read the paper, or if they did they didn't
understand it.

DeepCoder works with a very simple functional-ish toy DSL to solve very simple
toy problems. It doesn't copy code, because the DSL is unique - and it's so
simple there's no need to copy code, and nowhere to copy code from.

What it actually does is use an RNN to speed up a dumb search through the
space of all possible programs written in the DSL by "learning" which code
constructs are most common.

This works surprisingly well, but it's not obvious the process is
generalisable to code written in production languages to solve complex
problems with explicit logic and possible thread timing issues.

(It may well be. Naively I would expect a level of complexity beyond which the
improved search stops working and/or is too slow to be useful. But I may well
be wrong about that.)

Anyway - it's very, very interesting research. The article doesn't come close
to explaining it or doing it justice, so it's worth reading the source paper.

------
djfm
The title is misleading, I thought this was going to be about "True AI". The
AI doesn't write its own code, it writes code instead of you but always uses
the same code. Or did I misunderstand?

------
realworldview
_This article appeared in print under the headline “Computers are learning to
code for themselves”_

Oh dear New Scientist. _Steal_? What was wrong with the original article
title?

------
justjonathan
Now computers can blindly copy and paste code they don't understand from stack
exchange just like people.

------
try_finally
What happens when an AI breaks a patent or copyright based on a high level
description of the problem you fed it?

------
lightedman
So, this is basically a script-kiddie AI?

------
jonbaer
Gives new meaning to PEBKAC

------
y3rsh
like me.

------
ultrahate
This sounds like StackOverflow's mascot AI.

