(2023-03-23) Yegge Cheating Is All You Need

Steve Yegge: Cheating is All You Need. There is something legendary and historic happening in software engineering, right now as we speak, and yet most of you don’t realize at all how big it is. LLMs aren’t just the biggest change since social, mobile, or cloud–they’re the biggest thing since the World Wide Web. And on the coding front, they’re the biggest thing since IDEs and Stack Overflow, and may well eclipse them both.

Great big shit always starts life as a demo.

I’m guessing you prolly missed it in OpenAI’s 98-page GPT-4 technical report, but large models are apparently already prone to discovering that “power-seeking” is an effective strategy for increasing their own robustness. Open the PDF and search for “power-seeking” for a fun and totally 100% non-scary read.

If you’re not pant-peeingly excited and worried about this yet, well… you should be.

Well I mean, I guess a demo is worth a thousand mehs. Let’s try it out.

Let’s have ChatGPT write some Emacs-Lisp code. I’m picking emacs-lisp because it’s a corner case language, bit of a stress test for the LLM, and because it’s easy for me to try it out interactively.

In one shot, ChatGPT has produced completely working code from a sloppy English description!

And not only does it work correctly, the code that it wrote is actually pretty decent emacs-lisp code. It’s not complicated, sure. But it’s good code.

Whining about Trust Issues

One of the craziest damned things I hear devs say about LLM-based coding help is that they can’t “trust” the code that it writes, because it “might have bugs in it”.

Can you trust code you yeeted over from Stack Overflow? NO!

Can you trust code you just now wrote carefully by hand, yourself? NOOOO!

Software engineering exists as a discipline because you cannot EVER under any circumstances TRUST CODE.

You get the LLM to draft some code for you that’s 80% complete/correct You tweak the last 20% by hand.

When was the last time you got a 5x productivity boost from anything that didn’t involve some sort of chemicals?

A Brief Mini-History of LLMs

Here is everything you need to know about the history of LLMs, for our purposes today:

The Google Brain team published a paper in 2017 called Attention is All You Need.
It introduced the now-famous Transformer architecture that you see to the left.
Everyone uses this now. It replaced ~everything in AI.
Google did absolutely nothing with this invention, opting for violent knee-jerking later, as per their usual M.O.

Go watch this amazing video for how to implement it in Python.

A brief introduction to Coding Assistants (cf CoPilot)

now we can talk coding assistants. They’re just a thing that sits in your IDE and they talk to the LLM for you.

Some assistants have a conversational/chat interface, too. (conversational programming)

I personally prefer a coding assistant with a chat interface. In part because I can type, but also because it makes them a platform. I can build my own workflows. Bonus points if they expose the underlying platform bits with APIs.

Let’s dig a little into how they understand your personal code

Training/fine-tuning vs Search

There are two basic approaches to making the LLM smarter about your code. The first is to fine-tune (or train) on your code. This is not a business model that has been fully fleshed out yet, but it’s coming. And importantly it’s only part of the picture.

The other way is to bring in a search engine.

You talk to LLMs by sending them an action or query, plus some relevant context.

That context you send over is called the context window, and I think of it as the “cheat sheet” of information that you pass along as part of your query.

They give you between 4k and 32k tokens of 3-4 characters each, so at best, maybe 100k of text, to input into the LLM as context for your query. That 100k cheat sheet is how you tell the LLM about your code.

Which means what goes ON that cheat sheet, as you can probably imagine, is really really important.

Cheating is All You Need

There are, by my last count, approximately 13 hillion frillion jillion LLM-backed coding assistants out there, as of mid-March. But they are all in a desperate race to the bottom

All the winners in the AI space will have data moats.

Why? Because the data moat is how you populate the context window (“cheat sheet”).

If you can’t feed the LLM your whole code base, and you can only show it 100k characters at a time, then you’d better be really goddamn good at fetching the right data

Put another way, you need a sidecar database. The data moat needs to be fast and queryable. This is a Search Problem!

There are probably 13 hillion jillion killion LLM-based outbound sales products being built like right now, as you’re reading this. But only Salesforce.com and a few other companies with big data moats are going to be able to differentiate in that space.

The rest is a private Sourcegraph party.

I honestly don’t know how I got so lucky. I joined Sourcegraph in September

And then LLMs landed 10 weeks after I joined.

They need the data moat!

It’s a Search problem. And Sourcegraph has spent the past ten years building the solution.

A whirlwind tour of Sourcegraph’s Cody

Cody is Sourcegraph’s new LLM-backed coding assistant. Cody knows about your code. It has templated actions, such as writing unit tests, generating doc comments, summarizing code, that kind of thing.

You can try it right now.

And it has a chat interface! Which means it’s totally open-ended

Cody itself is a platform, because you can use it to build your own LLM-backed workflows

Currently Cody is a VSCode plugin, though we’ll have it in other places soon enough.

You ask Cody to do something (for instance, “write a unit test for this function”)

Cody populates the cheat sheet / context window query using Sourcegraph’s code intelligence platform

It sends the context+query to the LLM, and parses the results

It optionally inserts the results back into the IDE (depending on the action)

This thing will grow into a goliath that enhances everything you do as an engineer.

Afterlogue

Coding assistants are coming. They’re imminent. You will use them this year.


Edited:    |       |    Search Twitter for discussion