---
title: Principle-Based Instance Generation
url: https://www.emergentmind.com/topics/principle-based-instance-generation
type: topic
---

# Principle-Based Instance Generation

Principle-based instance generation denotes a family of generation strategies in which the generated object is not treated as a fixed task-level artifact or as an unconstrained random sample, but is instead derived from explicit principles, instance-specific structure, or solver-relevant constraints. Across recent work, the generated object may be a soft prompt, a set of situated principles, an instance-to-region correspondence, a benchmark instance, executable MILP generation code, or a significant example population for schema validation. This suggests that the term is best understood as a cross-domain methodological pattern rather than a single canonical algorithm: generation proceeds through an intermediate control layer that is conditioned on the current instance or constrained by an explicit structural model [2204.04497] [2502.03397] [2205.14753].

## 1. Conceptual scope and formal pattern

A recurring formal pattern is the replacement of a static control object with an instance-conditioned one. In language modeling, the prompt becomes a function of the input, as in
\[
\mathbf{W}_p(T, x_i)=\mathbf{G}(\mathbf{M}(x_i), T).
\]
In alignment, the principle set itself is synthesized from the query, beginning with
\[
K_0 = \mathcal{M}(T \oplus P_{\text{principle-gen}} \oplus S).
\]
In controllable image generation, the central object is an instance-level correspondence set,
\[
\mathcal{C} = [(\mathbf{t}_1,\mathbf{m}_1),(\mathbf{t}_2,\mathbf{m}_2), \ldots, (\mathbf{t}_N,\mathbf{m}_N)].
\]
In benchmarking and combinatorial optimization, the generated artifact is an instance whose usefulness is defined by solver behavior, or executable code that instantiates a problem family [2204.04497] [2502.03397] [2606.31924] [2205.14753] [2505.11526].

| Domain | Generated object | Governing principle |
|---|---|---|
| NLP transfer | Prompt embeddings | Condition prompts on the current input |
| LLM alignment | Situated principles or constitutions | Generate guidance per query or preference cluster |
| Text-to-image | Layouts, masks, assignments | Bind each instance description to a region |
| Benchmark generation | Graded or discriminating instances | Search for target solver behavior |
| MILP generation | Code or graph edits | Preserve formulation structure and hardness |
| Schema validation | Significant example populations | Enumerate allowed cardinality combinations |

Two broad interpretations recur. One interpretation is **instance-conditioned guidance generation**, where the system generates prompts, principles, rubrics, segment assignments, or masks for a specific input. The other is **principled instance-space construction**, where the instance generator is itself a constraint model, a code library, or a structured graph-editing process. A plausible implication is that the common denominator is not the modality of the output, but the use of explicit intermediate structure to control what is generated.

## 2. Instance-conditioned guidance in language models

In prompt-based transfer learning, "IDPG: An Instance-Dependent Prompt Generation Method" replaces the standard task-level soft prompt with a prompt generator conditioned on the current input sentence [2204.04497]. The method keeps the backbone LM frozen and adds a lightweight trainable generator \( \mathbf{G} \), implemented as a bottleneck MLP and optionally with PHM layers, to map the frozen instance representation \( \mathbf{M}(x_i)\in\mathbb{R}^d \) into a prompt matrix of shape roughly \( t \times d \). For sentence-pair tasks the input is
\[
x_i = \mathbf{E}([SEP]\,S_1\,[SEP]\,S_2\,[EOS]),
\]
and prediction is made from
\[
\mathbf{h}_{[CLS]} = M\big(\text{concat}[x_i,\mathbf{W}_p(T,x_i)]\big), \qquad
\hat{y} = \text{softmax}(\mathbf{W}\mathbf{h}_{[CLS]}).
\]
The paper explicitly characterizes IDPG as a strict generalization of prompt tuning, since setting the instance-dependent component to zero recovers a static prompt. On 10 NLU tasks, the paper reports that M-IDPG-PHM improves over prompt tuning by about **3.1 points** and over P-tuning v2 by about **1.6 points** on average in the full-data setting, while using many fewer parameters than Adapter and fewer than Compacter. The paper also reports that GloVe-based sentence encoding still gives strong performance, which it interprets as evidence that the gain comes mainly from instance-dependent prompt generation rather than from reliance on a powerful encoder.

