
In July of this year, I read Lilian Weng’s article on Harness Engineering. She discussed iterative improvements around the model’s operating environment [1]. Cue words are part of this environment (Harness), and I started to try a more specific question: Can higher-level models help us improve the complex cue words used by lower-level models?
The terms "high-level" and "low-level" are relative: the high-level model is responsible for analysis and proposing modification suggestions, while the low-level model is the target model for the actual execution of the prompts.
The scenario I encountered involved brand discovery: identifying mentioned brands from web pages or search materials, determining which brands compete with or substitute for the target brand's related businesses, and finally outputting candidate brands. Even if customers, channels, partners, and tools appear in the materials, they may not necessarily meet the criteria. The prompts consist of system prompts, user prompts, and few-shot examples.
The challenge in optimization lies in determining whether the problem stems from the rules, task descriptions, examples, or model selection; it also involves deciding on the direction of exploration and prioritizing reducing false negatives over false positives. In the initial rounds, I simply allowed the advanced model to freely propose solutions based on the prompts, but the results were inconsistent: sometimes new solutions were worse than old ones, so I would switch directions and try again. Such exploration consumed resources and time, but it didn't necessarily explain where the problem lay.
We need a comprehensive methodology and process to help advanced models find optimization directions and decide whether to adopt them based on evaluation results. This includes the following aspects:
Fixed target model and execution environment
The same prompts can perform completely differently on different models and under different inference modes. A good performance on GPT does not guarantee effectiveness on the Mini. Optimization must be tailored to the specific target model and mode being used.
I initially tried Doubao, DeepSeek Flash, DeepSeek Pro, and GPT, but none of these models met the task requirements. This led me to shift my optimization focus to the prompts; however, this alone doesn't prove that the model's capabilities were unaffected. Once the target model was determined, subsequent evaluations needed to fix the model and inference mode, and results from different execution environments couldn't be directly compared.
This task involves single-round prompt word determination. The execution end only requires one LLM call, and can run automatically with fixed hyperparameters and batch scripts. I used Codex sol to provide modification suggestions, while the execution scripts were placed in an isolated environment. Each round retains the prompt word version, call parameters, input, output, and score to avoid miscalculating changes in the model or running mode as improvements brought by the prompts.
Break down the cue words into distinguishable parts
Complex prompts, if not layered, can easily become structurally confusing and make it difficult to determine where to begin modifications. I break them down into system prompts, user prompts, and few-shot examples. To maintain generalization, I prioritize optimizing user prompts; system prompts mainly define identity and core task objectives and do not require frequent changes; few-shot examples are used to present ambiguous boundaries that are difficult to explain with rules, adding distinguishing positive and negative cases.
Once the responsibilities of each part are clearly defined, it becomes easier to check for duplication, ambiguity, or conflict between them. The target model also follows instructions at different levels. It may judge that the condition is met under one rule, but make the opposite judgment under another rule, ultimately swinging back and forth between different cases.
Fixed evaluation data and indicators
Evaluation data should include real-world failure cases, cover key boundaries, and be prioritized as P0, P1, P2, etc. Metrics should be selected based on task risk: if missed detections have a greater impact, prioritize recall; if false positives are more costly, prioritize precision; when both are equally important, then consider the F1 score. Each candidate version should be compared using the same batch of data and the same set of criteria before deciding whether to retain it.
Incorporate the execution trajectory of the target model into the diagnosis
I meticulously record the inference content ( especially the thought process ), i.e., the trajectories, returned by the target model for each call, along with the corresponding prompt word version, input, output, and evaluation labels. The advanced model can then compare these specific trajectories to identify which rule, example, or relation judgment went wrong. This allows for adjustments to be made based on actual failures, rather than relying solely on the advanced model's guesses based on the prompt word text.
The reasoning returned by the model provides diagnostic clues but cannot prove the model's internal decision-making process on its own. During analysis, the trajectory must be cross-checked against the original input, final output, and evaluation labels.
Results of the brand discovery task
This approach was used to iterate on brand discovery keywords. After less than ten rounds of optimization, the final keyword precision was 92.31%, recall was 88.89%, and F1 score was 90.57%.
What problems is this method applicable to?
Applicable conditions:
- The solution generation model differs from the actual execution model, and optimization is required for the execution model.
- The task uses complex prompts and is executed as a single-round LLM call.
- Evaluations can use explicit labels and fixed metrics.
- Time or tokens are limited, so it's necessary to control the cost of trial and error.
- The design space can be limited to a few verifiable directions, eliminating the need for large-scale searches.
Limitations of this experiment:
- The final prompt word version was only called 5 times, so there is limited evidence of its stability.
- The accuracy of the judge process was not evaluated.
- The ability to generalize to unseen data was not verified, nor was cross-model compatibility verified.
refer to
[1] Lilian Weng, "Harness Engineering for Self-Improvement", Lil'Log, July 4, 2026. Original text