Writing Better Prompts: 14 Practices for Complex Engineering Work with LLMs
Generic chat-style prompts often yield generic answers. This article explains 14 practical techniques—role setting, deliverable definition, constraints, stepwise decomposition, structured output, and iterative review—to help large language models produce usable drafts for modeling, code review, simulation, and other engineering tasks, while keeping human experts in charge of final validation.
Why the same model works better for some people
Many people treat large language models as a one-shot Q&A tool and get equally vague answers. Training sets the upper bound of capability; prompt quality largely determines how much of that capability you actually use. For tasks such as building presentations, financial models, reviewing code, writing 3D interactive programs, or contributing to mechanical design and engineering simulation, a clear prompt can produce a near-usable draft. A vague prompt produces fluent but unusable filler.
One premise first: a generated design is not a production-ready design. Material strength, tolerances, and assembly precision still need review by qualified engineers. Models are strongest at early ideation, draft modeling, and logic checks—work that would otherwise consume specialist time. The practices below assume that split of labor.
1. Define the task: say what you want
1. Set role and professional bar. Start by assigning an identity, for example “You are a financial analyst with ten years of experience” or “You are a senior embedded engineer.” Role framing tends to pull in more precise terminology and reasoning.
2. Describe the deliverable. Do not say “build me a model.” Say “output a three-year financial model with income statement, cost sheet, and cash-flow statement in tables, with assumptions listed separately.” Concrete form reduces rework.
3. Give context and constraints. Budget, timeline, tech stack, and compliance limits belong in the first prompt. Constraints narrow the search space rather than merely restricting the model.
4. Specify the audience. A board briefing and an engineering spec differ in depth and jargon. Name the reader so the model can calibrate.
2. Decompose: turn large problems into steps
5. Require stepwise reasoning. Add “list the approach first, then execute step by step.” That reduces skipped logic, especially in modeling and algorithm work.
6. Advance one stage at a time. For 3D interaction or simulation pipelines, split “requirements → data structures → core logic → optimization” across turns. Confirm each stage before continuing; that is more controllable than generating hundreds of lines at once.
7. Let the model ask questions first. End with “if information is missing, ask clarifying questions before you start.” That avoids large outputs built on wrong assumptions.
3. Constrain the output
8. List prohibitions explicitly. Examples: “do not use deprecated APIs,” “do not add extra dependencies,” “do not invent parameters.” Negative rules often control quality better than positive descriptions alone.
9. Provide examples (few-shot). One or two input–output samples teach format and style. A simple pattern:
Input: compute the sum of two numbersOutput:function name: addparameters: a, breturn: a + bHandle the following requirement in exactly this format.
10. Fix the output structure. Ask for JSON, tables, or fixed headings so results can be parsed or reviewed. Structured output is what makes automation possible.
4. Iterate and verify: do not treat the first draft as final
11. Require self-check and listed assumptions. Add “after the answer, list assumptions and residual risks.” Those notes are exactly what humans should review.
12. Test code with counterexamples. Do not ask only “are there bugs?” Ask the model to construct boundary and failure inputs and describe behavior in each case. That is more effective than a generic review request.
13. Separate ideation from critique. Let the model generate options freely, then in a new turn have it act as a skeptical reviewer. Mixing both modes in one turn often degrades both.
14. Build reusable templates. Capture frequent jobs as templates and swap variables. Example code-review template:
Role: senior [language] engineerTask: review the following codeFocus: correctness, edge cases, performance, readabilityOutput: a three-column table of Issue / Impact / Suggested changeDo not: change existing behavior or add new dependenciesCode:<paste code here>
Match method to the job
Complex engineering (multi-step modeling, system design, long-chain reasoning) and routine execution (review, cleanup, scripts) stress different strengths: context and reasoning versus speed and accuracy. Choose models and call parameters accordingly instead of using one pattern for every request.
In production, these prompt practices can sit on general cloud primitives: store templates and outputs in object storage, chain multi-turn calls with a message queue, log prompts and results for later tuning, and use monitoring and alerts to control cost. Platforms such as Baidu AI Cloud provide general model APIs and supporting services that can turn one-off prompting into a repeatable workflow.
Takeaway
Prompt engineering is not a set of magic phrases. It is disciplined requirements communication: clear goals, decomposed steps, explicit constraints, and repeated checks. The model accelerates drafts and exploration; professional judgment and sign-off stay with people. Used this way, the model is a collaborator in the work, not just a chat box.