In alignment, "SPRI: Aligning Large Language Models with Context-Situated Principles" makes the generated principle set itself the intermediate control object [2502.03397]. SPRI is a two-stage framework with a base model \( \mathcal{M} \) and a critic model \( \mathcal{C} \). Stage I synthesizes context-situated principles for a user input \(T\), beginning with
\[
K_0 = \mathcal{M}(T \oplus P_{\text{principle-gen}} \oplus S),
\]
then iteratively refining \(K_i\) using critic feedback until the principle score reaches at least **4** or a maximum of **4 iterations** is reached. Stage II generates and refines the response using those same principles as both guidance and evaluation rubrics:
\[
R_0 = \mathcal{M}(T \oplus P_{\text{response-gen}} \oplus K_{\text{final}}).
\]
The framework is evaluated on cognitive reappraisal generation, instance-specific rubric generation on BiGGen Bench, and synthetic SFT data generation. Reported results include average improvement of **6.1% alignment** and **8.4% empathy** over the strongest vanilla baseline in reappraisal, improvement of **12.1% on average** over the best instance-agnostic baseline in rubric generation, and TruthfulQA gains where SPRI beats off-the-shelf models by **24.76% on average**.

A related but reverse-direction formulation appears in "Decoding Human Preferences in Alignment: An Improved Approach to Inverse Constitutional AI" [2501.17112]. Here the task is to infer a compact constitution from preference pairs \((\text{chosen}, \text{rejected})\). The paper treats principle extraction as instance-to-principle generation and identifies the initial candidate-generation step as the main bottleneck. Improved version 1 modifies the principle-generation prompt and replaces random cluster sampling with centroid-based selection using cosine similarity of embeddings. Improved version 2 clusters embedding differences between chosen and rejected responses across three dimensions—**all-mpnet-base-v2** for content, a model from **Wegmann et al. (2022)** for content-independent style, and **DistilBERT** for sentiment—then generates principles from representative triplets. On the synthetic dataset, the top 5 triplets have **purity at least 66.7%**, and including numeric preference scores raises preference regeneration accuracy to **76.80%**. The paper’s central claim is that principles should reflect common structure across preference instances rather than the idiosyncrasies of a single pair.

## 3. Multi-instance image generation and instance-level control

In text-to-image generation, principle-based instance generation appears as the explicit generation of instance layouts, semantic assignments, and attention constraints. "InstanceGen: Image Generation with Instance-level Instructions" is a **training-free, inference-time** method for prompts involving object counts, instance-level attributes, and spatial relations [2505.05678]. Its central principle is to use the generative model’s own first-pass image as a realistic structural prior, rather than relying on manually provided or LLM-generated bounding boxes. The method first generates an initial image with **Emu (latest version)**, aggregates cross-attention maps, extracts anchor points, and combines them with **Mask R-CNN** and **SAM2** to produce an instance segmentation layout. An LLM parser and assigner based on **Llama 3.3** then maps objects, quantities, and attributes to the extracted segments. Final generation uses attention losses, self-attention and cross-attention masking, and background latent regularization, with total loss
\[
\mathcal{L} = \mathcal{L}_{obj} + \lambda_{att}\mathcal{L}_{att} + \lambda_{bg}\mathcal{L}_{bg},
\]
where \( \lambda_{att} = 0.8 \) and \( \lambda_{bg} = 0.3 \). On **DrawBench**, the paper reports **Counting F1 = 0.91** and **Spatial accuracy = 0.67**; on **CompoundPrompts**, **Avg. VQA Acc = 0.60** and **VQA Sim = 0.89**; on **GenEval**, **Overall = 0.79**. The paper also identifies limitations, including merging of nearby instances, poor handling of “front” versus “back,” expensive seed search, and imperfect instance copying.

