TRANSMISSION // 2611.37342v1
Can structured scenarios help AI write code that fits?
Source published
A Taki game study tests whether Scenario-Based Programming can help an AI use domain knowledge and generate extensions that work with existing reactive software.

Code that runs on its own may still fail when added to a system whose parts coordinate over time. A study using the Taki card game explores whether Scenario-Based Programming can make those interactions clearer to a language model—and provide a modular way to add its generated strategies.
Why study code composition?
A program can produce sensible actions in isolation yet disrupt a larger system when its behavior interacts with other components. This is a particular challenge for reactive software, which responds to events and coordinates activity over time. The authors of this study ask whether Scenario-Based Programming (SBP) can help a large language model (LLM) handle two related tasks: use structured descriptions of domain knowledge to write a strategy, and generate a new behavior that fits into an existing system.
They tested the idea in a two-player version of the card game Taki. The game has changing legal moves and action cards that can alter turn order or start a multi-card sequence. The researchers implemented the game in BPpy, an SBP framework, and generated strategies with GPT-5.4 through Codex.
What is Scenario-Based Programming?
In SBP, separate modules called b-threads describe behaviors or constraints. A central mechanism coordinates them by choosing among requested events, while respecting events that a b-thread blocks. For example, a rule module can prevent an illegal move, while a separate strategy module can favor a particular legal move. This modular setup offers a way to add behavior without rewriting the existing rules.
The researchers compared three generated Python players, given progressively richer context, with a strategy generated directly as SBP b-threads. The Python contexts included the game rulebook and player interface; later versions also received the SBP game implementation and examples of hand-written strategy modules. The SBP-generated strategy received the implementation, framework information and strategy examples.
They evaluated the strategies in repeated, controlled simulations, using 10,000 games for each comparison, balancing starting positions and using a fixed seed schedule. They monitored for runtime errors, deadlocks and draws, and measured wins against a random SBP player and in head-to-head matches. They also tested whether the generated SBP strategy could coexist with an additional hand-written behavior.
What did the simulations show?
All generated strategies completed their evaluated runs without observed runtime errors, deadlocks or draws. In a separate composition test, the generated SBP strategy also ran alongside the added hand-written behavior without observed failures. These are results from the tested simulations, not proof that the code is correct in every situation.
Against the same random SBP baseline, the generated Python strategies won between 59.4% and 62.5% of games. The highest figure came from the version given examples of hand-written SBP strategy modules. Adding the SBP game implementation alone made little difference to the reported overall win rate: it rose from 59.4% to 59.8%. The authors say the pattern is associated with richer SBP-based context, but their experiment used only one generated strategy per configuration. It therefore cannot establish that a particular context component caused the difference.
The directly generated SBP strategy won 64.9% of games against the random baseline. Head-to-head, it won 51.2% to 52.3% against the generated Python strategies. The authors describe this as competitive performance, not evidence that SBP is generally superior: the margins were small. Starting position also mattered, with strategies tending to perform better when they went first.
What remains uncertain?
The study is a case study of one two-player game, a subset of its rules and one SBP framework. The authors caution that the results may not carry over to systems with asynchronous inputs, timing constraints, physical processes or safety-critical requirements. Their testbed did not include external events interrupting an ongoing procedure.
The study also used one target model, a specific prompting setup and one generated artifact for each configuration. It does not show how reliably the same approach would perform across new generations, models or prompts. Simulations can reveal observed failures, but their absence is not a formal guarantee of correctness. Nor did the study assess code quality, maintainability or whether engineers find the generated modules easy to review. The authors identify those questions, and testing in other domains, as work for the future.
This article is based on an arXiv preprint (version 1), rather than evidence of peer-reviewed publication. Its findings should be read as an initial, bounded evaluation: SBP looks promising as both a way to present structured knowledge and a format for adding behavior, but broader tests are needed to determine how well that promise generalizes.
- Scenario-Based Programming
- LLM code generation
- reactive systems
- software composition
- Taki
- AI for software engineering
Reviewed cross-references
These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.
When ‘Verified’ AI Code Proves Less Than It Seems
Supporting evidence: Both papers caution against treating one validation result as a complete correctness guarantee. The SBP study says its simulation-based absence of observed failures is not formal correctness; the verified-code study reports that verifier acceptance and structural specification binding can still leave semantic gaps, including hidden-test failures. This supports the bounded point that validation claims depend on what is tested, not a direct performance comparison: the studies examine different systems and tasks.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2611.37342v1 — Original paper
Excerpt reference:
static/papers/2611.37342v1.md:986-1010
Basis: Paper text
Source file SHA-256:ddc2e05e7704c72c8070ceeec77c6bb5366933400dee52162a4737ec22816ec02611.05590v1 — Original paper
Excerpt reference:
static/papers/2611.05590v1.md:159-230
Basis: Paper text
Source file SHA-256:91af52a3c02604b73b2d97e93c93365f889e721f97f477472dcd3647c516414b2611.05590v1 — Original paper
Excerpt reference:
static/papers/2611.05590v1.md:597-654
Basis: Paper text
Source file SHA-256:91af52a3c02604b73b2d97e93c93365f889e721f97f477472dcd3647c516414b
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.