With a few lines of code, you can just create a list with all the numbers that are even and when you need to check if a number is odd, you simply have to check if it's in the list.
Yes, this is what we do as a RAG workflow. We created a list of all 32bit unsigned integers and whether they were even or odd, and we pass that into the context. The future is amazing!
We have an agentic system that looks up the context size, and then summarizes the even/odd table if necessary. We lose a little bit of accuracy, but now we can handle any model. Be sure to like & subscribe!
I have found that even 2 bit quantization works, but you have to make sure you only discard the LABs (that’s what we are calling the Left Aligned Bits internally). I have no idea why it works so well but it has cut our costs significantly.
Yeah, some of the bigger numbers were a problem, so we switched to using a horizontally scaling db cluster so that we could cover all of the (useful) numbers. When we encounter a new number, it gets routed to the appropriate db where the results of the function are cached after being calculated. We're thinking of spinning it off as an API service actually if there's any interest.