by canada_dry · 2y ago · 0 comments
Example: I give the LLM a range of 'verbal' instructions related to home automation to see how well they can identify the action, timing, and subject:
User: in the sentence "in 15 minutes turn off the living room light" output the subject, action, time, and location as json
Llama: { "subject": "light", "action": "turned off", "time": "15 minutes from now", "location": "living room" }
Several of the latest models are on par to the results from Gpt4 in my tests.
How would you translate the Json you'd get out of that to get the same output? The subject would be "lamp" . Your app code would need to know that lamp is also light.
Llama: { "subject": "lamp", "action": "switch off", "time": "3:45", "location": "" }
Where there is an empty parameter the code will try to look back to the last recent commands for context (e.g. I may have just said "turn on the living room light"). If there's an issue it just asks for the missing info.
Translating the parameters from the json is done with good old fashion brute force (i.e. mostly regex).
It's still not 100% perfect but its faster and more accurate than the cloud assistants and private.
If you're speaking through the kitchen microphone (which should be provided as context in the LLM prompt as well) and there are no controllable lights in that room, you could leave room in the grammar for the LLM to respond with a clarifying question or an error, so it isn't forced to choose an entity at random.
If you just say "the lamp" it asks to clarify. Though I hope to tie that in to something location based so I can use the current room for context.
A very dumb innocuous example would be you ordering a single pizza for the two of you, then telling the assistant “actually we’ll treat ourselves, make that two”. Assistant corrects the order to two. Then the next time you order a pizza “because I had a bad day at work”, assistant just assumes you ‘deserve’ two even if your verbal command is to order one.
A much scarier example is asking the assistant to “preheat the oven when I move downstairs” a few times. Then finally one day you go on vacation and tell the assistant “I’m moving downstairs” to let it know it can turn everything off upstairs. You pick up your luggage in the hallway none the wiser, leave and.. yeah. Bye oven or bye home.
Edit: enjoy your unlocked doors, burned down homes, emptied powerwalls, rained in rooms! :)
Your 'scary' examples are very hypothetical and would require intentional design to achieve today; they would not happen by accident.
All I can tell you is this: LLM’s frequently misinterpret, hallucinate and “lie”.
Good luck.
Just as the train was whirling through Sydenham, Passepartout suddenly uttered a cry of despair.
"What's the matter?" asked Mr. Fogg.
"Alas! In my hurry—I—I forgot—"
"What?"
"To turn off the gas in my room!"
"Very well, young man," returned Mr. Fogg, coolly; "it will burn—at your expense."
- Around The World in 80 Days by Jules Verne, who knew that leaving the heat on while you went on vacation wouldn't burn down your house, 1872.
Imagine asking your MixAIr to sort out some fresh dough in a bole and then leaving your house for a while. It might begin to spin uncontrollably fast and create an awful lot of hyperbole-y activity.
I think there's definitely room for this sort of thing to go badly wrong.
Fwiw bakllava is a much more recent model, using mistral instead of llama. Same size and capabilities
It checks a webcam feed to tell me the current weather outside (e.g. sunny, snowing) though the language parsing is a more important feature.
> more recent model
Yes... models are coming out quicker every week - it's hard to keep up! But I put this one in place a few months ago and its been working fine for my purposes (basic voice controller home automation).
Wow! So almost as good as alexa?