---
title: 'Stroke of Surprise: Progressive Semantic Illusions'
url: https://www.emergentmind.com/topics/stroke-of-surprise
type: topic
---

# Stroke of Surprise: Progressive Semantic Illusions

Stroke of Surprise is a generative framework for **Progressive Semantic Illusions**, a vector-sketching task in which a single sketch changes meaning as strokes are sequentially added: a prefix of the stroke sequence should depict one concept, while the completed sketch should depict another. The defining effect is temporal rather than spatial ambiguity: semantic reversal emerges through stroke accumulation, not through rotation, viewpoint change, or a multi-view consistency constraint. In the paper’s formulation, the central challenge is a **dual-constraint**: early strokes must already be recognizable as one object while also serving as the structural basis for a later reinterpretation as a different object [2602.12280].

## 1. Progressive semantic illusion and the temporalization of ambiguity

The task introduced under the name Stroke of Surprise is not standard vector sketch generation, standard semantic morphing, or a static visual illusion. Traditional visual illusions are described as relying on **spatial ambiguity**, including viewing angle, scale, frequency, shadow, anamorphosis, or multistable spatial configurations. By contrast, Progressive Semantic Illusions are defined by **multi-stage semantic consistency over prefixes of a stroke sequence**: the prefix sketch must depict concept \(p_1\), and the full sketch must depict concept \(p_2\) [2602.12280].

This distinction is operational as well as conceptual. Raster editing systems tend to perform destructive changes that overwrite earlier content, which violates the additive drawing constraint. Greedy sequential vector methods optimize the first phase only for the first concept; once later strokes are appended, the fixed prefix often becomes clutter or semantic noise. Stroke of Surprise is designed to avoid both failure modes by treating the drawing process itself as the site of illusion. The paper’s example of early strokes depicting **“pig”** and the full sketch later being read as **“angel”** captures the intended perceptual structure: the viewer first commits to one semantic hypothesis and then later strokes force a reinterpretation.

The result is what the paper characterizes as an extension of visual anagrams from the spatial domain to the temporal one. A plausible implication is that the framework redefines illusion not as simultaneous multistability in a finished artifact, but as controlled semantic recontextualization over an ordered construction process.

## 2. Formal problem definition and the dual-constraint

The sketch is represented as a sequence of learnable vector strokes partitioned into prefix and delta subsets. The paper defines

\[
S_{\text{prefix}} = \{s_1,\ldots,s_k\},
\qquad
S_{\text{delta}} = \{s_{k+1},\ldots,s_N\},
\]

with the full sketch

\[
S_{\text{full}} = S = \{s_1,\ldots,s_N\}.
\]

The stage-wise rasterized images are produced by a differentiable rasterizer \(\mathcal{R}(\cdot)\):

\[
I_{\text{prefix}} = \mathcal{R}(S_{\text{prefix}};\theta),
\qquad
I_{\text{full}} = \mathcal{R}(S_{\text{full}};\theta),
\]

where \(\theta\) denotes the learnable stroke parameters [2602.12280].

The semantic targets are two prompts, \(p_1\) for the prefix stage and \(p_2\) for the completed sketch. The central requirement is not merely that \(I_{\text{prefix}}\) and \(I_{\text{full}}\) each align with a prompt, but that the same prefix strokes satisfy two incompatible pressures. The paper names this the **dual-constraint**: early strokes must be a coherent depiction of object \(A\) and simultaneously a reusable scaffold for object \(B\).

This is the basis for the paper’s notion of a **common structural subspace**. The term is not formalized as a linear-algebraic subspace; it functions as a conceptual descriptor for a geometric arrangement of early strokes that supports two distinct semantic readings at two different drawing stages. The paper also notes a methodological limitation: it does **not explicitly specify** whether stroke order itself is optimized or fixed by partition/order initialization. The operative sequencing is therefore given by the partition into the first \(k\) strokes and the remaining \(N-k\) strokes.

## 3. Dual-branch SDS and sequence-aware joint optimization

The method’s main semantic supervision is a **dual-branch Score Distillation Sampling (SDS)** objective driven by a frozen **Stable Diffusion v1.5** prior. The prefix branch renders only the prefix strokes and conditions on prompt \(p_1\); the full branch renders all strokes and conditions on prompt \(p_2\). The total objective is written as

\[
\mathcal{L} = \mathcal{L}_{\text{SDS}} + \lambda_{\text{overlay}}\mathcal{L}_{\text{overlay}},
\]

