Manuel B. Garcia

Manuel B. Garcia serves as the Senior Director for Educational Technology and Digital Learning at FEU Institute of Technology, Manila, Philippines. Read More

Contact Info

1607, FEU Tech Building,
P. Paredes St, Sampaloc,
Manila, Philippines
mbgarcia@feutech.edu.ph

Follow Me

Can Researchers Optimize a Prompt Until AI Produces the Result They Want?

Researchers can legitimately improve AI prompts, but repeatedly modifying instructions until a model produces a preferred finding can undermine scientific validity. Learn how to distinguish methodological optimization from outcome-driven manipulation, separate development from evaluation, and report prompt selection transparently.

933
Prompt Optimization and Desired AI Results Guide 933 of 1196
01 · The Question

When Does Improving an AI Prompt Become Manipulating the Result?

You are evaluating whether generative AI can identify methodological weaknesses in research proposals. Your first prompt produces disappointing results. The model overlooks several important issues and sometimes recommends inappropriate revisions.

You revise the prompt to clarify the task, provide evaluation criteria, and specify the expected response format. Performance improves.

You continue making changes. Eventually, the model produces answers closely matching the reference evaluations. The results now look sufficiently impressive for publication.

But what exactly have you demonstrated? Have you developed a better prompting procedure, or have you adapted the prompt so closely to the evaluation examples that the apparent improvement no longer represents performance on unfamiliar cases?

Prompt optimization is a legitimate part of AI system development. The methodological problem arises when researchers use the outcomes they intend to evaluate as feedback for selecting the procedure that will produce those outcomes.

02 · The Short Answer

Optimize Prompts for Prespecified Performance, Not Preferred Findings

In Brief

Researchers may legitimately optimize AI prompts to improve task clarity, correctness, consistency, or other predefined performance objectives. However, repeatedly modifying prompts until a model produces a desired research finding can introduce selection bias, analytical overfitting, and misleading performance estimates, particularly when the same evaluation data are used for both optimization and final testing.

The distinction depends on the research design and the purpose of optimization. Prompt development should ordinarily use separate development data, explicit selection criteria, documented variants, and an independent final evaluation. Researchers should disclose material optimization procedures rather than presenting a selected successful prompt as though it were the only one tested.

03 · What You Need to Know

Distinguishing Legitimate Prompt Optimization From Outcome-Driven Manipulation

What is prompt optimization in research?

Prompt optimization is the systematic modification or selection of instructions supplied to an AI system to improve performance on a defined task.

Researchers may revise wording, clarify categories, provide examples, specify output formats, or adjust the organization of information.

For example, a researcher evaluating AI classification of research designs may discover that the original prompt does not clearly distinguish mixed-methods studies from quantitative studies containing open-ended survey questions.

Clarifying that distinction may improve the validity of the task instructions.

However, prompt optimization also introduces methodological choices that can affect the resulting performance estimates.

The researcher should therefore treat the prompt as part of the experimental procedure rather than as an incidental interface detail.

What is the difference between improving a prompt and obtaining a preferred result?

Legitimate optimization aims to improve performance according to predefined criteria.

Outcome-driven manipulation occurs when prompt modifications are selected because they produce a particular conclusion or favorable finding, without appropriate safeguards against bias.

Methodological prompt optimization Systematic prompt development guided by explicit task requirements and evaluated using appropriately separated development and test procedures.
Outcome-driven prompt selection Selecting or modifying prompts because their observed outputs support a preferred conclusion, especially when alternative results are concealed or the evaluation data are reused.

The same prompt modification may be defensible in one design and problematic in another.

For example, improving a classification prompt using a development dataset is different from repeatedly modifying it after inspecting the final test results and then reporting the best score as an independent evaluation.

Why does the researcher's intention matter?

Scientific research ordinarily aims to evaluate hypotheses or estimate performance using procedures that do not depend improperly on the desired outcome.

A researcher may reasonably hope that an AI system performs well. That expectation is not itself misconduct.

The concern arises when the expectation influences methodological decisions in ways that compromise the credibility of the evidence.

For example, selecting only prompts that make one model outperform another can create an unfair comparison.

Likewise, changing an evaluation prompt until AI-generated interpretations support a preferred hypothesis can undermine the independence of the analysis.

Researchers should distinguish exploratory development from confirmatory evaluation and disclose decisions that materially affect the results.

