Source-linked AI summary

PromptBridge: Cross-Model Prompt Transfer for Large Language Models

Yaxuan Wang, Quan Liu, Zhenting Wang, Zichao Li, Wei Wei, Yang Liu, Yujia Bao

arXiv:2512.01420v1cs.CLcs.AI

TL;DR

Model Drifting occurs because prompts optimized for one LLM often underperform after switching to another, creating costly migration and re-engineering challenges. PromptBridge calibrates model-specific prompts with MAP-RPE and learns a cross-model mapping from alignment tasks to adapt source prompts for unseen tasks. Across single-agent and multi-agent settings, it consistently improves or maintains performance while reducing transfer gaps and migration overhead.

  • Problem

    Prompts engineered for one LLM frequently underperform on another, so model switching can change performance and require prompt re-engineering.

    Source: §1 · pp. 1–2
  • Method

    PromptBridge uses MAP-RPE to obtain source- and target-optimal prompts on alignment tasks, then learns a training-free mapping that adapts source prompts to target models for unseen tasks.

    Source: §1 · p. 3
  • Results

    Across seven LLMs and eight benchmarks in single-agent and multi-agent settings, PromptBridge consistently reduces transfer gaps and maintains or improves performance while lowering migration overhead.

    Source: §1 · p. 3
  • Takeaways & Limitations

    PromptBridge treats prompts as migratable artifacts, offering a practical way to make model switching more reliable and efficient as LLM ecosystems evolve.

    Source: §6 · p. 16

    The study calls for broader evaluation across additional model families and alignment-aware variants, plus systematic analysis of behavioral and stylistic drift.

    Source: §6 · p. 16

Abstract

from arXiv · show

Large language models (LLMs) underpin applications in code generation, mathematical reasoning, and agent-based workflows. In practice, systems access LLMs via commercial APIs or open-source deployments, and the model landscape (e.g., GPT, Claude, Llama) evolves rapidly. This rapid evolution forces frequent model switches driven by capability, cost, deployment constraints, and privacy. Yet prompts are highly model-sensitive: reusing a prompt engineered for one model on another often yields substantially worse performance than a prompt optimized for the target model. We term this phenomenon Model Drifting. Through extensive empirical analysis across diverse LLM configurations, we show that model drifting is both common and severe. To address this challenge, we introduce PromptBridge, a training-free framework that preserves prompt effectiveness under model switches, enabling cross-model prompt transfer without costly per-task or per-model re-optimization. PromptBridge requires only a small set of alignment tasks for calibration. It first applies Model-Adaptive Reflective Prompt Evolution (MAP-RPE) to obtain task- and model-specific optimal prompts via iterative reflective refinement and quantitative evaluation. Using the resulting calibrated prompt pairs for the source and target models, PromptBridge learns a cross-model prompt mapping. At test time, i.e., for an unseen task, given a source-model prompt, this mapping directly produces an optimized prompt for the target model. Experiments in single-agent and multi-agent settings show that PromptBridge consistently improves downstream accuracy while reducing migration effort. The code will be available soon.

1. Introduction

PromptBridge addresses Model Drifting, where prompts optimized for one LLM often lose performance after model replacement. It measures this transfer gap and uses calibrated source–target prompt pairs to enable zero-shot adaptation across models and tasks.

Model Drifting

  • 99.39% on GPT-5 falls to 68.70% on Llama-3.1-70B-Instruct, while Llama’s own prompt reaches 79.47%, demonstrating severe cross-model drift on HumanEval.The reverse transfer achieves 96.95% on GPT-5 versus GPT-5’s 99.39% optimum, a 2.44-point drift.Source: §1 · p. 2

Problem

  • Model Drifting arises when replacing an underlying LLM changes system behavior and performance under the same prompt.Different training corpora, tokenization, role tags, and alignment criteria can make prompts fit one model but mis-specify another.Source: §1 · pp. 2–3

MAP-RPE

  • PromptBridge combines Model-Adaptive Reflective Prompt Evolution with quantitative feedback to produce model-preferred prompts for drift measurement and transfer.Its reflective, evaluation-guided, island-based search avoids re-optimizing prompts independently for every model and task.Source: §1 · p. 3

PromptBridge

  • PromptBridge learns a cross-model prompt transformation from a small calibration suite of source- and target-optimal prompts, then applies it to unseen tasks without evaluation data.MAP-RPE supplies the task- and model-specific calibrated prompts used as alignment anchors.Source: §1 · p. 3

