LLM Text Generation in R: Practical Prompt Engineering: A Short Course

An 8-Hour Livestream Seminar Taught by Hudson Golino, Ph.D.

Have you ever wondered how to generate new items automatically for your research project (survey, questionnaire) AI? Are you interested in having more control over the output of ChatGPT responses? Do you want to verify the impact of different prompt engineering techniques on the quality of the items you create with the GPT-based models? If so, this course is for you.

This intensive two-day workshop is designed to provide you with a comprehensive introduction to text generation via OpenAI models (GPT-3.5-TURBO/GPT-4, GPT-4o), with a specific focus on how to use them in the R programming environment via the OpenAI’s API.

Whether you are a beginner or an experienced data scientist, this course will equip you with the skills and knowledge needed to harness the full potential of the GPT models for text generation, including advanced prompt engineering techniques and API control methods.

Starting July 10, we are offering this seminar as an 8-hour synchronous*, livestream workshop held via the free video-conferencing software Zoom. Each day will consist of two lecture sessions which include hands-on exercises, separated by a 30-minute break. You are encouraged to join the lecture live, but will have the opportunity to view the recorded session later in the day if you are unable to attend at the scheduled time.

*We understand that finding time to participate in livestream courses can be difficult. If you prefer, you may take all or part of the course asynchronously. The video recordings will be made available within 24 hours of each session and will be accessible for four weeks after the seminar, meaning that you will get all of the class content and discussions even if you cannot participate synchronously. 

Closed captioning is available for all live and recorded sessions. Captions can be translated to a variety of languages including Spanish, Korean, and Italian. For more information, click here.

Computing

This is a hands-on course with instructor-led software demonstrations and guided exercises. These guided exercises are designed for the R language, so you should use a computer with a recent version of R (version 4.1.3 or later) and RStudio (version 2022.02.1+461 or later). The names of the packages needed for the course, and how to install them, will be provided during the course.

To follow along with the course exercises, you should have good familiarity with the use of R, including opening and executing data files and programs, as well as performing very basic data manipulation and analyses.

If you’d like to take this course but are concerned that you don’t know enough R, there are excellent on-line resources for learning the basics. Here are our recommendations.

Who Should Register?

Anyone interested in Prompt Engineering and Text Generation with OpenAI Models, and with a good knowledge of R.

Outline

Day 1: Exploring the fundamentals of OpenAI models

Introduction to ChatGPT, GPT-3.5-TURBO, GPT-4, GPT-4o

  • Understanding the concept of language models
  • Differentiating between the models
  • Exploring real-world applications

Setting up R environment for OpenAI models

  • Installing necessary libraries and packages
  • Authenticating with the OpenAI API
  • Obtaining API keys

Basic text generation

  • Creating your first GPT-3.5-TURBO/GPT-4 request in R
  • Generating text for simple prompts in R
  • Handling responses and formatting output in R
  • Hands-on activities

Day 2: Advanced applications and prompt engineering with ChatGPT/GPT-3.5-TURBO

Generating texts for tasks examples

  • Generating text data for topic modeling as an exercise in R
  • Text generation via OpenAI models for topic modeling
  • Hands-on activities

Prompt engineering techniques 

  • Few-shot prompting
  • Parameter tuning
  • Multi-step prompts
  • Hands-on activities

Seminar Information

Thursday, July 10 –
Friday, July 11, 2025

Daily Schedule: All sessions are held live via Zoom. All times are ET (New York time).

10:30am-12:30pm (convert to your local time)
1:00pm-3:00pm

Payment Information

The fee of $695 includes all course materials.

PayPal and all major credit cards are accepted.

Our Tax ID number is 26-4576270.