Ducksss / HacknRoll2023-Robin-Hood

Chrome Web Extension that uses a custom GPTZero Model to automatically detect and rephrase any GPT-generated text on Notion via a single click!
MIT License
12 stars 3 forks source link

Add more functionalities for GPT #14

Closed kiritowu closed 1 year ago

kiritowu commented 1 year ago

Find ways to make use of prompt engineer to enhance the usage of Chat-GPT

To-Dos:

kiritowu commented 1 year ago

Summarised from this blog post on best practice for prompt engineering

  1. Use latest model
  2. Input context like this:

    Summarize the text below as a bullet point list of the most important points.
    
    Text: """
    {text input here}
    """ 
  3. Be specific, descriptive and as detailed as possible about the desired context, outcome, length, format, style, etc
    Write a short inspiring poem about OpenAI, focusing on the recent DALL-E product launch (DALL-E is a text to image ML model) in the style of a {famous poet}
  4. Start with zero-shot, then few-shot (example), neither of them worked, then fine-tune

    • ✅ Zero-shot
      Extract keywords from the below 
      Text: {text}
      Keywords:
    • ✅ Few-shot - provide a couple of examples
      
      Extract keywords from the corresponding texts below.

    Text 1: Stripe provides APIs that web developers can use to integrate payment processing into their websites and mobile applications. Keywords 1: Stripe, payment processing, APIs, web developers, websites, mobile applications

    Text 2: OpenAI has trained cutting-edge language models that are very good at understanding and generating text. Our API provides access to these models and can be used to solve virtually any task that involves processing language. Keywords 2: OpenAI, language models, text processing, API.

    Text 3: {text} Keywords 3:

  5. Reduce “fluffy” and imprecise descriptions
    Use a 3 to 5 sentence paragraph to describe this product.
  6. Select parameters wisely
    • model - Higher performance models are more expensive and have higher latency.
    • temperature - A measure of how often the model outputs a less likely token. The higher the temperature, the more random (and usually creative) the output. This, however, is not the same as “truthfulness”. For most factual use cases such as data extraction, and truthful Q&A, the temperature of 0 is best.
    • max_tokens (maximum length) - Does not control the length of the output, but a hard cutoff limit for token generation. Ideally you won’t hit this limit often, as your model will stop either when it thinks it’s finished, or when it hits a stop sequence you defined.
    • stop (stop sequences) - A set of characters (tokens) that, when generated, will cause the text generation to stop.
kiritowu commented 1 year ago

Well-known use-case for GPT along with its prompts (if available)