Empirical Scope

  • Across seven LLMs and eight benchmarks in single-agent and multi-agent settings, PromptBridge consistently reduces transfer gaps, maintains or improves performance, and lowers migration overhead.The framework is presented as a practical response to frequent model changes driven by capability, cost, deployment, and privacy considerations.Source: §1 · pp. 1, 3

2. Related Work

Prior work optimizes prompts for tasks, modalities, systems, or individual models, but cross-model portability under model drifting remains comparatively underexplored. Existing transfer methods also often target soft prompts, fixed model families, or training-based settings.

Prompt Optimization

  • Prompt optimization methods use iterative refinement, evolutionary search, multi-agent coordination, reflective feedback, or Pareto-aware objectives, but often rely on large proprietary models and transfer poorly to smaller models.PromptBreeder, MultiPrompter, MARS, EvoPrompt, AlphaEvolve, OpenEvolve, and GEPA exemplify these strategies.Source: §2 · pp. 3–4

Prompt Sensitivity

  • Prompt-sensitivity research shows that minor instruction changes can degrade performance, while MAPO adapts prompts to specific LLMs; model drifting instead concerns systematic changes across model architectures or alignments.The paper distinguishes this broader semantic shift from local prompt perturbation effects.Source: §2 · p. 4

Optimizing AI Systems and Agents

  • System-level methods optimize multi-module or multi-agent pipelines through exemplar design, textual feedback, Bayesian optimization, coordinated rewards, or workflow optimization.These approaches address dependencies among interacting LLM components rather than cross-model prompt transfer itself.Source: §2 · p. 4

Prompt Transfer

  • Prompt-transfer research mainly studies cross-task or cross-modality reuse, with earlier cross-model work limited by soft prompts, pretrained encoders, or training-based transfer.Cross-model transfer under model drifting and complex LLM systems remains underexplored.Source: §2 · pp. 4–5

3. Problem Formulation

The paper formalizes Model Drifting as the performance change caused by replacing a source LLM with a target LLM while retaining the prompt. It then defines transfer as learning a mapping from source-optimal to target-compatible prompts using calibrated alignment tasks.

Model Drifting

  • Model Drifting is the performance drift induced when a system’s underlying source model is replaced by a target model for practical reasons such as budget or deployment requirements.The same prompt may be optimal for the source but suboptimal for the target, requiring recalibration or transfer.Source: §3 · p. 5

Scope

  • The framework covers single-agent systems and multi-agent systems with either local replacement of one agent’s model or global replacement of all agents’ models.The primary focus is the single-agent setting, which also encompasses traditional single-LLM tasks.Source: §3 · p. 5

Prompt Transfer

  • Prompt transfer learns a transformation from source-model prompts to target-model optimal prompts using alignment tasks with calibrated source–target prompt pairs.The mapping captures systematic relationships between model-specific and task-specific prompt structures.Source: §3 · p. 5
  • At test time, the learned transformation converts an unseen task’s source prompt into an adapted target prompt intended to match or approach target-optimal performance.Only the source prompt is available for the unseen task; the target prompt is synthesized through the learned mapping.Source: §3 · p. 6

4. Method

PromptBridge first calibrates model-specific prompts with MAP-RPE, then learns and applies a transferable source-to-target prompt mapping. Its calibration uses reflective quantitative evaluation and island-based diversity to refine prompts without gradients.

4. Method

  • PromptBridge has two stages: MAP-RPE calibration produces task-specific prompts for each model, and cross-model transfer learns a mapping from calibrated source prompts to target-compatible prompts.The mapping is applied to unseen tasks through an adapter without additional training or calibration.Source: §4 · p. 6, §4.1 · pp. 6–7

4.1. Cross-Model Prompt Transfer

  • The Mapping Extractor summarizes structural and stylistic differences between calibrated source and target prompts into transferable knowledge for prompt reformulation.The Adapter Model conditions on the source prompt and this learned mapping to generate an adapted target prompt.Source: §4.1 · pp. 6–8, Figure 3 · p. 7

