How to ask GPT to output the final results without middle steps?

I want to use gpt-4 or gpt 3.5 API to do translate and summary in one API call, and my prompt would be:

 I will give you a readme of a project readme, please do following steps but
 do not output results of middle step and only output in last step:

 Step1. Translate text to {target_lang}
 Step2. Summary the result of Step1 in {target_lang}, to show who can use this project
 in what kind of scenario, output result in text

After running, Step1 results will still be outputed, I try to change several ways but still not works, please help.

Gpt necesito un ejemplo de una premisa particular afirmativa, una premisa universal verdadera, una premisa particular afirmativa y conclusiĂłn

Quiero usar la API gpt-4 o gpt 3.5 para traducir y resumir en una llamada API, y mi mensaje serĂ­a: una premisa particular afirmativa, una premisa universal verdadera, una premisa particular afirmativa y conclusiĂłn

There is no internal memory or thinking state to the AI, the only thing it does is generate text.

If you need to do some detection of where to reproduce for the user when you add some parsing code:

Output format:
Step 1. Translate text to {target_lang}
Step 2. Print the text "[begin]" on its own line.
Step 3. Summarize the result of Step 1 in {target_lang}, to show who can use this project in what kind of scenario

The step 3 is also worded poorly, so I wouldn’t be able to figure out what you want written by the AI.

Thanks for your reply.

In short, I want to do a summary for the test given, but during my tests, I found if I said:

Summary xxx in {target_lang}

The quanlity of API returns is not good enough, and it seems like a translation.

So I tried to seperate my prompt and use two times of API call, the first call is to translate and second call is to summary my translation results. And the output is improved much more.

Based on this, I tried to put two prompts together in one prompt, but seems I can not get the same results for one combined prompt.

Your goal is to get the highest quality summary in the target language. We should consider some factors:

  • Summarizing text is one of the harder tasks for an AI, needing lots of fine-tuning.
  • Summarizing will be better in common world languages, best in English.
  • Producing a full translation uses lots of tokens already, and the AIs are trained to not produce a lot of text.

I propose this method:

  1. Summarize the article and answer the target audience (in text native language)
  2. Translate summary to target language: Mandarin Chinese

Here is an example without producing a full translation. JSON output makes it easy to separate the final product you desire:


(gpt-3.5-turbo)

(expand) text of system prompt

You are an AI summary and language translation writing assistant.

  1. Summarize the article, and answer who the target audience is (in text native language);
  2. Translate the summary you produced into to destination language: Mandarin Chinese.

Output format is json:

{
“native_summary”: “(text)”,
“chinese_summary”: “(text)”
}

Sound reasonable, let me have a try.

Sometimes json format is not valid, how do you handle this? Thanks.

I met the same question before and the issue was that the json format is not valid sometime. My solution was adding Think it step by step to the prompt.

You are an AI summary and language translation writing assistant. Think it step by step.

1. Summarize the article, and answer who the target audience is (in text native language);
2. Translate the summary you produced into to destination language: Mandarin Chinese.
1 Like