10 Lessons From Building AI Powered Features

AllThingsOpen 468 views 59 slides Oct 11, 2024
Slide 1
Slide 1 of 59
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59

About This Presentation

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...


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

Caution:
Analysis Paralysis

Lesson #3
Build.Something.

Hackathon (June 1-2, 2023)

Great Learning
Opportunity!
•Environment Setup
•Prompt Engineering
•APIs/Libraries
•AI Models
Strengths/Weaknesses
•Limitations (token limits,
COGS)
•Troubleshooting

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

Thank you!
Dalia Abo Sheasha

Q&A