Teaching a neural network to use a calculator
reiinakano.com
reiinakano.com
If you wanted to use this to solve other (e.g. programming) problems you would need examples of every step required for almost every problem.
Using neural networks in this way is akin to locality sensitive hashing, instead it should understand what it's lowest level operators do and discover useful combinations of them that can solve new problems.
That seems like a much better demo of using blackbox tools as substeps in problem solving. Is there a reason why it shouldn't work when the blackbox is a more complex function like sympy's eval?
> To try and explain this, we point out that although questions are unique, a lot of them will share the same answers. For example, Calculate prob of sequence aad from abcda, Calculate prob of sequence bbz from zbbmn, and Calculate prob of sequence rpr from {r: 2, p: 1, x:2} all lead to the same answer, 1/30.
> Doing a bit of analysis on training set questions, we find that out of 1 million samples each, swr_p_level_set and swr_p_sequence have 977179 and 978045 unique questions, respectively. This seems reasonable, as duplicates are limited to <3% of the training set and the distribution over questions appears fairly uniform.
> On the other hand, doing analysis on training set answers reveals that out of 1 million samples eachs, swr_p_level_set and swr_p_sequence have 1458 and 1865 unique answers, respectively.
> Counting the collective number of samples that share the top K most common answers reveals even more imbalance.
This is the real takeaway for me from the article.
But the article is more about using neural network transformers to build steps of a mathematical proof with each step checked by a symbolic "calculator". I.e., transformers applied to mathematical proofs.
Are we really capable of teaching a NN to parse and calculate an arbitrary arithmetic expression? Because that sounds incredibly impressive...
https://openreview.net/pdf?id=S1eZYeHFDS
Natural language is harder.
http://static.offd.es/numerals/
It’s unsurprisingly easy to implement
I don’t see any reason why it would be significantly harder to do, however
You’re right about accuracy. I didn’t let the model train enough to push the error low enough to guarantee exact results over the input range. But then again this was designed as a toy experiment, not something people should rely on