davideisinger.com

My personal website
Log | Files | Refs | README

softwarecrisis-dev-7c7z9g.txt (50327B)


      1 [1]Out of the Software Crisis Bird flying logo [2]Newsletter [3]Book [4]AI Book
      2 [5]Archive [6]Author
      3 
      4 Modern software quality, or why I think using language models for programming
      5 is a bad idea
      6 
      7 By Baldur Bjarnason,
      8 May 30th, 2023
      9 
     10 This essay is based on a talk I gave at [7]Hakkavélin, a hackerspace in
     11 Reykjavík. I had a wonderful time presenting to a lovely crowd, full of
     12 inquisitive and critically-minded people. Their questions and the discussion
     13 afterwards led to a number of improvements and clarifications as I turned my
     14 notes into this letter. This resulted in a substantial expansion of this essay.
     15 Many of the expanded points, such as the ones surrounding language model
     16 security, come directly from these discussions.
     17 
     18 Many thanks to all of those who attended. The references for the presentation
     19 are also the references for this essay, which you can find all the way down in
     20 the footnotes section.
     21 
     22 The best way to support this newsletter or my blog is to buy one of my books, 
     23 [8]The Intelligence Illusion: a practical guide to the business risks of
     24 Generative AI or [9]Out of the Software Crisis. Or, you can buy them both [10]
     25 as a bundle.
     26 
     27 The software industry is very bad at software
     28 
     29 Here’s a true story. Names withheld to protect the innocent.
     30 
     31 A chain of stores here in Iceland recently upgraded their point-of-sale
     32 terminals to use new software.
     33 
     34 Disaster, obviously, ensued. The barcode scanner stopped working properly,
     35 leading customer to be either overcharged or undercharged. Everything was
     36 extremely slow. The terminals started to lock up regularly. The new invoice
     37 printer sucked. A process that had been working smoothly was now harder and
     38 took more time.
     39 
     40 The store, where my “informant” is a manager, deals with a lot of businesses,
     41 many of them stores. When they explain to their customers why everything is
     42 taking so long, their answer is generally the same:
     43 
     44 “Ah, software upgrade. The same happened to us when we upgraded our terminals.”
     45 
     46 This is the norm.
     47 
     48 The new software is worse in every way than what it’s replacing. Despite having
     49 a more cluttered UI, it seems to have omitted a bunch of important features.
     50 Despite being new and “optimised”, it’s considerably slower than what it’s
     51 replacing.
     52 
     53 This is also the norm.
     54 
     55 Switching costs are, more often than not, massive for business software, and
     56 purchases are not decided by anybody who actually uses it. The quality of the
     57 software disconnects from sales performance very quickly in a growing software
     58 company. The company ends up “owning” the customer and no longer has any
     59 incentive to improve the software. In fact, because adding features is a key
     60 marketing and sales tactic, the software development cycle becomes an act of
     61 intentional, controlled deterioration.
     62 
     63 Enormous engineering resources go into finding new ways to minimise the
     64 deterioration—witness Microsoft’s “ribbon menu”, a widget invented entirely to
     65 manage the feature escalation mandated by marketing.
     66 
     67 This is the norm.
     68 
     69 This has always been the norm, from the early days of software.
     70 
     71 The software industry is bad at software. Great at shipping features and
     72 selling software. Bad at the software itself.
     73 
     74 Why I started researching “AI” for programming
     75 
     76 In most sectors of the software industry, sales performance and product quality
     77 are disconnected.
     78 
     79 By its nature software has enormous margins which further cushion it from the
     80 effect of delivering bad products.
     81 
     82 The objective impact of poor software quality on the bottom lines of companies
     83 like Microsoft, Google, Apple, Facebook, or the retail side of Amazon is a
     84 rounding error. The rest only need to deliver usable early versions, but once
     85 you have an established customer base and an experienced sales team, you can
     86 coast for a long, long time without improving your product in any meaningful
     87 way.
     88 
     89 You only need to show change. Improvements don’t sell, it’s freshness that
     90 moves product. It’s like store tomatoes. Needs to look good and be fresh.
     91 They’re only going to taste it after they’ve paid, so who cares about the
     92 actual quality.
     93 
     94 Uptime reliability is the only quality measurement with a real impact on ad
     95 revenue or the success of enterprise contracts, so that’s the only quality
     96 measurement that ultimately matters to them.
     97 
     98 Bugs, shoddy UX, poor accessibility—even when accessibility is required by
     99 law—are non-factors in modern software management, especially at larger
    100 software companies.
    101 
    102 The rest of us in the industry then copy their practices, and we mostly get
    103 away with it. Our margins may not be as enormous as Google’s, but they are
    104 still quite good compared to non-software industries.
    105 
    106 We have an industry that’s largely disconnected from the consequences of making
    107 bad products, which means that we have a lot of successful but bad products.
    108 
    109 The software crisis
    110 
    111 Research bears this out. I pointed out in my 2021 essay [11]Software Crisis 2.0
    112 that very few non-trivial software projects are successful, even when your
    113 benchmarks are fundamentally conservative and short term.
    114 
    115 For example, the following table is from [12]a 2015 report by the Standish
    116 Group on their long term study in software project success:
    117 
    118          SUCCESSFUL CHALLENGED FAILED TOTAL
    119  Grand   6%         51%        43%    100%
    120  Large   11%        59%        30%    100%
    121  Medium  12%        62%        26%    100%
    122 Moderate 24%        64%        12%    100%
    123  Small   61%        32%        7%     100%
    124 
    125 The Chaos Report 2015 resolution by project size
    126 
    127 This is based on data that’s collected and anonymised from a number of
    128 organisations in a variety of industries. You’ll note that very few projects
    129 outright succeed. Most of them go over budget or don’t deliver the
    130 functionality they were supposed to. A frightening number of large projects
    131 outright fail to ship anything usable.
    132 
    133 In my book [13]Out of the Software Crisis, I expanded on this by pointing out
    134 that there are many classes and types of bugs and defects that we don’t measure
    135 at all, many of them catastrophic, which means that these estimates are
    136 conservative. Software project failure is substantially higher than commonly
    137 estimated, and success if much rarer than the numbers would indicate.
    138 
    139 The true percentage of large software projects that are genuinely successful in
    140 the long term—that don’t have any catastrophic bugs, don’t suffer from UX
    141 deterioration, don’t end up having core issues that degrade their business
    142 value—is probably closer to 1–3%.
    143 
    144 The management crisis
    145 
    146 We also have a management crisis.
    147 
    148 The methods of top-down-control taught to managers are counterproductive for
    149 software development.
    150 
    151   • Managers think design is about decoration when it’s the key to making
    152     software that generates value.
    153   • Trying to prevent projects that are likely to fail is harmful for your
    154     career, even if the potential failure is wide-ranging and potentially
    155     catastrophic.
    156   • When projects fail, it’s the critics who tried to prevent disaster who are
    157     blamed, not the people who ran it into the ground.
    158   • Supporting a project that is guaranteed to fail is likely to benefit your
    159     career, establish you as a “team player”, and protects you from harmful
    160     consequences when the project crashes.
    161   • Teams and staff management in the software industry commonly ignores every
    162     innovation and discovery in organisational psychology, management, and
    163     systems-thinking since the early sixties and operate mostly on management
    164     ideas that Henry Ford considered outdated in the 1920s.
    165 
    166 We are a mismanaged industry that habitually fails to deliver usable software
    167 that actually solves the problems it’s supposed to.
    168 
    169 Thus, [14]Weinberg’s Law:
    170 
    171     If builders built buildings the way programmers wrote programs, then the
    172     first woodpecker that came along would destroy civilization.
    173 
    174 It’s into this environment that “AI” software development tools appear.
    175 
    176 The punditry presented it as a revolutionary improvement in how we make
    177 software. It’s supposed to fix everything.
    178 
    179 —This time the silver bullet will work!
    180 
    181 Because, of course, we have had such a great track record with [15]silver
    182 bullets.
    183 
    184 So, I had to dive into it, research it, and figure out how it really worked. I
    185 needed to understand how generative AI works, as a system. I haven’t researched
    186 any single topic to this degree since I finished my PhD in 2006.
    187 
    188 This research led me to write my book [16]The Intelligence Illusion: a
    189 practical guide to the business risks of Generative AI. In it, I take a broader
    190 view and go over the risks I discovered that come with business use of
    191 generative AI.
    192 
    193 But, ultimately, all that work was to answer the one question that I was
    194 ultimately interested in:
    195 
    196 Is generative AI good or bad for software development?
    197 
    198 To even have a hope of answering this, we first need to define our terms,
    199 because the conclusion is likely to vary a lot depending on how you define “AI”
    200 or even "software development.
    201 
    202 A theory of software development as an inclusive system
    203 
    204 Software development is the entire system of creating, delivering, and using a
    205 software project, from idea to end-user.
    206 
    207 That includes the entire process on the development side—the idea, planning,
    208 management, design, collaboration, programming, testing, prototyping—as well as
    209 the value created by the system when it has been shipped and is being used.
    210 
    211 My model is that of [17]theory-building. From my essay on theory-building,
    212 which itself is an excerpt from [18]Out of the Software Crisis:
    213 
    214     Beyond that, software is a theory. It’s a theory about a particular
    215     solution to a problem. Like the proverbial garden, it is composed of a
    216     microscopic ecosystem of artefacts, each of whom has to be treated like a
    217     living thing. The gardener develops a sense of how the parts connect and
    218     affect each other, what makes them thrive, what kills them off, and how you
    219     prompt them to grow. The software project and its programmers are an
    220     indivisible and organic entity that our industry treats like a toy model
    221     made of easily replaceable lego blocks. They believe a software project and
    222     its developers can be broken apart and reassembled without dying.
    223 
    224     What keeps the software alive are the programmers who have an accurate
    225     mental model (theory) of how it is built and works. That mental model can
    226     only be learned by having worked on the project while it grew or by working
    227     alongside somebody who did, who can help you absorb the theory. Replace
    228     enough of the programmers, and their mental models become disconnected from
    229     the reality of the code, and the code dies. That dead code can only be
    230     replaced by new code that has been ‘grown’ by the current programmers.
    231 
    232 Design and user research is an integral part of the mental model the programmer
    233 needs to build, because none of the software components ultimately make sense
    234 without the end-user.
    235 
    236 But, design is also vital because it is, to reuse Donald G. Reinertsen’s
    237 definition from Managing the Design Factory (p. 11), design is economically
    238 useful information that generally only becomes useful information through
    239 validation of some sort. Otherwise it’s just a guess.
    240 
    241 The economic part usually comes from the end-user in some way.
    242 
    243 This systemic view is inclusive by design as you can’t accurately measure the
    244 productivity or quality of a software project unless you look at it end to end,
    245 from idea to end-user.
    246 
    247   • If it doesn’t work for the end-user, then it’s a failure.
    248   • If the management is dysfunctional, then the entire system is
    249     dysfunctional.
    250   • If you keep starting projects based on unworkable ideas, then your
    251     programmer productivity doesn’t matter.
    252 
    253 Lines of code isn’t software development. Working software, productively used,
    254 understood by the developers, is software development.
    255 
    256 A high-level crash course in language models
    257 
    258 Language models, small or large, are today either used as autocomplete copilots
    259 or as chatbots. Some of these language model tools would be used by the
    260 developer, some by the manager or other staff.
    261 
    262 I’m treating generative media and image models as a separate topic, even when
    263 they’re used by people in the software industry to generate icons, graphics, or
    264 even UIs. They matter as well, but don’t have the same direct impact on
    265 software quality.
    266 
    267 To understand the role these systems could play in software development, we
    268 need a little bit more detail on what language models are, how they are made,
    269 and how they work.
    270 
    271 Most modern machine learning models are layered networks of parameters, each
    272 representing its connection to its neighbouring parameters. In a modern
    273 transformer-based language model most of these parameters are floating point
    274 numbers—weights—that describe the connection. Positive numbers are an
    275 excitatory connection. Negative numbers are inhibitory.
    276 
    277 These models are built by feeding data through a tokeniser that breaks text
    278 into tokens—often one word per token—that are ultimately fed into an algorithm.
    279 That algorithm constructs the network, node by node, layer by layer, based on
    280 the relationships it calculates between the tokens/words. This is done in
    281 several runs and, usually, the developer of the model will evaluate after each
    282 run that the model is progressing in the right direction, with some doing more
    283 thorough evaluation at specific checkpoints.
    284 
    285 The network is, in a very fundamental way, a mathematical derivation of the
    286 language in the data.
    287 
    288 A language model is constructed from the data. The transformer code regulates
    289 and guides the process, but the distributions within the data set are what
    290 defines the network.
    291 
    292 This process takes time—both collecting and managing the data set and the build
    293 process itself—which inevitably introduces a cut-off point for the data set.
    294 For OpenAI and Anthropic, that cut-off point is in 2021. For Google’s PaLM2
    295 it’s early 2023.
    296 
    297 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    298 
    299 Aside: not a brain
    300 
    301 This is very, very different from how a biological neural network interacts
    302 with data. A biological brain is modified by input and data—its environment—but
    303 its construction is derived from nutrition, its chemical environment, and
    304 genetics.
    305 
    306 The data set, conversely, is a deep and fundamental part of the language model.
    307 The algorithm’s code provides the process while the weights themselves are
    308 derived from the data, and the model itself is dead and static during input and
    309 output.
    310 
    311 The construction process of a neural network is called “training”, which is yet
    312 another incredibly inaccurate term used by the industry.
    313 
    314   • A pregnant mother isn’t “training” the fetus.
    315   • A language model isn’t “trained” from the data, but constructed.
    316 
    317 This is nonsense.
    318 
    319 But this is the term that the AI industry uses, so we’re stuck with it.
    320 
    321 A language model is a mathematical model built as a derivation of its training
    322 data. There is no actual training, only construction.
    323 
    324 This is also why it’s inaccurate to say that these systems are inspired by
    325 their training data. Even though genes and nutrition make an artist’s mind they
    326 are not in what any reasonable person would call “their inspiration”. Even when
    327 they are sought out for study and genuine inspiration, it’s our representations
    328 of our understanding of the genes that are the true source of inspiration.
    329 Nobody sticks their hand in a gelatinous puddle of DNA and spontaneously gets
    330 inspired by the data it encodes.
    331 
    332 Training data are construction materials for a language models. A language
    333 model can never be inspired. It is itself a cultural artefact derived from
    334 other cultural artefacts.
    335 
    336 The machine learning process is loosely based on decades-old grossly simplified
    337 models of how brains work.
    338 
    339 A biological neuron is a complex system in its own right—one of the more
    340 complex cells in an animal’s body. In a living brain, a biological neuron will
    341 use electricity, multiple different classes of neurotransmitters, and timing to
    342 accomplish its function in ways that we still don’t fully understand. It even
    343 has its own [19]built-in engine for chemical energy.
    344 
    345 The brain as a whole is composed of not just a massive neural network, but also
    346 layers of hormonal chemical networks that dynamically modify its function, both
    347 granularly and as a whole.
    348 
    349 The digital neuron—a single signed floating point number—is to a biological
    350 neuron what a flat-head screwdriver is to a Tesla.
    351 
    352 They both contain metal and that’s about the extent of their similarity.
    353 
    354 The human brain contains roughly 100 billion neuron cells, a layered chemical
    355 network, and a cerebrovascular system that all integrate as a whole to create a
    356 functioning, self-aware system capable of general reasoning and autonomous
    357 behaviour. This system is multiple orders of magnitude more complex than even
    358 the largest language model to date, both in terms of individual neuron
    359 structure, and taken as a whole.
    360 
    361 It’s important to remember this so that we don’t fall for marketing claims that
    362 constantly imply that these tools are fully functioning assistants.
    363 
    364 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    365 
    366 The prompt
    367 
    368 After all of this, we have a data set which can be used to generate text in
    369 response to prompts.
    370 
    371 Prompts such as:
    372 
    373     Who was the first man on the moon?
    374 
    375 The input phrase, or prompt, has no structure beyond the linguistic. It’s just
    376 a blob of text. You can’t give the model commands or parameters separately from
    377 other input. Because of this, if your model lets a third party enter text, an
    378 attacker will always be able to bypass whatever restrictions you put on it.
    379 Control prompts or prefixes will be discovered and countermanded. Delimiters
    380 don’t work. Fine-tuning the model only limits the harm, but doesn’t prevent it.
    381 
    382 This is called a prompt injection and what it means is that model input can’t
    383 be secured. You have to assume that anybody that can send text to the model has
    384 full access to it.
    385 
    386 Language models need to be treated like an unsecured client and only very
    387 carefully integrated into other systems.
    388 
    389 The response
    390 
    391 What you’re likely to get back from that prompt would be something like:
    392 
    393     On July 20, 1969, Neil Armstrong became the first human to step on the
    394     moon.
    395 
    396 This is NASA’s own phrasing. Most answers on the web are likely to be
    397 variations on this, so the answer from a language model is likely to be so too.
    398 
    399   • The moon landing happens to be a fact, but the language model only knows it
    400     as a text.
    401 
    402 The prompt we provided is strongly associated in the training data set with
    403 other sentences that are all variations of NASA’s phrasing of the answer. The
    404 model won’t answer with just “Neil Armstrong” because it isn’t actually
    405 answering the question, it’s responding with the text that correlates with the
    406 question. It doesn’t “know” anything.
    407 
    408   • The language model is fabricating a mathematically plausible response,
    409     based on word distributions in the training data.
    410   • There are no facts in a language model or its output. Only memorised text.
    411 
    412 It only fabricates. It’s all “hallucinations” all the way down.
    413 
    414 Occasionally those fabrications correlate with facts, but that is a
    415 mathematical quirk resulting from the fact that, on average, what people write
    416 roughly correlates with their understanding of a factual reality, which in turn
    417 roughly correlates with a factual reality.
    418 
    419 A knowledge system?
    420 
    421 To be able to answer that question and pass as a knowledge system, the model
    422 needs to memorise the answer, or at least parts of the phrase.
    423 
    424 Because “AI” vendors are performing a sleight-of-hand here and presenting
    425 statistical language synthesis engines as knowledge retrieval systems, their
    426 focus in training and testing is on “facts” and minimising “falsehoods”. The
    427 model has no notion of either, as it’s entirely a language model, so the only
    428 way to square this circle is for the model to memorise it all.
    429 
    430   • To be able to answer a question factually, not “hallucinate”, and pass as a
    431     knowledge system, the model needs to memorise the answer.
    432   • The model doesn’t know facts, only text.
    433   • If you want a fact from it, the model will need to memorise text that
    434     correlates with that fact.
    435 
    436 “Dr. AI”?
    437 
    438 Vendors then compound this by using human exams as benchmarks for reasoning
    439 performance. The problem is that bar exams, medical exams, and diagnosis tests
    440 are specifically designed to mostly test rote memorisation. That’s what they’re
    441 for.
    442 
    443 The human brain is bad at rote memorisation and generally it only happens with
    444 intensive work and practice. If you want to design a test that’s specifically
    445 intended to verify that somebody has spent a large amount of time studying a
    446 subject, you test for rote memorisation.
    447 
    448 Many other benchmarks they use, such as those related to programming languages
    449 also require memorisation, otherwise the systems would just constantly make up
    450 APIs.
    451 
    452   • Vendors use human exams as benchmarks.
    453   • These are specifically designed to test rote memorisation, because that’s
    454     hard for humans.
    455   • Programming benchmarks also require memorisation. Otherwise, you’d only get
    456     pseudocode.
    457 
    458 Between the tailoring of these systems for knowledge retrieval, and the use of
    459 rote memorisation exams and code generation as benchmarks, the tech industry
    460 has created systems where memorisation is a core part of how they function. In
    461 all research to date, memorisation has been key to language model performance
    462 in a range of benchmarks.^[20][1]
    463 
    464 If you’re familiar with storytelling devices, this here would be a [21]
    465 Chekhov’s gun. Observe! The gun is above the mantelpiece:
    466 
    467     👉🏻👉🏻 memorisation!
    468 
    469 Make a note of it, because those finger guns are going to be fired later.
    470 
    471 Biases
    472 
    473 Beyond question and answer, these systems are great at generating the averagely
    474 plausible text for a given prompt. In prose, current system output smells
    475 vaguely of sweaty-but-quiet LinkedIn desperation and over-enthusiastic social
    476 media. The general style will vary, but it’s always going to be the most
    477 plausible style and response based on the training data.
    478 
    479 One consequence of how these systems are made is that they are constantly
    480 backwards-facing. Where brains are focused on the present, often to their
    481 detriment, “AI” models are built using historical data.
    482 
    483 The training data encompasses thousands of diverse voices, styles, structures,
    484 and tones, but some word distributions will be more common in the set than
    485 others and those will end up dominating the output. As a result, language
    486 models tend to lean towards the “racist grandpa who has learned to speak fluent
    487 LinkedIn” end of the spectrum.^[22][2]
    488 
    489 This has implications for a whole host of use cases:
    490 
    491   • Generated text is going to skew conservative in content and marketing copy
    492     in structure and vocabulary. (Bigoted, prejudiced, but polite and
    493     inoffensively phrased.)
    494   • Even when the cut-off date for the data set is recent, it’s still going to
    495     skew historical because what’s new is also comparatively smaller than the
    496     old.
    497   • Language models will always skew towards the more common, middling,
    498     mediocre, and predictable.
    499   • Because most of these models are trained on the web, much of which is
    500     unhinged, violent, pornographic, and abusive, some of that language will be
    501     represented in the output.
    502 
    503 Modify, summarise, and “reason”
    504 
    505 The superpower that these systems provide is conversion or modification. They
    506 can, generally, take text and convert it to another style or structure. Take
    507 this note and turn it into a formal prose, and it will! That’s amazing. I don’t
    508 think that’s a trillion-dollar industry, but it’s a neat feature that will
    509 definitely be useful.
    510 
    511 They can summarise text too, but that’s much less reliable than you’d expect.
    512 It unsurprisingly works best with text that already provides its own summary,
    513 such as a newspaper article (first paragraphs always summarise the story),
    514 academic paper (the abstract), or corporate writing (executive summary).
    515 Anything that’s a mix of styles, voices, or has an unusual structure won’t work
    516 as well.
    517 
    518 What little reasoning they do is entirely based on finding through correlation
    519 and re-enacting prior textual descriptions of reasoning. They fail utterly when
    520 confronted with adversarial or novel examples. They also fail if you rephrase
    521 the question so that it no longer correlates with the phrasing in the data set.
    522 ^[23][3]
    523 
    524 So, not actual reasoning. “Reasoning”, if you will. In other “AI” model genres
    525 these correlations are often called “shortcuts”, which feels apt.
    526 
    527 To summarise:
    528 
    529   • Language models are a mathematical expression of the training data set.
    530   • Have very little in common with human brains.
    531   • Rely on inputs that can’t be secured.
    532   • Lie. Everything they output is a fabrication.
    533   • Memorise heavily.
    534   • Great for modifying text. No sarcasm. Genuinely good at this.
    535   • Occasionally useful for summarisation if you don’t mind being lied to
    536     regularly.
    537   • Don’t actually reason.
    538 
    539 Why I believe “AI” for programming is a bad idea
    540 
    541 If you recall from the start of this essay, I began my research into machine
    542 learning and language models because I was curious to see if they could help
    543 fix or improve the mess that is modern software development.
    544 
    545 There was reason to be hopeful. Programming languages are more uniform and
    546 structured than prose, so it’s not too unreasonable to expect that they might
    547 lend themselves to language models. Programming language output can often be
    548 tested directly, which might help with the evaluation of each training run.
    549 
    550 Training a language model on code also seems to benefit the model. Models that
    551 include substantial code in their data set tend to be better at correlative
    552 “reasoning” (to a point, still not actual reasoning), which makes sense since
    553 code is all about representing structured logic in text.
    554 
    555 But, there is an inherent [24]Catch 22 to any attempt at fixing software
    556 industry dysfunction with more software. The structure of the industry depends
    557 entirely on variables that everybody pretends are proxies for end user value,
    558 but generally aren’t. This will always tend to sabotage our efforts at
    559 industrial self-improvement.
    560 
    561 The more I studied language models as a technology the more flaws I found until
    562 it became clear to me that odds are that the overall effect on software
    563 development will be harmful. The problem starts with the models themselves.
    564 
    565 1. Language models can’t be secured
    566 
    567 This first issue has less to do with the use of language models for software
    568 development and more to do with their use in software products, which is likely
    569 to be a priority for many software companies over the next few years.
    570 
    571 Prompt injections are not a solved problem. OpenAI has come up with a few
    572 “solutions” in the past, but none of them actually worked. Everybody expects
    573 this to be fixed, but nobody has a clue how.
    574 
    575 Language models are fundamentally based on the idea that you give it text as
    576 input and get text as output. It’s entirely possible that the only way to
    577 completely fix this is to invent a completely new kind of language model and
    578 spend a few years training it from scratch.
    579 
    580   • A language model needs to be treated like an unsecured client. It’s about
    581     as secure as a web page form. It’s vulnerable to a new generation of
    582     injection vulnerabilities, both direct and indirect, that we still don’t
    583     quite understand.^[25][4]
    584 
    585 The training data set itself is also a security hazard. I’ve gone into this in
    586 more detail elsewhere^[26][5], but the short version is that training data set
    587 is vulnerable to keyword manipulation, both in terms of altering sentiment and
    588 censorship.
    589 
    590 Again, fully defending against this kind of attack would seem to require
    591 inventing a completely new kind of language model.
    592 
    593 Neither of these issues affect the use of language models for software
    594 development, but it does affect our work because we’re the ones who will be
    595 expected to integrate these systems into existing websites and products.
    596 
    597 2. It encourages the worst of our management and development practices
    598 
    599 A language model will never question, push back, doubt, hesitate, or waver.
    600 
    601 Your managers are going to use it to flesh out and describe unworkable ideas,
    602 and it won’t complain. The resulting spec won’t have any bearing with reality.
    603 
    604 People on your team will do “user research” by asking a language model, which
    605 it will do even though the resulting research will be fiction and entirely
    606 useless.
    607 
    608 It’ll let you implement the worst ideas ever in your code without protest. Ask
    609 a copilot “how can I roll my own cryptography?” and it’ll regurgitate a
    610 half-baked expression of sha1 in PHP for you.
    611 
    612 Think of all the times you’ve had an idea for an approach, looked up how to do
    613 it on the web, and found out that, no, this was a really bad idea? I have a
    614 couple of those every week when I’m in the middle of a project.
    615 
    616 Language models don’t deliver productivity improvements. They increase the
    617 volume, unchecked by reason.
    618 
    619 A core aspect of the theory-building model of software development is code that
    620 developers don’t understand is a liability. It means your mental model of the
    621 software is inaccurate which will lead you to create bugs as you modify it or
    622 add other components that interact with pieces you don’t understand.
    623 
    624 Language model tools for software development are specifically designed to
    625 create large volumes of code that the programmer doesn’t understand. They are
    626 liability engines for all but the most experienced developer. You can’t solve
    627 this problem by having the “AI” understand the codebase and how its various
    628 components interact with each other because a language model isn’t a mind. It
    629 can’t have a mental model of anything. It only works through correlation.
    630 
    631 These tools will indeed make you go faster, but it’s going to be accelerating
    632 in the wrong direction. That is objectively worse than just standing still.
    633 
    634 3. Its User Interfaces do not work, and we haven’t found interfaces that do
    635 work
    636 
    637 Human factors studies, the field responsible for designing cockpits and the
    638 like, discovered that humans suffer from an automation bias.
    639 
    640 What it means is that when you have cognitive automation—something that helps
    641 you think less—you inevitably think less. That means that you are less critical
    642 of the output than if you were doing it yourself. That’s potentially
    643 catastrophic when the output is code, especially since the quality of the
    644 generated code is, understandably considering how the system works, broadly on
    645 the level of a novice developer.^[27][6]
    646 
    647 Copilots and chatbots—exacerbated by anthropomorphism—seem to trigger our
    648 automation biases.
    649 
    650 Microsoft themselves have said that 40% of GitHub Copilot’s output is committed
    651 unchanged.^[28][7]
    652 
    653 Let’s not get into the question of how we, as an industry, put ourselves in the
    654 position where Microsoft can follow a line of code from their language model,
    655 through your text editor, and into your supposedly decentralised version
    656 control system.
    657 
    658 People overwhelmingly seem to trust the output of a language model.
    659 
    660 If it runs without errors, it must be fine.
    661 
    662 But that’s never the case. We all know this. We’ve all seen running code turn
    663 out to be buggy as hell. But something in our mind switches off when we use
    664 tools for cognitive automation.
    665 
    666 4. It’s biased towards the stale and popular
    667 
    668 The biases inherent in these language models are bad enough when it comes to
    669 prose, but they become a functional problem in code.
    670 
    671   • Its JS code will lean towards React and node, most of it several versions
    672     old, and away from the less popular corners of the JS ecosystem.
    673   • The code is, inevitably, more likely to be built around CommonJS modules
    674     instead of the modern ESM modules.
    675   • It won’t know much about Deno or Cloudflare Workers.
    676   • It’ll always prefer older APIs over new. Most of these models won’t know
    677     about any API or module released after 2021. This is going to be an issue
    678     for languages such as Swift.
    679   • New platforms and languages don’t exist to it.
    680   • Existing data will outweigh deprecations and security issues.
    681   • Popular but obsolete or outdated open source projects will always win out
    682     over the up-to-date equivalent.
    683 
    684 These systems live in the popular past, like the middle-aged man who doesn’t
    685 realise he isn’t the popular kid at school any more. Everything he thinks is
    686 cool is actually very much not cool. More the other thing.
    687 
    688 This is an issue for software because our industry is entirely structured
    689 around constant change. Software security hinges on it. All of our practices
    690 are based on constant march towards the new and fancy. We go from framework to
    691 framework to try and find the magic solution that will solve everything. In
    692 some cases language models might help push back against that, but it’ll also
    693 push back against all the very many changes that are necessary because the old
    694 stuff turned out to be broken.
    695 
    696   • The software industry is built on change.
    697   • Language models are built on a static past.
    698 
    699 5. No matter how the lawsuits go, this threatens the existence of free and open
    700 source software
    701 
    702 Many AI vendors are mired in lawsuits.^[29][8]
    703 
    704 These lawsuits all concentrate on the relationship between the training data
    705 set and the model and they do so from a variety of angles. Some are based on
    706 contract and licensing law. Others are claiming that the models violate fair
    707 use. It’s hard to predict how they will go. They might not all go the same way,
    708 as laws will vary across industries and jurisdictions.
    709 
    710 No matter the result, we’re likely to be facing a major decline in the free and
    711 open source ecosystem.
    712 
    713  1. All of these models are trained on open source code without payment or even
    714     acknowledgement, which is a major disincentive for contributors and
    715     maintainers. That large corporations might benefit from your code is a
    716     fixture of open source, but they do occasionally give back to the
    717     community.
    718  2. Language models—built on open source code—commonly replace that code.
    719     Instead of importing a module to do a thing, you prompt your Copilot. The
    720     code generated is almost certainly based on the open source module, at
    721     least partially, but it has been laundered through the language model,
    722     disconnecting the programmer from the community, recognition, and what
    723     little reward there was.
    724 
    725 Language models demotivate maintainers and drain away both resources and users.
    726 What you’re likely to be left with are those who are building core
    727 infrastructure or end-user software out of principle. The “free software” side
    728 of the community is more likely to survive than the rest. The Linux kernel,
    729 Gnome, KDE—that sort of thing.
    730 
    731 The “open source” ecosystem, especially that surrounding the web and node, is
    732 likely to be hit the hardest. The more driven the open source project was by
    733 its proximity to either an employed contributor or actively dependent business,
    734 the bigger the impact from a shift to language models will be.
    735 
    736 This is a serious problem for the software industry as arguably much of the
    737 economic value the industry has provided over the past decade comes from
    738 strip-mining open source and free software.
    739 
    740 6. Licence contamination
    741 
    742 Microsoft and Google don’t train their language models on their own code.
    743 GitHub’s Copilot isn’t trained on code from Microsoft’s office suite, even
    744 though many of its products are likely to be some of the largest React Native
    745 projects in existence. There aren’t many C++ code bases as big as Windows.
    746 Google’s repository is probably one of the biggest collection of python and
    747 java code you can find.
    748 
    749 They don’t seem to use it for training, but instead train on collections of
    750 open source code that contain both permissive and copyleft licences.
    751 
    752 Copyleft licences, if used, force you to release your own project under their
    753 licence. Many of them, even non-copyleft, have patent clauses, which is poison
    754 for quite a few employers. Even permissive licences require attribution, and
    755 you can absolutely get sued if you’re caught copying open source code without
    756 attribution.
    757 
    758 Remember our Chekhov’s gun?
    759 
    760     👉🏻👉🏻 memorisation!
    761 
    762 Well, 👉🏻👉🏻 pewpew!!!
    763 
    764 Turns out blindly copying open source code is problematic. Whodathunkit?
    765 
    766 These models all memorise a lot, and they tend to copy what they memorise into
    767 their output. [30]GitHub’s own numbers peg verbatim copies of code that’s at
    768 least 150 characters at 1%^[31][9], which is roughly the same, in terms of
    769 verbatim copying, as what you seem to get in other language models.
    770 
    771 For context, that means that if you use a language model for development, a
    772 copilot or chatbot, three or four times a day, you’re going to get a verbatim
    773 copy of open source code injected into your project about once a month. If
    774 every team member uses one, then multiply that by the size of the team.
    775 
    776 GitHub’s Copilot has a feature that lets you block verbatim copies. This
    777 obviously requires both a check, which slows the result down, and it will throw
    778 out a bunch of useful results, making the language model less useful. It’s
    779 already not as useful as it’s made out to be and pretty darn slow so many
    780 people are going to turn off the “please don’t plagiarise” checkbox.
    781 
    782 But even GitHub’s checks are insufficient. The keyword there is “verbatim”,
    783 because language models have a tendency to rephrase their output. If GitHub
    784 Copilot copies a GPLed implementation of an algorithm into your project but
    785 changes all the variable names, Copilot won’t detect it, it’ll still be
    786 plagiarism and the copied code is still under the GPL. This isn’t unlikely as
    787 this is how language models work. Memorisation and then copying with light
    788 rephrasing is what they do.
    789 
    790 Training the system only on permissively licensed code doesn’t solve the
    791 problem. It won’t force your project to adopt an MIT licence or anything like
    792 that, but you can still be sued if it’s discovered.
    793 
    794 This would seem to give Microsoft and GitHub a good reason not to train on the
    795 Office code base, for example. If they did, there’s a good chance that a prompt
    796 to generate DOCX parsing code might “generate” a verbatim copy of the DOCX
    797 parsing code from Microsoft Word.
    798 
    799 And they can’t have that, can they? This would both undercut their own
    800 strategic advantage, and it would break the illusion that these systems are
    801 generating novel code from scratch.
    802 
    803 This should make it clear that what they’re actually doing is strip-mine the
    804 free and open source software ecosystem.
    805 
    806 How much of a problem is this?
    807 
    808 —It won’t matter. I won’t get caught.
    809 
    810 You personally won’t get caught, but your employer might, and Intellectual
    811 Property scans or similar code audits tend to come up at the absolute worst
    812 moments in the history of any given organisation:
    813 
    814   • During due diligence for an acquisition. Could cost the company and
    815     managers a fortune.
    816   • In discovery for an unrelated lawsuit. Again, could cost the company a
    817     fortune.
    818   • During hacks and other security incidents. Could. Cost. A. Fortune.
    819 
    820 “AI” vendors won’t take any responsibility for this risk. I doubt your business
    821 insurance covers “automated language model plagiarism” lawsuits.
    822 
    823 Language models for software development are a lawsuit waiting to happen.
    824 
    825 Unless they are completely reinvented from scratch, language model code
    826 generators are, in my opinion, unsuitable for anything except for prototypes
    827 and throwaway projects.
    828 
    829 So, obviously, everybody’s going to use them
    830 
    831   • All the potentially bad stuff happens later. Unlikely to affect your
    832     bonuses or employment.
    833   • It’ll be years before the first licence contamination lawsuits happen.
    834   • Most employees will be long gone before anybody realises just how much of a
    835     bad idea it was.
    836   • But you’ll still get that nice “AI” bump in the stock market.
    837 
    838 What all of these problems have in common is that their impact is delayed and
    839 most of them will only appear in the form of increased frequency of bugs and
    840 other defects and general project chaos.
    841 
    842 The biggest issue, licence contamination, will likely take years before it
    843 starts to hit the industry, and is likely to be mitigated by virtue of the fact
    844 that many of the heaviest users of “AI”-generated code will have folded due to
    845 general mismanagement long before anybody cares enough to check their code.
    846 
    847 If you were ever wondering if we, as an industry, were capable of coming up
    848 with a systemic issue to rival the Y2K bug in scale and stupidity? Well, here
    849 you go.
    850 
    851 You can start using a language model, get the stock market bump, present the
    852 short term increase in volume as productivity, and be long gone before anybody
    853 connects the dots between language model use and the jump in defects.
    854 
    855 Even if you purposefully tried to come up with a technology that played
    856 directly into and magnified the software industry’s dysfunctions you wouldn’t
    857 be able to come up with anything as perfectly imperfect as these language
    858 models.
    859 
    860 It’s nonsense without consequence.
    861 
    862 Counterproductive novelty that you can indulge in without harming your career.
    863 
    864 It might even do your career some good. Show that you’re embracing the future.
    865 
    866 But…
    867 
    868 The best is yet to come
    869 
    870 In a few years’ time, once the effects of the “AI” bubble finally dissipates…
    871 
    872 Somebody’s going to get paid to fix the crap it left behind.
    873 
    874 The best way to support this newsletter or my blog is to buy one of my books, 
    875 [32]The Intelligence Illusion: a practical guide to the business risks of
    876 Generative AI or [33]Out of the Software Crisis. Or, you can buy them both [34]
    877 as a bundle.
    878 
    879 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    880 
    881  1. There’s quite a bit of papers that either highlight the tendency to
    882     memorise or demonstrate a strong relationship between that tendency and
    883     eventual performance.
    884 
    885       □ [35]An Empirical Study of Memorization in NLP (Zheng & Jiang, ACL 2022)
    886       □ [36]Does learning require memorization? a short tale about a long tail.
    887         (Feldman, 2020)
    888       □ [37]When is memorization of irrelevant training data necessary for
    889         high-accuracy learning? (Brown et al. 2021)
    890       □ [38]What Neural Networks Memorize and Why: Discovering the Long Tail
    891         via Influence Estimation (Feldman & Zhang, 2020)
    892       □ [39]Question and Answer Test-Train Overlap in Open-Domain Question
    893         Answering Datasets (Lewis et al., EACL 2021)
    894       □ [40]Quantifying Memorization Across Neural Language Models (Carlini et
    895         al. 2022)
    896       □ [41]On Training Sample Memorization: Lessons from Benchmarking
    897         Generative Modeling with a Large-scale Competition (Bai et al. 2021)
    898     [42]↩︎
    899  2. See the [43]Bias & Safety card at [44]needtoknow.fyi for references. [45]↩︎
    900 
    901  3. See the [46]Shortcut “Reasoning” card at [47]needtoknow.fyi for references.
    902     [48]↩︎
    903 
    904  4. Simon Willison has been covering this issue [49]in a series of blog posts. 
    905     [50]↩︎
    906 
    907  5.
    908       □ [51]The poisoning of ChatGPT
    909       □ [52]Google Bard is a glorious reinvention of black-hat SEO spam and
    910         keyword-stuffing
    911     [53]↩︎
    912  6. See, for example:
    913 
    914       □ [54]Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s
    915         Code Contributions (Hammond Pearce et al., December 2021)
    916       □ [55]Do Users Write More Insecure Code with AI Assistants? (Neil Perry
    917         et al., December 2022)
    918     [56]↩︎
    919  7. This came out [57]during an investor event and was presented as evidence of
    920     the high quality of Copilot’s output. [58]↩︎
    921 
    922  8.
    923       □ [59]Getty Images v. Stability AI - Complaint
    924       □ [60]Getty Images is suing the creators of AI art tool Stable Diffusion
    925         for scraping its content
    926       □ [61]The Wave of AI Lawsuits Have Begun
    927       □ [62]Copyright lawsuits pose a serious threat to generative AI
    928       □ [63]GitHub Copilot litigation
    929       □ [64]Stable Diffusion litigation
    930     [65]↩︎
    931  9. Archived link of the [66]GitHub Copilot feature page. [67]↩︎
    932 
    933 Join the Newsletter
    934 
    935 Subscribe to the Out of the Software Crisis newsletter to get my weekly (at
    936 least) essays on how to avoid or get out of software development crises.
    937 
    938 Join now and get a free PDF of three bonus essays from Out of the Software
    939 Crisis.
    940 
    941 [68][                    ]
    942 Subscribe
    943 
    944 We respect your privacy.
    945 
    946 Unsubscribe at any time.
    947 
    948 [70]Mastodon [71]Twitter [72]GitHub [73]Feed
    949 
    950 References:
    951 
    952 [1] https://softwarecrisis.dev/
    953 [2] https://softwarecrisis.dev/
    954 [3] https://softwarecrisis.baldurbjarnason.com/
    955 [4] https://illusion.baldurbjarnason.com/
    956 [5] https://softwarecrisis.dev/archive/
    957 [6] https://softwarecrisis.dev/author/
    958 [7] https://www.hakkavelin.is/
    959 [8] https://illusion.baldurbjarnason.com/
    960 [9] https://softwarecrisis.baldurbjarnason.com/
    961 [10] https://baldurbjarnason.lemonsqueezy.com/checkout/buy/cfc2f2c6-34af-436f-91c1-cb2e47283c40
    962 [11] https://www.baldurbjarnason.com/2021/software-crisis-2/
    963 [12] https://standishgroup.com/sample_research_files/CHAOSReport2015-Final.pdf
    964 [13] https://softwarecrisis.baldurbjarnason.com/
    965 [14] https://quoteinvestigator.com/2019/09/19/woodpecker/
    966 [15] http://worrydream.com/refs/Brooks-NoSilverBullet.pdf
    967 [16] https://illusion.baldurbjarnason.com/
    968 [17] https://www.baldurbjarnason.com/2022/theory-building/
    969 [18] https://softwarecrisis.baldurbjarnason.com/
    970 [19] https://en.wikipedia.org/wiki/Mitochondrion
    971 [20] https://softwarecrisis.dev/letters/ai-and-software-quality/#fn1
    972 [21] https://en.wikipedia.org/wiki/Chekhov's_gun
    973 [22] https://softwarecrisis.dev/letters/ai-and-software-quality/#fn2
    974 [23] https://softwarecrisis.dev/letters/ai-and-software-quality/#fn3
    975 [24] https://en.wikipedia.org/wiki/Catch-22_(logic)
    976 [25] https://softwarecrisis.dev/letters/ai-and-software-quality/#fn4
    977 [26] https://softwarecrisis.dev/letters/ai-and-software-quality/#fn5
    978 [27] https://softwarecrisis.dev/letters/ai-and-software-quality/#fn6
    979 [28] https://softwarecrisis.dev/letters/ai-and-software-quality/#fn7
    980 [29] https://softwarecrisis.dev/letters/ai-and-software-quality/#fn8
    981 [30] https://archive.ph/2023.01.11-224507/https://github.com/features/copilot#selection-19063.298-19063.462:~:text=Our%20latest%20internal%20research%20shows%20that%20about%201%25%20of%20the%20time%2C%20a%20suggestion%20may%20contain%20some%20code%20snippets%20longer%20than%20~150%20characters%20that%20matches%20the%20training%20set.
    982 [31] https://softwarecrisis.dev/letters/ai-and-software-quality/#fn9
    983 [32] https://illusion.baldurbjarnason.com/
    984 [33] https://softwarecrisis.baldurbjarnason.com/
    985 [34] https://baldurbjarnason.lemonsqueezy.com/checkout/buy/cfc2f2c6-34af-436f-91c1-cb2e47283c40
    986 [35] https://aclanthology.org/2022.acl-long.434
    987 [36] https://doi.org/10.1145/3357713.3384290
    988 [37] https://doi.org/10.1145/3406325.3451131
    989 [38] https://papers.nips.cc/paper/2020/hash/1e14bfe2714193e7af5abc64ecbd6b46-Abstract.html
    990 [39] https://aclanthology.org/2021.eacl-main.86
    991 [40] https://arxiv.org/abs/2202.07646
    992 [41] https://dl.acm.org/doi/10.1145/3447548.3467198
    993 [42] https://softwarecrisis.dev/letters/ai-and-software-quality/#fnref1
    994 [43] https://needtoknow.fyi/card/bias/
    995 [44] https://needtoknow.fyi/
    996 [45] https://softwarecrisis.dev/letters/ai-and-software-quality/#fnref2
    997 [46] https://needtoknow.fyi/card/shortcut-reasoning/
    998 [47] https://needtoknow.fyi/
    999 [48] https://softwarecrisis.dev/letters/ai-and-software-quality/#fnref3
   1000 [49] https://simonwillison.net/series/prompt-injection/
   1001 [50] https://softwarecrisis.dev/letters/ai-and-software-quality/#fnref4
   1002 [51] https://softwarecrisis.dev/letters/the-poisoning-of-chatgpt/
   1003 [52] https://softwarecrisis.dev/letters/google-bard-seo/
   1004 [53] https://softwarecrisis.dev/letters/ai-and-software-quality/#fnref5
   1005 [54] https://doi.org/10.48550/arXiv.2108.09293
   1006 [55] https://doi.org/10.48550/arXiv.2211.03622
   1007 [56] https://softwarecrisis.dev/letters/ai-and-software-quality/#fnref6
   1008 [57] https://www.microsoft.com/en-us/Investor/events/FY-2023/Morgan-Stanley-TMT-Conference#:~:text=Scott%20Guthrie%3A%20I%20think%20you%27re,is%20now%20AI%2Dgenerated%20and%20unmodified
   1009 [58] https://softwarecrisis.dev/letters/ai-and-software-quality/#fnref7
   1010 [59] https://copyrightlately.com/pdfviewer/getty-images-v-stability-ai-complaint/?auto_viewer=true#page=&zoom=auto&pagemode=none
   1011 [60] https://www.theverge.com/2023/1/17/23558516/ai-art-copyright-stable-diffusion-getty-images-lawsuit
   1012 [61] https://www.plagiarismtoday.com/2023/01/17/the-wave-of-ai-lawsuits-have-begun/
   1013 [62] https://www.understandingai.org/p/copyright-lawsuits-pose-a-serious
   1014 [63] https://githubcopilotlitigation.com/
   1015 [64] https://stablediffusionlitigation.com/
   1016 [65] https://softwarecrisis.dev/letters/ai-and-software-quality/#fnref8
   1017 [66] https://archive.ph/2023.01.11-224507/https://github.com/features/copilot#selection-19063.298-19063.462:~:text=Our%20latest%20internal%20research%20shows%20that%20about%201%25%20of%20the%20time%2C%20a%20suggestion%20may%20contain%20some%20code%20snippets%20longer%20than%20~150%20characters%20that%20matches%20the%20training%20set.
   1018 [67] https://softwarecrisis.dev/letters/ai-and-software-quality/#fnref9
   1019 [70] https://toot.cafe/@baldur
   1020 [71] https://twitter.com/fakebaldur
   1021 [72] https://github.com/baldurbjarnason
   1022 [73] https://softwarecrisis.dev/feed.xml