"ISAC: Training-Free Instance-to-Semantic Attention Control for Improving Multi-Instance Generation" also adopts an explicitly instance-first perspective, but without external models [2505.20935]. The method argues that semantic-only attention control is insufficient because cross-attention mainly reflects **what** the model thinks the object is, not **where its boundaries are**. ISAC therefore uses self-attention to discover and separate instance structure first, then uses cross-attention to assign semantic labels. The latent optimization objective is
\[
\mathcal{L}_t(X_t):=\lambda_\text{ins}(t)\mathcal{L}_\text{ins}(X_t)+\lambda_\text{cls}(t)\mathcal{L}_\text{cls}(X_t),
\]
with schedule \( \lambda_\text{ins}(t)=t/T \) and \( \lambda_\text{cls}(t)=1-t/T \). A key ingredient is the Maximum Pixel-wise Overlap metric,
\[
MPO(A, B) = \max_{p\in \{1,\dots,F\}} \left(A[p]\cdot B[p]\right),
\]
used to penalize merged instances. The paper reports **up to 52% average multi-class accuracy** and **83% average multi-instance accuracy**; on SD3.5-M, multi-class accuracy improves from **25% to 52%** and multi-instance accuracy from **64% to 83%**. Its limitations include **2× to 3.3×** overhead, latent optimization sensitivity, and dependence on explicit instance count information.

"InstanceControl: Controllable Complex Image Generation without Instance Labeling" addresses the same multi-instance association problem in controllable generation, but with a VLM-driven correspondence stage and adaptive mask refinement [2606.31924]. The VLM parses instance descriptions from the prompt and predicts corresponding masks from the visual condition, producing a correspondence set \( \mathcal{C} \). The paper introduces a Shared SEG Token strategy for repeated object mentions and a mask refinement module that fuses the predicted mask, an attention-based mask, the confidence score \( s_i^\mathit{pred} \), and image latent features. Those refined masks are then injected into the diffusion or DiT attention computation through a correspondence mask \( \mathbf{M} \). On **MIG-Eval**, the paper reports MIoU gains from **0.6526 to 0.8250** for Canny, from **0.7782 to 0.8116** for Depth, and from **0.6817 to 0.8472** for HED. In a unified-model comparison, it reports **MIoU: 0.8834** and **Local CLIP: 20.54**. The method’s main failure modes are missed objects, incomplete regions, localization offsets, and dependence on the VLM grounding backbone.

## 4. Benchmark instance synthesis in constraint programming and planning

In benchmarking, principle-based instance generation is used to construct informative instances whose value is defined by solver behavior rather than by superficial randomness. "A Framework for Generating Informative Benchmark Instances" introduces **AutoIG**, which combines a parameterized generator model \(M\), **irace** over generator configurations \(G\), a quality test for graded or discriminating instances, and a benchmarking pipeline over multiple solvers [2205.14753]. A graded instance is one solved by a target solver \(S\) within \([t_{min}, t_{max}]\) and of desired type \(T\); the evaluation returns \(-1\) for success and \(0\) otherwise. A discriminating instance is one that favors \(S_F\) over \(S_B\), scored using the MiniZinc competition rule and optimized through the negated ratio
\[
-\frac{score_F}{score_B}.
\]
AutoIG treats infeasible or oversize generator configurations with penalty \(+\infty\), minion timeout with penalty \(1\), and otherwise returns the graded or discriminating penalty. The system is evaluated on five MiniZinc competition problems: **macc**, **carpet-cutting**, **mario**, **racp**, and **lot-sizing**. For graded instances, the reported setup uses **2,000 runs**, a grading range of **10 seconds to 20 minutes**, and sampling of **50 graded instances per solver** when enough are available. The experiments show that competition rankings can shift on the generated instance sets; for example, **racp** shows a major ranking shift in which OR-Tools and Chuffed swap positions, and Picat-SAT and Yuck also swap positions. The paper’s broader claim is that informative benchmarking requires exploring where in the instance space solvers are strong or weak.