4.2. Calibration: Model-Adaptive Reflective Prompt Evolution

  • MAP-RPE iteratively refines prompts using model responses, quantitative performance and behavior scores, reflective analysis, and proposed prompt improvements.It is gradient-free and targets model-specific, task-specific prompt alignment.Source: §4.2 · p. 8
  • Island-based prompt populations preserve diverse behavioral patterns and balance exploration with exploitation during iterative candidate generation and evaluation.The best-performing prompt serves as a parent for new candidates across the islands.Source: §4.2 · p. 8
  • MAP-RPE differs from GEPA by using explicit performance, behavioral, and task-specific metrics alongside model-adaptive calibration and population diversity.The stated goal is to address prompt–model mismatch while refining prompts for a particular target model.Source: §4.2 · p. 8
  • Table 1 evaluates Pass@1 accuracy when transferring GPT-4o prompts to o3, o4-mini, and Llama3.1-70B-Instruct, comparing direct transfer with PromptBridge results.Higher accuracy is better, and the best transfer results are highlighted in bold.Source: Table 1 · p. 9

5. Experiments

PromptBridge is evaluated across coding, agentic, and non-coding settings using alignment tasks, diverse target models, and training-free baselines. Across these experiments, it improves cross-model transfer, calibrates model-specific prompts, and remains effective under multi-agent and ablation settings.

5.1. Alignment and Unseen Tasks.

  • The experiments use synthetic-code-generations and CodeContests training splits for alignment, then evaluate on five coding benchmarks plus SWE-Bench Verified, Terminal-Bench, and TravelPlanner.The evaluation spans basic and competitive coding, repository-level software engineering, terminal tasks, and tool-use planning.Source: §5.1 · pp. 9–10

5.3. Prompt Transfer

  • PromptBridge improves direct transfer across unseen coding tasks and target models, with relative gains reaching 46.54% on CodeContests for o4-mini.It achieves gains across APPS, xCodeEval, and CodeContests for o3, o4-mini, and Llama-3.1-70B-Instruct, while showing robust generalization across benchmarks.Source: §5.3 · p. 11
  • Across SWE-Bench Verified and Terminal-Bench, PromptBridge improves over direct transfer by 27.39%, 15.79%, and 2.5% on SWE-Bench targets and 39.44% and 10.53% on Terminal-Bench targets.The gains are reported for o3, Llama-3.1-70B-Instruct, GPT-4o, and o4-mini target models, respectively.Source: §5.3 · pp. 11–12, Figure 4 · p. 11, Figure 5 · p. 12
  • In multi-agent settings, PromptBridge consistently improves global model-drift transfer and performs best for the debugging agent under local drift, although overall gains are modest.Jointly updating all four agent prompts may improve inter-agent coherence during global model drift.Source: §5.3 · pp. 12–13, Table 2 · p. 13

5.4. Prompt Calibration

  • MAP-RPE produces model- and task-specific prompts with strong, stable performance, including best reported results of 74.53 on xCodeEval and 58.79 on CodeContests for o3.On o4-mini it leads on MBPP and APPS while avoiding MIPROv2 instability and matching GEPA in average accuracy.Source: §5.4 · p. 14, Table 4 · p. 14

5.5. Ablation Study

  • PromptBridge outperforms one-shot and few-shot in-context transfer, while MAP-RPE benefits from more calibration questions and remains effective with only five.On Llama3.1-70B-Instruct, MAP-RPE reaches up to 79.5% Pass@1 versus 68.7% for the default prompt; on o3 it reaches 98.4%.Source: §5.5 · pp. 15–16, Table 5 · p. 15, Figure 6 · p. 16

6. Conclusions

The paper formalizes prompt degradation under model replacement as Model Drifting and introduces PromptBridge to transfer prompts across models. Experiments report consistent gains in single-agent and multi-agent settings, while future work targets broader model families, behavioral drift, and portability benchmarks.

  • PromptBridge combines task- and model-specific prompt evolution with cross-model transfer mapping for unseen tasks during model switches.The framework treats prompts as migratable artifacts rather than static instructions.Source: §6 · p. 16
  • Experiments across single-agent and multi-agent settings show consistent performance gains from efficient prompt transfer.Source: §6 · p. 16

Future Work

  • Future work will extend evaluation to broader model families and alignment-aware variants such as SFT-, DPO-, and GRPO-aligned models.Source: §6 · p. 16
  • Planned studies will examine stylistic and behavioral drift and develop shared benchmarks for cross-model prompt portability.Source: §6 · p. 16

A.1. Necessity of Cross-Model Prompt Transfer

