From Monolithic Prompts to Scaffolded Execution for Memory Agents with Small Language Models

Seunghan Yang, Jihwan Bang, Sungha Choi, Juntae Lee


Abstract
Personal memory agents process sensitive user data, making on-device deployment with small language models (SLMs) attractive. However, existing memory-agent prompts are often monolithic specifications written for high-capacity LLMs, overloading a single inference with many requirements while leaving necessary intermediate operations implicit. This mismatch creates two bottlenecks for SLMs: prompt complexity and logical incompleteness. We introduce CAST (Compiling Agent Specifications into Scaffolded Tasks), a framework that converts a monolithic memory-agent prompt into a scaffolded execution procedure. CAST segments the original prompt into fixed, semantics-preserving main tasks, then synthesizes and places auxiliary scaffolding tasks that produce reusable intermediate artifacts; a trajectory-feedback step then adapts these scaffolds to the target SLM. At inference time, only the target SLM executes the compiled procedure. Across two memory-agent frameworks on LoCoMo and MemoryAgentBench, CAST outperforms monolithic prompting, prompt optimization, and reasoning-based baselines, while offering a stronger quality-latency trade-off than unconstrained reasoning. The results show that adapting memory agents to SLMs requires restructuring execution, not merely rewriting prompts.
Anthology ID:
2026.findings-emnlp.968
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
20471–20498
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.968/
DOI:
10.18653/2026.findings-emnlp.968
Bibkey:
Cite (ACL):
Seunghan Yang, Jihwan Bang, Sungha Choi, and Juntae Lee. 2026. From Monolithic Prompts to Scaffolded Execution for Memory Agents with Small Language Models. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 20471–20498, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
From Monolithic Prompts to Scaffolded Execution for Memory Agents with Small Language Models (Yang et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.968.pdf