Talk to UI components in under 200ms

A chat UI that picks a prebuilt banking form and fills it in from what the customer types.
Code on GitHub · Explore the results

Defaulting to Chatbots

It’s so easy, it should feel wrong. Offload the interaction to a simple chatbot box. Let users type questions and get text responses back from the AI. I think this is a trap for certain workflows. The user ends up without the guidance offered by traditional user interfaces and feels lost. For exploratory tasks where the entire point is creating or figuring out their workflow, or when the user doesn’t need to think through the task end-to-end, this is fine. But when the user knows what to do and the task is narrow, this chatbot design pattern is friction.

Many apps now have chat as their main component. Some apps even drop building their own user interfaces and adopt native messaging apps, like Instinct. One of the topics I like to think about is the role of traditional user interfaces in the age of the chatbot.

Rethinking Interaction

This article explores an alternative: what if the right UI materialized in front of the user when they type (or speak) their intent? Linear does this through keyboard shortcuts. Making new user stories, assigning them to people, setting estimates, and putting stories into the right sprint is just a few keyboard taps.

Inspired by these ideas, this article takes the following approach. For tasks with well-known patterns of interaction, a chat interface can surface the right UI and guide the user through the task, so they don’t have to remember and navigate a multi-screen, multi-dropdown interface. Executed well, the experience can be fluid.

Principle: when selecting a design approach, think about how it makes the user feel. Can they efficiently get the right context and complete their task with minimal friction?

The Setup

Given where I work, banking is top of mind. This is how I think banking apps could look: a chat UI that picks a prebuilt form and fills it in from what the client types.

Define the action space

Extract what you typically find in a banking app into intent-based actions. The last two columns denote which parts of the action form are filled out by which model. Jev is good at picking out the right option from a set of options, but can’t generate text so freeform entities can’t easily be picked out and filled out, unless you tokenize the input and apply Jev to each <token, form field> pair. This feels awkward, and it could break when an entity spans several tokens. Meanwhile, billion- and trillion-parameter models are noticeably slow and expensive for extracting data from a single phrase. I had previously read about Liquid Foundation Models and how easy they are to tune for narrow, domain-specific tasks, like data extraction. They are very fast and well-suited for edge deployments. More on this later.

ActionWhat it doesFree-text fields (small fine-tuned model)Choice fields (Jev)
add_etransfer_contactSave a new e-Transfer recipientname, email, phone
send_etransferSend an e-Transfer, now or scheduledrecipient*, recipient_email*, amount, datefrom_account, frequency
request_etransferAsk someone to send you moneyfrom_person, from_email, amount
cancel_etransferCancel an unaccepted e-Transferrecipient*, amount
setup_autodepositTurn on Autodepositemail, phonedeposit_account
pay_credit_cardPay a credit cardamountpayment_option, from_account
pay_billPay a biller, now or scheduledpayee*, amount, datefrom_account, frequency
add_payeeAdd a billerbiller, account_number
transfer_between_accountsMove money between your own accountsamount, datefrom_account, to_account, frequency
open_accountOpen a new accountinitial_depositaccount_type, from_account
manage_cardLock, unlock or replace a cardcard_action, card, reason
view_accountShow a balance or transactionsaccount, view
update_contact_infoChange phone, email or addressnew_email, new_phonecontact_type

In a real system, some of these fields would be matched to internally stored data, such as existing contact lists.

Northstar Metrics

Now that I knew what the goal workflow was, I needed synthetic training and evaluation data. But good training data is linked to what good results look like:

  1. The right action. Jev picks the form the user meant, consistently. I measure the share of test messages sent to the right action.
  2. The right form. The user’s request is translated correctly into the form. I measure whole forms with every field right, and precision and recall for each field.
  3. Messy nuance. People don’t type clean commands: spelled-out amounts (“two grand”), typos, corrections (“$50, no wait make it $60”), negations (“don’t send $50 to Sam”), even text that tries to give the model instructions. I measure this on a separate set of hard cases that I kept out of training.
  4. Fast and cheap. The user is typing and just wants to get a small task done, so it should be fast, under 300ms to show the form and fill out the fields. Since the model is called after every word, it should be cheap to run.

Generate training data with a strong model

I used Opus 5.5 to generate 1,853 command phrases for this action space to mimic people using the app. This dataset let me run the simplest step of model post-training: using a closed-weight model’s outputs to run supervised fine-tuning on a smaller open-weight student model. Supervised fine-tuning is when a student model learns to mimic a larger model’s output, such as how it translates English into a constrained JSON object per action form. Example:

{
  "messages": [
    {"role": "system",    "content": "Extract these fields from the user's banking message: recipient, recipient_email, amount, date. Only copy information. Never invent names, emails, phone numbers or dates."},
    {"role": "user",      "content": "transfer $300 to priya.k@example.com"},
    {"role": "assistant", "content": "{\"recipient\":\"\",\"recipient_email\":\"priya.k@example.com\",\"amount\":300,\"date\":\"\"}"}
  ],
  "meta": {
    "id": "smp-006",
    "action": "send_etransfer",
    "vague": false,
    "present": ["recipient_email", "amount"]
  }
}

The data was split into train, validation, and test sets. The untuned baseline, the 350M-parameter Liquid model, filled out the JSON correctly about 20% of the time. The main failure mode was hallucinating a value for a field when none was stated.

