Combining Techniques

Combining Techniques

TAKEAWAYS

  • Understand how to combine prompting techniques

As we have seen in the previous lessons, prompts can have varying formats and complexity. They can include context, instructions, and multiple input-output examples. However, thus far, we have only examined separate classes of prompts. Combining these different prompting techniques can lead to more powerful prompts.

Combining Role and Instruction Prompting

Role and instruction prompting can also be combined to create more complex prompts. For example, you could instruct the AI to assume the role of a historian and then provide instructions for a specific task.

Copy

Prompt


You are a historian specializing in the American Civil War. Write a brief summary of the key events and outcomes of the war.        

The AI's response:

Copy

AI Output


The American Civil War, fought from 1861 to 1865, was a pivotal event in the history of the United States. It began primarily as a conflict over the preservation of the Union and the legality of slavery, particularly in the newly admitted western states.

Key events of the war include the Battle of Fort Sumter, which marked the beginning of the conflict; the Battle of Antietam, the bloodiest single-day battle in American history; and the Emancipation Proclamation in 1862, in which President Abraham Lincoln declared that all slaves in Confederate-held territory were to be set free.

The Battle of Gettysburg in 1863 is often considered the war's turning point. The Union's victory there, along with their successful Siege of Vicksburg, gave the North a decisive advantage. The war effectively ended with General Robert E. Lee's surrender at Appomattox Court House in 1865.

The war resulted in approximately 620,000 soldier deaths and an undetermined number of civilian casualties. It ended slavery in the United States, restored the Union, and greatly expanded the powers of the federal government.        

In this example, the AI assumes the role of a historian and follows the instructions to write a brief summary of the American Civil War. The combination of role and instruction prompting results in a detailed and accurate response.

Combining Context, Instruction, and Few Shot Prompting

This is an example of a prompt that combines context, instruction, and few-shot prompting. The context is provided by the explanation about Twitter and the task of classifying tweets. The instruction is given in the sentence "Make sure to classify the last tweet correctly." The few-shot prompting is demonstrated by the two examples of positive and negative tweets. The AI is then expected to use this combination of context, instruction, and examples to correctly classify the final tweet.

Copy

Prompt


Twitter is a social media platform where users can post short messages called "tweets". Tweets can be positive or negative, and we would like to be able to classify tweets as positive or negative. Here are some examples of positive and negative tweets. Make sure to classify the last tweet correctly.

Q: Tweet: "What a beautiful day!"
Is this tweet positive or negative?

A: positive

Q: Tweet: "I hate this class"
Is this tweet positive or negative?

A: negative

Q: Tweet: "I love pockets on jeans"

A:        

Conclusion

Combining different prompting strategies can lead to more powerful and effective prompts. Almost all prompts you write will combine multiple strategies. As you continue to experiment with and refine your prompts, consider how different techniques can be combined to achieve your desired results.

要查看或添加评论,请登录

Aris Ihwan的更多文章

  • Tips Membuat Test Case yang Baik

    Tips Membuat Test Case yang Baik

    Tips Membuat Test Case yang Baik Pahami Tujuan Pengujian. Sebelum mulai membuat Test Case, pahami dengan jelas tujuan…

  • Langkah-Langkah Membuat Test Case

    Langkah-Langkah Membuat Test Case

    Langkah-Langkah Membuat Test Case Proses pembuatan Test Case sangat penting dalam Quality Assurance untuk memastikan…

  • Perbedaan Test Case dan Test Scenario

    Perbedaan Test Case dan Test Scenario

    Terdapat beberapa perbedaan antara test case dan test scenario berdasarkan beberapa karakteristik berikut ini: Lingkup…

  • QA - Test Case, Test Suite, Test Suite, Test Scenario

    QA - Test Case, Test Suite, Test Suite, Test Scenario

    Dalam proses Quality Assurance, terdapat beberapa konsep kunci yang sangat berperan dalam menguji dan memastikan…

  • Test Scenario

    Test Scenario

    Test Scenario Test Scenario merupakan bagian penting dalam Quality Assurance yang bertujuan untuk merencanakan dan…

  • Level Testing dalam Quality Assurance

    Level Testing dalam Quality Assurance

    Level Testing dalam Quality Assurance Level Testing adalah pendekatan yang digunakan dalam Quality Assurance untuk…

  • Type of Testing

    Type of Testing

    Type of Testing Testing dalam Quality Assurance terdiri dari dua jenis, yaitu Static Testing dan Dynamic Testing dengan…

  • Testing Life Cycle

    Testing Life Cycle

    Testing Life Cycle Testing Life Cycle merupakan proses yang terstruktur dan terorganisasi untuk melakukan pengujian…

  • Testing Process

    Testing Process

    Testing Process Dalam Testing Process, terdapat dua elemen penting yang harus dipahami dengan baik oleh tim QA, yaitu…

  • Basic Principle

    Basic Principle

    Quality Assurance merupakan bagian penting dalam siklus pengembangan software yang bertujuan untuk memastikan bahwa…

社区洞察

其他会员也浏览了