The Research Report
When Gibberish Beats Careful Prompting: PromptQuine and the Strange Evolution of Self-Replicating Prompts
By Taygotech – June 25, 2026
If you've spent any time working with large language models, you've internalized a core assumption: better prompts yield better results. Write clearer instructions. Provide well-chosen demonstrations. Structure your in-context learning examples with care. The entire discipline of prompt engineering rests on the premise that natural language, thoughtfully composed, is the best interface to an LLM's capabilities.
A paper presented at ICML 2025 shatters that assumption. PromptQuine (arXiv:2506.17930), from Jianyu Wang, Zhiqiang Hu, and Lidong Bing, demonstrates that pruning carefully crafted demonstrations into syntactically incoherent "gibberish" can remarkably improve task performance—and that an evolutionary search framework which treats prompts as self-replicating programs can discover these optimized prompts automatically, without any gradient updates.
The name is a deliberate nod to the concept of a quine—a program that reproduces its own source code. PromptQuine treats prompts as self-replicating entities that mutate, compete, and evolve within the context window itself. The result is a framework that consistently matches or surpasses state-of-the-art prompt optimization methods across classification, question answering, generation, and math reasoning tasks.
This is not a minor improvement in prompt tuning. This is a paradigm shift in how we think about LLM prompting.
The Disturbing Core Finding: Less Language, More Performance
The central observation behind PromptQuine is deceptively simple. Take a standard few-shot ICL prompt with carefully written demonstrations. Now systematically delete tokens—not based on any semantic understanding, but through an optimization process—and the resulting "pruned" prompt, which often looks like gibberish to a human reader, outperforms the original.
Consider a concrete example from the paper. The well-known chain-of-thought prompt "Let's work this out step by step to be sure we have the right answer" improves InstructGPT's performance on MultiArith from 78.7% to 81.5%. By pruning it to "Let's work out step by step sure we right answer"—stripping away the syntactic coherence—accuracy jumps to 86.7%.
The authors call this the Partial Context Hypothesis: given a natural language prompt x with task performance X, there exists a pruned subsequence z (where z is a subsequence of x) that achieves significantly better performance Z. This pruned prompt can even surpass the performance Y of "unnatural language" prompts discovered by prior token-level search algorithms, despite starting from a much lower baseline.
Why does this work? The paper argues that LLMs—despite extensive alignment training—may exhibit only superficial alignment with human language. Under the surface, transformers appear to rely on sparse, rule-based generalization during in-context learning, where minimal features dominate predictions. Many tokens in a natural language prompt may be redundant or even actively harmful to the model's task performance. Pruning strips away the noise and lets the model attend to what actually matters.
This finding extends prior work on "secret language" in LLMs—unnatural prompts like "StaffAreaFocusHardware Advisory" that mysteriously outperform careful natural language instructions for specific tasks. PromptQuine doesn't just confirm this phenomenon; it provides a systematic framework for discovering such prompts at scale.
How Self-Replicating Prompts Work
PromptQuine draws its philosophical foundation from two concepts that seem distant from NLP: biological evolution and computational quines.
The Quine Analogy
In computer science, a quine is a program that takes no input and produces its own source code as output. It's a self-referential, self-reproducing entity. PromptQuine borrows this idea: the prompt is a program that, through evolutionary dynamics, reproduces and modifies itself. Each generation of prompts carries forward successful mutations while discarding failures.
More formally, the framework connects to the algebraic theory of self-replication in term-rewriting systems. As shown by Moss (2023), any language supporting "diagonal" (self-application) and "write" (quoting) combinators supports self-replicating programs. The token-sequence representation of prompts, combined with binary-mask mutations, realizes exactly these primitives.
The Evolutionary Mechanism
Here's how PromptQuine works in practice:
Representation. Each prompt is encoded as a binary mask m ∈ {0,1}^n, where 1 means a token is retained and 0 means it's pruned. The initial population consists of P copies of the all-ones mask (the full, unmodified prompt).
Fitness Evaluation. Each mask is evaluated using a task-specific fitness function f(m; D) on a small training set D. The fitness is non-differentiable—there's no gradient signal, only the model's actual output quality.
Selection. Parents are chosen via k-tournament selection (k ≈ 20% of population size), where the best-performing mask from a random subset becomes a parent.
Mutation. Each parent mask undergoes δ random bit flips from 1→0 (where δ ∈ {1,2,3,4}). This is the self-replication step: the prompt copies itself with mutations, pruning away tokens.
No Crossover. Unlike traditional genetic algorithms, PromptQuine deliberately omits crossover. Swapping token subsets between prompts yields little benefit because the search space is already sufficiently explored through mutation alone.
Replacement. Offspring replace the oldest individuals in the population (FIFO), maintaining population size while continuously refreshing the gene pool.
Termination. Evolution runs for N generations or until the average prompt length drops below a threshold ℓ.
Calibration. The top k% of elite prompts from the entire evolutionary history are re-evaluated on a larger validation set to guard against overfitting to the small training set.
Fitness Functions by Task
The fitness function adapts to the downstream task:
- Classification and Multi-choice QA: A piecewise reward function that measures the "gap" between the correct label probability and the highest-incorrect label probability, scaled by multipliers λ₁ > λ₂.
- Style Transfer: A joint score combining content preservation, style transfer accuracy, and fluency.
- Jailbreaking: Attack success rate measured by exact-match or LLM-based judgment.
- Chain-of-Thought Reasoning: Accuracy on held-out math problems.
Why It's Called "Self-Replicating"
The key insight is that the prompt itself is the genome. There's no external template or target distribution. The evolutionary process doesn't construct new tokens or swap in novel words—it can only remove tokens that already exist in the original prompt. The prompt literally replicates itself with deletions, generation after generation, with only the fittest variants surviving.
This constraint is both a limitation and a strength. The search space is combinatorial (2^n possible subsequences) rather than the exponential vocabulary space of token-level generation, making it tractable. And because every pruned prompt is a subsequence of the original, the results are grounded in real token co-occurrences rather than arbitrary token combinations.
The TAPruning Baseline: Hill-Climbing Before Evolution
Before introducing the full evolutionary framework, the paper establishes a simpler baseline called TAPruning (Threshold Accepting Pruning). TAPruning iterates through tokens left-to-right, tentatively removing each one and accepting the removal if performance stays within a threshold (e.g., ≥96% of current best). This is essentially a greedy hill-climbing approach with threshold acceptance to escape local optima.
TAPruning already validates the Partial Context Hypothesis. Even this simple method produces pruned prompts that outperform the original ICL baseline and match or exceed prior unnatural-language prompt discovery methods. However, hill-climbing is fundamentally limited: it explores a single trajectory through the search space and can get trapped in local optima.
PromptQuine's evolutionary approach addresses these limitations through population-based search, maintaining multiple candidate solutions simultaneously and exploring diverse pruning trajectories in parallel.
Experimental Results: Gibberish Wins Across the Board
The paper presents extensive experiments across multiple task categories and model families:
Classification Tasks
On standard text classification benchmarks (SST-2, Subj, AG's News, Yahoo, Yelp-5, SNLI), PromptQuine consistently outperforms baselines:
| Configuration | PromptQuine | ICL Baseline | Promptbreeder |
|---|---|---|---|
| 1-shot (Llama-3-8B-Instruct) | 77.5% | 69.6% | 75.8% |
| 4-shot (Llama-3-8B-Instruct) | 81.3% | 72.0% | — |
Multi-Choice QA (PIQA)
PromptQuine achieves competitive or superior results on the PIQA physical reasoning benchmark compared to both vanilla ICL and automatic prompt optimization methods.
Style Transfer
On Yelp sentiment style transfer, PromptQuine achieves a joint score of 61.0 with Llama-3-8B-Instruct, compared to 59.6 for ICL and 59.1 for Promptbreeder.
Math Reasoning
On chain-of-thought math reasoning (GSM8K, MAWPS), 1-shot PromptQuine achieves 78.6% on MAWPS with Llama-3-8B-Instruct, compared to 77.7% for standard ICL with 4-8 shots—meaning pruned single-shot prompts can outperform multi-shot baselines.
Jailbreaking
Perhaps the most striking result: PromptQuine achieves approximately 99% attack success rate on Vicuna-7B and Mistral-7B-Instruct for jailbreaking tasks, compared to roughly 50% for standard ICL. This demonstrates both the power and the potential danger of the approach—pruned prompts can bypass safety alignment.
Model Generality
The findings hold across diverse model families: RoBERTa-large, GPT-2, Gemma-7B, Llama-3-8B, Llama-3-8B-Instruct, and Llama-3-70B-Instruct. Critically, the effect persists regardless of whether models have undergone alignment training, suggesting that LLM alignment may be more superficial than commonly assumed.
Runtime Efficiency
PromptQuine converges rapidly. For 1-shot classification with Llama-3-8B-Instruct, optimization completes in approximately 4 minutes. In contrast, methods like RLPrompt require hours of reinforcement learning training. The evolutionary framework is inherently parallelizable—fitness evaluations and reproduction can be distributed across GPU clusters.
Ablation Insights
Ablation studies reveal that:
- Greedy pruning alone underperforms and converges unreliably
- Random search fails to find high-quality solutions consistently
- Token-attribution methods (e.g., gradient-based saliency) do not produce robust pruning strategies
- Standard prompt compression (LLMLingua, LLMLingua-2) optimizes for length, not task performance, and fails to improve accuracy
- Crossover operations add no meaningful benefit in this search space
Perhaps most surprisingly, PromptQuine can improve performance even starting from random verbalizers (random label word assignments)—pruning can rescue performance from below chance-level baselines.
Why Existing Methods Fail
The paper systematically demonstrates why intuitive and established approaches cannot substitute for evolutionary search:
Human intuition fails. When researchers tried to manually identify which tokens to prune based on semantic importance, they could not reliably produce improvements. The tokens that matter most to LLM performance often bear no relation to what humans consider "important."
Attribution methods fail. Gradient-based saliency maps and attention-based attribution methods produce noisy, unreliable token importance scores that don't translate into effective pruning strategies.
Prompt compression fails. Existing compression methods like LLMLingua and LLMLingua-2 are designed to reduce prompt length for inference efficiency, not to improve task performance. They prune tokens based on perplexity or information-theoretic measures that don't align with downstream accuracy.
The fundamental problem is that the relationship between token presence and task performance is highly non-linear and multimodal. Removing a seemingly unimportant token can dramatically change model behavior, while removing a seemingly critical token might have no effect at all. This makes the search landscape rugged and deceptive—exactly the kind of landscape where evolutionary algorithms excel over greedy methods.
The Objective Landscape: Why Evolution Works
The paper provides an insightful analysis of the fitness landscape. Visualizing the relationship between pruning decisions and task performance reveals:
- High multimodality: Different pruning paths lead to wildly different local optima. A single greedy trajectory misses most of the good solutions.
- Deceptive gradients: The relationship between token removal and performance improvement is full of plateaus, cliffs, and counterintuitive jumps. Methods that rely on smooth gradients (attribution, compression) are fundamentally mismatched to this landscape.
- Emergent diversity: Population-based search naturally discovers diverse effective solutions—different runs may converge on completely different token subsets, all achieving similar performance. This mirrors ecological niche-filling in biological evolution.
The absence of effective crossover is itself a finding: in this landscape, recombination doesn't help because the "building blocks" of good solutions aren't modular in the way traditional genetic algorithms assume. Each prompt's effectiveness depends on the specific combination of retained tokens, not on independently advantageous subsequences.
Implications for Adaptive Prompt Engineering
PromptQuine's implications extend far beyond a single optimization technique:
1. The "LLM Language" Hypothesis
The paper's most provocative claim is that optimal prompts for LLMs may exist in an "LLM language space" that diverges significantly from human language. The fact that gibberish outperforms careful natural language suggests that LLMs process prompts through a different lens than humans—attending to statistical patterns, positional features, and token co-occurrences rather than semantic meaning. This has profound implications for mechanistic interpretability: understanding why certain token subsets are more effective could reveal fundamental properties of how transformers perform in-context learning.
2. Prompt Optimization Without Gradients
PromptQuine requires no gradient computation, no backpropagation, and no model access beyond inference. This makes it applicable to any LLM accessed through an API—no need for logprobs, embeddings, or fine-tuning capabilities. The only requirement is the ability to evaluate task performance on a small held-out set. This democratizes prompt optimization for practitioners using closed-source models.
3. Security and Alignment Concerns
The jailbreaking results are sobering. If pruned "gibberish" prompts can bypass safety training with ~99% success rates, this reveals a fundamental weakness in current alignment approaches. Safety training may teach models to resist coherent harmful requests while remaining vulnerable to incoherent but strategically optimized token patterns. This suggests that robust alignment may require understanding and defending against the full space of token-level manipulations, not just natural-language attacks.
4. Scaling with More Examples
An encouraging finding: PromptQuine's improvements become more pronounced as the number of in-context examples increases. With more demonstrations, there are more tokens to potentially prune, and more opportunities to discover high-performing subsequences. This suggests the approach scales naturally with context length—a crucial property as models support increasingly long contexts.
5. Broader Open-Endedness
The authors explicitly call for embracing open-ended search algorithms for prompt optimization, drawing parallels to the broader open-endedness agenda in AI (Stanley et al., 2017). Rather than optimizing toward a fixed objective, open-ended approaches explore diverse solutions and discover unexpected strategies. PromptQuine's population-based evolutionary search embodies this philosophy: it doesn't presuppose what a good prompt looks like, only that fitness (task performance) should guide selection.
Limitations and Open Questions
PromptQuine is not without limitations:
- Search cost: While faster than RL-based methods, evolutionary search still requires hundreds or thousands of model evaluations. For very large models or expensive APIs, this can be costly.
- Fixed-order constraint: The current framework only prunes tokens without reordering them. Allowing word-order changes would dramatically expand the search space but might yield further improvements.
- Interpretability: The resulting "gibberish" prompts are opaque. Understanding why specific token subsets work remains an open mechanistic question.
- Task-specific fitness: Each task requires its own fitness function and small evaluation set. Transferring pruning strategies across tasks is not yet well understood.
- No token insertion: The framework can only remove tokens, not add new ones. Future work might explore hybrid approaches that combine pruning with novel token insertion.
The Bigger Picture: Prompts as Living Programs
PromptQuine reframes the relationship between prompts and LLMs in a way that resonates with broader trends in AI research. The shift from static, hand-crafted prompts to evolving, self-optimizing sequences mirrors the broader movement from hand-engineered features to learned representations—except this learning happens during inference, without any parameter updates.
The quine metaphor is apt in ways the authors may not have fully intended. A quine is a program that contains a complete description of itself. In PromptQuine, the prompt (genome) contains the complete information needed for its own replication and modification. The evolutionary process is a meta-program that runs on the substrate of LLM inference calls. The fitness landscape emerges from the model's internal representations—a landscape we can evaluate but cannot directly observe.
This suggests a provocative future direction: prompts that not only self-replicate and evolve, but adapt in real-time to the specific task, context, and even the model version they're running on. A prompt that evolves during a conversation, pruning itself based on the user's actual questions. A prompt that co-evolves with the model, maintaining performance across updates. A prompt that discovers novel in-context learning strategies that no human would ever design.
The authors' call for open-endedness is well-placed. If LLMs operate in a language space orthogonal to human intuition, then the space of effective prompts is vast, largely unexplored, and full of surprises. PromptQuine gives us a vehicle for exploration—but the territory remains largely unmapped.
Technical Details and Availability
Paper: "Evolving Prompts In-Context: An Open-ended, Self-replicating Perspective" (arXiv:2506.17930)
Authors: Jianyu Wang, Zhiqiang Hu, Lidong Bing
Venue: ICML 2025 (42nd International Conference on Machine Learning)
Code: github.com/jianyu-cs/PromptQuine (MIT License)
Key methods released: PromptQuine (evolutionary search) and TAPruning (hill-climbing baseline)
Supported tasks: Few-shot classification, multi-choice QA, text style transfer, chain-of-thought reasoning, and jailbreaking
Models tested: RoBERTa-large, GPT-2, Gemma-7B, Llama-3-8B/Instruct, Llama-3-70B/Instruct
Closing Thought
There's a beautiful irony at the heart of PromptQuine. The entire field of prompt engineering was built on the assumption that the key to better LLM performance is writing better instructions—more clarity, more detail, more examples. PromptQuine shows that sometimes the best instruction is the one that's been stripped down to its essential tokens, even if no human can read it.
The gibberish isn't random. It's evolved. And in the evolutionary process, it found something that careful human prompt designers missed: the specific token patterns that an LLM actually needs to perform a task well. We've been writing prompts for ourselves. PromptQuine writes them for the model.
That's not just a technique improvement. It's an epistemic shift—one that suggests our understanding of how LLMs process language is far less complete than we assumed, and that the most effective prompts may be ones we could never have written by hand.
Tags: #PromptEngineering #LLM #ICML2025 #EvolutionaryComputation #InContextLearning #PromptOptimization #SelfReplication