Here is one such example going through training. Drag the slider to watch the model's confidence in the right answer rise and the loss fall. The numbers are illustrative, not from a real run.

Vibe code an annotation app and label the data

Generating UIs is easy now and my use case is pretty simple. I just want to see the English command, the model’s output colour-coded by which model filled each field, and the expected answers. So I got Claude to generate an annotation app for me over the 1,853 examples it just made. It closely matches the UI of the actual application, so reviewing examples there feels like using the real product.

I then spent 30 minutes going through 62 cases — just enough to identify key problems and decide what the answer should have been. This process is called “open-coding”, a technique from qualitative research methods. It involves writing short descriptive labels about the model outputs to let labels inductively emerge from the data. This effort also generated 62 golden answers. I let Claude categorize the notes into a set of labels (“axial-coding”) and then freely review and modify the rest of the dataset’s golden answers conditioned on my labelling feedback. In a work project, I would give axial-coding more review time.

The annotation app: a message, the model's output colour coded by which model produced each field, and the expected answer

Some examples of errors:

Results

The share of whole forms where every field is right. One wrong field fails the whole form.

ModelValidationTest
Untuned LFM2.5-350M20.8%24.2%
SFT LFM2.5-350M98.9%96.9%

Per-field precision and recall

I also scored each form field on its own.

A wrong value counts against both, and fields that are correctly left blank are not counted.

ModelPrecision (val)Recall (val)Precision (test)Recall (test)
Untuned LFM2.5-350M46.2%88.7%49.5%88.5%
SFT LFM2.5-350M99.4%99.2%98.7%98.0%

The untuned model finds most values but fills in nearly everything, so only about half of what it writes is right. Tuning fixed that without losing recall. On the test set the fine-tuned model fabricated 2 values, missed 7 and got 6 wrong, across 642 stated values. The weakest fields were open_account.initial_deposit (83% precision) and dispute_transaction.date (83% recall, only 6 cases).

I also kept 129 hard cases out of training: typos, spelled-out amounts, corrections, negations and instructions hidden in the message. The fine-tuned model got 125 of them fully right, against 17 for the untuned model. These cases were written separately from the training data.

Explore the per-field and per-action results interactively.

Picking the action

Jev’s choice of action on the 459 test messages: 431 correct (93.9%). Most actions were found 93 to 100% of the time. The weak one is pay_bill (76% recall): 6 of its 42 messages went to send_etransfer and 4 to “none”.

Recall is the share of an action's messages that Jev sent to it. Precision is the share of messages Jev sent to it that really belonged there.

ActionTest messagesPrecisionRecall
send_etransfer10793.6%95.3%
request_etransfer46100%95.7%
add_etransfer_contact44100%95.5%
pay_bill42100%76.2%
dispute_transaction36100%97.2%
transfer_between_accounts35100%97.1%
cancel_etransfer3293.8%93.8%
open_account29100%100%
pay_credit_card29100%93.1%
setup_autodeposit23100%95.7%
update_contact_info19100%94.7%
add_payee17100%94.1%

Subset analysis is my favourite type of analysis because it’s the most actionable. You can dive deeper to investigate how specific scenarios are struggling and add examples back to the training set, or to Jev’s prompt. For example, here’s what’s going on with pay_bill. The pay_bill messages that went to send_etransfer are mostly commands that name a company but never say “bill”: “pay Bell $89” or “pay Shaw $120 every month”. Messages that said “bill” (for example “pay my Telus bill $80”) almost always went to pay_bill correctly. How can this be fixed? Perhaps Jev is missing some guidance around what is a company (pay_bill) and what is a person (send_etransfer). This could be added to the Jev prompt and re-evaluated. Alternatively, the real world app would have bill payees and e-transfer recipients in the database, so user-stated entities can be matched to the database contents and the likely action chosen from how well the message matches.

Why LFM2.5-350M

  1. It's a small model (about 400 MB). Its architecture is built for edge devices, so it is cheap to run (free*, with a caveat: unless your company has more than $10M in revenue, according to the LFM license). This matters because the model runs on every word typed, and a larger model would be slower and more expensive, whether through GPU rental or token fees.
  2. It's quick: ~200ms per response on my MacBook's CPU. Since it runs on every word, keeping this latency low is also key.

It’s interesting to see that such a small model is able to output valid and correct structured JSON. Constrained decoding usually forces the output into a valid shape, but it does not make the values correct.

Typically, small models aren’t reliable at creating the right value. Case in point: the untuned 350M model got only 24% of test forms fully right and filled in 84.5% of the fields that should have been blank. Fine-tuning worked because it taught the core rule: leave a field blank unless the message states it. The untuned model has the language skills to create some plausible-looking answers but not the domain-specific rule, so it filled in nearly every field that should have been blank. This narrow rule shows a good example where small language models are a good fit.

Learnings

1. Let the model label first

Given a good description of the task, a strong model can bootstrap the messages and draft answers. Your job becomes checking the output and steering it where needed, which is fast.

2. Look at the data yourself

This is high ROI. Thirty minutes surfaced key problems and developed a deeper intuition for how the system works. Writing a short note on each case, then grouping the notes turned the data into rules I could apply to the rest of the dataset. Each error also points to missing subsets of training data, which you can describe to Claude to generate more examples.

3. Make your own evaluation app when…

4. A small model can learn a narrow rule well

LFM worked great (fast, cheap, correct) for this task.