Generative artificial intelligence are computer programs trained on a large language model (or LLM).
The training process involves consuming large amounts of text from books, articles, and websites, then analyzing the text to find patterns and relationships in human language. Once it is trained, it can create new text based on an understanding of human language.
Text based content creation can produce essays, blogs, scripts, news articles, reflective statements and even poetry.
Some examples of generative AI that can create text content include: ChatGPT and Perplexity AI.
Prompt: Write a poem in iambic pentameter about the University of California, Merced
"Harmony of Wisdom: Ode to UC Merced"
In Merced's embrace, where sunlit valleys sprawl,
A campus rises, proud and standing tall.
The University of California's gem,
In knowledge's pursuit, it does transcend.
Beneath the golden rays of Californian sky,
Where learning's flame burns bright, unyielding, high.
In fields of study diverse, like nature's bloom,
Merced's scholars find their intellectual room.
With lakes reflecting wisdom's endless quest,
The UC Merced campus is truly blessed.
Surrounded by the beauty of the land,
It fosters growth with an encouraging hand.
In classrooms filled with eager minds aglow,
In labs where curiosity does grow,
A vibrant tapestry of dreams takes flight,
As students reach for knowledge, pure and bright.
Through orchards whispering tales of the past,
Where innovation's spirit is held fast.
The Bobcat roams with pride and noble grace,
A symbol of the courage to embrace.
Within these walls, diversity takes hold,
A melting pot of stories to be told.
United by a common thirst for truth,
In Merced, echoes of eternal youth.
Oh, University of California, true,
In Merced's heart, we find our dreams anew.
A beacon shining, guiding minds to soar,
Forevermore, in knowledge, we explore.
Prompt: What steps do I take to work through a research project?
Working through a research project involves several key steps. Here's a general outline of the process:
Remember, these steps are meant to provide a general framework, and the specific requirements may vary depending on the discipline, research field, or project complexity. It's also essential to consult with your academic advisor or research team to get tailored guidance based on your specific project.
This type of AI learns through analyzing datasets of images with captions or text descriptions. Therefore, if it knows what two different concepts are, such as a cat and roller skates, it can merge those concepts together when prompted to create an image of a cat wearing roller skates.
Generative AI image tools can produce diverse images in a range of mediums, everything from photorealistic oil painting style to anime.
Some examples of generative AI that can create imagery include: Dall.E 2, Midjourney, and Stable Diffusion.
- Images generated in Stable Diffusion - Summer 2023.
AI music generators analyze music tracks and metadata (artist name, albums name, genre, year song was released, associated playlists) to identify patterns and features in particular music genres. They have also been trained on lyrics associated with songs. Keep in mind, if it has only been exposed to one type of music such as Mozart, then the music it generates will sound somewhat similar to his works.
Some examples of generative AI that can create audio content include: AIVA, Soundful, and Murf.ai.
Learning to code is similar to learning a language. Commonly generative AI is exposed to large datasets of open access code in a variety of program languages (e.g. Python, Java, etc.). Through this exposure it can find common patterns, practices and structures within program languages. This leads to generative AI been used to write and improve code in a variety of ways, such as:
Some examples of generative AI that can create code include: ChatGPT, CodeT5, and Tabnine.
- Code generated in ChatGPT on July 14, 2023. Prompt: "Write a simple Python script that prompts the user for their name and then greets them"
Prompt: Write a simple Python script that prompts the user for their name and then greets them
ChatGPT: Certainly! Here's a simple Python script that prompts the user for their name and greets them:
name = input("What is your name? ")
print("Hello, " + name + "! Nice to meet you.")
ChatGPT: When you run this script, it will display the prompt "What is your name?" in the console. The user can then enter their name, and the script will respond with a greeting like "Hello, John! Nice to meet you."
You can save this script in a file with a .py extension (e.g., greeting.py) and run it using a Python interpreter or integrated development environment (IDE).
- Code generated in ChatGPT on July 14, 2023. Prompt: "Write a simple HTML code that opens and closes an accordion box one at a time"
Note: The code used for the Show Text-Only options comes from the code generated in this example!
Prompt: Write a simple HTML code that opens and closes an accordion box one at a time
ChatGPT: Sure! Here's a simple HTML code that creates an accordion box with the ability to open and close one section at a time:
<!DOCTYPE html>
<html>
<head>
<style>
.accordion {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
text-align: left;
border: none;
outline: none;
transition: 0.4s;
}
.active, .accordion:hover {
background-color: #ccc;
}
.panel {
padding: 0 18px;
display: none;
background-color: white;
overflow: hidden;
}
</style>
</head>
<body>
<h2>Accordion Example</h2>
<button class="accordion">Section 1</button>
<div class="panel">
<p>Content for Section 1...</p>
</div>
<button class="accordion">Section 2</button>
<div class="panel">
<p>Content for Section 2...</p>
</div>
<button class="accordion">Section 3</button>
<div class="panel">
<p>Content for Section 3...</p>
</div>
<script>
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none";
} else {
panel.style.display = "block";
}
});
}
</script>
</body>
</html>
ChatGPT: When you open this HTML file in a web browser, you will see three sections labeled "Section 1", "Section 2", and "Section 3". By clicking on each section, you can open and close it individually while the others remain closed. The content inside each section is hidden by default and will be displayed when the corresponding section is opened.
This code utilizes HTML, CSS, and JavaScript to create the accordion functionality. The JavaScript code adds event listeners to the accordion buttons and toggles the display of the associated panel when clicked.
Creating a video typically requires the use of audio, visual and text elements. There are a variety of generative AI video programs, some have harvested existing videos to learn how to create new ones, others have sourced the three elements to creating video from audio, visual and text sources. There are even generative AI video programs that have been trained on how to use video editing software, so they are able to apply effects to a video that you have created, such as adding captions, transitions, animations, etc.
Some examples of generative AI that can create videos include: Gen-1 Runway and Invideo.
Generative AI can be used in many ways, such as creating realistic images, generating music, or even writing stories. Keep in mind that it's limited by the amount, quality and context of the data it's trained on.
Watch this video first, to think about how to use LLMs ethically and carefully.
Copyright @ The Regents of the University of California. All rights reserved.