with the SDS gradients combined as

\[
\nabla_\theta \mathcal{L}_{\text{SDS}}
=
\nabla_\theta \mathcal{L}_{\text{SDS}}^{\text{prefix}}
+
\nabla_\theta \mathcal{L}_{\text{SDS}}^{\text{full}}.
\]

For the prefix branch, the paper gives

\[
\nabla_\theta \mathcal{L}_{\text{SDS}}^{\text{prefix}}
=
\left[
w(t)\left(\epsilon_\phi(z_t,t,p_1)-\epsilon\right)\frac{\partial z_t}{\partial \theta}
\right].
\]

The main text does not write the full-branch formula explicitly, but states that it is the analogous SDS gradient for the rendered full sketch under prompt \(p_2\) [2602.12280].

This dual-branch construction is the core technical move. Prefix strokes receive gradients from both semantic stages, while delta strokes affect only the full sketch. Consequently, the prefix is prevented from collapsing into a phase-1-only optimum. The paper explicitly contrasts this with a naïve sequential baseline: optimize the prefix for \(p_1\), freeze it, then optimize the delta strokes for \(p_2\). That baseline fails because the phase-1 strokes become semantically rigid. Joint optimization instead keeps the prefix adaptable throughout training, allowing it to migrate toward the shared configuration the paper calls the common structural subspace.

The optimization is therefore **sequence-aware** in a precise sense: semantic supervision is applied to cumulative subsets of a single evolving stroke sequence, rather than to multiple views of a fixed final image.

## 4. Overlay Loss, multi-phase generalization, and optimization regime

Semantic guidance alone can produce degenerate completions in which delta strokes simply sit on top of the prefix, obscuring rather than recontextualizing it. To suppress this, the paper introduces **Overlay Loss**, which operates on separately rendered prefix and delta images after Gaussian blurring. The blurred renders \(\tilde I_{\text{prefix}}\) and \(\tilde I_{\text{delta}}\) are compared via

\[
\mathcal{L}_{\text{overlay}}
=
\frac{
2\langle \tilde I_{\text{prefix}}, \tilde I_{\text{delta}} \rangle
}{
\|\tilde I_{\text{prefix}}\|_1 + \|\tilde I_{\text{delta}}\|_1
}.
\]

Because overlap is measured after blurring, the penalty does not only discourage exact intersection; it also discourages near-overlap and local crowding. The intended effect is **spatial complementarity**: delta strokes should add structure rather than occlude or duplicate prefix structure [2602.12280].

The framework is also extended to \(K\)-phase illusions. If \(S_1,\dots,S_K\) are stroke groups and each cumulative sketch \(S_{1:i}=\bigcup_{j=1}^{i}S_j\) should depict concept \(A_i\) with prompt \(p_i\), the paper gives

\[
\mathcal{L}
=
\sum_{i=1}^{K}\mathcal{L}_{\text{SDS}}^{i}
+
\sum_{i=1}^{K-1}\lambda_{\text{overlay}}^{i}\mathcal{L}_{\text{overlay}}^{i}.
\]

In implementation, optimization is performed per prompt pair rather than by training a feed-forward generator. The reported setup uses **Adam**, **2000** iterations, **guidance scale = 100**, and

\[
\lambda_{\text{overlay}} = 0.1.
\]

The paper reports about **13 minutes** runtime for two-phase illusions and about **15 minutes** for three-phase illusions on an **NVIDIA RTX 4090**. Strokes are initialized near the canvas center in a gathered configuration. The default stroke budget is **\(16 \rightarrow 32\)**, with the paper noting that simple concepts may work with **\(8 \rightarrow 16\)** strokes, while complex ones such as Einstein may require **\(32 \rightarrow 64\)**.

## 5. Evaluation protocol and empirical performance

The evaluation dataset contains **64 common objects** spanning diverse categories. Prompt pairs are sampled from this set, multiple optimization attempts are run, and outputs are filtered and ranked. Automatic evaluation uses the minimum **CLIP score** across phases, **structural concealment**, **semantic concealment**, and **coverage**. Structural concealment is defined, for a metric \(M \in \{\text{CLIP}, \text{ImageReward}, \text{HPS}\}\), as

\[
C_{\text{struct}}^M = M_{\text{full}} - M_{\text{delta}},
\]

