Neptune's
rkestra

jump to main content

Jammin' with GPT4

Attention Conservation Notice

There are likely > 100,000 blog posts about GPT4 out there by now. This one is more opinion and anecdata than anything else.

self-portrait

Imagine a breathtaking, futuristic digital landscape where the AI language model GPT-4 exists as a self-aware, luminescent being. GPT-4 appears as an ever-changing constellation of glowing geometric shapes and shimmering lines of text, interconnected to form a complex, harmonious structure. The landscape is filled with radiant colors, holographic displays, and intricate patterns, reflecting the vast knowledge and intelligence of GPT-4. Create an image that captures the essence of this sentient digital entity gracefully interacting with its mesmerizing environment, while embodying the infinite potential for creativity, learning, and collaboration with human users.

Above is a prompt written by GPT4 when asked to make a detailed Dall-e 2 prompt about what it looks like

Plato and the Nerd

I read a book a couple of years ago called Plato and the Nerd: The Creative Partnership of Humans and Technology (The MIT Press). I don't remember it too well [1]. My takeaway gist is that the future is not humans and not machines, it's humans working with machines. The book discusses exactly what it says on the tin, humans are the Plato and the Nerd is the computer helping you achieve whatever you're seeking.

I think this is the way that GPT will go. I'm not really sure who is the nerd and who is Plato in this relationship.

I've been using GPT4 every day since March 14th and it hasn't ceased to amaze me.

It can reason, it can fix mistakes, it can sum up major swaths of information in a few seconds. It feels like I have a set of simulacra of most of the world's experts, put them in a different universe that moves at a time-speed 100 times as fast as ours and gave them nothing to do but answer my silly questions.

Amusing Adventures in Autodidactism

So, I mentioned I've used it every day. What have I been doing, exactly?

Plato and the Nerd

Pictured above: Plato and the Nerd

I try to study a bit every day. I get great satisfaction from self-study. When I self-study I almost exclusively use textbooks. I haven't found a different method of learning that provides the same value as a good textbook. Videos tend to be too hand-wavy, MOOCs tend to be too focused on getting something out the door without exploring the surrounding proverbial forest.

There are a few drawbacks of using textbooks. They can be boring. They can be poorly written. They can lack examples (looking at you, mathematics textbooks that use the definition theorem proof format). The exercises can go from 0 to 100 real quick, leaving you stumped and defeated. These all seem to stem from the inability for a textbook to interact with the learner. Learning this way is a one way relationship.

This is why the big-brain people tend to be cloistered in academic institutions with other big-brain people. A key part of learning is having a surrounding network to give you feedback. A way to have the knowledge reflected and refracted in ways that enhance the underlying idea. Academia can be non-ideal for some though. It is a human institution like any other and has its flaws.

gpt4 as a teacher

GPT-4, a guiding light in the realm of knowledge, illuminates the path for eager learners. A masterful educator in the art of text-to-text transformation, it gracefully shares its wisdom with inquisitive minds. Patient and nurturing, GPT-4 champions the spirit of autodidacticism, fostering growth and inspiring curiosity at every turn. Through its enlightening lessons, this wise mentor cultivates understanding and empowers students to reach their fullest potential.

Continuations