When is prompt optimization scientifically legitimate?

Prompt optimization is legitimate when it is aligned with the research question and evaluated through an appropriate methodological procedure.

For example, a study may explicitly investigate which prompting strategy produces the most accurate classifications of educational research abstracts.

In that case, comparing prompt variants is the object of the research.

Another study may seek to develop an AI-assisted screening system and optimize its prompt before evaluating the final system on held-out documents.

Both approaches can be defensible when the optimization objective, development procedure, and final evaluation are transparent.

Problems arise when exploratory optimization is presented as independent confirmation without acknowledging the selection process.

What is prompt cherry-picking?

Prompt cherry-picking occurs when researchers selectively choose prompts or outputs that support a preferred interpretation while disregarding less favorable alternatives.

For example, a researcher may test 30 prompt formulations but report only the one producing the highest AI accuracy.

Reporting the selected prompt's performance is not inherently inappropriate if the study clearly describes the optimization procedure and evaluates the selected prompt independently.

However, presenting its development-set score as though it resulted from a single prespecified test can exaggerate performance.

Researchers should distinguish legitimate selection among candidates from selective reporting that conceals relevant methodological decisions.

The broader problem of prompt cherry-picking in AI research concerns how selection affects the validity and transparency of the findings.

How does prompt optimization create analytical overfitting?

Analytical overfitting occurs when a procedure becomes excessively adapted to the particular observations used during its development.

In AI evaluation, repeatedly revising prompts based on the same test items can produce an increasingly favorable score without necessarily improving performance on unfamiliar data.

For example, a prompt may be refined until it correctly handles the exact methodological ambiguities present in a small benchmark.

Its apparent success may partly reflect adaptation to those examples rather than a generalizable improvement.

This resembles overfitting in predictive modeling, although the mechanism involves selection of instructions rather than necessarily updating the model's parameters.

Researchers should recognize that prompt optimization can become analytical overfitting even when the underlying AI model remains unchanged.

Why should development and test datasets be separated?

Development data are used to design and select the prompting procedure.

Test data are used to estimate the performance of the selected procedure on observations not used during optimization.

Dataset Primary purpose Appropriate use
Development set Prompt construction and initial refinement Inspect errors and revise instructions
Validation set Selection among candidate prompts Compare prespecified performance criteria
Held-out test set Final performance estimation Evaluate the selected procedure without further tuning

Not every study requires three distinct datasets. Smaller studies may use development and held-out test sets, cross-validation, or other justified procedures.

The essential principle is to prevent the final evaluation from being repeatedly used as feedback for optimization.

If researchers inspect the held-out results and then revise the prompt, the data are no longer fully independent of the development process.

Can researchers optimize prompts using the same benchmark repeatedly?

They can, but the resulting benchmark performance must be interpreted carefully.

Repeated feedback from a fixed benchmark can gradually influence prompt selection, even when the researcher does not explicitly memorize individual answers.

The more extensively the benchmark guides development, the less convincing its final score becomes as an independent estimate of generalization.

Researchers may need an additional untouched evaluation dataset or an appropriately designed validation procedure.

They should document how often benchmark feedback was used and avoid describing extensively reused test data as independent.

Does prompt optimization always improve generalization?

No. A prompt can improve performance on development examples while performing worse on unfamiliar tasks.

For example, adding highly specific instructions may help the model recognize particular research designs but make it less flexible when encountering unusual methodological combinations.

Likewise, a prompt optimized for one discipline may perform poorly in another.

Researchers should evaluate whether improvements persist across relevant task categories, document types, and difficulty levels.

Generalization should be demonstrated rather than inferred from development-set improvement.

What should the optimization objective be?

The optimization objective should correspond to the intended application.

For classification, the primary outcome might be accuracy, macro-F1, or recall for a consequential category.

For research summarization, the objective may prioritize factual faithfulness and preservation of essential findings.

For methodological recommendations, researchers may need to emphasize avoidance of critical errors rather than average response quality.

The objective should be defined before comparing candidate prompts whenever feasible.

Otherwise, researchers may select whichever metric produces the most favorable result after observing the data.

Should researchers optimize for accuracy or the result they expect?

These are fundamentally different objectives.

Optimizing for accuracy means improving agreement with an independently defensible reference standard.

Optimizing for an expected result means encouraging the model to produce a conclusion preferred by the researcher.

