Smile news

Prompt Engineering: Techniques and Best Practices

  • Date de l’événement Sep. 29 2026
  • Temps de lecture min.

Zero-shot, few-shot, chain-of-thought: master prompt engineering techniques to get the most out of your LLMs in business. Smile complete guide.

The same question asked of an LLM can produce an unusable answer or one that can be used directly in production. The difference lies less in the model itself than in how the instruction is constructed.

Prompt engineering is the discipline that allows us to bridge this gap. It's not a mysterious art reserved for artificial intelligence researchers. It's a set of structured and reproducible techniques at the heart of generative AI, which any practitioner can learn and apply to obtain reliable results from their LLMs.

This guide provides you with the fundamental techniques, best practices in a professional context, and limitations to be aware of.

  • Performance: The use of structured prompts significantly increases accuracy and reduces errors on complex tasks (OpenAI best practices guide).
  • Skills: Training teams in AI tools has become a priority for many companies, and an obligation since the AI Act came into effect in February 2025.
  • Production: lack of internal expertise remains a frequent obstacle to the transition of LLM projects to production.

What is prompt engineering?

Prompt engineering refers to the set of techniques and methods used to design, structure, and optimize instructions submitted to an LLM to maximize the quality, relevance, and reliability of its outputs.

It is the discipline that transforms a passive user of an LLM into an operator capable of extracting systematic and reproducible value from it.

A Large Language Model (LLM ) is an artificial neural network that generates responses by predicting the most likely sequence of tokens given the provided context. The quality of this context—that is, the prompt—directly determines the quality of the response. A poorly constructed prompt produces vague, incorrect, or unusable output. A well-constructed prompt guides the model toward exactly what you need.

By 2026, prompt design has become a strategic skill for three reasons.

LLMs are ubiquitous in professional workflows. The ability to use them effectively directly differentiates organizations that derive real value from them from those that remain in the experimental stage.

These learning models are very sensitive to the wording of instructions. A slight variation in the prompt structure can produce radically different results.

Prompt engineering complements RAG and fine-tuning. Mastering this discipline allows you to get the most out of an LLM before investing in more expensive approaches.

The fundamental techniques of prompt design

Zero-shot prompting

The simplest technique: submit a direct instruction without an example. The model responds solely based on its general knowledge.

Example: "Summarize this contract in three key points."

Effective for simple and well-defined tasks. Insufficient for complex tasks or those requiring a precise format.

 

Few-shot prompting

Provide two to five examples of the expected input and output before the actual task. The model learns by analogy and reproduces the demonstrated pattern.

Example: show three examples of summaries in the desired format before submitting the document to be summarized.

This is the most effective technique for imposing a specific output format, editorial style, or response structure.

 

Chain-of-thought prompting

Explicitly ask the model to reason step by step before providing its final answer. This technique significantly improves performance on logical reasoning, mathematical, and complex analysis tasks.

Typical wording: "Think step by step before answering."

The so-called "reasoning" models, common in 2026, already reason step by step on their own. With them, this instruction is often unnecessary: it's better to precisely describe the expected result.

Particularly useful for legal, financial or technical analyses where the intermediate reasoning is as important as the conclusion.

 

Role prompting

Assign a role or persona to the model before submitting the task. The model adjusts their register, vocabulary, and perspective accordingly.

Example: "You are an expert in French contract law. Analyze this service contract."

This technique improves the relevance of responses in specialized areas and calibrates the level of expertise expected in the response.

 

Instruction prompting

Structure the prompt with explicit constraints on format, length, tone, and expected content. Specify what the template should and should not do.

Example: "Write a response in three paragraphs maximum, without technical jargon, using a professional tone and citing the sources used."

This is the basic technique for any production deployment: without explicit constraints, the model chooses a default format that may not meet your needs.

Best practices for effective business responses

1. Always specify the context, the role, and the format

An effective prompt answers three questions: who is speaking (role), in what context (situation), and in what form should the response appear (format). The more explicit these three elements are, the more relevant and directly usable the response will be.

2. Break down complex tasks

A Language Management (LMM) approach produces better results on well-defined tasks than on complex and vague requests. Break down a complex task into sequential subtasks, each with its own dedicated prompt.

3. Manage length and tokens

Each model has a limited context window (expressed in tokens). An excessively long prompt reduces the space available for the response and can degrade the model's consistency regarding information located in the middle of a long context.

Be concise in your instructions, include only the information strictly necessary, and ensure data protection by avoiding submitting personal or confidential information in your prompts.

4. Test and iterate systematically

A good prompt is rarely perfect on the first try. Build a library of tested and validated prompts for each recurring use case. Document the variants that work and those that fail. This is the foundation of an industrial approach to prompt design.

5. Managing hallucinations through prompt design

