Steer Your Conversations with ChatGPT: Custom Instructions Are Here
Tags: chatgpt, openai, llm, webdev
Published: 2023-07-20 20:44:55

Photo by <a href="https://unsplash.com/@freshvanroot?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Rolf van Root</a> on <a href="https://unsplash.com/photos/oLthDWAG244?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

[OpenAI](https://openai.com/) is rolling out a fresh, innovative feature to its Plus users that will allow us to get to the crux of our conversations. Say hello to custom instructions, an addition set to redefine the way you interact with the beloved (and besmirched) AI, ChatGPT.

##The Custom Instructions Revolution
As a user, you're familiar with the journey we've embarked upon, aiming to enhance the steerability of our models. Our mission has been to ensure that ChatGPT aligns with the diverse contexts and unique needs of users worldwide. The custom instructions feature is a critical step towards this objective.

So, what does this feature bring to the table?

Custom instructions allow you to instill your preferences or requirements into ChatGPT. This means, instead of starting each conversation from scratch, ChatGPT carries forward your custom instructions, applying them to every response, thus reducing the redundancy in your interactions.

For instance, if you're a teacher formulating a lesson plan, there's no need to reiterate that you teach 3rd-grade science. Similarly, developers who desire efficient code in a non-Python language can communicate this preference once, and it will be considered throughout the interaction. The feature comes in handy for large family grocery shopping as well, with ChatGPT adjusting the list for six servings.

##Setting it Up
The custom instructions are a beta feature so to use it in your chat you need to have a ChatGPT plus subscription. You're then able to go to your settings and switch it on.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wb3a7tdznbzxhffk6er6.jpg)

##Seeing the Difference: Custom Instructions On and Off
To better illustrate the difference, consider the following scenario of requesting ChatGPT to write code for finding the nth number in the Fibonacci sequence:

**Custom Instructions Off**
When asked to "Write code for getting the nth number in the Fibonacci sequence" with custom instructions off, ChatGPT produces:

`Sure, here is a simple Python function to compute the nth number in the Fibonacci sequence using a recursive method:`

```
def fibonacci_recursive(n):
    if n ≤ 0:
        print("Input should be a positive integer")
        return None
    elif n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)

# Test
print(fibonacci_recursive(10))
```

`This recursive solution, however, is not very efficient (it has an exponential time complexity due to repeated calculations), especially for larger values of n.

Here's a more efficient version using dynamic programming (this has linear time complexity):`

```
def fibonacci_dp(n):
    if n ≤ 0:
        print("Input should be a positive integer")
        return None
    elif n == 1:
        return 0
    elif n == 2:
        return 1

    fib = [0, 1]
    while len(fib) < n:
        fib.append(fib[-1] + fib[-2])

    return fib[-1]

# Test
print(fibonacci_dp(10))
```
`In these functions, n=1 corresponds to the first number in the Fibonacci sequence (which is 0), n=2 corresponds to the second number (which is 1), and so on.
`

Long and verbose, but the ChatGPT that we've come to know and love. Well now there's a way to get to the point!!

##Custom Instructions On
Here is an example of the same prompt from the [OpenAI](https://openai.com/blog/custom-instructions-for-chatgpt) release on this. First you setup your custom instructions which will be weighted for the remainder of the conversation. This saves all that pesky "please just give me the code" type prompting.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1zv45ijujejlsrsztzw.jpg)

With the same prompt ("Write me code for getting the nth number in the Fibonacci sequence") you pretty much just get what you're after:

```
package main

import "fmt"

func Fibonacci(n int) int {
    if n ≤ 1 {
        return n
    }
    a, b := 0, 1
    for i := 2; i ≤ n; i++ {
        a, b = b, a+b
    }
    return b
}

func main() {
    fmt.Println(Fibonacci(10)) // replace 10 with the nth number
}
```

##Wrapping Up
In a nutshell, with the dawn of custom instructions, ChatGPT isn't just another AI—it's your AI. It remembers, it learns, it adapts, and most importantly, it understands you better with each interaction. This innovation brings us a step closer to a world where technology isn't just smart—it's personalized. So gear up, set your instructions, and let ChatGPT surprise you with its nuanced understanding of your needs. Because at OpenAI, we believe the future of AI isn't just in creating intelligent systems—it's in crafting experiences that are uniquely yours. Stay tuned for more exciting updates on our journey to redefine the way you interact with AI. The AI revolution is here, and it’s more personal than ever!

Reference: This example and post is adapted straight from the [OpenAI release on this feature](https://openai.com/blog/custom-instructions-for-chatgpt).

If you'd like to know more about AI and making it work for your business checkout my startup Erudii. I'm always looking for people to collaborate with!