so larger values indicate that the prefix contributes essential structure to the full sketch. Semantic concealment is computed as

\[
C_{\text{semantic}} = \operatorname{tr}(\operatorname{softmax}(S/\tau)).
\]

The paper also uses **GPT-4o** for post-hoc evaluation on **phase recognizability**, **single-object integrity**, **illusion quality**, and **sketch quality** [2602.12280].

A concise comparison of the main text-to-illusion results is as follows:

| Method | Avg min CLIP | Coverage |
|---|---:|---:|
| SketchDreamer | 24.803 | 100% |
| SketchAgent | 24.393 | 100% |
| Nano Banana Pro | 26.821 | 34.9% |
| Ours (GPT-ranking) | 29.873 | 100% |
| Ours (Metric-ranking) | 30.044 | 100% |

The detailed metrics strengthen the same conclusion. In the direct text-to-illusion setting, **SketchDreamer** has structural concealment CLIP **\(-0.393\)** and semantic concealment **0.887**; **SketchAgent** has structural concealment CLIP **\(-2.544\)** and semantic concealment **0.752**; **Nano Banana Pro** has structural concealment CLIP **\(-2.774\)** and semantic concealment **0.875**. The negative structural concealment values indicate that delta-only strokes can score as well as or better than the full composition, meaning the prefix is not contributing meaningfully. By contrast, **Ours (GPT-ranking)** reports structural concealment CLIP **1.668**, structural concealment IR **0.839**, structural concealment HPS **0.023**, semantic concealment **0.983**, and coverage **100%**; **Ours (Metric-ranking)** improves these to structural concealment CLIP **3.282**, structural concealment IR **1.237**, structural concealment HPS **0.029**, semantic concealment **0.980**, and coverage **100%**.

The paper also reports an **Ours-to-illusion** protocol, where baselines are given the authors’ optimized prefix. Under this setting, **SketchDreamer** improves to Avg min CLIP **28.148**, **Nano Banana Pro** improves to **28.903**, and **SketchAgent** remains at **24.019**. The interpretation offered in the paper is that the optimized prefix itself encodes reusable structure.

Human evaluation consists of **two user studies** with **143 participants** total. In the first, top-1 outputs are compared against baselines on **five prompt pairs**; in the second, participants assess the ranking pipeline over the top-4 outputs on **four prompt pairs**. Participants preferred the method in **67.7%** of cases for GPT-ranked outputs and **87.1%** of cases for metric-ranked outputs. The ranking pipeline achieved over **98% satisfaction rate**.

## 6. Interpretation, relation to broader surprise research, and limitations

Stroke of Surprise treats “surprise” as a perceptual-semantic event: later strokes force a reinterpretation of the earlier drawing. This is materially different from the probabilistic and information-theoretic uses of surprise catalogued in the broader literature, including **prediction surprise**, **change-point detection surprise**, **confidence-corrected surprise**, and **information gain surprise** [2209.01034]. It is also distinct from recent video models that define surprise as Bayesian information gain over textual hypotheses [2509.23433] or as latent prediction error relative to a Taylor-extrapolated trajectory [2605.22678]. A plausible implication is that Stroke of Surprise belongs to a separate family of temporal-semantic constructs in which surprise is produced by recontextualization rather than by event improbability, KL divergence, or belief reset.

Several common misconceptions are explicitly addressed by the paper. The method is not ordinary morphing, because the prefix must already be a valid object rather than an intermediate interpolation. It is not raster editing, because earlier content cannot be destructively replaced. It is not simply standard text-to-sketch optimization, because later strokes are not merely refinements of the same concept. The framework’s specific contribution is to optimize a shared prefix under two incompatible stage-wise semantic constraints.

The paper also reports concrete limitations. It inherits weaknesses of the diffusion prior; in particular, **weak SDS guidance for complex structures such as “scissors”** can cause optimization failure. The main text mentions visual failure examples in supplementary material but does **not** provide a broader failure taxonomy. The need for multiple optimization trials, post-hoc filtering, and ranking further indicates that the method remains stochastic and prompt-sensitive.

Within those limits, Stroke of Surprise establishes a distinct generative task: semantic ambiguity unfolds through stroke order, and early structure must be future-compatible rather than merely locally recognizable. That shift—from static ambiguity to progressive reinterpretation—is the paper’s principal conceptual contribution [2602.12280].

Source: https://www.emergentmind.com/topics/stroke-of-surprise