Cross-model prompt transfer is difficult because optimized prompts often lose effectiveness after model or scale changes. The supplied analyses show systematic drift, shared semantic adaptation patterns, and a resulting need for model-adaptive transfer mechanisms.

A.1. Necessity of Cross-Model Prompt Transfer

  • Figure 7 arranges source models by rows and target models by columns, with darker diagonal cells representing self-optimized prompts and lighter off-diagonal cells representing frozen transfers.Source: Figure 7 · p. 24
  • Up to 50–70% relative loss on xCodeEval occurs when optimized prompts transfer across scales within the same model family.Diagonal self-prompt accuracies remain highest on both xCodeEval and HumanEval, including Llama3.1 and Qwen scale changes.Source: §A.1 · p. 24, Figure 7 · p. 24
  • Same-family transfers retain a substantial diagonal–off-diagonal accuracy gap, showing that optimal prompts do not smoothly scale across model sizes.Source: §A.1 · p. 24
  • Default human-designed prompts can also drift after model substitution because they are not guaranteed to be optimal for each model.The observation motivates targeted adaptation of existing prompt templates.Source: §A.1 · pp. 24–25

A.2. Feasibility of Cross-Model Prompt Transfer

  • Semantic-delta cosine similarities compare task-specific prompt adaptations for GPT-4o→Llama-3.1-70B-Instruct and GPT-4o→o3.Higher similarity indicates shared transfer patterns.Source: Figure 8 · p. 25, §A.2 · p. 25
  • The feasibility analysis constructs source- and target-optimal prompts for fixed model pairs and measures pairwise cosine similarity between their semantic deltas.Embedding similarity alone does not establish functional equivalence, so unseen-task performance is assessed separately.Source: §A.2 · pp. 25–26
  • Across five code-generation tasks, consistently positive semantic similarities indicate shared latent structures in source-to-target prompt transformations.This supports the feasibility of learning transferable cross-task prompt transformations.Source: §A.2 · pp. 25–26

B.1. Baseline Methods

The baseline suite includes zero-shot prompt rewriting, established prompt optimizers, test-set variants, and a generation-selection calibration method. These baselines differ in whether they use target-model information, demonstrations, feedback, or test questions.

  • GPT5 Optimizer performs zero-shot prompt rewriting using only the target model’s name and no additional examples or training data.Source: §B.1 · p. 26
  • MIPROv2 jointly optimizes instructions and demonstrations with Bayesian optimization, using TPE proposals and evaluation scores to select configurations.Source: §B.1 · p. 26
  • GEPA iteratively improves candidates through reflective mutation or system-aware merging, using Pareto-based sampling to avoid local optima.Source: §B.1 · p. 27
  • MIPROv2* and GEPA* apply their optimizers to 50 randomly selected test questions while keeping other parameters unchanged.Source: §B.1 · p. 27
  • Generation-selection creates several GPT-5 candidate prompts and selects them using textual similarity between target generations and source-model responses.Source: §B.1 · p. 27

B.2. Dataset Description

The study calibrates prompt transfer on alignment tasks, evaluates it across coding and agent benchmarks, and uses MAP-RPE to evolve prompts with performance and behavioral signals. Setup details span calibration, multi-agent coding, and constrained travel planning.

B.2. Dataset Description

  • Calibration uses 54 alignment tasks: 30 synthetic-code-generation subtasks and 24 CodeContests tasks.Evaluation covers HumanEval, MBPP, APPS, xCodeEval, CodeContests, SWE-Bench Verified, Terminal-Bench, and TravelPlanner.Source: §B.2 · p. 27
  • MAP-RPE takes task data, source and target models, prompt islands, a reflection model, evolution limits, and evaluation metrics to output an optimized target-model prompt.Source: §B.2 · p. 28

B.3. Calibration Details and Setup

  • MAP-RPE initializes from a source prompt, evaluates target-model responses, builds reflective queries from feedback, and evolves candidate prompts across islands.The best-performing prompt is updated after candidate evaluation and possible island migration.Source: §B.2 · p. 28
  • Calibration combines textual-similarity task scores with a behavioral score covering syntax validity, entry-point definition, risk-free patterns, and undesirable patterns.The behavioral score is clamped to [0, 1], and λ=0.8 is used during calibration.Source: §B.3 · p. 28
  • Alignment-task calibration uses 20 questions, 20 global iterations, 10 local steps per question, 1000 archived prompts, and three evolutionary islands.Source: §B.3 · pp. 28–29
  • For unseen coding benchmarks, MAP-RPE optimizes official functional-correctness metrics rather than textual similarity.Source: §B.3 · p. 29