"Exploring Instance Generation for Automated Planning" extends the same concern to planning, but argues that PDDL is too low-level and too Boolean-centric for direct declarative instance generation [2009.10156]. The paper explores a PDDL augmentation with an `instance-constraints` section and constructs such as `xor`, `min`, `max`, `exactly-k`, `atleast-k`, `atmost-k`, and `appear`, with translation into Essence. However, it identifies two central limitations: limited flexibility and poor scalability. For square-grid constraints, the PDDL-style Boolean encoding requires roughly \(4 \times n^4\) constraints, whereas the Essence high-level encoding requires roughly \(4 \times n^2\). The paper reports that generating one \(20 \times 20\) grid with Minion took about **20 minutes**, and a \(22 \times 22\) grid took more than **30 minutes**. Its main proposal is therefore to model planning problems directly in Essence, using rich type constructors such as `set`, `relation`, `function`, `sequence`, `record`, and `matrix`, and even sketching a planning-specific `plan` type. This suggests that, in planning, principle-based instance generation is tightly linked to the expressiveness of the modeling language used to specify the instance space.

## 5. MILP instance generation, code retrieval, and structured graph generation

In MILP generation, the principle-based shift is from direct instance reconstruction toward explicit generative programs or structured graph edits. "Code Retrieval for MILP Instance Generation" reformulates MILP instance generation as MILP code generation [2505.11526]. Rather than generating an instance directly, the method retrieves executable **PySCIPOpt** code from a library, guided by **MILP-EmbedSim**, a learned similarity measure defined as cosine similarity between normalized MILP embeddings:
\[
\mathrm{MILP\text{-}EmbedSim}(P,Q) = \tilde{f}_e(P)^\top \tilde{f}_e(Q).
\]
The embedding model is trained contrastively on matched MILP graphs and textual descriptions using **NV-Embed-V2** as a frozen text encoder. The retrieval pipeline builds two libraries with **MILP-Evolve**: **Evolve/Train** with **8 seed classes**, **4,000 MILP codes**, and **59,033 MILP instances / graphs / descriptions**, and **Evolve/Test** with **4 disjoint seed classes**, **50 MILP codes**, and **672 MILP instances / graphs / descriptions**. On **Evolve/Test (50 classes)**, the paper reports for MILP-Retrieval **Pass@1: 50/50**, **Code validity: 0.920**, and **Average similarity: 0.920**. GPT-4o and finetuned LLaMA-3-8B perform substantially worse. In instance generation, MILP-Retrieval reports similarities of **0.819** on FCNF, **0.981** on TSP, **0.842** on GA, **0.992** on VRP, **0.822** on NurseSched, **0.962** on CVS, and **0.919** on IIS, while ACM-MILP is often infeasible or times out. The paper’s claim is that retrieving code amounts to retrieving the generative principle embodied in the formulation.

"A Deep Instance Generative Framework for MILP Solvers Under Limited Data Availability" proposes **G2MILP**, the first deep generative framework for MILP instances, based on a masked VAE over weighted bipartite graphs \(G=(\mathcal{V}\cup\mathcal{W},\mathcal{E})\) [2310.02807]. Constraint nodes encode \(b_i\), variable nodes encode a 9-dimensional feature vector including \(c_j\), variable type, and bounds, and edges encode \(a_{ij}\). The model corrupts a real instance by masking one constraint node and its adjacent edges, then reconstructs the masked content using a latent variable \(z\) and a decoder that explicitly predicts bias, degree, edge existence, and edge weights. The ELBO is
\[
\log p_\theta(G\mid \tilde G)\ge \mathbb{E}_{z\sim q_\phi(z\mid G,\tilde G)}\big[\log p_\theta(G\mid \tilde G,z)\big] -\mathrm{KL}\!\left(q_\phi(z\mid G,\tilde G)\,\|\,p(z)\right),
\]
with \(p(z)=\mathcal N(0,I)\). Structural realism is evaluated using **11 classical statistics** on the bipartite graph. At masking ratio \( \eta=0.01 \), the paper reports structural similarity scores of **0.997** on MIS, **0.835** on SetCover, and **0.991** on MIK, substantially outperforming Bowly and Random. It also reports close preservation of computational hardness—for MIS, training solve time is **0.349s** and G2MILP at \( \eta=0.01 \) is **0.354s**; for SetCover, training is **2.344s** and G2MILP is **2.360s**—and downstream test-MSE reductions of **69.1%** on MIK and **19.3%** on Nurse Scheduling in optimal value prediction. Here the principle is learned, but still explicit in the sense that the generator only makes local, semantically structured edits to a valid MILP graph.

## 6. Significant example generation for schema validation