Explicitly ask the model to indicate its level of certainty and to signal when it lacks sufficient information. Phrase it as: "If you are not certain about a piece of information, state it clearly rather than stating it as fact." This instruction limits fabricated responses, but does not eliminate them.

Prompt engineering and enterprise generative AI: concrete use cases

Content generation: A well-constructed prompt specifies the editorial tone, target length, vocabulary level, and intended audience. The result: publishable content rather than drafts that need to be completely rewritten.

Document analysis: The chain-of-thought process combined with role prompting produces structured and reasoned analyses of contracts, financial reports, or regulatory documents. The quality of the analysis depends directly on the quality of the instruction.

Software development: specifying the language, version, coding style, and technical constraints in the prompt significantly reduces errors and iterations. Asking the model to explain its reasoning improves the detection of potential bugs.

Customer support: Well-structured system prompts define the agent's scope of response, tone, limitations, and escalation scenarios. This is the difference between a chatbot that misses the mark and an agent who effectively handles a large proportion of incoming requests.

Summary and reporting: Few-shot prompting is particularly effective for producing summaries in a standardized format. Showing three examples of the desired report format is usually enough to obtain output that can be directly integrated into your reporting tools.

The limits of prompt engineering and when to switch to RAG or fine-tuning

Prompt engineering is powerful, but it doesn't solve everything. Here's a quick decision guide.

 

Situation

Recommended solution

The model does not know your internal data

RAG

The answers are outdated.

RAG

The model does not understand your industry vocabulary.

Fine-tuning

The style or tone is not appropriate

Fine-tuning or few-shot

The response lacks precision regarding a defined task.

Prompt optimization

The output format is not respected.

Instruction prompting

The hallucinations persist despite a good prompt

RAG

 

What instruction optimization cannot do

It cannot inject knowledge that the model does not possess. It cannot modify the model's fundamental behavior in a specialized domain, which requires vast amounts of training data that only fine-tuning can leverage. It cannot guarantee factual accuracy without being grounded in verified sources.

When these limits are reached, RAG or fine-tuning becomes necessary. However, prompt design remains the first step to optimize before investing in these more expensive approaches.

Smile and prompt design: application in production

At Smile, prompt design isn't an additional skill. It's a discipline integrated into all our LLM implementation projects. Our teams design and maintain validated prompt libraries for each use case, document iterations, and industrialize patterns that work in production.

Our conviction: a poorly prompted LLM in a well-architected pipeline produces poor results. A well-prompted LLM, even without fine-tuning or RAG, can produce usable results for the majority of common professional use cases.

We support our clients in building this skill internally, with practical training geared towards real-world use cases and regular reviews of their prompt libraries.

Do you want to structure your approach to prompt engineering for your LLM projects? Consult our complete open source LLM guide .

Frequently asked questions about prompt design

Do you need to be a developer to design effective prompts?

No. Prompt design is accessible to anyone who regularly uses LLMs: writers, lawyers, analysts, marketing managers. The fundamental techniques (zero-shot, few-shot, role prompting) can be applied in natural language without requiring technical skills.

More advanced approaches (token management, system prompts, prompt chaining) require a more nuanced understanding of how LLMs work.

 

Are the engineering techniques for prompts universal or specific to each model?

The fundamental principles apply to all LLMs. However, each model has its own specific characteristics: some are more sensitive to role prompting, while others respond better to highly structured instructions. A prompt library must be tested and adjusted for each target model. What works perfectly on an OpenAI model may require adjustments on Mistral or DeepSeek.

 

How to measure the effectiveness of a prompt in production?

Three metrics are useful: the relevance of the outputs assessed on a set of reference questions, the rate of answers requiring human correction, and the consistency of the output format with the expected specifications.

An automated evaluation system based on a judge LLM (a second LLM that evaluates the quality of the outputs of the first) is increasingly used in production to monitor quality on a large scale.

 

What is the difference between a system prompt and a user prompt?

The system prompt is a permanent instruction that defines the general behavior of the LLM for an entire session or application. It specifies the role, tone, constraints, and boundaries of the model. The user prompt is the specific instruction submitted with each request. Combining the two allows for the creation of consistent and predictable agents, where the system prompt guarantees the framework and the user prompt specifies the task.

 

Does prompt design apply to image generation models?

Yes, and it's even a field in its own right. Models like Stable Diffusion, Midjourney, or OpenAI's image generators allow you to generate images from text instructions. The techniques vary: specifying the artistic style, composition, lighting, or level of detail allows you to precisely control the visual result.

Certain specific phenomena, such as visual hallucinations (anatomical distortions, illegible text), can be mitigated by negative prompt instructions. Other types of generative models (audio, video, code) also benefit from prompt engineering techniques tailored to their specific characteristics.