From Domain Knowledge to Composable Reactive Code: LLM-Assisted Development with Scenario-Based Programming
Adiel AshrovTom YaacovGuy Katz
Nov 2026
Artificial Intelligence
Abstract
Reactive systems must continuously respond to events and coordinate interacting behaviors, making code generation challenging: reliability depends not only on individual components but on how they compose at runtime. We investigate Scenario-Based Programming (SBP) in two complementary roles: as a structured medium for communicating domain knowledge to a Large Language Model (LLM), and as the target paradigm for generated extensions. We implement the Taki card game in SBP and ask an LLM to generate Python players using progressively richer SBP-cast domain knowledge. Separately, we ask the LLM to generate strategy scenarios that compose directly with the existing implementation. In controlled simulations, all generated strategies that we evaluated complete their runs without observed runtime errors, deadlocks, or draws. The generated SBP strategy also composes with an additional hand-authored scenario without observed execution failures. Richer SBP-cast domain knowledge is associated with stronger generated Python strategies: their win rate against a fixed random SBP baseline increases from 59.4% to 62.5%. The directly generated SBP strategy wins 64.9% against the same baseline and 51.2%--52.3% head-to-head against the generated Python strategies. These results suggest that SBP can serve both as a medium for communicating domain knowledge and as a composable target for reactive-system extensions.
It is found that Llama 3 delivers comparable quality to leading language models such as GPT-4 on a plethora of tasks, and performs competitively with the state-of-the-art on image, video, and speech recognition tasks.
This paper investigates developing real-world perception for active agents, proposes Gibson Environment for this purpose, and showcases a set of perceptual tasks learned therein.
F. Xia, Amir Zamir, Zhi-Yang He et al.· 2018 IEEE/CVF Conference on...· 1,069 citations· ⚡112
GAOKAO-Bench is introduced, an intuitive benchmark that employs questions from the Chinese GAOKAO examination as test samples, including both subjective and objective questions that contribute a robust evaluation benchmark for future large language models and offers valuable insights into the advantages and limitations...
Xiaotian Zhang, Chun-yan Li, Yi Zong et al.· arXiv.org· 216 citations· ⚡17
An algorithm is proposed which leverages disentangled semantic factors to generate adversarial perturbation by altering controlled semantic attributes to fool the learner towards various "adversarial" targets.
Haonan Qiu, Chaowei Xiao, Lei Yang et al.· arXiv.org· 208 citations· ⚡17
This work proposes a HALO that directly maximizes the utility of generations instead of maximizing the log-likelihood of preferences, and suggests that the best loss depends on the inductive biases most appropriate for a given setting, an oft-overlooked consideration.
This work investigates the possibilities of using LLMs in a resume screening setting via a document retrieval framework that simulates job candidate selection and finds that the MTEs are biased, significantly favoring White-associated names in 85% of cases and female-associated names in only 11.1% of cases.