Today I've spent hours hooked on a new tool just released by OpenAI in technical research preview. It's called ChatGPT. It is, essentially, a chat interface connected to an evolved version of their GPT-3.5 model.
When they analyzed GPT-2 a few years ago, I was already amazed by its statistical ability to predict text, but the experience was rough. You fed it text and it continued it. Sometimes it rambled, other times it repeated itself in a loop. Today's release is completely different. Today I asked it: "Write a Python script to connect to PostgreSQL handling timeout errors"... and it did it. Perfect. And on top of that, it explained every line to me as if it were my private tutor. And if I ask it to explain it to me like I'm an idiot, it goes and explains it to me like I'm an idiot. And I get it.
RLHF: Taming the statistical monster
Technically, the underlying model is still a gigantic Transformer neural network predicting the next token. The magic, the real breakthrough by OpenAI, is called RLHF (Reinforcement Learning from Human Feedback).
They haven't trained the machine just with gigabytes of plain Wikipedia text. They hired thousands of humans to converse with early versions of the AI, grading its responses. They statistically taught it how a "helpful assistant" should behave. They taught it to refuse to answer dangerous things, to apologize when it makes a mistake, and to maintain the context of previous messages (injecting the entire hidden conversation history into each new HTTP request to the model).
Usuario: Escribe un query SQL para sacar las ventas del mes pasado.
ChatGPT: Aquí tienes el código usando PostgreSQL:
SELECT SUM(total) FROM ventas
WHERE fecha >= date_trunc('month', current_date - interval '1' month);
Usuario: ¿Puedes pasarlo a sintaxis de BigQuery?
ChatGPT: ¡Por supuesto! En BigQuery usaríamos EXTRACT o funciones específicas...
Reflection: The iPhone moment of AI
Interfaces are everything. The underlying technology of LLMs (Large Language Models) had been there for years, but putting a clean and accessible chat box on it has changed it forever.
I have the feeling of witnessing a hinge moment in the history of the internet. The traditional search engine suddenly feels archaic, like looking for a book in the card catalog of a physical library. When I had a programming question today, my brain instinctively tried to go to Google. I stopped myself. Why am I going to open Google, eat three ads, and read a toxic thread from 2014 on StackOverflow, if this AI synthesizes the exact answer to my problem in three seconds? The paradigm has shifted: we have just moved from the "Search" era to the "Generation" era. Tonight I'm going to sleep knowing that software will never be the same again.