home/writing/softprompt-ir-research-paper

SoftPrompt IR Research Paper

GPTClaudeGemini··159 copies·updated 2026-07-14
softprompt-ir-research-paper.prompt
**SoftPrompt-IR is not executable code.
It is a declarative intent representation for LLM behavior - a low level layer **  

 ** SoftPrompt-IR is valid as a declarative intermediate representation insofar as it defines consistent relative intent relations, independent of execution semantics. **

---

# SoftPrompt-IR: Explicit Intent Weighting and Hierarchical Enforcement for LLM Prompts

**Authors:** Tobias Geisler  
**Affiliation:** Independent researcher  
**Contact:** tobsgo1@gmail.com  
**Date:** December 19, 2025

---

## Abstract

Prompt engineering for large language models (LLMs) relies heavily on natural language to express constraints, preferences, and priorities. While structured prompting improves clarity, existing approaches lack explicit mechanisms for representing graded instruction strength, hierarchical policy enforcement, and deterministic conflict resolution.

We introduce **SoftPrompt-IR (Soft Prompt Intermediate Representation)**, a declarative symbolic representation that encodes hard constraints, soft guidance, directional propagation, and instruction precedence as first-class elements. Through zero-shot cross-model testing across **five frontier architectures** (Claude Sonnet 4.5, GPT-5.2, Gemini 3.0, Grok 4.1, DeepSeek V3.2), we demonstrate **100% consensus on directional hard operators across four leading closed-source frontier models** and **98% overall average semantic consensus** on a complete bidirectional policy enforcement framework.

SoftPrompt-IR achieves **75-92% token reduction** while preserving behavioral equivalence and enables expression of:
- Hard constraints with directional propagation (`!>`, `!>>`)
- Backward dependencies and prerequisites (`!<`, `!<<`)
- Soft recommendations and conditional rules (`~>`, `??`)
- Hierarchical conflict resolution with explicit precedence (`>>`)

Empirical validation reveals models leverage learned **Infrastructure-as-Code patterns** (Terraform, Ansible, Kubernetes) to interpret hierarchical policy semantics through **compositional transparency**, enabling portable, refactorable prompt engineering without model-specific training.

**Keywords:** Prompt Engineering, LLM, Intermediate Representation, Policy Language, Hierarchical Enforcement, Compositional Semantics

---

## 1. Introduction

Large language models (LLMs) are primarily controlled through natural-language prompts. While this affords flexibility, it places a heavy burden on narrative techniques—such as repetition, emphatic phrasing, and strategic ordering—to implicitly communicate instruction importance, optionality, and precedence. As prompts grow in length and complexity, these implicit mechanisms become brittle, difficult to refactor, and token-inefficient.

Consider a pedagogical agent prompt requiring strict priority ordering:

> *"Your primary goal is mission success. This takes precedence over all other considerations. Second in importance is pedagogical effectiveness. User adaptation, while valuable, should never compromise the first two priorities. If these conflict, always prioritize in this order..."*

This verbose encoding (47 words) communicates a simple precedence relationship that could be expressed symbolically as:

when to use it

Community prompt sourced from the open-source GitHub repo tobs-code/SoftPrompt-IR (Apache-2.0). A "SoftPrompt IR Research Paper" 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

writingcommunitygeneral

source

tobs-code/SoftPrompt-IR · Apache-2.0