SOFTPROMPT IR SPECIFICATION V2.0
# SoftPrompt-IR: Formal Specification v2.0
**Version:** 2.0
**Date:** 2025-12-19
**Status:** Empirically Validated
**Validation:** 100% consensus on directional hard operators across 4 leading closed-source frontier models (Claude Sonnet 4.5, GPT-5.2, Gemini 3.0, Grok 4.1); 98% overall cross-model consensus
---
## Abstract
SoftPrompt-IR (Soft Prompt Intermediate Representation) is a declarative, symbolic intermediate representation for encoding instruction priority, constraint strength, and hierarchical enforcement in Large Language Model (LLM) prompts.
Through empirical cross-model validation, SoftPrompt-IR achieves **100% consensus on directional hard operators across four leading closed-source frontier models** (Claude Sonnet 4.5, GPT-4o, Gemini 2.0 Flash, Grok) and **98% overall cross-model consensus** across five frontier model families on a complete bidirectional policy enforcement framework comprising seven core operators with compositional transparency.
SoftPrompt-IR enables explicit representation of:
- Hard constraints with directional propagation
- Backward dependencies and prerequisites
- Soft recommendations and conditional rules
- Hierarchical conflict resolution with explicit precedence
The system achieves 75-92% token reduction while preserving behavioral equivalence, enabling portable, refactorable prompt engineering across diverse model architectures.
---
## 1. Core Principles
### 1.1 Design Philosophy
1. **Explicit over Implicit** — Priority, strength, and directionality are symbolically encoded
2. **Compositional Transparency** — Operator meaning derivable from constituent parts
3. **Gradient over Binary** — Intent strength as continuous spectrum
4. **Minimal over Expressive** — Small, orthogonal operator set
5. **Declarative over Imperative** — Describes *what* is required, not *how*
6. **LLM-Native** — Leverages learned Infrastructure-as-Code patterns
7. **Hierarchical Enforcement** — Explicit parent-child policy propagation
8. **Deterministic Conflict Resolution** — Precedence through compositional rules
### 1.2 Non-Goals
- Executable semantics or control flow
- Guaranteed deterministic model behavior
- Complete replacement of natural language
- Model training or fine-tuning requirements
- Runtime dependencies or execution environments
---
## 2. Structural Elements
### 2.1 Blocks
**Syntax:**when to use it
Community prompt sourced from the open-source GitHub repo tobs-code/SoftPrompt-IR (Apache-2.0). A "SOFTPROMPT IR SPECIFICATION V2.0" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
roleplaycommunitygeneral
source
tobs-code/SoftPrompt-IR · Apache-2.0