Skip to Main Content

Using Generative AI

What is Generative AI? (Video Tutorial)

Types of generative AI

Text content creation

Generative artificial intelligence are computer programs trained on a large language model.

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.

Text Examples:

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:

  1. Identify your research question or objective: Clearly define the problem or topic you want to investigate. It should be specific, relevant, and aligned with your interests and goals.
  2. Review existing literature: Conduct a thorough literature review to familiarize yourself with previous research and gain a deeper understanding of your chosen topic. Identify any knowledge gaps and determine how your research can contribute to the existing body of knowledge.
  3. Develop a research plan: Outline your research design, methodology, and data collection techniques. Determine the appropriate research approach (qualitative, quantitative, mixed methods, etc.) and the tools or instruments you will use.
  4. Collect data: Implement your data collection methods based on your research plan. This may involve surveys, interviews, experiments, observations, or analyzing existing data sources. Ensure that you adhere to ethical guidelines and obtain any necessary permissions or approvals.
  5. Analyze the data: Organize and analyze your data using appropriate statistical or qualitative analysis techniques, depending on the nature of your research. Interpret the results and look for patterns, trends, or relationships that address your research question.
  6. Draw conclusions: Based on your analysis, draw conclusions that directly address your research question or objective. Evaluate the significance and implications of your findings and consider any limitations or potential biases.
  7. Communicate your results: Prepare a research report or paper that presents your findings in a clear, logical, and concise manner. Include an introduction, methodology, results, discussion, and conclusion sections. Additionally, consider disseminating your work through presentations, conferences, or publications.
  8. Reflect and iterate: Reflect on your research process and outcomes, considering what went well and what could be improved. If necessary, make revisions or adjustments to your methods or approach for future research.

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.


Image content creation

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.

Image Examples:

A realistic photo of a blue tick coonhound dancing on a dancefloor. In the background are blurry people and brightly colored lights.
Image 1 Prompt:
"A blue tick coonhound dancing at a disco"
A paining with the head of blue tick coonhound in a green Renaissance-style shirt. The painting is in a golden, antique-looking frame.
Image 2 Prompt:
"A renaissance style painting of a blue tick coonhound "
A realistic head of a blue tick coonhound on a drawing of a dog dressed as an astronaut. Drawings of stars and spaceships are in the background.
Image 3 Prompt:
"A blue tick coonhound, as an astronaut"

- Images generated in Stable Diffusion - Summer 2023.


Sound content creation

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.

Sound Examples:


Coding creation

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:

  • create code from scratch
  • predict the code you are creating
  • review code you have created and find errors

Some examples of generative AI that can create code include: ChatGPT, CodeT5, and Tabnine.

Code Examples:

  • ChatGPT Python code

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

 

  • ChatGPT Accordion code

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


Video creation

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.

Video Examples:

Original Video by Video by Pressmaster on Pexels
- Video generated by Gen-1 Runway on Jul7 17, 2023. Prompt: "In style of Vincent Van Gogh"

Key considerations

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.


Images by GraphiqaStock on Freepik (other than AI generated images)

 

Large Language Models - LLMs (Video Tutorial)

Watch this video first, to think about how to use LLMs ethically and carefully.