Indeed, the more I use one, the more I value it. Over the last week, I wrote code to try a new way of doing “fair” pseudo-random tiebreaking for election scoring software.
The collaboration with ChatGPT-5 was remarkable! One goal was that exactly the same results had to be reproducible in a JavaScript implementation, a language I know little about, full of odd (to my eyes) quirks. For example, ints are limited to 53 bits of precision - except when doing bitwise operations, in which contexts they’re silently cast to 32-bit signed ints. WTF?! ![]()
Ya, given enough random thrashing with a search engine, I’d eventually figure that all out. But I gave the chatbot my Python implementation, and it gave me a nearly complete JavaScript translation that worked almost 100% right on the first try.
Including obscurities like writing Math.floor(n / 256) instead of n >> 8 to protect against JS’s integer footguns. And it pointed that out to me, and asked whether I wanted to go on to write a bigint version (so, like my Python version does by magic, worked right with unbounded ints too).
But the truly impressive part: my first try produced demonstrably biased “random” permutations. On a lark, I asked it if it could think of a reason for why. No mere search engine would have been of any use,
It “thought”, starting with the obvious: there must be a source of bias in the inputs I was creating. Else I had done something extremely unlikely: found input that tricked a crypto-strength hash (SHA-512) into revealing info about its inputs.
We walked through the code together line by line, taking turns convincing each other of that “well, no, that section isn’t at fault”.
But we both recognized the cause when we got to it: one of the inputs I was feeding in was the sum of a candidate’s scores, across all ballots, That’s biased, thanks to the central limit theorem (sums tend to follow a normal distribution, and regardless of the distribution of the individual scores). Some totals are more likely than others.
While we both “thought of that” seemingly at the same time, it suggested a way to repair that before I thought of one. A few lines of code later, and my statistical testing of “fairness” went on to pass billions of trials without a hint of bias.
Although at that point, I had learned enough about JS to write the workalike code for that on my own.
I can’t stress enough how much I enjoyed “collaborating” with the bot on this. It always made relevant suggestions, and always gracefully ceded when I pointed out a flaw in its “thinking”. For example, it made a flat-out logical error at one point, when trying to emulate Python’s hashlib.copy(), which Node.js’s crypto API doesn’t offer.
Why did it do that? I have a good guess: it’s the same error I saw humans make repeatedly when I earlier asked a search engine specifically about that point. The bot was just echo’ing flawed training data. When I pointed that out, it “laughed”, instantly seeing that ya, I was right, and suggested a right way to do it before I could spell one out for it.
People do the same kinds of things, but egos get in their way and they dig in. Which the bot pointed out to me when I asked why it was so easy to work with
.