SmartIntent: A Serverless Edge Intelligence Architecture with Local LLMs for Building Automation

Zhenghao Wu, Shaoshu Zhu, Shuyi Sun, Zhiyuan Chen, Dina Shi, Chaofan Li, Hadi Tabatabaee MalaziarXiv 2026

TL;DR

When you mutter "make it brighter in here" to a smart building, translating that vague wish into a safe, machine-executable command—without sending your private home data to the cloud—is surprisingly tough. SmartIntent solves this by embedding a compact, locally hosted Large Language Model (LLM) inside a serverless edge architecture, pairing AI's linguistic flexibility with strict, deterministic safety checks before any switch is flipped. Even better: a fine-tuned 4-billion-parameter model running locally can nearly match a model nearly seven times its size while keeping latency and energy costs down.

What Problem Does This Paper Address?

Humans don't speak in API calls. In smart buildings, we issue commands that are ambiguous ("too cold"), context-dependent ("turn on the light"—which one?), or multilingual. While cloud-based LLMs are great at understanding messy human intent, relying on them for building automation introduces network latency, privacy risks (shipping room occupancy and device inventories off-site), and reliability issues.

Furthermore, an LLM hallucination in a chat window is an annoyance; in building automation, it’s a system violation—like trying to set a dimmer to 500% or turning on a nonexistent heater. Prior research has looked at serverless IoT, local LLM serving, and structured output generation in isolation. The missing piece is an end-to-end, local "intent-to-execution" pipeline that grounds an LLM in live room context and rigorously validates its outputs before any hardware actually moves.

Methods

SmartIntent treats the LLM not as a standalone chatbot, but as one specialized microservice inside a three-layer serverless architecture orchestrated via Kubernetes (K3s) and Knative:

  1. Context Aggregation & JSON Contract: When a user makes a request, an Aggregator service pulls live states and capability schemas (valid actions, parameter ranges) from simulated device microservices backed by Redis. The Intent Server bundles the user's prompt and this household snapshot into a strict JSON input contract.
  2. Compact LLM Adaptation: Instead of relying on massive models, the authors fine-tuned two compact (~4B scale) instruction-tuned models (Qwen3.5-4B and Gemma-4-E2B-it) using LoRA (Low-Rank Adaptation—a lightweight method that trains a tiny fraction of weights). For edge deployment, models are quantized to 4-bit (Q4_K_M) GGUF format.
  3. Deterministic Runtime Gating: The LLM must output a strict JSON schema flagging whether clarification is needed (needsClarification), a user-facing message, and an array of machine-executable results. Before dispatching commands to devices or the event-condition-action Rule Engine, deterministic checks verify schema conformance, device existence, and parameter bounds. (An LLM-as-a-judge is used only offline to evaluate semantic understanding and language consistency).

Datasets

The authors introduce a reproducible, synthetic SmartIntent benchmark generated via a clever hierarchical pipeline. Rather than letting an LLM invent everything (and potentially hallucinate ground-truth labels), a rule-based sampler first builds realistic room profiles and selects target intents across six scenarios: direct control, direct query, fuzzy control, ambiguous control, nonexistent device, and irrelevant instruction. An LLM is only used at the end to phrase the natural-language prompt.

  • Training: 1,000 Chinese-language instances for LoRA fine-tuning.
  • Offline Evaluation: A held-out multilingual test set of 2,000 instances (668 Chinese, 666 English, 666 French).
  • Edge Deployment: Two 50-scenario Chinese workloads—default (short context) and stress (longer prompts with dense device inventories)—monitored with Shelly Plus Plug smart meters to measure real-time wall-power.

Key Insights and Ideas

  • "Thinking" mode isn't worth the watt-hours here: Enabling chain-of-thought reasoning ("thinking mode") on the fine-tuned Qwen model improved valid outputs by at most 1.6 percentage points, while spiking latency by up to 118% and energy consumption by up to 152%. For constrained JSON tasks, fast, non-thinking inference is the sweet spot.
  • Zero-shot cross-lingual transfer works: Even though the model was fine-tuned exclusively on Chinese examples, its schema compliance and device-grounding improvements transferred cleanly to English and French prompts.
  • Fine-tuning isn't magic for every architecture: While Qwen3.5-4B thrived under LoRA adaptation, applying the exact same recipe to Gemma-4-E2B-it actually degraded format compliance because it started leaking explanatory text outside the JSON block.
  • Safety is easier to learn than precision: The adapted model was nearly flawless at knowing when not to act (withholding commands for nonexistent devices or ambiguous requests), whereas remaining errors clustered around tricky multi-parameter grounding in direct and fuzzy control.

Key Results

  • Offline Accuracy: Qwen3.5-4B+LoRA beat its base model by +22.8 percentage points in clarification handling, +20.9 in device identification, and +13.1 in action-parameter correctness. It matched or beat the massive Qwen3.6-27B in format compliance (99.8% vs. 99.6%) and clarification (86.8% vs. 86.2%), trailing by less than 2 points on device and parameter accuracy.
  • Edge Deployment: On the local K3s/Knative cluster, Qwen3.5-4B+LoRA hit 98.0% valid outputs on default and 96.0% on stress workloads (+14.9 and +10.0 points over its base model).
  • Latency & Energy: Despite a modest 10.9–16.6% bump in response time (averaging 1.55 s on default, 2.97 s on stress), the fine-tuned model actually used 5.2–18.4% less baseline-adjusted dynamic energy per run (4.13 Wh default, 8.74 Wh stress) than its unadapted counterpart.

Limitations and Future Work

The edge deployment experiments processed requests sequentially through a single inference slot using simulated devices. Consequently, the study does not measure cold-start delays, concurrent user traffic, Knative autoscaling dynamics, or physical hardware actuation times. Additionally, repetition counts varied across runs, and one baseline (Nemotron-4B) couldn't complete the stress test due to its small 4,096-token context window. Future work aims to test concurrent autoscaling setups, wire the system into real physical buildings, expand multilingual training, and build deeper validation for persistent automation rules.

Summary updated

BibTeX
@misc{wu2026smartintent,
  author = {Zhenghao Wu and Shaoshu Zhu and Shuyi Sun and Zhiyuan Chen and Dina Shi and Chaofan Li and Hadi Tabatabaee Malazi},
  title = {{SmartIntent: A Serverless Edge Intelligence Architecture with Local LLMs for Building Automation}},
  year = {2026},
  eprint = {2611.38743},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.38743},
}
Figure