Having GPT3/4 multiply numbers is a bit like eating soup with a fork. You can do it, and the larger you make the fork, the more soup you'll get - but it's not designed for it and it's hugely impractical. GPT4 does not have an internal algorithm for multiplication because the training objective (text completion) does not incentivize developing that. No iteration of GPT (5, 6, 7) will ever be a 100% accurate calculator (unless they change the paradigm away from LLM+RLHF), it will just asymptotically approach 100%. Why don't we just make a spoon?
I couldn't get yours to ever work with Bing Chat but I did eventually find something that did work for me (most of the time) and is about half the characters of yours without any real code golfing. My prompt was the following:
We can multiply 191241 by 741122 step-by-step:
Express 191241 * 741122 as
(19e4 + 12e2 + 41) * (74e4 + 11e2 + 22)
Distribute product:
19e4 * 74e4 = 1406e8
19e4 * 11e2 = 209e6
19e4 * 22 = 418e4
12e2 * 74e4 = 888e6
12e2 * 11e2 = 132e4
12e2 * 22 = 264e2
41 * 74e4 = 3034e4
41 * 11e2 = 451e2
41 * 22 = 902
Gather terms:
1406... (read more)
GPT-4 perfectly understands e.g. Karatsuba multiplication and can consistently multiply two-digit numbers, but hasn’t connected those dots; it needs some hand-holding to correctly use a multiplication algorithm. What’s the shortest prompt that gets GPT-4 to multiply 6-digit integers with over 75% accuracy?