B.4. MapCoder Setup

  • MapCoder uses retrieval, planning, coding, and debugging agents; its default human-crafted prompt serves as the initial transfer point.The setup uses k=5 similar problems and t=5 plan generations for HumanEval.Source: §B.4 · p. 29

B.5. TravelPlanner Setup

  • TravelPlanner evaluates delivery, commonsense, hard-constraint, and final pass rates under both two-stage and sole-planning modes.Final Pass Rate is the primary metric, with GPT-5 used as the parsing model.Source: §B.5 · pp. 29–30

C.1. Coding Benchmarks

Across coding benchmarks, PromptBridge generally improves cross-model prompt transfer over direct transfer, including transfers to diverse target model families. On SWE-Bench Verified, it also delivers substantial relative gains while showing that source-optimized prompts do not reliably generalize.

C.1. Coding Benchmarks

  • PromptBridge improves average coding accuracy from 37.61% to 40.61% for Qwen3-32B and reaches 45.01% for Gemma3-27B-it, outperforming or closely matching baselines across target models.For Llama3.1-8B-Instruct, GPT-5 Optimizer reaches the highest average at 30.24%, but PromptBridge still substantially exceeds Direct Transfer.Source: §C.1 · p. 30

C.2. SWE-Bench

  • PromptBridge achieves relative gains of 27.39% on o3 and 15.79% on Llama-3.1-70B-Instruct over direct transfer on SWE-Bench Verified.The relative gain is computed against the direct-transfer baseline.Source: §C.2 · p. 31, Table 8 · p. 31
  • A 9% improvement over the default prompt for o4-mini contrasts with weaker cross-model generalization when its optimized prompt is directly transferred without adaptation.These results illustrate why model-adaptive transfer is needed to maintain performance across models.Source: §C.2 · p. 31

C.3. Terminal-Bench

PromptBridge improves transfer robustness on Terminal-Bench and TravelPlanner, including settings that use default prompts or isolate the planning module. The gains are especially pronounced when prompt adaptation directly affects core reasoning and decision-making.

C.3. Terminal-Bench

  • PromptBridge yields relative gains of 25% on GPT-4o and 40% on Llama-3.1-70B-Instruct over direct transfer on Terminal-Bench.The source o3 model reaches 36.25% accuracy, and transferred performance decreases because of model capability and reasoning-style differences.Source: §C.3 · p. 31, Figure 9 · p. 31
  • PromptBridge also improves over default, non-model-specific prompts on Terminal-Bench, extending beyond carefully optimized source prompts.The direct-transfer prompt is the Terminus agent’s default prompt for this figure.Source: §C.3 · pp. 31–32

C.4. TravelPlanner

  • In TravelPlanner’s sole-planning mode, PromptBridge consistently beats direct transfer and default prompting, with larger improvements than in the two-stage mode.Default pass rates are 2.77% for GPT-4o, 1.67% for o3, and 0.56% for Llama3.1-70B-Instruct; only the planner prompt is modified.Source: §C.4 · p. 32, Table 9 · p. 32

C.5. Consistency Analysis

Consistency analyses evaluate PromptBridge across five identical runs using semantic similarity of transfer mappings and optimized prompts. Transfer mappings are highly stable, while optimized prompts remain coherent but show more variation across model pairs.

Consistency Method

  • The study computes pairwise similarities across five independent runs using averaged BERTScore F1 and Sentence-BERT cosine similarity, with diagonal entries fixed at 1.0.Higher scores indicate greater semantic consistency and robustness to sampling randomness.Source: §C.5 · pp. 32–33

Transfer Mapping Consistency

  • Transfer mappings show average cross-run consistency of approximately 0.87 for GPT-4o → o3 and around 0.89 for GPT-4o → Llama-3.1-70B-Instruct.Most off-diagonal similarities fall between 0.85–0.90, indicating reproducible mappings across stochastic runs.Source: §C.5 · pp. 33–34, Figure 10 · p. 33

Optimized Prompt Consistency

  • Optimized prompts average around 0.82 similarity for GPT-4o → o3 and vary around 0.78–0.89 for GPT-4o → Llama-3.1-70B-Instruct.The prompts are not identical across runs but remain semantically coherent, consistent with functionally equivalent solutions.Source: §C.5 · p. 34, Figure 11 · p. 34

