SELF-DIRECTED · 7 min read
The Space in Front of the Screen as the UI
For this project, I explored using a local LLM to create a UI untethered from traditional input hardware. Along the way, I discovered the importance of animation in conveying system state for voice and gesture-based UIs, and stumbled into a problem I call "conversational uncanny valley".
A chat is started with a two-step process: 1) raise a hand, 2) speak. I want to explore more natural ways to interact with machines. Raising a hand and speaking is intuitive.
A chat is started with a two-step process: 1) raise a hand, 2) speak. I want to explore more natural ways to interact with machines. Raising a hand and speaking is intuitive.
Ghosts of the Mechanical Age
Most interactions with computers are based on a keyboard invented in Milwaukee in the early 1870s and a mouse created in Menlo Park in 1964. Both deserve their place in history, but they've also shaped us: for 150 years, we've had to put our hands on mechanical devices to interact with our machines. Form follows hardware. Today, AI and ML are opening doors for designers exploring interfaces organized around more natural intfaces.
Ready to chat?
Ready to chat?
Designing For the 3-D Space Humans Inhabit
This project explores moving the center of gravity of HCI design out of the world of screens and into the 3-D space that humans inhabit, which is a natural place for interations: People have been expressing themselves with speech and gestures for millennia.
How it Works
The language model is local
The app uses a locally-running version of Google’s language model, Gemma2-b. The LLM is accessed through Chrome’s API, enabling incredibly fast responses.
The LLM sits on the user’s local machine.
The LLM sits on the user’s local machine.
Gestures are JavaScript Events
Using MediaPipe’s open-source gesture capture library1, I created a JS event handler that allowed me to rapidly experiment and fine-tune interactions in code.
My app tracks the user’s hands using MediaPipe’s open source gesture-capture library.
My app tracks the user’s hands using MediaPipe’s open source gesture-capture library.
I created a custom JavaScript event handler that makes incorporating gestures into React easy.
I created a custom JavaScript event handler that makes incorporating gestures into React easy.
Designing Multi-Modal Interaction Loops
The end-to-end gesture-to-chat cycle involves several interlocking loops of interaction2. The outer loop has three sections:
1) Activation --> 2) Dialog --> 3) Resolution
Each of these, in turn, have their own micro interaction loops that guide the user to the next action. All loops are an interplay of speech, gesture, and system feedback through graphics and motion.
The activation loop
The activation loop starts with an invitation / affordance to the user to raise a hand, which triggers another signal that conveys "live mic".
1. A hand icon in the lower left corner conveys that the system is ready for hand gestures.
2. When the user raises their hand, the system feedback is a “live mic” animation conveying they can now start speaking.
The dialog loop
The user has now gone from intent (“I want to chat”) to raised hand (action) to live mic (system responded to action). Now they can speak. Once a word is detected, the next loop starts.
1. Once the system detects a raised hand and a word, it opens the chat drawer.
2. The user can then see their words appear as they speak. When done, an animation that darkens the text conveys that what they said is being processed.
3. The user sees the LLM’s response and evaluates whether the LLM did what they wanted. As the user continues the chat, a raised hand starts the mic animation in the text box.
The Close / Resolution Loop
Once the user is done with their dialog, they can close the session with a thumbs-up.
1. When the drawer opens, a "thumbs-up" tool tip animates in next to the close button.
2. Once a thumbs-up gesture is detected, the tool tip animates confirming the users intent and the drawer closes.
3. We resolve the outer interaction loop with the hand tool tip.
Key Challenges and Learnings
human Design judgement is more relevant than ever
Boiled to its essence, design is about externalizing ideas, evaluating them, and iterating based on learnings. That hasn’t changed; it’s just in a new context.
I relied a lot on my muscle memory and general interaction design knowledge accumulated over the years. I also augmented this with HCI research, such as Don Norman’s work around interaction loops. I’ve become comfortable making a call about a design trade-off, writing code, then testing.
Tinkering as discovery
For a self-directed project like this, I find myself starting off by tinkering with new technology like gesture capture. After that, my design process is a combination of sketching, coding in Python, visual refinement, coding in React, etc. But there is less structure than, say, trying to follow a double diamond process or anything like that.
After experimenting with the gesture library in JavaScript, I explored concepts with pen and paper. I found myself going from exploratory code to pen and paper to code to Figma to code, etc...
After experimenting with the gesture library in JavaScript, I explored concepts with pen and paper. I found myself going from exploratory code to pen and paper to code to Figma to code, etc...
Conversational uncanny valley
The speed at which the local LLM responded was too fast. It felt like the LLM was starting to answer your question before you finished asking. There was no hard rule, it just felt weird.
Adding a 500ms pause before the LLM’s response fixed it. I believe this is because we learn how a “normal” conversation is paced from talking to other people who need a heartbeat to process before speaking. That’s pure design judgement.
The local LLM's responses were too fast and it felt like the AI was interrupting. Adding a 500ms pause made conversational cadence feel natural.
The local LLM's responses were too fast and it felt like the AI was interrupting. Adding a 500ms pause made conversational cadence feel natural.
System Feedback for Voice and Gesture
I’ll confess I’ve looked at animations in UIs with skepticism. Most seem excessive and often distracting. But for this prototype, I learned Framer Motion out of necessity: When designing naturalistic UIs, you can’t assume the user is holding the device or within range of the trackpad or mouse. Also, a gesture event does not have a graphical control (e.g., a button) as its trigger that would anchor the user's attention to a space on the screen. Animations became an important part of conveying system status by drawing attention and conveying changes to state.
Further Explorations
beyond chat: User intent and Agent Delegation
What if instead of just answering questions directly, the local LLM’s job was to detect intent, then reacting appropriately? If the user asks about the weather, it first detects user need (“Will it rain today”), then makes a function call to a weather API before formulating an answer.
I wrote a quick test that takes text (e.g., a user question) input and uses evals to try to detect fit into four categories: location, person, weather or other.
An eval experiment using Gemma2-b showed promise. It can detect the difference between a question about the weather and one about location. They are both about Berkeley, CA.
An eval experiment using Gemma2-b showed promise. It can detect the difference between a question about the weather and one about location. They are both about Berkeley, CA.
Modality-Agnostic Interaction Design
I dream of fine-tuning local LLMs to understand user intent through gestures, speech, clicks, typing, or whatever. The local fine-tuned LLM would understand user intent in context of system state.
I'm drawn to this because LLMs are good at semantic stuff: System state and gestures can be codified in words. Think of JS components with meta data that describe what they are and what they do, with evolving context provided by a state machine.
NOTES
- If you want to try your hand at gesture capture, check out MediaPipe's "Gesture recognition guide for Web".
- If you are interested in learning more about interaction loops, here is a nice summary of Don Norman's "The Human Action Cycle".