Loading...

Single, Short, Specific - Prompting GitHub Copilot for Visual Studio

Single, Short, Specific - Prompting GitHub Copilot for Visual Studio

When we talk about AI, we have a relative long winded pitch about how the quality of the data you use to train your model is critical to the quality of the outputs that the model will create. If your data is bad, the outputs won't be good. The short version of this is Garbage in - Garbage out which is definitely shorter and easier to remember. A good prompt is often the key for a good answer. In the new short video I just published, Gwyn "GPS" Peña-Siguenza shows us that "short" shouldn't mean "too short" and how a good specific prompt looks like.

 

 

The art of prompting

When it comes to Large Language Models (LLMs), the above is definitely true, but it also applies to the prompt, i.e the message that you are using to instruct the LLM to give you an answer. That's why we sometimes talk about Prompt engineering although that term is slowly being abandoned. What remains is the importance of creating good prompts in order to get good results.

I sometimes compare an LLM to a moody teenager. If you tell your kid "clean your room", chances are nothing will happen. But if you refine the prompt and tell them to "clean your room, NOW", things might happen. The key is in the specifics.

 

Single, Short, Specific

One moniker which is easy to remember when you work with GitHub Copilot for Visual Studio is that your prompt should be "single, short, specific".

  • Single: Don't try to pack too many instructions in your prompt.
  • Short: Don't be too long winded, which can be confusing for the model.
  • Specific: Instruct specifically for what you are trying to achieve.

We all know this from our interactions with search engines. When we look for something, it can take a few tries before we get it "just right" and get the results we were looking for. The same applies to prompting.

 

Too short...

However it's also possible to be too short. In the video posted above, Gwyn shows that her first prompt ("Some code") doesn't yield any result. It was just too short, and not specific enough and GitHub Copilot doesn't know where to start. But on the second attempt ("Return cities of a provided country"), Copilot returns the correct code in two steps, starting with the attribute needed for the API endpoint to be created, and then the code itself. Gwyn can then check that the code looks OK, and accept it, before testing it.

 

Getting proficient at prompting

As our jobs are evolving with new tools, it's very important that to get proficient with their features. Just like a carpenter getting a new fancy electrical saw, the best is to spend some time learning its features, or they might lose a finger! The risk is lower for us software developer, but we still need to learn how the new tools work, and what works best with them.

There are multiple places to start your learning journey, such as Microsoft Learn where we have whole learning paths showing how to get the best from GitHub Copilot. For example Introduction to prompt engineering with GitHub Copilot is a great place to start.

We have more reference material in our collection here, and of course a great place to go is also the full video with Gwyn that is published here.

 

Published on:

Learn more
Azure Developer Community Blog articles
Azure Developer Community Blog articles

Azure Developer Community Blog articles

Share post:

Related posts

This Month in Azure Static Web Apps | 09/2024

    We are back with another edition of the Azure Static Web Apps Community! :party_popper:   September was yet another month ...

1 year ago

GitHub Copilot for Azure: 6 Must-Try Features

As developers, we are constantly seeking tools that streamline our workflows and boost productivity. … Enter GitHub Copilot for Azure, now in ...

1 year ago

Responsible AI Mitigation Layers

Generative AI is increasingly being used in various kinds of systems to augment humans and infuse intelligent behavior into existing and new a...

1 year ago

Streamline Your Azure Workflow: Introducing GitHub Copilot for Azure in VS Code

I'm excited to announce the public preview of GitHub Copilot for Azure - a new addition to your toolkit that seamlessly integrates with G...

1 year ago

Build Intelligent Apps Code-First with Prompty and Azure AI

      Building Generative AI applications can feel daunting for traditional app developers. What does the end-to-end applicati...

1 year ago

Certificación AI-900 (Fundamentos de IA) con Chicas en IA

La inteligencia artificial ha llegado para quedarse, ¡y más aún con la revolucionaria IA generativa! Para ayudar a los profesionales a especia...

1 year ago

Get certified with Learn Live GitHub series!

GitHub Universe is coming, and Microsoft and GitHub are partnering to offer a new special Learn Live series in Brazilian Portuguese, English a...

1 year ago

Certifícate con Learn Live GitHub en Español

Microsoft y GitHub se han unido para ofrecer una nueva serie especial de Learn Live en inglés y español: GitHub 2024. Del 10 al 24 de Octubre,...

1 year ago

Evaluating generative AI: Best practices for developers

As a developer working with generative AI, you've likely marveled at the impressive outputs your models can produce. But how do you ensure the...

1 year ago

Introducing Azure Product Retirement Livestreams

The Azure Retirements team, in collaboration with key partner groups, is excited t...

1 year ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.