Inspiration

We all had previous frustration with ChatGPT and word problems with math, as often times it would get the problem really close, but still wrong. A general trend that we noticed was that ChatGPT was generally a good indicator of the steps required. Therefore, we decided that it may be better to offload the actual number crunching from large LLMs that aren't specialized for getting accurate math due to the pattern recognition feature.

What it does

Topo Logic is a web application that allows you to solve generalized math problems. They can be anywhere from word problems to straight math equations. It will also store your previous questions and answers for you to reference in the future if needed.

How we built it

We built Topo Logic by using React in the front-end and Python with the Flask library to create a back-end api. The input txt file from the user will be stored into Pinata and also be run through a Samba Nova Llama model to get the steps of solving the problem and each step's dependent steps. Then the steps get parsed into a directed graph, which is then topologically sorted to achieve a fast and space-efficient step-by-step solution, which is then solved at each step using predetermined math functions to guarentee accuracy. Then the results and the original steps with descriptions are passed back into the Llama to generate a readable step-by-step solution.

Challenges we ran into

Some challenges we ran into were with linking our front and back-ends together, as we needed to figure out the fuzzy lines between the two for which end gets which job. We also found a lot of trouble with keeping the json files accurate in format for our solver to successfully solve. We definitely found trouble trying to work with git as we were not the most familiar with it. Lastly, We had trouble with fine-tuning the context prompt for the Llamas model. We managed to mostly get around this by using very specific instructions.

Accomplishments that we're proud of

We are very proud of our front-end and how easy it is to navigate and use, as well as how it looks. We are also extremely proud of the fact that our solution was able to sometimes get some word problems right when the GPT-4 model would not. We are also very proud of our solution's design, as we believe that the concept allows for extremely high scalability.

What we learned

We learned many things, including how to make an api using Flask, learning far more React than we ever would have thought, and most importantly, we learned how to work as a team.

What's next for Topo Logic

As mentioned before, the potential scalability of using trees to solve math problems is huge, due to it's availability in calculus, numerical analysis, and general PEMDAS operations which lets it scale into linear algebra.

Built With

Share this project:

Updates