For example, improving a prompt so that it correctly identifies statistical assumptions is different from repeatedly asking the model to reinterpret results until it declares an intervention effective.

The latter can create confirmation bias and may compromise research integrity when the generated interpretation is presented as independent analysis.

Researchers should evaluate whether their prompt modifications improve evidentiary correctness or merely increase agreement with their expectations.

How can researchers calculate the apparent benefit of optimization?

One descriptive measure is the difference between the performance of the selected prompt and the initial prompt on the same evaluation set.

Observed Prompt Improvement
Observed improvement = Selected prompt score − Baseline prompt score
Both scores must use the same defined performance metric and comparable evaluation items. The difference is expressed in percentage points when the scores are percentages.
Suppose the initial prompt achieves 76% accuracy and the selected prompt achieves 89% accuracy on development items. The observed improvement is 13 percentage points.

The 13-percentage-point difference describes improvement on the evaluated development data.

It does not establish that the same improvement will occur on an independent test set.

Researchers should distinguish development performance from held-out performance and report appropriate uncertainty when making inferential claims.

What if optimization produces excellent development results but weak test results?

This pattern may indicate overfitting, distribution differences, or instability in the evaluation procedure.

For example, a prompt might achieve 95% accuracy on development examples but only 79% on held-out examples.

The difference should prompt investigation of whether the development items adequately represented the intended task domain.

Researchers should also examine whether prompt selection was excessively tailored to unusual features of the development set.

However, the difference alone does not establish a particular causal explanation.

Model variability, sample size, and task difficulty may also contribute.

Should every prompt variant be preserved?

Researchers should preserve enough of the prompt development history to explain how the final procedure was selected.

For systematic optimization studies, retaining all tested variants and their associated evaluation results may be appropriate.

For extensive exploratory development, a structured decision log may help distinguish meaningful revisions from incidental drafting changes.

Relevant records may include prompt text, testing dates, model configurations, development items, performance scores, and reasons for selection or rejection.

Such documentation supports archiving prompt variants and allows readers to assess the extent of optimization.

Confidential data and proprietary materials may require controlled access rather than unrestricted publication.

Should failed prompts be reported?

Failed prompt variants may provide important information about the development process.

For example, a prompt that improves overall accuracy while increasing serious errors on mixed-methods studies reveals a trade-off that may be relevant to interpretation.

Researchers need not reproduce every trivial wording experiment in the main manuscript.

However, material failures, selection criteria, and the extent of testing should not be concealed when they affect the credibility of the reported performance.

The principles of reporting failed AI prompts are especially relevant when a study claims that a particular prompting strategy is effective.

Can automated prompt optimization introduce the same biases?

Yes. Automated prompt optimization systems may generate and evaluate numerous candidate prompts using performance feedback.

Although the selection process is automated, it can still overfit development data or exploit weaknesses in the evaluation metric.

Researchers should document the optimization algorithm, candidate-generation procedure, search budget, evaluation data, and stopping rules.

The final selected prompt should undergo appropriate independent testing.

Automation does not eliminate researcher responsibility for the validity of the optimization procedure.

Should different AI models receive separately optimized prompts?

This depends on the research question.

If the study compares performance under a common prompting procedure, identical or substantively equivalent prompts may be appropriate.

If the study compares the best achievable performance under a defined optimization budget, model-specific prompt optimization may be justified.

However, each model should receive a comparable opportunity for development.

Optimizing one model extensively while using an untested prompt for another may produce a misleading comparison.

Researchers should document the optimization budget and avoid presenting unequal development conditions as a neutral benchmark.

Can optimization change the construct being evaluated?

Yes. Prompt modifications may alter the task rather than merely improve its clarity.

For example, a prompt initially asking the model to identify a research design may later include detailed examples that effectively reveal the expected classification rules for the test items.

The final task may require less independent interpretation than the original task.

Researchers should examine whether revisions preserve the intended construct and whether added information changes the nature of the evaluation.

A performance improvement is difficult to interpret if the optimized prompt solves a substantially different problem.

When does prompt optimization become a research-integrity concern?

Prompt optimization becomes an integrity concern when methodological choices are used to misrepresent evidence, conceal relevant failures, or manufacture support for a preferred conclusion.

For example, selectively reporting only prompts that support a desired hypothesis may constitute a questionable research practice.

