Prompt engineering is a key technique in the field of intelligence artificielle[1]. It refers to the process of crafting and structuring text in a way that enhances an AI’s understanding. This can involve various forms of text, including queries, commands, and contextual statements.
The goal is to provide the AI with clear instructions and useful context, which can improve its ability to reason and solve problems. Prompt engineering can be implemented in various ways, such as through chain-of-thought prompting, least-to-most prompting, and self-consistency decoding.
It also plays a significant role in the development of AI models, like text-to-image models, which generate visual art from text prompts. Additionally, it’s essential for addressing potential security[2] concerns, as it can help protect large language models from prompt injection attacks.
Overall, prompt engineering is a crucial aspect of AI development and application, contributing to their effectiveness, safety, and performance.
Ingénierie rapide is the process of structuring text that can be interpreted and understood by a generative AI model. A prompt is natural language text describing the task that an AI should perform.
A prompt for a text-to-text language model can be a query such as "what is Fermat's little theorem?", a command such as "write a poem about leaves falling", or a longer statement including context, instructions, and conversation history. Prompt engineering may involve phrasing a query, specifying a style, providing relevant context or assigning a role to the AI such as "Act as a native French speaker". A prompt may include a few examples for a model to learn from, such as asking the model to complete "maison → house, chat → cat, chien →" (the expected response being dog), an approach called few-shot learning.
When communicating with a text-to-image or a text-to-audio model, a typical prompt is a description of a desired output such as "a high-quality photo of an astronaut riding a horse" or "Lo-fi slow BPM electro chill with organic samples". Prompting a text-to-image model may involve adding, removing, emphasizing and re-ordering words to achieve a desired subject, style, layout, lighting, and aesthetic.