Jammin' with GPT4

Pair sessions where dflowdt\tfrac{d\,\text{flow}}{dt} tracks E[tokensprompt]\mathbb{E}[\text{tokens} \mid \text{prompt}].

4/26/2023

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.

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?

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.

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

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

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

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

    [back]
  2. Note [3]

    The Racket Discord was invaluable for clarifying questions; thanks to the big-brain folks hanging out there.

    [back]
  3. Note [4]

    Seven-day Python & Flask curriculum GPT-4 produced:

    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, range)
    • List comprehensions
    • Functions, arguments, return values
    • Lambda functions plus map, filter, reduce

    Day 3: Error Handling and Modules

    • Exception handling (try, except, finally, raise)
    • Importing and using built-in Python modules
    • Creating custom modules
    • Exploring 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
    • Handling JSON data
    • Authentication and authorization
    • Error handling and validation
    • Deployment options for Flask apps

    Day 6: Introduction to Databases and SQL

    • Relational database overview
    • SQL basics (SELECT, INSERT, UPDATE, DELETE)
    • Connecting Python to databases (SQLite, MySQL, PostgreSQL)
    • Executing SQL queries from 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
    [back]
  4. Note [5]

    Project-based Arch Linux study guide from GPT-4:

    Install Arch Linux on a Virtual Machine

    • Skills: Installation, partitioning, boot loader configuration, base system setup.
    • Project: Install Arch Linux in a VM (VirtualBox, VMware) to learn the full installer flow.

    Configure a Desktop Environment

    • Skills: Package management, desktop environment setup, display manager configuration.
    • Project: Install and configure a lightweight desktop such as Xfce or LXQt.

    Set up a Home Server

    • Skills: Networking, server configuration, service management.
    • Project: Host services like Samba, Plex, or Nextcloud on your Arch box.

    Customize your Terminal

    • Skills: Terminal customization, shell scripting.
    • Project: Theme the terminal, add aliases/functions, learn tools like tmux and htop.

    Write an AUR Package

    • Skills: AUR workflow, PKGBUILD authoring, package creation.
    • Project: Package software missing from the repos and publish it to the AUR.

    Set up a Firewall and Harden the System

    • Skills: System security, firewall configuration, service auditing.
    • Project: Configure iptables or UFW, disable unnecessary services, follow hardening best practices.

    Create a Custom Live USB

    • Skills: Custom ISO creation, live environment configuration, filesystem manipulation.
    • Project: Build a personalized Arch live USB with your preferred packages and settings.

    Automate System Maintenance Tasks

    • Skills: Cron, systemd timers, scripting.
    • Project: Automate updates, cache cleanup, and backups via scheduled jobs.

    Configure a Web Server

    • Skills: Web server setup, HTTP configuration, SSL/TLS.
    • Project: Deploy Apache or Nginx and secure it with Let’s Encrypt.

    Learn Containers and Virtualization

    • Skills: Containerization, virtualization, resource management.
    • Project: Try Docker or Podman alongside KVM or QEMU to compare approaches.
    [back]
  5. Note [6]

    Guix System project list tailored by GPT-4:

    Install Guix System on a Virtual Machine

    • Skills: Installation, partitioning, base configuration.
    • Project: Practice the Guix installer inside a VM (VirtualBox, KVM, etc.).

    Manage Software Packages with Guix

    • Skills: Package management, rollbacks, multiple profiles.
    • Project: Install, remove, and upgrade packages while experimenting with rollbacks and profiles.

    Use Guix Channels (and Add Your Own)

    • Skills: Channel management, custom channel creation.
    • Project: Add/remove channels and publish a small custom channel.

    Set up a Development Environment with Guix

    • Skills: guix environment, dependency management, reproducible builds.
    • Project: Build an isolated environment for a language/framework and explore reproducibility.

    Customize and Reproduce System Configurations

    • Skills: Declarative system management, service configuration.
    • Project: Tweak the Guix system configuration file and reproduce it on another machine.

    Deploy Guix System on a Server

    • Skills: Remote management, server configuration.
    • Project: Install Guix on a VPS and configure it for a concrete use case such as web hosting.

    Set up a Guix Container or VM

    • Skills: Guix containerization, virtualization.
    • Project: Experiment with guix system container and guix system vm workflows.

    Contribute to the Guix Package Collection

    • Skills: Package definitions, contribution workflow.
    • Project: Add or update a package and submit it upstream.

    Create a Custom Guix System Installation Image

    • Skills: Custom ISO/image generation.
    • Project: Build an installation image with curated packages and settings.

    Explore Guix on non-Guix Systems

    • Skills: Standalone Guix package manager usage.
    • Project: Install Guix alongside another distro and compare package management experiences.
    [back]
  6. Note [7]

    Example lilypond composition GPT-4 produced during our chat:

    \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 { }
    }
    [back]