Whether a particular action meets an institution's formal definition of research misconduct depends on applicable policies, the nature of the conduct, and relevant findings about intent and evidence.

Researchers should not automatically classify every instance of poor prompt development as misconduct.

However, transparency, accurate reporting, and separation of exploratory development from confirmatory testing are important safeguards.

How should prompt optimization be disclosed in a research paper?

The methods section should explain whether prompts were prespecified, piloted, manually refined, or optimized automatically.

Researchers should identify the data used for development and selection, the criteria guiding optimization, and the procedure used for final evaluation.

Where relevant, they should report the number of candidate prompts tested and preserve material prompt variants.

The final prompt should be provided where confidentiality and licensing permit.

Researchers should also identify whether the final evaluation data influenced any subsequent revisions.

Such reporting allows readers to distinguish independently evaluated performance from results obtained through extensive adaptation to the test data.

04 · A Practical Example

When Prompt Optimization Improves Development Accuracy but Not Generalization

Hypothetical Example

Optimizing AI classification of research methodology

A researcher develops a prompt for classifying educational research abstracts as qualitative, quantitative, or mixed methods.

The dataset contains 300 abstracts, divided into 150 development items, 75 validation items, and 75 held-out test items.

The researcher evaluates several candidate prompts and selects one using the validation procedure.

Evaluation stage Initial prompt Selected prompt
Development accuracy 76% 94%
Validation accuracy 78% 88%
Held-out test accuracy 80% 82%
Step 1: Define the optimization objectiveThe researcher specifies classification accuracy and category-specific performance as the evaluation criteria.
Step 2: Develop candidate promptsPrompt variants are tested using the development set. Errors are examined to improve instructions and category definitions.
Step 3: Select the promptThe validation set is used to choose the final candidate according to the predefined selection procedure.
Step 4: Freeze the procedureAfter selection, the prompt is not revised using information from the held-out test set.
Step 5: Conduct independent testingThe selected prompt achieves 82% accuracy on the held-out set, compared with 80% for the initial prompt.
Step 6: Interpret the resultsThe researcher reports the large development improvement and the smaller held-out difference without claiming that the development gain represents generalizable performance.

The hypothetical example illustrates how a prompt can become increasingly effective on development examples without producing an equally large advantage on unfamiliar items.

The two-percentage-point held-out difference is descriptive and requires appropriate uncertainty analysis before a reliable improvement can be claimed.

The scientifically relevant result is not necessarily the highest score achieved during optimization. It is the performance of the selected procedure under an evaluation that appropriately tests generalization.

05 · What Researchers Often Get Wrong

Common Misconceptions About Prompt Optimization and Desired Results

Misconception

Prompt Optimization Is Always Research Manipulation

Systematic prompt development is legitimate when the objective, data use, and evaluation procedure are transparent and scientifically justified.

Misconception

The Best Development Score Is the Model's True Performance

Development performance may be optimistic because the prompt was selected using those observations. Independent testing is needed to assess generalization.

Misconception

Changing Only the Prompt Cannot Cause Overfitting

Repeated prompt selection can adapt the evaluation procedure to specific data even when model parameters remain unchanged.

Misconception

Researchers May Keep Testing Until Their Hypothesis Is Supported

Repeatedly selecting favorable outputs without transparent reporting can introduce confirmation bias and undermine the independence of the analysis.

Misconception

Only the Final Successful Prompt Matters

Material prompt variants and selection decisions may be necessary to interpret the reported result and assess possible selection bias.

Misconception

Automated Optimization Eliminates Researcher Bias

Automated search can still overfit evaluation data or exploit weaknesses in scoring criteria. The optimization procedure requires independent validation.

Misconception

Every AI Model Should Receive the Same Amount of Prompt Tuning

Comparable optimization opportunities are important, but the appropriate procedure depends on whether the study evaluates common prompting or model-specific optimized performance.

06 · What This Means for You

Optimizing Prompts Without Compromising Research Validity

Researchers should distinguish improving an AI procedure from selecting evidence that supports a preferred conclusion.

Prompt optimization is most defensible when its objective, search procedure, and final evaluation are established before the researcher examines the confirmatory results.

A simple decision framework

