On-device Small Language Models (SLMs) promise fully offline, private AI experiences for mobile users (no cloud dependency, no data leaving the device). But is this promise achievable in practice? This paper presents a longitudinal practitioner case study documenting the engineering challenges of integrating SLMs (Gemma 4 E2B, 2.6B parameters; Qwen3 0.6B, 600M parameters) into Palabrita, a production Android word-guessing game. Over a 5-day development sprint comprising 204 commits (~90 directly AI-related), the system underwent a radical transformation: from an ambitious design where the LLM generated complete structured puzzles (word, category, difficulty, and five hints as JSON) to a pragmatic architecture where curated word lists provide the words and the LLM generates only three short hints, with a deterministic fallback if it fails. We identify five categories of failures specific to on-device SLM integration: output format violations, constraint violations, context quality degradation, latency incompatibility, and model selection instability. For each failure category, we document the observed symptoms, root causes, and the prompt engineering and architectural strategies that effectively mitigated them, including multi-layer defensive parsing, contextual retry with failure feedback, session rotation, progressive prompt hardening, and systematic responsibility reduction. Our findings demonstrate that on-device SLMs are viable for production mobile applications, but only when the developer accepts a fundamental constraint: the most reliable on-device LLM feature is one where the LLM does the least. We distill our experience into eight actionable design heuristics for practitioners integrating SLMs into mobile apps.


翻译:端侧小语言模型(SLMs)有望为移动用户提供完全离线、私密的AI体验(无需依赖云端,数据无需离开设备)。然而,这一承诺在实践中能否实现?本文通过一项纵向实践者案例研究,记录了将SLMs(Gemma 4 E2B,26亿参数;Qwen3 0.6B,6亿参数)集成到Palabrita(一款生产级Android猜词游戏)中的工程挑战。在为期五天的开发冲刺中(包含204次提交,其中约90次直接与AI相关),系统经历了根本性转变:从最初由LLM生成完整结构化谜题(包括单词、类别、难度及五个提示,以JSON格式输出)的雄心勃勃设计,演变为一种务实架构——即由精选词库提供单词,LLM仅生成三个简短提示,并在失败时采用确定性回退方案。我们识别出五类端侧SLM集成特有的故障:输入格式违规、约束违反、上下文质量退化、延迟不兼容及模型选择不稳定。针对每类故障,我们记录了观察到的症状、根本原因,以及有效缓解这些问题的提示工程与架构策略,包括多层防御性解析、带失败反馈的上下文重试、会话轮换、渐进式提示硬化及系统性责任缩减。我们的发现表明,端侧SLM在生产级移动应用中可行,但前提是开发者必须接受一项基本约束:最可靠的端侧LLM功能,恰恰是让LLM承担最少任务的那一种。我们基于实践经验提炼出八条可操作的设计启发式原则,供将SLMs集成至移动应用的从业者参考。

0
下载
关闭预览

相关内容

综述:面向移动端大语言模型的隐私与安全
专知会员服务
19+阅读 · 2025年9月7日
赋能大型语言模型多领域资源挑战
专知会员服务
10+阅读 · 2025年6月10日
大语言模型与小语言模型协同机制综述
专知会员服务
40+阅读 · 2025年5月15日
当持续学习遇上多模态大型语言模型:综述
专知会员服务
32+阅读 · 2025年3月5日
小型语言模型综述
专知会员服务
56+阅读 · 2024年10月29日
西工大最新《多模态大型语言模型》全面综述
专知会员服务
70+阅读 · 2024年8月6日
移动边缘智能与大型语言模型综述
专知会员服务
42+阅读 · 2024年7月31日
大型语言模型的挑战与应用,72页pdf
专知会员服务
91+阅读 · 2023年7月21日
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
25+阅读 · 2023年6月23日
VIP会员
最新内容
综述 | 3D场景图:开放挑战与未来方向
专知会员服务
4+阅读 · 6月22日
21世纪的无人机战争
专知会员服务
4+阅读 · 6月22日
《量子技术的军事任务技术适配与利用》
专知会员服务
4+阅读 · 6月22日
美国从乌克兰无人机战争中学习经验
专知会员服务
7+阅读 · 6月21日
ICML 2026 | 面向视觉语言模型的语义鲁棒性认证
专知会员服务
5+阅读 · 6月21日
相关VIP内容
综述:面向移动端大语言模型的隐私与安全
专知会员服务
19+阅读 · 2025年9月7日
赋能大型语言模型多领域资源挑战
专知会员服务
10+阅读 · 2025年6月10日
大语言模型与小语言模型协同机制综述
专知会员服务
40+阅读 · 2025年5月15日
当持续学习遇上多模态大型语言模型:综述
专知会员服务
32+阅读 · 2025年3月5日
小型语言模型综述
专知会员服务
56+阅读 · 2024年10月29日
西工大最新《多模态大型语言模型》全面综述
专知会员服务
70+阅读 · 2024年8月6日
移动边缘智能与大型语言模型综述
专知会员服务
42+阅读 · 2024年7月31日
大型语言模型的挑战与应用,72页pdf
专知会员服务
91+阅读 · 2023年7月21日
相关基金
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员