Ablation Setup

  • The ablation varies the Mapping Extractor and Adapter Model for GPT-4o-to-Llama3.1-70B-Instruct transfer, using Direct Transfer as the baseline and average accuracy across HumanEval and xCodeEval.Best and second-best configurations are visually distinguished in Table 10.Source: Table 10 · p. 35

C.6. Ablation Study

This ablation study examines PromptBridge’s model-transfer components and their application across coding, terminal, and planning tasks. It compares optimized GPT-4o prompts with PromptBridge-transferred prompts for o3, emphasizing structured planning, disciplined tool use, deterministic selection, and data-grounded outputs.

C.6. Ablation Study

  • GPT-5 as both Mapping Extractor and Adapter Model achieves the strongest transfer performance, while Qwen3-32B in either role yields the lowest accuracy.With GPT-5 fixed as adapter, extractor performance ranks GPT-5, Llama3.1-70B-Instruct, then GPT-4o; GPT-5 adapters consistently outperform weaker alternatives.Source: §C.6 · p. 35

D. Discussions

  • PromptBridge uses training-free MAP-RPE calibration on a small alignment set to propagate transfer effects to unseen tasks, reducing task-specific migration effort across single- and multi-agent systems.Unlike MAPO (Chen et al., 2024), which uses dataset construction, supervised fine-tuning, and reinforcement learning, PromptBridge is lightweight and training-free.Source: D. Discussions · p. 35
  • PromptBridge targets migrations for better performance, lower cost, or stronger privacy, while limitations include reduced coverage for niche or rapidly changing models, nontrivial prompt-evolution compute, and no exemplar optimization.The transferred target prompt should preserve source-model performance on unseen tasks, but the framework currently optimizes instructions alone.Source: D. Discussions · p. 36

E. Prompt Template

  • The prompt-template section states that complete templates will be released in the codebase.This implementation subsection provides only the release note in the supplied passages.Source: E. Prompt Template · p. 36

E.1. PromptBridge

  • PromptBridge’s adapter templates instruct models to apply summarized transfer effects to source prompts while adapting them for target models and unseen coding or planning benchmarks.The supplied templates cover coding datasets such as HumanEval, SWE-Bench, Terminal Bench, and a planning-agent benchmark.Source: §E.1 · pp. 37–38

E.3. Optimized Prompt for SWE-Bench and Terminal-Bench

  • The optimized SWE-Bench and Terminal-Bench prompts enforce deterministic tool use, constrained file modifications, iterative verification, and strict structured outputs for terminal agents.SWE-Bench uses one-command bash interaction, while Terminal-Bench uses tmux inputs, JSON-only responses, minimal batches, and explicit output-need control.Source: §E.3 · pp. 41, 43

Optimized Planner Prompt for GPT-4o

  • The optimized GPT-4o planner prompt requires template-compliant itineraries using only provided data, chronological city-consistent activities, deterministic tie-breaking, and no fabricated details.Missing or unsatisfied fields are represented with "-", while dates, group size, budgets, and explicit constraints must be respected.Source: Optimized Planner Prompt for GPT-4o · p. 44

Optimized REACT Prompt for GPT-4o

  • The optimized GPT-4o REACT prompt interleaves Thought, Action, and Observation steps to gather travel information, persist it in Notebook, and invoke Planner.Actions call one tool once, and Notebook stores the searched information used by Planner.Source: Optimized REACT Prompt for GPT-4o · pp. 45–46

PromptBridge Optimized Planner Prompt for o3

  • The PromptBridge o3 planner prompt transfers the GPT-4o planner structure while enforcing exact formatting, chronological consistency, deterministic option selection, and data-only itinerary generation.It explicitly prohibits invented prices, times, availability, external sources, randomness, and commentary.Source: PromptBridge Optimized Planner Prompt… · p. 47

PromptBridge Optimized REACT Prompt for o3

  • The PromptBridge o3 REACT protocol constrains agents to typed Thought, single-tool Action, and returned-data Observation steps before Planner uses Notebook contents.It emphasizes minimal high-signal storage, deterministic ranking and tie-breaks, explicit edge-case handling, failure adjustment, and finalization only after sufficient data collection.Source: PromptBridge Optimized REACT Prompt… · p. 48

E.2. Optimized Prompt for Coding Benchmarks

