Table of Contents
Fetching ...

Prompt Decorators: A Declarative and Composable Syntax for Reasoning, Formatting, and Control in LLMs

Mostapha Kalami Heris

TL;DR

Prompt Decorators address the lack of reproducibility and interpretability in LLM prompting by introducing a declarative, composable vocabulary of behavioral tokens that can be stacked and scoped across conversations. The method decouples task semantics from execution behavior via a six-stage Processing Model (Parsing, Scope Resolution, Planning, Reasoning, Formatting, Introspection) and two functional decorator families (Cognitive & Generative; Expressive & Systemic). The paper provides twenty core decorators (e.g., +++Reasoning, +++Tone, +++ChatScope, +++Export) with illustrative compositions and a design philosophy emphasizing declarativity, reusability, transparency, and accessibility. It demonstrates applications across six use cases, discusses risks such as interpretive drift and prompt injection, and outlines future work toward standardization and integration with agent frameworks, aiming for auditable, cross-model behavioral governance.

Abstract

Large Language Models (LLMs) are central to reasoning, writing, and decision-support workflows, yet users lack consistent control over how they reason and express outputs. Conventional prompt engineering relies on verbose natural-language instructions, limiting reproducibility, modularity, and interpretability. This paper introduces Prompt Decorators, a declarative, composable syntax that governs LLM behavior through compact control tokens such as +++Reasoning, +++Tone(style=formal), and +++Import(topic="Systems Thinking"). Each decorator modifies a behavioral dimension, such as reasoning style, structure, or tone, without changing task content. The framework formalizes twenty core decorators organized into two functional families (Cognitive & Generative and Expressive & Systemic), each further decomposed into subcategories that govern reasoning, interaction, expression, and session-control. It defines a unified syntax, scoping model, and deterministic processing pipeline enabling predictable and auditable behavior composition. By decoupling task intent from execution behavior, Prompt Decorators create a reusable and interpretable interface for prompt design. Illustrative use cases demonstrate improved reasoning transparency, reduced prompt complexity, and standardized model behavior across domains. The paper concludes with implications for interoperability, behavioral consistency, and the development of declarative interfaces for scalable AI systems.

Prompt Decorators: A Declarative and Composable Syntax for Reasoning, Formatting, and Control in LLMs

TL;DR

Prompt Decorators address the lack of reproducibility and interpretability in LLM prompting by introducing a declarative, composable vocabulary of behavioral tokens that can be stacked and scoped across conversations. The method decouples task semantics from execution behavior via a six-stage Processing Model (Parsing, Scope Resolution, Planning, Reasoning, Formatting, Introspection) and two functional decorator families (Cognitive & Generative; Expressive & Systemic). The paper provides twenty core decorators (e.g., +++Reasoning, +++Tone, +++ChatScope, +++Export) with illustrative compositions and a design philosophy emphasizing declarativity, reusability, transparency, and accessibility. It demonstrates applications across six use cases, discusses risks such as interpretive drift and prompt injection, and outlines future work toward standardization and integration with agent frameworks, aiming for auditable, cross-model behavioral governance.

Abstract

Large Language Models (LLMs) are central to reasoning, writing, and decision-support workflows, yet users lack consistent control over how they reason and express outputs. Conventional prompt engineering relies on verbose natural-language instructions, limiting reproducibility, modularity, and interpretability. This paper introduces Prompt Decorators, a declarative, composable syntax that governs LLM behavior through compact control tokens such as +++Reasoning, +++Tone(style=formal), and +++Import(topic="Systems Thinking"). Each decorator modifies a behavioral dimension, such as reasoning style, structure, or tone, without changing task content. The framework formalizes twenty core decorators organized into two functional families (Cognitive & Generative and Expressive & Systemic), each further decomposed into subcategories that govern reasoning, interaction, expression, and session-control. It defines a unified syntax, scoping model, and deterministic processing pipeline enabling predictable and auditable behavior composition. By decoupling task intent from execution behavior, Prompt Decorators create a reusable and interpretable interface for prompt design. Illustrative use cases demonstrate improved reasoning transparency, reduced prompt complexity, and standardized model behavior across domains. The paper concludes with implications for interoperability, behavioral consistency, and the development of declarative interfaces for scalable AI systems.
Paper Structure (94 sections, 1 figure, 2 tables)

This paper contains 94 sections, 1 figure, 2 tables.

Figures (1)

  • Figure 1: Hierarchical taxonomy of Prompt Decorators, organized into two primary functional families, Cognitive & Generative and Expressive & Systemic, each decomposed into subcategories that govern reasoning, interaction, expression, and meta-control behaviors. The diagram illustrates how decorators collectively span the cognitive, expressive, and systemic layers of model behavior.