AI for Software and Analysis Development
Candace Savonen, Carrie Wright and Elizabeth Humphries
https://bit.ly/AI_ITN
Schedule for today
Join at slido.com�#208 2139
ⓘ
Click Present with Slido or install our Chrome extension to display joining instructions for participants while presenting.
Have your phone
(or a separate tab) handy for interactive polls!
Join at slido.com�#208 2139
What is your favorite tv show?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
What's your email?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
What do you hope to learn from this workshop?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
What do you use AI for in your daily work currently?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
Informatics Technology for Cancer Research (ITCR)
Informatics Technology for Cancer Research (ITCR)
ITCR tools: itcr.cancer.gov/informatics-tools
What is the ITN?
ITCR Training Network
Catalyzing informatics research through training opportunities
User preparedness
Gap
Tool usability
Informatics research is hindered by a gap between different types of experts
CC-BY jhudatascience.org - Image made by Candace Savonone using https://getavataaars.com/ and https://thenounproject.com/ a
User preparedness
Gap
Tool usability
Catalyzing Informatics for Research
CC-BY jhudatascience.org - Image made by Candace Savonone using https://getavataaars.com/ and https://thenounproject.com/ a
Elements of ITN:
ITN courses
Current ITN courses: itcrtraining.org/courses
Management | Software Development | Tools and Resources | Best Practices |
Leadership for Cancer Informatics Research | Documentation & Usability | Computing for Cancer Informatics | Introduction to Reproducibility |
| AI for Software Development | Introduction to Overleaf and LaTeX for Writing Scientific Articles | Advanced Reproducibility |
| Software Development beyond Coding (coming soon!) | Choosing Genomics Tools | Ethical Data Handling |
| | | NIH Data management and Sharing Policy |
Who is the AI course for?
For individuals who:
Icons from iconpacks, iconmonstr, and openmoji
Concepts discussed in the AI for Software Development course:
Using AI to annotate code
Introduction to Large Language AI tools
Using AI to refactor code
Using AI to write code from scratch
Using AI to understand unfamiliar code
Icons from Openmoji.org, Nounproject.org and Iconpacks.net
Ethics of AI tool use for software development
The media talking about AI:
AI can enhance your work!
Skills you need for working with AI
*Skills we currently use
Which LLM should you use?
Wow, there are already so many options!
LLM | What is it really good at? | What does it struggle with? |
Bard |
|
|
ChatGPT |
|
|
Claude |
|
|
Phind |
|
|
Using AI as an editor
AI can help edit and clean up your writing
Example sentence:
Human activities, like urbanization, road building, or other activities that alter the landscape, are likely to have an effect on the bacteria in the soil.
Let’s make the sentence more concise.
Example paragraph:
Activities altering the landscape through urbanization, road building, and other means likely impact soil bacteria. One way is an increased load of heavy metal contaminants such as lead and arsenic in the soil adjacent to areas of increased human activity. When cars drive on roads, compounds from the exhaust, oil, and other fluids might settle onto the roads and be washed into the soil. When we put salt on roads, parking lots, and sidewalks, the salts themself will eventually be washed away and enter the ecosystem through both water and soil. Chemicals from factories and other businesses also leech into our environment. Previous research has demonstrated that in areas with more human activity, like cities, soils have greater concentrations of heavy metals than found in rural areas with fewer people.
Let’s rewrite this rough draft
Can you improve the paragraph?
Can you make the paragraph more concise?
Can you write this for an elementary school student?
Query:
OKAY – but not specific on what improvements are needed
BETTER - we’ve specified a goal
BEST - we’ve specified an audience or tone
Can you improve the paragraph?
Can you make the paragraph smoother?
Can you write this for an elementary school student?
AI cannot read your mind!
AI for writer’s block:
How can I expand on the ideas in this paragraph?
What helpful prompts have you used an LLM to help you with writing?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
Reproducibly using LLMs
Be mindful of reproducibility!
There is some randomness in how an LLM answers your query
Some LLMs keep logs, but also a simple markdown or google doc can work too!
We previously asked Bard about R:
Is here::here(“raw”, “data.csv”) equivalent to here::here(“raw/data.csv”) ?
AI chatbots are constantly being updated and “learning” when they are mistaken.
Answer two weeks earlier:
Query:
If you were a person, what would you look like?
Bard’s answer
Another answer from Bard
And a third:
The answers are not always the same even if given the same prompt
Using AI for code!
Can people learn how to program using LLMs?
For now, LLMs can be a supplement to traditional coding education, not as a replacement
Test and validate EVERYTHING an LLM writes
You are responsible for code you put out into the world, even if an LLM wrote it.
Good ideas for using AI for code
This code did NOT work at all, but the basic structure of it got me started
Good ideas for using AI for code
Getting a basic strategy for how to write code for something
Reviewing existing code for improvements
LLMs can be good at reviewing already existing code:
Image created by Candace Savonen using Avataars.
def my_function(x):
result = x
for i in range(10):
for j in range(5):
result = result + 2 * (i + 1) * (j + 1) * (i % 2 == 0 and j % 2 == 0) - 1
return result
Ruby the Researcher
Wait, what is this code even?
plot-data-2020-9-11.tsv
plot-data-20-10-2020.tsv
plot-data-20-10-2020-clean.tsv
plot_final.R
plot_final_FINAL.R
plot_final_old.R
plot.py
functions.R
functions-old.R
plot-final.png
plot-new.png
AI is really good for understanding unfamiliar code!
It’s like having a pair programmer explain things to you.
Good ideas for using AI for code
Getting a basic strategy for how to write code for something
Image created by Candace Savonen using Avataars.
Ruby’s code
ERROR
Ruby’s code
Now Ruby
Future Ruby
Code annotation Improves readability
Code annotation Improves maintainability
Code annotation Improves quality
There are many benefits to annotating code:
Ethics alert
Remember, you don’t know what an LLM does with the code you provide in your query.
Keep in mind:
AI as a code explainer -
Demonstration using ChatGPT 3.5
Query:
What does this function do?
def my_function(x):
result = x
for i in range(10):
for j in range(5):
result = result + 2 * (i + 1) * (j + 1) * (i % 2 == 0 and j % 2 == 0) - 1
return result
What helpful prompts have you used to use LLMs to help you with code or programming?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
A Good README
A Good README
Link to template README: https://raw.githubusercontent.com/jhudsl/Reproducibility_in_Cancer_Informatics/main/resources/README-template.md
Writing READMEs: https://jhudatascience.org/Reproducibility_in_Cancer_Informatics/documenting-analyses.html#readmes
Info that should be included in a README:
Choosing an LLM
Which LLM should you use?
Wow, there are already so many options!
AI is only as good as its training data
LLMs aren’t really “talking” to you
They are simply putting words together based on patterns learned from the training data.
AI is only as good as its training data
Biased training data
Biased LLM responses
The bias often lies with us
Bias exists, so it is our responsibility that our work doesn’t make things worse!
Being aware of Bias in AI
Let’s strive to become more aware of the biases everywhere!
(Especially the ones that we aren’t affected by but affect others) !
Calling out an LLM:
Part 1
Calling out an LLM:
Part 2
Calling out an LLM Part 3
Dr. Joy Buolamwini
AI needs to be:
Equitable
Accountable
Knowing that LLMs have these biases, what strategies can we use to make sure we don't perpetuate their biases when we use them?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
Let’s talk about data privacy
Assume that nothing you give an LLM is kept private or secure*
*unless you created the LLM
NEVER submit code that contains PHI or PII to AI tools
Activity: Make a README with an LLM
Do this! | Do NOT do this! |
Be transparent about how you use LLMs wherever you use them! Say which one you used. Keep records of your prompts! | Do not hide the fact that you’ve used an LLM for your work |
Look for LLM guidelines and requirements specific to your field or a particular submission or application! | Do not use LLMs without considering the application! (People who review what you’ve submitted can often tell!) |
Use LLMs for drafting emails or some kinds of correspondences, but make sure you read and edit what it has written | Do not use LLMs to be a journal reviewer in your stead! |
Verify the accuracy (and sources!) of LLM output | Do not use LLMs without verifying their output! |
Feel free to give a LLM code if it does not contain PHI or PII | NEVER submit code that contains PHI or PII! And don’t share anything to an LLM you wouldn’t share with someone not on the project (or IRB) |
What helpful things have you used LLMs for successfully?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
Activity options:
Steps:
LLM | What is it really good at? | What does it struggle with? |
Bard |
|
|
ChatGPT |
|
|
Claude |
|
|
Phind |
|
|
How likely are you to use what you learned in your daily work?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
How likely would you be to recommend this workshop?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
What did you like most about the workshop?
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
Please share any recommendations you have for improvements.
ⓘ
Click Present with Slido or install our Chrome extension to activate this poll while presenting.
Demographics Survey