LLM Model Selection and Prompt Engineering: A Practical Guide
This guide explains why newer LLM versions can appear worse than older ones and how to evaluate models objectively. It covers matching prompt complexity to model tiers, tuning reasoning effort, writing structured prompts for high-constraint tasks, and using a dual-tier routing strategy to balance cost and reliability. Readers will find a practical evaluation framework and a selection checklist for choosing the right model tier, reasoning intensity, and prompt design.
1. Why an Upgrade Can Look Like a Downgrade
After switching to a newer model version, many teams conclude that the new version is worse. This judgment usually comes from a single dimension: the output is shorter, the style is plainer, and there is less small talk or extra explanation. But if you change the evaluation dimensions to constraint satisfaction rate and token cost per task, the conclusion is often the opposite.
Take a task like “generate a structured vector graphic.” The new model may cover the main features with less than 4KB of code, while the older version produces longer code that still has structural defects. The former is not a loss of capability but a change of strategy: fewer redundant embellishments and more direct constraint fulfillment.
So evaluating a model starts with defining an evaluation function. At minimum, it should include four items: functional correctness, constraint satisfaction rate, token consumption, and recoverability after failure. A comparison without an evaluation function is essentially just a subjective preference.
2. A General Understanding of Capability Tiers
The industry usually divides models in the same series into several capability tiers: the lightweight tier emphasizes throughput and cost, the mid-tier emphasizes general balance, and the flagship tier emphasizes complex reasoning and stability on long-chain tasks. This tiering is not a marketing concept but an engineering fact directly tied to training objectives, inference budgets, and context utilization efficiency.
The key principle is “match prompt complexity to model tier”:
- Simple prompt + lightweight tier: lowest cost, suitable for classification, extraction, formatting, and template filling.
- Medium prompt + mid-tier: suitable for routine business code, script refactoring, and document summarization.
- High-constraint prompt + flagship tier: suitable for multi-constraint geometry/structure generation, cross-file refactoring, and long-chain planning.
Mismatches cause two typical kinds of waste: running simple tasks on the flagship tier raises cost with little gain; running high-constraint tasks on the lightweight tier leads to mid-task abandonment, lost constraints, and truncated output.
3. How to Adjust Reasoning Effort
Most reasoning models offer a parameter for thinking intensity or reasoning budget (naming varies by implementation; this is only a general description). The practical rules are:
- The number of task constraints sets the lower bound of intensity. With fewer than 3 constraints, low intensity is usually enough; with more than 8 coupled constraints, higher intensity is needed for consistency checks.
- Output size is positively correlated with intensity. The larger the target artifact (such as a complete vector graphic on a 1200×1200 canvas), the more intensity is needed to keep the global structure from breaking down.
- Interactive scenarios should keep intensity low. Low-latency conversations and batch extraction should prioritize controlling intensity to keep costs stable.
A schematic call skeleton (pseudocode, only expressing parameter relationships):
request = {model_tier: "flagship", # lightweight / mid-tier / flagshipreasoning_effort: "high", # positively correlated with constraint countmax_output_tokens: 8000, # must cover the target artifact sizetemperature: 0.2 # use a low value for high-constraint tasks}
4. Writing Structured Prompts
When high-constraint tasks fail, it is usually not the model’s fault but the prompt turning “requirements” into “wishes.” A reusable structure has five parts:
- Goal and acceptance criteria: define what counts as done.
- Domain knowledge checklist: make implicit common sense explicit, such as object anatomy or the rule that mechanical structures must form closed triangles.
- Coordinate and parameter planning: require internal planning of key anchor points before drawing.
- Self-check and repair: require re-checking constraints before output and fixing unmet items.
- Output contract: output only the target artifact, with no extra explanation.
Example (structured drawing task):
Generate a vector graphic on a 1200x1200 canvas.Planning requirement: determine key anchor coordinates first, then draw.Structural constraints:- The main outline, proportions, hanging pouch, S-curved neck, folded wings, and leg joint directions must be correct;- Mechanical parts must form closed triangular structures, with pipes meeting at shared nodes and no dangling endpoints;- Contact relationships must hold: the main body bears weight sitting on the seat, both legs touch the pedals at reasonable crank angles, and the wings interact with the handle;- No floating limbs, detached parts, or off-ground wheels.Self-check: verify coordinates and contact points one by one before output, and fix unmet items.Output contract: output only one complete vector graphic code block, with no extra text.
The value of this prompt is that it translates “looking right” into a mechanically verifiable checklist, making differences between model tiers measurable.
5. Cost, Stability, and Iteration Strategy
Engineering practice suggests a “dual-tier routing” approach: first use the lightweight tier for drafts and structural skeletons, then use the flagship tier for constraint validation and repair. This controls cost while preserving the success rate of high-constraint tasks.
Supporting practices include:
- Sample multiple times and pick the best, scoring automatically with a unified evaluation function;
- Feed failed samples back as prompt constraint entries to build a constraint library;
- Set up segmented generation and concatenation checks for long outputs to avoid mid-way truncation;
- Carry artifacts on the cloud with general-purpose capabilities, for example using object storage to save versioned artifacts, using logging and monitoring with alerts to track success rate and token cost, and using a container platform to run batch evaluation tasks.
If you use the relevant general-purpose capabilities of Baidu AI Cloud, you can make the evaluation pipeline a scheduled task and track success rate, average tokens, and average latency as dashboard metrics. Model tier and reasoning intensity can then shift from “gut feeling” to “data-driven.”
6. Selection Decision Checklist
- Task constraints ≤3 and short output: lightweight tier + low intensity.
- Routine code and documentation: mid-tier + medium intensity.
- Multi-constraint structure generation and long-chain refactoring: flagship tier + high intensity + low temperature.
- When a “new version is worse” conclusion appears, first complete the evaluation function and constraint checklist, then retest.
- Cost-sensitive scenarios should always use dual-tier routing rather than a globally uniform highest tier.
The core conclusion is one sentence: model tier, reasoning intensity, and prompt complexity must be aligned; any mismatch will be misread as a “capability decline.”
