Updated on 2025-07-02 GMT+08:00

What Is Prompt Engineering?

Introduction

Prompt engineering is the relatively new discipline of developing and optimizing prompts to efficiently use language models (LMs) for a wide variety of applications and in a wide variety of research fields. Prompt engineering skills help us better understand the capabilities and limitations of large language models (LLMs).

Prompt engineering is not just about designing and developing prompts. It encompasses a wide range of skills and techniques that are useful for interacting and developing with LLMs. It is an important skill for understanding the capabilities of and working effectively with LLMs. You can use prompt engineering to improve safety of LLMs and develop new capabilities, enabling you to augment LLMs with domain knowledge and external tools.

Elements of a Prompt

You can achieve a lot with simple prompts, but the quality of the results depends on how much information you provide it and how well-crafted the prompt is. A prompt can contain information like the instructions or question you are passing to the model and can include other details such as additional context, inputs, or examples. You can use these elements to instruct the model more effectively to improve the quality of results. A prompt contains any of the following elements:

  • Instruction: a specific task or instruction you want the model to perform, for example, to summarize, extract, or generate something
  • Context: external information or additional context that can steer the model to better responses
  • Input data: the input or question that you are interested in finding a response for
  • Output indicator: the type or format of the output

You do not need all four elements for a prompt, and the format depends on the task at hand.

Process for Using Prompt Engineering

The large model development platform ModelArts Studio helps you write, compare, evaluate, save, and manage prompts.

Table 1 Function descriptions

Function

Description

Prompt engineering project management

The prompt engineering platform manages prompt engineering projects. Each project is tailored to a particular scenario or optimization requirement. You can optimize, compare, and evaluate prompts in a prompt engineering project.

You can create, query, modify, and delete prompt engineering projects.

Prompt writing

You can edit prompts, define prompt variables, view the outcomes generated from prompts, and track the optimization history.

Candidate prompt management

You can manage candidate prompts that have been optimized. You can save a maximum of nine candidate prompts per prompt engineering project. These prompts can be compared and evaluated later.

Prompt comparison

You can select two candidate prompts to compare their content and parameters. You can set the same variable values for them to compare their outcomes.

Prompt evaluation

You can manage prompt evaluation tasks, for example, creating, querying, modifying, and deleting tasks. You can create an evaluation task, select candidate prompts and variable sets, select the evaluation method, and evaluate the results generated from those prompts.

Prompt management

You can save satisfactory prompts as candidates and query or delete prompts.

Figure 1 Process for using prompt engineering