Presented at All Things Open RTP Meetup
Presented by: Dalia Abo Sheasha, Senior Product Manager @ Microsoft
Abstract: In this session, Dalia from the GitHub Copilot in Visual Studio team will share valuable lessons learned from integrating AI-powered features into one of the world’s most widely-u...
Presented at All Things Open RTP Meetup
Presented by: Dalia Abo Sheasha, Senior Product Manager @ Microsoft
Abstract: In this session, Dalia from the GitHub Copilot in Visual Studio team will share valuable lessons learned from integrating AI-powered features into one of the world’s most widely-used development environments. Drawing from hands-on experience, Dalia will discuss the unique challenges of embedding AI into existing systems, the art and science of prompt engineering, navigating COGS limitations, and adhering to Responsible AI standards. You'll learn practical strategies for balancing speed with quality, leveraging AI to enhance user experience, and overcoming common technical hurdles. Whether you’re new to AI or working on your own AI-powered projects, this talk will provide actionable insights to help you build smarter, more powerful applications.
Size: 6.44 MB
Language: en
Added: Oct 11, 2024
Slides: 59 pages
Slide Content
10 Lessons from
Building AI-Powered
Features
Dalia Abo Sheasha
Senior Product Manager, Microsoft
Who Am I?
•Now:
•Product Manager (Microsoft Visual
Studio)
•Before:
•Software Engineering Team Lead
(Modernization tooling)
•Software Engineer (Backend
development)
•Developer Advocate (Developer tools)
The era of the
AI Copilot
“But the thing that every
developer can do that is hard for
us at a scale to do, is to really go
into specific domains and
figure out how to make this
technology work there”
6 months later…
Lessons
Learned
Lesson #1
Learn how AI works
(it’s not magic)
I'm a bit jet lagged. It was an 8 hour ____.
Source: Ahmed Tawfik | What is Generative AI?
Can you fill in the blank?
flight
trip
ride
journey
mission
…
Generative AI: Strengths
Generating
content
Having
conversations
Summarizing
content
Creating images and videos
Language translations
Personalization
Data augmentation
And more…
Generative AI: Current Weaknesses
Bias AccuracyContext
Lesson #2
Identify an unmet user need
Mission
Empower every developer
to do more
“What is your
least favorite part
of your job?”
Generative
AI
Strengths
Your User
Need
The sweet spot
Best reason to prototype?
Have something to show your users and
validate they actually want it.
Lesson #4
Be ready to pivot and iterate
Red Flags
New feature contradicts existing user understanding
“I would not read that”
“The code is supposed to explain
what you're doing, the doc should
explain why you're doing it”
If the suggestions are wrong,
the consequences are big
“Copilot doesn't like my code,
my self-esteem suffers”
“My problem with AI is that
sometimes it's breaking my code”
“It has inferred variable names
and I'm not sure how”
AI-Powered Rename
Suggestions
(DEMO)
A software developer is
using an AI rename feature
in a code editor. Your task
is to help a developer
improve their symbol…
Prompt
Response
{"resultMessage",
"outcomeMessage",
"gameResult"}
Large Language
Model (LLM)
Lesson #5
A good prompt is key
“Prompt engineering is the practice of
designing inputs for generative AI tools
that will produce optimal outputs.”
What is prompt engineering? | McKinsey
Early Attempts
Input
Your task is to help the Developer improve the name of one
variable. The variable is indicated by [CURRENT DOCUMENT CODE
SELECTED BY THE DEVELOPER] and [CURRENT DOCUMENT CODE SELECTED
BY THE DEVELOPER END].
Analyze the definition and usage of the variable in the current
document.
…
public static String Message(Choice choice1, Choice choice2)
{
[CURRENT DOCUMENT CODE SELECTED BY THE DEVELOPER]
String str = string.Empty;
[CURRENT DOCUMENT CODE SELECTED BY THE DEVELOPER END]
if (choice1 == choice2)
{
Console.ForegroundColor = ConsoleColor.Yellow;
…
Return three variable names that would be better than the
current document code selected by the developer. The variable
names should do the following in order of priority
- Describe how the variable is defined and is being used.
- Follow the current document naming conventions
- Follow the language best practices.
Output
```C#
// Better variable names for x in class Game
of file path
C:\Users\dabosheasha\source\repos\RockPaperS
cissors\RockPaperScissors\Game.cs
// Describes that this is the result of the
game played
String gameResult = string.Empty;
// Describes that this is the player’s
choice of Rock, Paper or Scissors
Choice playerSelection = Choice.Invalid;
//Describes that this is the computer’s
random choice of Rock, Paper, or Scissors
Choice computerSelection = Choice.Invalid;
```
50+ Attempts Later…
Input
A software developer is using an AI rename feature in a
code editor.
Your task is to help a developer improve their symbol
indicated by [NameThisIdentifier]. The existing symbol
name is "str".
The following is the code:
…
public static String Message(Choice choice1, Choice
choice2)
{
String [NameThisIdentifier] = string.Empty;
if (choice1 == choice2)
{
Console.ForegroundColor = ConsoleColor.Yellow;
…
Given the provided information, generate five suggestions
to rename the selected symbol. Put the suggestions in a
JSON array called `SuggestedNames` and return the json
object only as a response. Here is an example of the
RESPONSE format: { "SuggestedNames": ["firstName",
"secondName", "thirdName", "fourthName", "fifthName"] }
Output
{ "SuggestedNames":
[
"resultMessage",
"outcomeMessage",
"gameResult"
]
}
Experiment and document your
attempts
OpenAI Prompt
Engineering Guide
Lesson #6
Start with simple
prompt techniques
LLM
Zero-shot prompting
Tell me a joke
Why can't you give Elsa a
balloon?
Because she will let it go!
LLM
Few-shot prompting
Tell me a joke
Example: Why don't eggs
tell jokes? They'd crack
each other up.
Example: What do you
call cheese that isn't
yours? Nacho cheese.
Example: Why did the
coffee file a police
report? It got mugged.
What do you call fake
spaghetti? An impasta!
Relevant
Data
Retrieval Augmented Generation
Tell me a topical joke What do you call
an AI that loves to
sing? A tune-ning
machine! LLM
Fine-tuned
LLM
Fine-tuning
Tell me a joke
ةرمدحاوهجدعقيىلعةوهقدعق
ىلعياش
Translation: Once upon a
time, a guy was going to
sit on a coffee shop
(another word for coffee),
he sat instead on tea
Which technique do you use?
Start with zero-shot,
then few-shot,
then RAG,
then fine-tune
Source: Inside Microsoft AI innovations
with Mark Russinovich
Lesson #7
Suggestions Quality > UI
A suggestion accuracy and relevance
has the highest correlation with user
satisfaction (more than usability)
“Data is your superpower,
even more so in an AI world”
– Taylor Mullen
Data
•Acceptance rate ↑
•Request rate ↑
•Error rate ↓
Lesson #8
Build Responsibly
(Responsible AI)
Microsoft
Responsible AI
Principles
Building Responsibly
•Need to be transparent with the
user that an AI is in use and
results may be variable
•Encourages users to pause and verify
•Accepting a bad suggestion leads to
dissatisfaction
•Transparency about context
allowed users to use the
product better
•Give developers more controls
•Ask for permission when
appropriate
Building Responsibly
•Privacy and Security
•GitHub Copilot Trust
Center
(https://gh.io/ctc)
•More information:
•Microsoft Responsible
AI Standard
•Responsible AI
Transparency Report
Lesson #9
Be careful with COGS
(Cost of Goods Sold)
Credit: Etienne Baudoux
Remove
the button! Put it back!
Remove
the button!
Lesson #10
Enjoy the Journey
Lessons
1.Learn how AI works
2.Identify an unmet user need
3.Build.Something.
4.Be ready to pivot and iterate
5.A good prompt is key
6.Start with simple prompt techniques
7.Suggestions Quality > UI
8.Build Responsibly (Responsible AI)
9.Be careful with COGS
10.Enjoy the Journey
Resources
•AI for Beginners
•OpenAI Prompt Engineering Guide
•Microsoft Responsible AI
Standard
•GitHub Copilot with Visual Studio
•AI-Powered Rename Suggestions
in Visual Studio