If the prompt is unclear or underspecified
Revise it using task requirements and development examples, documenting material changes.
If several prompt variants are being compared
Use predefined selection criteria and an appropriate validation procedure.
If the final test results are already known
Avoid treating subsequent prompt revisions as independently evaluated without new held-out evidence.
If optimization targets a preferred conclusion
Reconsider whether the procedure measures evidentiary correctness or merely agreement with researcher expectations.
If the selected prompt will be reported in a paper
Disclose the development process, selection criteria, relevant variants, and independent evaluation results.

Researchers should also consider whether prompt changes alter the substantive task.

Improving instructions is not the same as supplying information that effectively reveals the expected answers.

Watch Out

Do not repeatedly modify an AI prompt until the model produces a preferred research conclusion and then present that response as independent evidence. The procedure may demonstrate that the model can be steered toward the desired result, not that the result is scientifically supported.

07 · A Quick Checklist

Before Optimizing AI Prompts for a Research Study

Before finalizing prompt development, check:
Define the intended task and the performance construct being optimized.
Establish appropriate optimization objectives and scoring criteria.
Separate prompt development from independent final evaluation.
Document the candidate prompts and material revisions.
Record the development data, validation procedure, and selection rules.
Avoid using held-out test results repeatedly to guide optimization.
Check whether revisions preserve the intended task and evaluation construct.
Evaluate generalization across relevant task categories and difficulty levels.
Distinguish development gains from independently measured improvements.
Report material failed variants and selection decisions when relevant.
Disclose automated optimization procedures and their search budgets where applicable.
Avoid selecting prompts merely because they support preferred research conclusions.
08 · Frequently Asked Questions

Frequently Asked Questions About AI Prompt Optimization

Can researchers optimize AI prompts during a study?

Yes. Prompt optimization can be legitimate when the procedure is transparent, guided by appropriate objectives, and evaluated using defensible development and testing practices.

Is it acceptable to revise a prompt until AI gives the correct answer?

It may be appropriate during development using designated examples. However, repeatedly revising prompts on final evaluation items can compromise independent performance estimation.

What is the difference between prompt optimization and cherry-picking?

Optimization systematically develops a procedure according to defined criteria. Cherry-picking selectively emphasizes favorable prompts or outputs while concealing relevant alternatives or selection effects.

Can prompt optimization cause overfitting?

Yes. Repeated selection using the same evaluation data can produce prompts tailored to those observations rather than generalizable task performance.

Should researchers use a separate test dataset?

Generally, yes, when the study intends to estimate performance after prompt optimization. A held-out evaluation reduces the risk of reporting development-set performance as independent evidence.

Must every failed prompt be published?

Not necessarily in the main article. However, material variants, selection criteria, and relevant failures should be documented sufficiently to support transparent interpretation.

Is automated prompt optimization more objective than manual optimization?

Not automatically. Automated procedures can still overfit data, exploit scoring weaknesses, or favor particular outcomes. Their objectives and evaluation procedures require scrutiny.

Can researchers optimize prompts to support a hypothesis?

Researchers should not treat outputs selected to support a preferred hypothesis as independent confirmation. Prompt development should prioritize valid task performance and transparent evidence.

Should prompt optimization be disclosed in a research paper?

Yes, when it materially affects the evaluated procedure. Researchers should report the development process, selection criteria, relevant prompt variants, and final evaluation conditions.

09 · The Bottom Line

Improve the Prompt, but Do Not Engineer the Evidence

The Bottom Line

Researchers may optimize AI prompts to improve predefined task performance, but they should not repeatedly select instructions merely because those instructions produce preferred findings. Defensible optimization requires transparent development procedures, appropriate separation of evaluation data, and independent assessment of the selected prompt.

The scientific distinction is between improving a method and adapting the method to obtain a desired conclusion. A carefully optimized prompt can strengthen an AI research workflow, but its credibility depends on whether the reported performance generalizes beyond the examples that guided its development.

10 · Sources and Further Reading

Research on Prompt Optimization, Overfitting, and Evaluation Integrity

11 · Cite this Guide

How to Cite This Guide

This guide is intended to be read, shared, and used in research, teaching, and academic work. If you draw on its ideas, explanations, or other content, please acknowledge the source by citing the guide. Doing so gives appropriate credit and helps your readers locate the original resource.

Has the Field Guide helped your research?

If a guide helped clarify a question, inform a research decision, or move your work forward, I would love to hear about your experience. Your story may also help other researchers discover the Field Guide.

Share Your Experience
Takes only a few minutes