|
3 | 3 | :::{.callout-tip icon="false" collapse="false"} |
4 | 4 | ### {{< fa brain >}} Learning Objectives |
5 | 5 |
|
6 | | -After completing this topic you will be able to: |
| 6 | +After completing this topic you will be able to: |
7 | 7 |
|
8 | | -{{< fa person-digging >}} Under construction; check back later |
| 8 | +- Identify modalities for engaging with generative AI |
| 9 | +- Discuss some use-cases and drawbacks of genAI |
9 | 10 |
|
10 | | -- <u>TBD</u> |
| 11 | +::: |
| 12 | + |
| 13 | +Generative AI (hereafter "genAI") has become increasingly broadly-discussed and adopted in the sciences. As with any other flexible tool, there are a variety of opinions and use-cases. The goal of this component of this lesson is _not_ to provide comprehensive coverage for the entirety of genAI, rather **the goal here is to give you a _starting_ point for thinking about genAI and deciding whether/how you'd like to use these tools.** We are by no means experts in the design and application of AI, we are just curious and excited (and sometimes apprehensive) about the possibilities these new tools offer. |
| 14 | + |
| 15 | +### Big Picture |
| 16 | + |
| 17 | +GenAI results are _probabilistic_ rather than _deterministic._ This means that the same exact prompt is not guaranteed to return the same result. This means that genAI results are not reproducible (i.e., cannot be guaranteed to return the same output from the same inputs) so should be used with caution when reproducibility is a priority. |
| 18 | + |
| 19 | +**Whether and how to use genAI for these projects is something your team will need to decide on collaboratively.** The use-cases, modalities, and drawbacks described below--or that you've encountered in your own work--may provide helpful context for that converation but the key point is that you do discuss this as a group and reach a shared understanding and plan of action that everyone on the team is comfortable with. |
| 20 | + |
| 21 | +Finally, note that **you must have a fundamental understanding of any process you ask genAI to do for/with you.** Without that, you won't be able to properly vet the outputs and confirm that the AI tool has given you something that works and does what you want. Remember that the same truism that applies to non-AI coding also applies here: the worst case isn't that your code gets an error, it's that your code _appears_ to work but does not actually do what you intend! |
| 22 | + |
| 23 | +:::{.callout-tip} |
| 24 | +### Pseudocode Aside |
| 25 | + |
| 26 | +**Pseudocode** is a way of planning out an analysis by writing out the sequence of steps you expect to take, in plain language, perhaps as bullet points. There are more formalized versions of pseudocode, and less formalized (see "vibecoding") but a middle path of just plain English sentences to communicate our intentions is often sufficient. Some tips: |
| 27 | + |
| 28 | +- Specify whether you want to use Tidyverse or base R functions |
| 29 | + - Or another language entirely (e.g., Python)! |
| 30 | +- If you know the names of certain functions, it is helpful to use those in your pseudocode |
| 31 | + - This helps your AI code assistant incorporate those into its code completions |
| 32 | +- Use comments to signal to your AI assistant what you’d like to do at each step. |
11 | 33 |
|
12 | 34 | ::: |
13 | 35 |
|
14 | | -### What Do We Mean By "AI"? |
| 36 | +### AI Use-Cases |
| 37 | + |
| 38 | +There are a handful of particularly well-recognized use-cases for genAI tools. A non-exhaustive set of these is included below. |
| 39 | + |
| 40 | +:::{.panel-tabset} |
| 41 | +#### Note-Taking |
| 42 | + |
| 43 | +Many video conference platforms (e.g., Microsoft Teams, Zoom) now include AI components that take meeting notes and may even provide executive summaries of key points and/or action items |
15 | 44 |
|
16 | | -{{< fa person-digging >}} Under construction |
| 45 | +#### Refactoring Code |
17 | 46 |
|
18 | | -### How You Can and Cannot Use AI |
| 47 | +You may want to use AI to "refactor" code that you've already written; this means that the code will still accept the same inputs and produce the same outputs but the way it accomplishes the steps between the beginning and end is changed. This can be useful to 'clean up' code and/or increase its efficiency |
| 48 | + |
| 49 | +#### Writing Unit Tests |
| 50 | + |
| 51 | +In software development, a "unit test" is not a test on a measurement unit, _it is a test on the smallest relevent unit of a piece of code._ When developing a function or package, a unit test might check whether one argument/parameter of a function returns an error when it should (for instance, a function that calculates the average of a set of numbers should return an error if it is provided with a set of letters instead of numbers) |
| 52 | + |
| 53 | +#### Code Translations |
| 54 | + |
| 55 | +In some synthesis teams, particularly those with a wide range of disciplines represented, it can be the case that not all members "speak" the same code languages. R, Python, and MATLAB are--in our experience--the most common but other languages may also be used depending on each individual's background |
| 56 | + |
| 57 | +Using genAI to translate from one language into another can be super useful! Your group should discuss what the desired style/language of the output is and make sure that the original code and translated code are _tightly_ reviewed by someone who can speak both languages to make sure the code is actually comparable. |
| 58 | + |
| 59 | +Errors in translation can be particularly pernicious to diagnose if the original author can't vet the translation of their work themself to confirm that the code does _exactly_ the same thing in both languages |
| 60 | + |
| 61 | +::: |
| 62 | + |
| 63 | +### AI Modalities |
| 64 | + |
| 65 | +There are a few different ways with which you can engage genAI tools. Each has some strengths and weaknesses or just may feel better to your instincts so consider which is the best fit for your needs as you work. |
19 | 66 |
|
20 | 67 | :::{.panel-tabset} |
21 | | -#### What AI _Can_ Do |
| 68 | +#### Browser |
| 69 | + |
| 70 | +Perhaps the most common way of interacting with genAI tools--at least at time of writing--is to use your web browser to chat with an AI agent. This typically involves a 'conversation' between you and the AI agent as you iteratively provide prompts and receive outputs. Pseudocode is an important part of building effective prompts (and getting your own logic straight before posing a prompt). |
| 71 | + |
| 72 | +Note that if you use this modality, be sure to attempt to run any AI-generated code in your IDE of choice (copy/pasting it from the chat session into a new script or computational notebook file). Their performance is improving but this format of AI agent has been known to provide code that _looks_ right but actually either doesn't run at all or does run but doesn't provide the expected output. |
22 | 73 |
|
23 | | -{{< fa person-digging >}} Under construction |
| 74 | +#### IDE |
24 | 75 |
|
25 | | -#### What AI _Cannot_ Do |
| 76 | +You can use genAI as an assistant that is directly tied into your IDE that essentially looks over your shoulder and suggests code as you are writing it. This is typically called "pair programming"--whether the pair in question is two humans or one and an AI agent. GitHub Copilot is one such tool. It is available as a plugin for IDEs such as Positron and RStudio. Copilot is a large language model (LLM) related to ChatGPT, trained on public repositories on GitHub and other codebases, and it can generate code completions in real time based on the context of your coding task. |
26 | 77 |
|
27 | | -{{< fa person-digging >}} Under construction |
| 78 | +If you have an [GitHub Education account](https://github.com/education) (i.e., a .edu email address that is associated with your GitHub account), you should be able to get free access to Copilot Pro. Otherwise you can access a free but limited version of Copilot, which should be adequate for this session. |
| 79 | + |
| 80 | +#### Command Line |
| 81 | + |
| 82 | +With the advent of Model Context Protocols (MCP) for standardizing interactions with an underlying large-language model, command line interactions with AI agents are increasing in popularity. You can think of an MCP as a "bridge" that defines how an AI model communicates with tools and resources so that interactions are reliable and--more--reproducible. Prior to MCP use, you'd need to use a separate API for each application to directly talk to the relevant LLM, now, the MCP sits between those applications and the LLM and provides a standardizing and safeguarding influence. More specifically, an MCP: |
| 83 | + |
| 84 | +- Ensures structured communication between AI and external systems |
| 85 | +- Improves safety by controlling what the model can and cannot access |
| 86 | +- Makes it easier to integrate AI into workflows like coding, research, and publishing |
| 87 | + |
| 88 | +::: |
| 89 | + |
| 90 | +### AI Drawbacks |
| 91 | + |
| 92 | +**The purpose of this section is just to briefly touch on some drawbacks of generative AI** (at time of writing), **_not_ to provide an exhaustive review on this topic.** If you choose to engage with AI tools, consider doing your own due diligence prior to making a decision in general or for a particular project. |
| 93 | + |
| 94 | +:::{.panel-tabset} |
| 95 | +#### Environment |
| 96 | + |
| 97 | +Using AI directly and substantively contributes to climate change [@un_2024]. |
| 98 | + |
| 99 | +**AI Queries** – A ChatGPT query uses about 5 times the energy of an equivalent web search [@zewe_2025]. A 100-word email written by ChatGPT (GPT-4) uses 519 mL (17.6 oz) of water–about equivalent to a single-use water bottle [@verma_2024]. |
| 100 | + |
| 101 | +**Data Centers** – Data centers use 10-50 times the energy used by a commercial office building of the same size [@doe_2026]. The electricity used to power the data centers is still largely powered by burning fossil fuels. Data centers tend to be built in places where the cost of land is cheap, and water is often scarce in such places [@osaka_2023]. Large data centers may use 1-5 million gallons of water a day, comparable to the daily water usage of a town of 10-50,000 people [@osaka_2023]. An average Google data center in 2022, for example, used 450,000 gallons of water each day [@hozle_2022]. In 2018, United States data centers used just under 136 billion gallons of water [@siddick_2021]. |
| 102 | + |
| 103 | +#### Intellectual Property |
| 104 | + |
| 105 | +GenAI tools are/were trained on all publicly-available information (in many cases, regardless of license or copyright status) and on users' ongoing interactions with these tools. Keep in mind that the the original content used to train the models was used without consent, attribution, or compensation for the creators [@appel_2023] and include that in your decision-making process for whether/how to use these tools. |
| 106 | + |
| 107 | +If you use these tools, be sure to check the privacy settings to ensure that you are comfortable with how your interactions are used to train the model you're using. If you are dealing with sensitive or private data (e.g., medical information, Indigenous data), making sure that you're not feeding that data into a large language model can have even more important ethical ramifications. |
| 108 | + |
| 109 | +For example, **GitHub Copilot by default learns from all of your interactions in GitHub!** You can switch this behavior off (Settings {{< fa arrow-right >}} Copilot {{< fa arrow-right >}} Features {{< fa arrow-right >}} Privacy) if desired, but this is illustrative of the reality that most of these tools (particularly the free ones or at least the free tier) do need to be told _not_ to collect your inputs/outputs rather than opting in to sharing that information. |
| 110 | + |
| 111 | +#### Critical Thinking |
| 112 | + |
| 113 | +Studies on how AI use affects brain activity and critical thinking skills are beginning to be conducted and published. Using generative AI tools leads to a reduction of critical thinking skills, memory, and neural connections in the brain [@kosmyna_2025]. Frequent AI use has been found to negatively relate to critical thinking ability in adults aged 17-45 [@gerlich_2025]. The negative effect was strongest for the youngest age group of that study: 17-25 year olds [@gerlich_2025]. In work contexts, participants reported that they did less critical thinking the more that they trusted genAI outputs [@lee_2025]. |
| 114 | + |
| 115 | +#### Oversight & Bias |
| 116 | + |
| 117 | +Corporations develop and own generative AI engines but legal safeguards protecting customers–or people in general–are still in their infancy [@yakimova_2022]. In 2022, Google fought a 13-month legal battle [@rogoway_2022] to avoid disclosing that they were using 25 percent of the town’s drinking water in The Dalles, Oregon [@osaka_2023]. |
| 118 | + |
| 119 | +If the information going into a model is inaccurate, biased, fabricated, etc., the product will be inaccurate, biased, or fabricated. AI suffers from a range of biases [@nazer_2023]. GenAI used in hiring decisions is particularly problematic as it reflects the biases built into current hiring pools and industry demographics. Amazon had to scrap its AI-hiring tool after finding it penalized resumes including the word "women" [@dastin_2018]. A genAI-based speech recognition system used by HireVue to make hiring decisions was found to disadvantage deaf and non-white applicants [@stein_2025]. |
28 | 120 |
|
29 | 121 | ::: |
30 | 122 |
|
31 | | -### AI and the Environment, Intellectual Property, and Justice |
| 123 | +::::{.callout-warning icon="false"} |
| 124 | +### {{<fa rocket >}} Activity: Discuss AI Use for This Project |
| 125 | + |
| 126 | +As a project team, get together and discuss (some of) the following questions: |
| 127 | + |
| 128 | +- What policies around genAI use does your institution have? |
| 129 | + - How will those policies affect how you're even potentially able to use these tools as part of this group? |
| 130 | +- Do you use these tools yourself? |
| 131 | + - If so, where have they worked well and where have they been less useful or you've been less comfortable using them? |
| 132 | +- For the work in this group, are there contexts where you are more or less comfortable using genAI tools? |
| 133 | + - Note-taking? |
| 134 | + - Code assistance? |
| 135 | + - Scientific paper writing? |
| 136 | + - Manuscript revision? |
| 137 | +- How do you plan to document (and eventually report) your use of genAI for this project? |
| 138 | + |
| 139 | +Conversations about AI use can become heated and may be susceptible to various forms of stuck communication, **remember to intentionally apply facilitation and dialogue techniques as you seek to understand your colleagues' perspectives.** |
32 | 140 |
|
33 | | -{{< fa person-digging >}} Under construction |
| 141 | +::: |
0 commit comments