Trained my first small language model
I have a tool that uses Gemini Flash with the lowest thinking budget to do summarization work. It's very fast, 0.9-1.2s in most cases. But I have a user experience problem where people make the wrong choice when using an internal app for the team. Gemini Flash can figure out what the user should do and highlight the right next step, but people move too fast, so that the 0.9s doesn't work. I know, 0.9s doesn't seem too long, but if you use the app a thousand times per day, you just click, click, click super fast and don't think about it much. The prompt was something like "For 'string a' and 'string b' is string b related to string a 'in a certain way'?" and the answer is a boolean. Deterministic python and javascript can answer this question in a couple ms and it is right a little over 66% of the time. Gemini Flash is right 99% of the time. I was hesitant to train a new model, I thought it would be hard. I just followed the instructions a commercial AI tool suggested. I had about 550 example use cases. I then used two different frontier models to create look-alike examples so that I had about 2,500 total. The training was done on my RTX A6000 16gb GPU. It took about 15 min. The end result is a small model, about 50MB. When I run it locally it suggests the right answer 97% of the time and it responds in 0.06 seconds when run on CPU (older Threadripper, 3.1GHz). The difference between 99% and 97% accuracy is perfectly acceptable in this case. I will deploy this so that it runs server side, which will add a tiny bit of latency and the server probably will be a little slower than my workstation. I am also logging the accuracy and comparisons so that I can evaluate it and supplement the training. In theory, I can do this client side in the browser. I will deploy over the weekend, but my expectation is the 0.1-0.2 second latency will be fast enough to not require the complexity of client side inference, but it sounds like fun.