In conceptual modeling, principle-based instance generation is used not to optimize downstream task accuracy, but to expose the logical consequences of cardinality constraints. "Generating Significant Examples for Conceptual Schema Validation" defines a population as significant if it shows **all allowed combinations of instances with respect to the cardinality constraints** on the relationship type [2105.09561]. The method restricts attention to a small tree-like subschema called an **umbrella**, selected around a target relationship type. The underlying ORM schema is formalized as
\[
(TP, RC, VC, OB, RO, SpecOf, Roles, Player, RefSch, DomSize, Unique, Total).
\]
Within the selected umbrella, the central generation step is
\[
GenPattern : RC \times (TP \to \mathbb{N}_\infty) \to (TP \to \mathbb{N}_\infty) \times \mathcal{P}(RO \to \mathbb{N}),
\]
which builds tuples witnessing valid combinations under uniqueness, totality, and available type sizes. The extendability test is
\[
Extendable(P : \mathcal{P}(RO)) = \left(\forall p \in P\ [Used(Player(p)) < Size(Player(p))]\right) \wedge Used(Rel(p)) + |P| \le Size(Rel(p)).
\]
The algorithm generates fresh tuples, mutated tuples for uniqueness probing, nil tuples for totality probing, and concrete instances through `GenerateInst`, `GetInst`, and `Compose`. The special case \( n=0 \) yields `nil`, which makes optional participation visible in the final population. A spin-off fixed-point procedure, `CalcSizes()`, propagates maximum sizes through the schema; if a type’s computed size becomes \(0\), the paper treats this as strong evidence of a modeling error. In this setting, significant examples function as constraint witnesses rather than as arbitrary demonstrations.

## 7. Recurring design principles, misconceptions, and limitations

A first common misconception is that principle-based instance generation is simply random sampling with additional metadata. The surveyed work consistently argues the opposite. IDPG contrasts instance-conditioned prompts with a fixed prompt shared by all examples [2204.04497]. SPRI contrasts context-situated principles with generic constitutions and fixed rubrics [2502.03397]. AutoIG contrasts informative benchmarking with arbitrary benchmark selection by explicitly optimizing for graded or discriminating behavior [2205.14753]. In each case, the generated intermediate object is designed to encode what matters for the specific instance.

A second misconception is that these methods are uniformly training-intensive. The literature is mixed. InstanceGen and ISAC are explicitly **training-free** and operate at inference time [2505.05678] [2505.20935]. MILP-Retrieval is retrieval-based at inference time, though it depends on a previously trained embedding model and a constructed library [2505.11526]. By contrast, G2MILP, InstanceControl, and IDPG rely on learned generators or learned grounding modules [2310.02807] [2606.31924] [2204.04497]. This suggests that principle-based generation is orthogonal to whether the system is training-free.

A third recurring theme is the importance of intermediate structure. In language tasks the intermediate object may be a prompt or a principle set; in image generation it may be a segmentation layout, a shared-instance token grouping, or a refined correspondence mask; in optimization it may be executable code or a masked graph edit; in schema validation it is a tuple pattern over roles. A plausible implication is that the field’s central design question is not merely how to generate outputs, but which intermediate abstraction best exposes the governing principle for the current instance.

The limitations reported across domains are also structurally similar. InstanceGen depends on the quality of the initial layout and incurs expensive seed search; it can also struggle with depth-like relations and stacked geometry [2505.05678]. InstanceControl can fail when the VLM misses objects or produces badly shifted masks [2606.31924]. ISAC incurs substantial latency and VRAM overhead and assumes access to instance count information [2505.20935]. SPRI reports large degradations when seeds are removed or generic default principles are used, which underscores the fragility of context-insensitive guidance [2502.03397]. In planning, low-level PDDL formulations lead to inflexibility and poor scalability [2009.10156]. In MILP generation, library coverage matters for retrieval, and masking ratio \( \eta \) trades off fidelity against novelty in G2MILP [2505.11526] [2310.02807].

Taken together, these results indicate that principle-based instance generation is less a single technique than a general research program: generate the control object that the instance itself requires, and do so in a representation where the relevant structure—semantic, spatial, logical, or solver-behavioral—can be made explicit.

Source: https://www.emergentmind.com/topics/principle-based-instance-generation