The problem
With Nae, I am building a voice assistant that runs on my own machine. The model behind it is small enough for my graphics card. In a normal chat window I was happy with it. Inside my assistant it suddenly seemed slow on the uptake: short, evasive answers, and some questions ended up as a note in my inbox when they should have been answered.
My first thought was to move to a bigger model. Luckily I first looked at what I was actually sending to the model.
Four causes, all mine
First, every message was sent along with excerpts from my notes, even a general question like “explain a hash table”. The model had to work through text that had nothing to do with the question.
Second, I had capped answers at three sentences. That sounded sensible for spoken output and is too little for an explanation.
Third, my instruction said: “Only answer from the notes.” With that I had forbidden the model its general knowledge.
Fourth, questions were filed as notes. The German question “Wie lege ich eine Liste an?” contains the verb for “create”, and my logic took that for an order.
I had noticed something similar before: the small model sometimes claimed it had saved a note without calling the tool for it. Since then my program decides whether something is saved. The model only fills in the fields.
The fix: sort first, then ask
I put a small dispatcher in front, a router. One short call to the model settles a single question: what kind of message is this? A conversation, a question about my notes, a web search, or a note to be filed. Only then is the real request built, and built to fit: notes only when the question is about notes, and no length cap when something needs explaining.
Of my 15 test messages, the router sorted all 15 correctly. That is a small sample and not proof, but the difference in daily use was audible at once.
What I take from it
Before you swap a model or blame it, look at what you feed it. For me it was the same as in any data project: look at the data first. The bigger model would have received the same poor input and would only have been slower.