Sunday, January 29, 2023

ChatGPT. First perspective (Developer view included)

 

Gone are the days of relying on Google and Wikipedia to search information. Say hello to ChatGPT, an AI chatbot that is revolutionising the industry, the newest craze in technology.

 

What is ChatGPT?

ChatGPT is an AI-powered chatbot making waves in the technology world. It is a state-of-the-art language generation model that has been trained on a diverse range of internet text. It can execute a wide range of activities, including answering questions, composing imaginative stories, producing jokes, and much more, with a particular focus on producing text that sounds human.

 

What are key capabilities of ChatGPT?

ü  Conversational AI: ChatGPT is designed to respond to user queries in a conversational manner.

ü  Text generation: It can generate a wide range of text-based content such as summaries, headlines, and stories.

ü  Knowledge base: ChatGPT has a vast knowledge base, allowing it to answer a wide range of questions on various topics.

It's also worth mentioning that ChatGPT is highly customizable and can be fine-tuned to specific use cases, making it a versatile tool for businesses and developers.

 

How does ChatGPT works?

Powered by large amounts of data and advanced computing techniques, ChatGPT can string words together in a meaningful way, making it a language machine with vast vocabulary and encyclopedic knowledge.

At its core, ChatGPT is a language machine that uses statistics, reinforcement learning, and supervised learning to index words, phrases, and sentences. It may not have real "intelligence", but it can answer questions, write articles, summarize information, and more effectively. The more we use ChatGPT, the better it gets at refining answers and avoiding certain types of conversations.

 

How to Use ChatGPT? What's in for me?

With its ability to respond in a human-like manner and constantly learn from user interactions, ChatGPT is a valuable resource for businesses and developers alike.

Developed by OpenAI, ChatGPT is based on GPT-3.5, a language model that was unveiled as a prototype on November 30, 2022. Even though OpenAI has just made ChatGPT available for review and beta testing, developers will be able to integrate the chatbot into their own programmes when API access becomes available, which is anticipated to happen sometime this year.  With the ability to refine answers as more questions are asked, ChatGPT is constantly learning and storing information for others to use. 

The chatbot is currently available for free testing on OpenAI's official website, but users must first create an account. Programmers have begun to use it for writing code snippets, code reviews and fine tuning their code.

Developers

Use it to help you find mistakes in your code. If you have a segment of code that you’re having trouble debugging, you can put that into ChatGPT with information about what you’re expecting versus what’s actually happening. The model may be able to assist you with finding the issue.

Use it to help find edge cases in your code. The model has a lot of computational power so it may be able to generate edge cases for which your code will fail that you might not be able to identify as quickly.

Use it for product ideas. Asking it product related questions can get you a quick list of possible use cases for your software based on other products and ideas it’s been trained on. This usually won’t yield out of the box ideas but it will help you find gaps in your product in comparison to others.

Use it for writing test cases. ChatGPT is competent at writing unit tests and it’s low risk to get test cases from the model, as they will simply fail if they are wrong and will be clearly incorrectly formulated if it’s not testing what it’s supposed to. Also, as unit tests are generally straight forward, the probability that the model will get it right is high, given you enter the format: test component X with the inputs a, b and c and expect the output to be Y.

Use it to get architectural and infrastructure options. When evaluating different strategies for a task you know will require infrastructure changes, it might be useful to ask ChatGPT input. It can give you ideas but don’t fully rely on its answer, it should be no more than a source of inspiration if you’re not sure which way to go.

 

How does it differ from similar programmes like Alexa, Siri, Google Assistant, and others?

The level of performance in GPT-3.5 (latest version), despite the fact that this concept is not new (we've had chatbots for a decade, including Siri, Alexa, Olivia, and more), is astonishing. It responded rather well when I questioned it about things like "what are the best practises for recruiting" or "how do you construct a corporate training programme." Although the answers were somewhat inaccurate and fairly simple, they will undoubtedly improve with usage.

 

Where can I test out ChatGPT?

https://chat.openai.com/chat

 

What are the limitations Of ChatGPT?

The model may produce correct sounding but incorrect answers. That’s because the model itself has no true inherent understanding of code, but rather know what correct code “looks like”. Keep in mind, this is a model trained on data, not an actual software engineer.

Rephrasing can result in quite different results. Being extremely precise in the input prompt is required for the highest probability of the “correct answer”.

Which brings me to another limitation, the “correct answer” might not exist. The answers from ChatGPT is validated by humans without a central source of truth, different people will rank different answers to be the “correct answer”.

You will likely not get the answer you’re looking for from the first question, and you need to continue to converse with the model with improvements and rephrasing to eventually get the answer you’re looking for.

The data it’s been trained on is limited to 2021 data. So usually, the model will be lagging behind the most up to date industry standards, and I produce deprecated code.

 

How NOT To Use ChatGPT?

Now that we understand what ChatGPT is and isn’t, let’s discuss how to absolutely not use it:

Do NOT use it to learn how to code. The code that is generated is not guaranteed to be right. It may be functional, but even if it is functional it might not be the best way to to code. For example: I’ve noticed when I asked it to write React components it uses a general props item and does not explicitly define each property as is industry standard. Also, it does not automatically abstract similar code into functions so the code is usually overly-verbose.

Do NOT use it to generate code that requires a lot of context. If you’re hoping to have the model do your job, I have some bad news for you. It’s impossible to provide the model the context of an entire codebase or product, so if you don’t already have a strong idea of how to approach the task then ChatGPT will realistically not be very helpful.

Do NOT use it for school or university assignments. Aside from the fact that the answer may not be correct, and also that probably other students will use it for the same purpose leading in plagiarism detection, you will not learn. Solving assignments is what made me grow most during my formal education of software engineering. Not the lecture, the assignments are what taught me the most, so if you cheat using ChatGPT you’re simply cheating yourself out of a better career.

 

Further reading:

ChatGPT Blog = https://openai.com/blog/chatgpt/

 

I hope this helps! Let me know if there's anything else you'd like to know.