72 Science & technology The Economist July 10th 2021
grammer has already written.
The purpose of all this, of course, is to
save time. Kite, a firm in San Francisco,
claims its aicompletion products cut the
number of keystrokes required for some
tasks by nearly half. Overall efficiency
gains, however, are lower. Vitaly Khudo
bakhshov, head of aiproducts at the St Pet
ersburg office of JetBrains, a Czech devel
oper of programming software, sees time
savings of 10% to 20%. In the view of Sharif
Shameem, the boss of Debuild, a firm in
San Francisco that uses gpt3 to help build
websites, the technology also reduces
“cognitive overhead”. Selecting from mul
tiple choices is less taxing than devising
solutions from scratch.
Bugs and the system
Nor are those who write code the only ben
eficiaries. Developers spend nearly as
much time searching for bugs in what they
have written as they do writing it in the
first place. A machinelearning model be
ing built by Brendan DolanGavitt of New
York University may speed up the debug
ging process.
To train it, Dr DolanGavitt is collecting
code labelled as buggy by GitHub, a Micro
soft subsidiary that hosts the biggest col
lection of nonproprietary “open source”
code in the world. By one estimate, GitHub
holds at least a billion snippets of code
identified as harbouring a bug. Dr Dolan
Gavitt’s model, provisionally called gpt
csrc, will devour that code this summer.
Another bugspotting model is in de
velopment at the Massachusetts Institute
of Technology (mit). Shashank Srikant, a
phdstudent working on the project, says
the goal is to train the model to recognise
not just inadvertent bugs, but also mali
ciously inserted vulnerabilities. Rogue
employees are sometimes behind trickery
of this sort, which is intended to do things
like secretly gain access to passwords. The
practice is most common, however, in
opensource programming projects to
which anyone can contribute. Human re
viewers typically struggle to spot these
“vulnerability injections”, as they are
sometimes known.
The reason, Mr Srikant says, is that, in a
bid to slip their handiwork past reviewers,
devious coders often use deceptive but
purely cosmetic names for things like the
variables handled by a program. The team
at mit is therefore training its model to flag
discrepancies between snippets’ labels
and their actual functionality. The difficul
ty is that good examples of such mischief
are much rarer than ordinary errors.
There is, however, an additional sign
that a vulnerability injection may be lurk
ing. Malicious coders often conceal these
by writing superfluous code intended to
throw off reviewers, so Mr Srikant is also
feeding mit’s model with examples of this
type of potentially telltale code, which he
describes as “dangling” and “dead”.
The clear destination of all this activity
is the creation of software programmers
which can, like the human variety, take an
idea and turn it into code. An inkling of
things to come is provided by a website
created by Dr DolanGavitt. Named “This
Code Does Not Exist”, it asks programmers
to determine if sections of code dozens of
lines long were written by a human or a
model based on gpt2 that he has built. Of
more than 329,200 assessments made, less
than 51% have been correct. That is only a
shade better than random.
Machines, it turns out, are now able to
write even longish sequences of function
ing code. As John Carmack, a noted Ameri
can computer engineer, has tweeted, pon
dering this development “does generate a
slight shiver”. Unsurprisingly, a number of
firms see an opportunity.
One is a Parisian firm called Sourceai. It
is designing software into which users
type, in natural language, a request for
code—suchassomethingthatwillwork
outthevalueofnumbersina mathemati
calformulacalledtheFibonaccisequence.
By tapping into gpt3, Sourceai’s epony
mous software churns out the desired
lines of code in a range of programming
languages.
Debuild is testing the same idea. It is
trying to create software that lets nonpro
grammers describe, in plain English, a pro
gram they want to create, and will then
write it. A request for, say, a barbershop
app that lets patrons choose a barber and
an appointment slot can already produce
more or less just that. Mr Shameem says
the goal is to sweep away the minutiae of
codetyping, so that people can focus on
what they want done, not how to instruct
computers to do it.
For its part, Microsoft is also using
gpt3 to power what it calls “no code/low
code” programming. Charles Lamanna,
who leads the work, envisages a bright fu
ture of cheaper software created by un
trained “citizen developers”. Some folk fear
an alternative, darker outcome. Might ais
eventually write whatever code they fancy
running? No such runaway feedback loop
isaroundthecorner. But that mainstay of
sciencefictiondoes now appear a little less
farfetched.n
Coppergushers
Brine mines
C
opper wasthe first metal worked by
human beings. They hammered it into
jewellery and ornaments as much as 11,000
years ago. Today, Homo sapiensuses more
than 20m tonnes of the stuff a year, much
of it in buildings and electrical infrastruc
ture. More will be required in coming de
cades, to meet the need for widespread
electrification brought about by the transi
tion to less carbonintensive economies.
Copper is an essential part of batteries,
motors and charging equipment. Solar and
wind installations use more copper than
their fossilfuel counterparts, and electric
vehicles contain four times more copper
than do cars with combustion engines.
This has spurred interest in new sourc
es of the metal, most of which comes at the
moment from rocks dug out of vast open
cast mines that are then ground up and
processed to release the copper they con
tain, typically about 1% of their mass.
Metalrich nodules scattered across va
rious parts of the ocean floor are a pos
sibility. But exploiting these brings tech
nological and regulatory difficulties, and is
in any case controversial because of the
damage it would do to deepocean ecosys
tems. Jon Blundy of Oxford University,
however, offers an alternative. This is to
extract, from deep under Earth’s surface,
the mineralrich brines from which ores of
copper and other valuable metals are gen
erated in the first place. As Dr Blundy
points out, “pretty much all of the nonfer
People may one day drill for copper as they now drill for oil
Acopper-bottomed volcano