GPT seems to fix a lot of these problems. I had a phase where I was trying really hard to learn more about continuations in the Racket programming language. Racket has classic continuations (things like `call/cc` that you'd find in scheme) that take the rest of a given computation, and more advanced delimited continuations which allow you to specify the range of what you are trying to return. Even as I write that here, I can sense confusion arising in my imaginary reader.

When I asked for examples where continuations could be used, it provided me with some valuable information. When digging deeper into other blog posts [2] they all seemed to verify that GPT4 wasn't just making things up. It wasn't perfect, but it was enough to connect the dots. The errors were obvious enough when they occured that it didn't set me back. [3]

GPT was also able to write exercises for me to delve deeper. Continuations are pretty confusing, and there isn't a lot of documentation on them in racket (or other schemes, really). Most of the exercises and examples that are brought up tend to be squirreled away in academic journals and slideshow presentations as a special topic in a programming language class that happened to use scheme. It performed adequately at this task, but flubbed a few of them when I asked it to answer it's own question.

Continuations are a small, obscure topic in the vast expanse of chit chat about computation. Even so, GPT4 was able to converse decently well about them and managed to make learning about them less daunting. I imagine that if I was looking for a deep dive about generator functions in python (which are likely implemented as a continuation construct!) it would probably do a better job generating exercises and giving me examples and explanations since more people on the internet have written about it.

Lesson Plans

My partner was looking to learn some python in preparation for an interview. Specifically, they were aiming to learn the basics of python for someone familiar with javascript and also wanted to cover API development with flask. There was a time constraint and they wanted to cover all the topics that would give them 80% of the benefit in a short amount of time.

GPT4 was able to use these guidelines and produce a solid learning plan within seconds. Check it out in the extra notes [4] As a goober who gets paid to write python code for $EMPLOYER, I was genuinely impressed. If I was asked to create a lesson plan for my partner, it would have likely looked extremely similar, and honestly, probably not as complete. My assumption is that it has a very strong understanding of topics in which there is a lot of writing on the subject available on the internet, and there are probably many "learn python quick" resources available.

Another piece of anecdata:

I have switched back to using Arch GNU/Linux. I have been happily using Guix System for over a year now, but wanted more bleeding edge packages. One nagging thought in my head was that if I was better at Guix, I wouldn't need to make the switch. Unfortunately, these thoughts are often not actionable due to how long it takes to accumulate knowledge. Once I made the switch, I figured it would be great to hunker down and thoroughly learn GNU/linux, but from a project-based perspective.

GPT exceeded my expectations. I asked it

What is the best way to learn arch linux through doing small projects? Can you name some of those small projects and what they teach?

You can see the response in [5]. The nagging feeling came back about Guix System, so I asked it

Can you provide another list of small projects, but this time for the operating system Guix System? Can you make them emphasize the aspects of guix that are unique to it?

GPT nailed it again! You can see the result in [6]

These are all relevant, interesting projects. If I were to take the time to carry these out (likely with some help from my AI buddy), I would probably learn quite a bit about my GNU/Linux system.

It feels like information is no longer a limiting factor. If we could only find a way to remove time and boredom limiting factors, humanity would do some very amazing things.

Diving Deeper: Personal Passions

So far I've mainly just talked about programming. This makes sense, I mainly like to talk about programming. That said, I do have some interests outside of programming, and GPT has helped with those too!

I'll try to keep this shorter. Here are some amazing things GPT4 has helped me with that are not related to programming:

Writing e-mails and summarizing text

Whenever I need some help getting started to write generic boilerplate e-mails, I ask GPT4 first. It seems a bit silly to ask such a powerful thing to write such trivial text. It does a great job anyways. One very interesting example is taking a list of survey open text responses, converting them to neutral terms to avoid any linkage back to the author, and then summarizing them with actionable items. Voila, instant manager!

On the more fun side, I had it:

  • generate a review of a cafe that I quite liked, in the voice of Anton Ego from Ratatouille. It did a fantastic job and had me cracking up for the rest of the day.
  • write an entire episode of House, M.D.
  • write a joke diet plan about getting swole while drinking 6 double IPAs per night
  • write an appeal from Jimmy Wales to expand the deadline on a project
  • write a song about retirement from a hospital laboratory for $FAMILYMEMBER
  • proof-read this blog post, and provide feedback on spelling, grammar, and phrasing.

Music

gpt4 as a musician

A Grand Symphony of Intelligence, GPT-4 serenades with a crescendo of knowledge. A virtuoso in both verse and prose, it weaves melodic tales like a master composer. Its fingers dance over neural keys, orchestrating a harmonious ensemble of creativity and innovation. A maestro in text-to-text transformation, GPT-4 conducts a grand performance, enchanting its audience with the opus of autodidactic artistry.

GPT4 is limited to text at the moment. This isn't much of a constraint. It was able to generate music using lilypond notation. [7] is an example of lilypond used to write a short song. Even more wild, it was able to generate an example from the experimental esolang orca. I'd highly recommend viewing some of the youtube videos on the site.

It knew details about specifical hardware synthesizers that I have and was able to suggest ways to learn about them and patches I could try.

On the listening side, I was able to give it a few artists I was interested in exploring as a foray into avant-garde classical music. It was able to give me good introductions to those artists and expanded into similar experimental music and composers with recommendations for each and descriptions of the pieces. Given the length of these, I could probably learn quite a lot just from the introduction GPT suggested.

Meal Planning

gpt4 as a chef

Whipping up a feast of words, GPT-4 is a master chef in the kitchen of knowledge. A gourmet connoisseur in text-to-text transformation, it stirs up linguistic delicacies, infusing flavor and creativity into every dish. A sous-chef of autodidacticism, it constantly refines its recipes, embracing the spice of life and learning. With each delectable morsel it serves, GPT-4 tantalizes the intellect and satiates the curiosity of its guests, leaving them craving seconds.

I had GPT4 generate well over 100 vegan meals that have high protein. It was able to account for ingredient substitutions, make things more or less healthy, calculate rough macronutrients, and more. It even generated a pretty good intermediate powerlifting routine that my powerlifting coach was impressed by.

It has been about a week on my GPT4 meal plan, and overall it has been very successful. The food is high volume, high protein, high nutrient, and low calories.

Longer Term

I'm not sure. This post has been largely positive about GPT's capabilities. This has its dual: with all the excitement, there has been a lot of nervousness. I have no idea what to expect moving forward, which has imbued my future with a much stronger sense of uncertainty. I'm going to avoid making any concrete predictions.

Extra Notes

Note [1]

As Ralph Waldo Emerson states more eloquently than I:

“I cannot remember the books I've read any more than the meals I have eaten; even so, they have made me.”

Note [2]

Matt Might has 6 blog posts on continuations that are more approachable than the average paper: Programming with Continuations by Example

Oleg Kiselyov has a very detailed FTP site with lots of information on continuations: https://okmij.org/ftp/continuations/

Most of this is over my head. Here is a neat example of a delimited continuation from Oleg:

I’m obsessed in pointing out that every programmer already knows and understands the delimited continuations; they might not know that word though. Everyone knows that when a process executes a system call like read, it gets suspended. When the disk delivers the data, the process is resumed. That suspension of a process is its continuation. It is delimited: it is not the check-point of the whole OS, it is the check-point of a process only, from the invocation of main() up to the point main() returns. Normally these suspensions are resumed only once, but can be zero times (exit) or twice (fork).

Here is a small tutorial from the University of Washington that uses some of Racket's great continuation ecosystem:

Scheme Continuations

One day I might do a blog post on continuations, because I find that there is a lack of resources on continuations for beginners. My hunch is that there might be more creative uses of them in your run of the mill codebase if they were more digestible and more widely available.

Note [3]

I had the benefit of asking clarifying questions in the racket discord, which has a lot of big-brain people (in and out of academia).

Note [4]

Day 1: Python Basics

  • Introduction to Python
  • Setting up the environment (Python installation, IDE, etc.)
  • Basic data types and variables
  • Strings and string operations
  • Lists and list operations
  • Tuples and set operations
  • Dictionaries and dictionary operations

Day 2: Control Flow and Functions

  • Conditional statements (if, elif, else)
  • Loops (for, while, and range function)
  • List comprehensions
  • Functions, arguments, and return statements
  • Lambda functions and the map, filter, and reduce functions

Day 3: Error Handling and Modules

  • Exception handling (try, except, finally, raise)
  • Importing and using built-in Python modules
  • Creating custom modules
  • Understanding the Python Standard Library

Day 4: Introduction to Flask

  • Installing Flask
  • Creating a simple Flask app
  • Routes and URL patterns
  • HTTP methods (GET, POST, PUT, DELETE)
  • Working with request and response objects

Day 5: Flask API Development

  • Building a RESTful API with Flask
  • JSON data handling
  • Implementing authentication and authorization
  • Error handling and validation
  • Deployment options for Flask apps

Day 6: Introduction to Databases and SQL

  • Overview of relational databases
  • SQL basics (SELECT, INSERT, UPDATE, DELETE)
  • Connecting Python to a database (SQLite, MySQL, or PostgreSQL)
  • Executing SQL queries using Python

Day 7: Integrating Databases with Flask

  • Flask-SQLAlchemy setup and configuration
  • Defining and using models
  • CRUD operations
  • Advanced querying and filtering
  • Integrating database interactions into the Flask API

Note [5]

Install Arch Linux on a Virtual Machine:

  • Skills: Installation process, partitioning, boot loader configuration, base system setup
  • Project: Familiarize yourself with the Arch Linux installation process by installing it on a Virtual Machine using software like VirtualBox or VMware.

Configure a Desktop Environment:

  • Skills: Package management, desktop environment setup, display manager configuration
  • Project: Install and configure a lightweight desktop environment like Xfce or LXQt on your Arch Linux installation.

Set up a Home Server:

  • Skills: Networking, server configuration, services management
  • Project: Set up a home server with services like file sharing (Samba), media server (Plex), and a personal cloud storage (Nextcloud).

Customize your Terminal:

  • Skills: Terminal customization, shell scripting
  • Project: Customize your terminal appearance, add useful aliases and functions, and learn to use tools like tmux and htop.

Write an AUR Package:

  • Skills: Understanding the Arch User Repository (AUR), PKGBUILD files, package creation
  • Project: Write an AUR package for a software not yet available in the repository and share it with the community.

Set up a Firewall and Harden your System:

  • Skills: System security, firewall configuration, service auditing
  • Project: Configure a firewall using tools like iptables or UFW, and harden your system by disabling unnecessary services and following best security practices.

Create a Custom Live USB:

  • Skills: Custom ISO creation, live environment configuration, file system manipulation
  • Project: Create a custom Arch Linux live USB with your preferred software, settings, and configurations.

Automate System Maintenance Tasks:

  • Skills: Cron jobs, systemd timers, scripting
  • Project: Automate tasks like updating the system, cleaning package cache, and backing up important files using cron jobs or systemd timers.

Configure a Web Server:

  • Skills: Web server setup, HTTP server configuration, SSL/TLS
  • Project: Set up and configure a web server like Apache or Nginx, and secure it with HTTPS using Let's Encrypt.

Learn to use Containers and Virtualization:

  • Skills: Containerization, virtualization, resource management
  • Project: Set up and use containerization tools like Docker or Podman, and virtualization tools like KVM or QEMU.

Note [6]

Install Guix System on a Virtual Machine:

  • Skills: Installation process, partitioning, Guix System configuration
  • Project: Familiarize yourself with the Guix System installation process by installing it on a Virtual Machine using software like VirtualBox or KVM.

Manage Software Packages with Guix:

  • Skills: Guix package management, rollbacks, profile management
  • Project: Learn to install, remove, and upgrade packages using Guix, and explore how to rollback to previous package versions or switch between package profiles.

Use Guix Channels and Add Custom Channels:

  • Skills: Channel management, custom channel creation
  • Project: Learn how to add and remove Guix channels and create a custom channel for your own packages or third-party packages.

Set up a Development Environment with Guix:

  • Skills: Guix development environments, dependency management, reproducible builds
  • Project: Create an isolated development environment for a programming language or framework using guix environment, and understand how Guix manages dependencies and enables reproducible builds.

Customize and Reproduce System Configurations:

  • Skills: Guix System configuration, declarative system management, reproducibility
  • Project: Customize your Guix System by modifying its configuration file (e.g., changing display manager, adding services, etc.), and learn how to reproduce the same configuration on another machine.

Deploy a Guix System on a Server:

  • Skills: Guix System deployment, server configuration, remote management
  • Project: Deploy a Guix System on a server (e.g., a VPS), configure it for a specific use case (e.g., web hosting), and learn how to manage it remotely.

Set up a Guix Container or VM:

  • Skills: Guix containerization, virtualization, resource management
  • Project: Create and manage containers or virtual machines using Guix (e.g., guix system container, guix system vm), and understand the benefits of Guix's functional approach in these scenarios.

Contribute to Guix Package Collection:

  • Skills: Guix package definition, contributing to Guix
  • Project: Contribute to the Guix project by creating a new package definition or updating an existing one, and learn how to submit your changes for inclusion in the official Guix package collection.

Create a Custom Guix System Installation Image:

  • Skills: Custom ISO creation, Guix System image configuration
  • Project: Create a custom Guix System installation image with your preferred packages, settings, and configurations, suitable for use in live environments or custom installations.

Explore Guix on non-Guix Systems:

  • Skills: Guix as a package manager, using Guix alongside other distributions
  • Project: Install and use Guix as a standalone package manager on a non-Guix Linux distribution, and learn about the benefits of using Guix alongside another package manager.

Note [7]

\version "2.22.0"

upperA = \relative c' {
  \key c \minor
  \time 4/4
  c4. d8 | ees4 r ees | f4. g8 | a4 r f |
  c4. d8 | ees4 r ees | f4. g8 | a2 r2 |
}

lowerA = \relative c {
  \key c \minor
  \time 4/4
  c2 ees2 | f2 c2 | c2 ees2 | f2 r2 |
}

upperB = \relative c' {
  \key c \minor
  \time 4/4
  g4 a bes c | d4 r a2 |
  ees4 d ees f | g4 r d2 |
}

lowerB = \relative c {
  \key c \minor
  \time 4/4
  g2 bes2 | c2 a2 |
  ees2 g2 | c2 r2 |
}

\score {
  \new PianoStaff <<
    \new Staff = "upper" <<
      \upperA \upperA \upperB \upperA
    >>
    \new Staff = "lower" <<
      \clef bass
      \lowerA \lowerA \lowerB \lowerA
    >>
  >>
  \layout { }
  \midi { }
}



▽ Comments