cat posts/2024-09-17-reasoning-models.md

Reasoning models

· 4 min read · ai llms programming

48 seconds. That’s how long o1-preview “thought” before answering my first question on Thursday night, and I spent most of those seconds assuming it had hung. I’ve been conditioned by two years of chat models to expect the first word within a second, so watching a little “Thinking” label with a timer felt broken. Then the answer was right, and it was right about something GPT-4o had got confidently wrong twice the week before.

The question was a timezone bug, which I’ll write up properly next month. Short form: a function that computes the next run of a recurring job by adding 24 hours to the last run, in UTC, for a customer who scheduled it for “9 a.m. every day” in their local time. Twice a year that’s off by an hour, and the existing tests didn’t cover a DST change. I’d written a stripped-down version from scratch, with no company code in it, since our AI policy keeps company code out of consumer ChatGPT and o1 isn’t available on our API account yet. GPT-4o, given the same thing, rewrote the function more nicely and kept the bug. o1-preview’s answer started by asking what “every day at 9” means when a day is 23 hours long, which is the right question.

What it is

OpenAI released two models on Thursday, o1-preview and o1-mini, with a post called “Learning to Reason with LLMs”. The idea is that the model has been trained, with reinforcement learning, to produce a long chain of reasoning before it gives an answer: break the problem down, try an approach, notice a mistake, back up. The chain of thought was a prompting trick before. Now it’s something the model has been trained to do well, and the claim is that performance keeps improving as you let it think longer, so there’s a new knob, compute at answer time, and not only compute at training time.

The benchmark numbers are big. On the 2024 AIME math exam, OpenAI says GPT-4o solved about 12% of the problems on average and o1 about 74% with a single attempt. On Codeforces o1 is at the 89th percentile. Those are for o1, though, which isn’t released. What we got is o1-preview, which is an earlier checkpoint and noticeably weaker on those charts, and o1-mini, which OpenAI says is nearly as good as o1 at competitive programming and much cheaper. Both are in ChatGPT Plus, and at launch the cap was 30 messages a week for preview and 50 for mini, which I’ve been rationing like a student with a meal plan.

What it changes for code

After five days and about twenty-five prompts, here’s where I am.

It’s better, clearly, at problems where the difficulty is thinking. The timezone bug. An interval-merging function with an off-by-one I’d planted on purpose, which it found and explained. A question about whether a sequence of Postgres lock acquisitions could deadlock, where it walked through the interleavings one by one, which is what I’d have done on a whiteboard, more slowly. It also did well on a couple of Advent of Code puzzles from last December that GPT-4 had struggled with.

It’s no better, and much slower, at ordinary code. I asked both models for a small CRUD endpoint in C# with validation. GPT-4o gave me a reasonable answer in about five seconds. o1-preview thought for half a minute and gave me a slightly longer reasonable answer. For the bulk of the work my team does with Copilot and GPT-4 every day, boilerplate and tests and “what does this function do”, none of this matters, and I wouldn’t switch.

What it doesn’t do at all yet is anything with tools. In ChatGPT it can’t browse, take files or run code, and in the API it doesn’t support system messages, streaming or function calling, so you can’t build anything interesting on top of it yet. I expect that to change quickly.

So my first guess about what it changes is the debugging and the review side, not the writing side. A model you hand a failing test and a stack trace and that comes back a minute later with a hypothesis would be useful. Whether “a minute later” becomes “ten minutes later, but right more often” is the question OpenAI’s test-time compute chart is really asking, and I don’t know the answer.

The part I don’t like

You don’t get to see the reasoning. ChatGPT shows a summary of it, a few lines like “Considering daylight saving transitions”, and the actual chain stays hidden. OpenAI’s post says they want to be able to monitor the raw chain of thought for things like the model trying to manipulate the user, which means it has to be left unpolished, so they don’t want to show it. One of the reasons they list for hiding it is, in so many words, competitive advantage. There are reports this week of people getting warning emails from OpenAI after trying to get the model to reveal its reasoning.

In the API, those hidden reasoning tokens are billed as output tokens. You pay for thinking you can’t read. For the timezone bug that’s fine; I can check the answer. But the whole appeal of a model that reasons is the reasoning, and when it’s wrong, which it will be, the most useful thing to look at is the part I’m not allowed to see. I’ve spent thirty years debugging code by reading what it did, and I’m not keen to start debugging an answer by guessing what it thought.

I’ll keep using it for the hard ones. I’ve started keeping a note of them during the week and sending them in a batch, which is a very strange way to use a computer.