arXiv:2501.18668cs.AIcs.SE2025-01被引 1

用状态流编程让大模型稳定运行复杂模拟,避免混乱出错。

Simulation Streams: A Programming Paradigm for Controlling Large Language Models and Building Complex Systems with Generative AI

  • 通过状态流转和操作符控制大模型,任务更聚焦
  • 支持上百到上千轮模拟,保持规则一致性和信息可控
  • 适合构建多角色互动、动态演化的智能系统

我们提出Simulation Streams,一种面向大型语言模型(LLM)的编程范式,用于高效控制复杂动态仿真与代理工作流。其核心目标是构建一个干扰最小的框架,利用LLM的自主能力,同时克服其在一致性维持、信息选择性忽略/包含及严格规则执行方面的不足。该方法采用基于状态的机制,通过“操作符”按序修改变量,输出遵循固定格式,并确保状态变量始终处于分布内。结合实体-组件-系统(ECS)架构,使程序编写更直观,支持跨组件和实体的工作流复用。这一设计提升了输出流的模块化程度,实现多实体复杂模拟,同时保证格式统一、信息可控和规则强制。配套自研编辑器支持模拟创建、运行与分析。我们在市场经济学模拟、三人公园接球社交模拟以及经典强化学习基准任务中验证了其多样性。这些案例展示了该范式在数百至数千次迭代中处理复杂演化场景的能力,支持不同代理流程与模型的对比,并持续生成有意义的发展结果。

原文摘要 · Abstract (English)

We introduce Simulation Streams, a programming paradigm designed to efficiently control and leverage Large Language Models (LLMs) for complex, dynamic simulations and agentic workflows. Our primary goal is to create a minimally interfering framework that harnesses the agentic abilities of LLMs while addressing their limitations in maintaining consistency, selectively ignoring/including information, and enforcing strict world rules. Simulation Streams achieves this through a state-based approach where variables are modified in sequential steps by "operators," producing output on a recurring format and adhering to consistent rules for state variables. This approach focus the LLMs on defined tasks, while aiming to have the context stream remain "in-distribution". The approach incorporates an Entity-Component-System (ECS) architecture to write programs in a more intuitive manner, facilitating reuse of workflows across different components and entities. This ECS approach enhances the modularity of the output stream, allowing for complex, multi-entity simulations while maintaining format consistency, information control, and rule enforcement. It is supported by a custom editor that aids in creating, running, and analyzing simulations. We demonstrate the versatility of simulation streams through an illustrative example of an ongoing market economy simulation, a social simulation of three characters playing a game of catch in a park and a suite of classical reinforcement learning benchmark tasks. These examples showcase Simulation Streams' ability to handle complex, evolving scenarios over 100s-1000s of iterations, facilitate comparisons between different agent workflows and models, and maintain consistency and continued interesting developments in LLM-driven simulations.

大模型编程仿真系统代理系统ECS架构

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。