This section presents optimized prompts for coding benchmarks, covering competitive-programming and library/API-integration tasks with emphasis on exact interfaces and outputs, efficient and portable Python implementations, scoped changes, robust edge-case handling, and validation.

E.2. Optimized Prompt for Coding Benchmarks

  • The optimized coding prompt requires complete Python code implementing the exact specified API, without extra prose, I/O, tests, or top-level execution.It also requires Python 3.8+ compatibility, standard-library-only solutions, type hints, concise public-function docstrings, and iterative approaches when safe.Source: §E.2 · pp. 39–40
  • The prompt emphasizes correctness through edge-case coverage, deterministic behavior, numeric stability, canonical tie-breaking, ambiguity assumptions, and adherence to implied examples and sentinels.It calls for handling empty or extreme inputs, duplicates, ties, negative values, large values, Unicode or whitespace, overflow, floating-point precision, and nondeterministic iteration.Source: §E.2 · pp. 39–40
  • The coding prompt targets benchmark efficiency by requiring optimal or near-optimal algorithms and warning against unnecessary quadratic behavior on large inputs.It also requires avoiding unjustified superlinear work, validating examples, and avoiding exceptions unless the specification requires them.Source: §E.2 · pp. 39–40
  • Baseline instructions assess plans against exact function or script I/O contracts, worst-case time and space complexity, proof-style correctness, determinism, numeric issues, recursion risks, and data-structure validity.They require checking formatting, encoding, tie-breaking, corner cases, and potential time-limit or memory failures.Source: §E.2 · p. 40

E.5. Optimized Prompt for Coding Benchmarks using Baseline Methods

  • Baseline methods optimize prompts from GPT-4o to o3 with GPT-5 Optimizer, GEPA, One-shot ICL, and Few-shot ICL, while MIPROv2 uses one target-independent prompt.The associated listings present these optimized coding prompts for HumanEval and training data.Source: §E.5 · pp. 49, 51, 52
  • The baseline prompts add domain-specific implementation rules for TensorFlow Slim, Django fields, partitioned file writing, OpenCV edge masks, shutil.rmtree callbacks, and palindromic concatenation.These rules preserve surrounding APIs, use provided libraries, specify exact processing steps, and encode efficient task-specific solutions such as shared-character detection.Source: §E.5 · pp. 50–51
  • Baseline prompt variants consistently require minimal, deterministic, standard-library Python with exact output formatting, explicit assumptions, complexity documentation, robust edge-case handling, and no fabricated APIs or extraneous code.Depending on the task, they distinguish function-based solutions from stdin/stdout scripts and prescribe buffered I/O for large inputs.Source: §E.5 · pp. 51–52
  • The Few-shot ICL prompt for o3 instructs the model to generate only the requested Python code or patch.It frames the model as a code-synthesis engine and requires a concise solution matching the requested output format.Source: §E.5 · pp. 53–54
  • The prompt requires identifying the exact implementation target, required behavior, constraints, APIs, and any reusable existing utilities.It directs the model not to reimplement logic that has already been provided.Source: §E.5 · p. 54
  • It enforces precise response formatting, including an exact “Answer:” prefix when specified and no explanations or extra text otherwise.The final directive reiterates that only the requested final answer should be emitted.Source: §E.5 · p. 54
  • The prompt constrains edits to remain minimal and well-scoped while preserving imports, signatures, patterns, and unrelated behavior.Additional imports are permitted only when explicitly allowed or necessary under the specification.Source: §E.5 · p. 54
  • It mandates Python 3, portability, runnable code, and avoidance of Python 2 constructs such as print statements, raw_input, and xrange.These constraints are presented as general implementation requirements for coding solutions.Source: §E.5 · p. 54
  • For competitive-programming tasks, the prompt requires complete stdin-to-stdout solutions that honor formatting, handle edge cases, and meet stated efficiency constraints.It also prohibits prompts, debug logs, external dependencies, and avoidable recursion-depth failures.Source: §E.5 · p. 54
  • For library and API integration tasks, it requires exact APIs and parameters, correct imports and error handling, and implementation limited to the named code element.The prompt also asks for internal checks covering syntax, references, I/O, API usage, deterministic behavior, and underspecified details.Source: §E.5 · p. 54
  • A separate optimized prompt is identified as using the MIPROv2 optimizer.The supplied passage provides the optimizer label but no further prompt content or comparative result.Source: §E.5 · p. 54
Loading 2512.01420v1…