LESSON 5

Hard to understand, harder to fix

Developed by Carl T. Bergstrom and Jevin D. West

Photo: Carl Bergstrom

Photo: Carl Bergstrom

LLMs are not traditional computer programs. 

Their capacities aren’t explicitly encoded in step-by-step instructions. Rather, they are a form of machine learning system that exhibits complex emergent behaviors when trained on mind-bogglingly large data sets. 

What is machine learning? Answering that question in detail would require an entire course. But think about it this way:

When you develop a traditional computer program, you plan out in advance what you want it to do. Then you write computer code to do precisely that.

A traditional program of this sort takes data as an input, operates on that data, and finally generates output.

Diagram: Data --> Program --> Output

Bergstrom and West (2020) Calling Bullshit

Bergstrom and West (2020) Calling Bullshit

Machine learning works differently. For example, suppose you want a program that can distinguish images of cats from images of dogs. You don't explicitly tell it what to look for to draw the distinction. Instead, you collect a large number of images, labeled "cat" or "dog". These are your training data. You feed that data into a learning algorithm, and that learning algorithm writes your program for you. Finally, you can put new, unlabeled images—the test data—into the program. If all goes well, it will be able to correctly identify each.

Diagram: Row 1: Trailing data & labels (with pictures and labels of dogs and cats) --> Learning algorithm --> Program (drawn as a neural net).   In row 2: Test data (unlabeled pictures of cats and dogs) --> program --> Output "dog, dog, cat". Arrow goes from program in row 1 to program in row 2.

Bergstrom and West (2020) Calling Bullshit

Bergstrom and West (2020) Calling Bullshit

This approach is very powerful, but it is often difficult to understand exactly what the resulting programs are doing or precisely how they work.

Large language models are created using a machine learning approach. Instead of predicting whether an image is a cat or a dog, they predict what words are likely to come next in a string of text. The training data are massive amounts of text scraped from the internet.

Unlike in our cats and dogs example, labels are unnecessary because the aim is just to predict the next word from the previous words. The machine simply reads up to some point, challenges itself to predict what comes next, checks to see if it was right, and iterates.

The result is a gigantic model where the computer learns how to set approximately a trillion parameters. And somehow, that gives us a machine that can...

Translate Old English into modern Italian...

ChatGPT session: Translate this Old English text into modern Italian:  Hwæt. We Gardena in geardagum, þeodcyninga, þrym gefrunon, hu ða æþelingas ellen fremedon. Oft Scyld Scefing sceaþena þreatum, monegum mægþum, meodosetla ofteah, egsode eorlas. Syððan ærest wearð feasceaft funden, he þæs frofre gebad, weox under wolcnum, weorðmyndum þah, oðþæt him æghwylc þara ymbsittendra ofer hronrade hyran scolde, gomban gyldan. þæt wæs god cyning. ChatGPT said: ChatGPT  Ecco la traduzione in italiano moderno del testo antico inglese:  Ascoltate! Noi dei Danesi nelle antiche epoche, dei re del popolo, abbiamo appreso la gloria, di come quei nobili compirono grandi imprese. Spesso Scyld Scefing, strappando le sale della birra a molte tribù e schiacciando i nemici, terrorizzava i guerrieri. Finché, trovato abbandonato, egli trovò conforto, crebbe sotto le nuvole, si innalzò nella gloria, e prosperò con onore, tanto che tutti coloro che abitavano attorno a lui, oltre il mare delle balene, dovevano obbedirgli, e pagargli tributo. Egli fu un buon re.

ChatGPT 4.o query 12/7/2024

ChatGPT 4.o query 12/7/2024

Debug FORTRAN code...

ChatGPT session: This FORTRAN code doesn't work. Can you debug it for me?  program cylindervolume   implicit none   real :: pi   real :: radius   real :: height   real :: area   real :: volume   pi = 3.1415927   print *, 'Enter cylinder base radius:'   read(*,*) radius   print *, 'Enter cylinder height:'   area = pi * radius**2   volume = area * height   print *, 'Cylinder volume is: ', volume end program cylindervolume ChatGPT said: ChatGPT  Your FORTRAN code has a bug because the variable height is used in the calculation of the cylinder volume before it is assigned a value. Specifically, you forgot to read the value of height from the user.  Here is the corrected version of your code:  program cylindervolume   implicit none   real :: pi   real :: radius   real :: height   real :: area   real :: volume    pi = 3.1415927    ! Prompt user for cylinder base radius   print *, 'Enter cylinder base radius:'   read(*,*) radius    ! Prompt user for cylinder height   print *, 'Enter cylinder height:'   read(*,*) height    ! Calculate area of the base   area = pi * radius**2    ! Calculate volume   volume = area * height    ! Print the calculated volume   print *, 'Cylinder volume is: ', volume end program cylindervolume

ChatGPT 4.o query 12/7/2024

ChatGPT 4.o query 12/7/2024

Hold a passable conversation in the Klingon language...

majQa'! tlhIngan Hol vIlo’! qatlh bIjatlh tlhIngan Hol? tlhIH chovnatlh qechmey’e’ DaneHbogh vIghojmoHlaH. DubelmoHchugh QInvam yIlaD! You said: HIja', tlhIngan Hol vIjatlh, qoH! ChatGPT said: ChatGPT  bIjatlh 'e' yImev, petaQ! tlhIngan Hol Dayaj 'e' Datu'be'chugh, vaj bIHa'DIbaH DaDa! yIjatlhqa', qaStaHvIS 'e' yIghoj neH! You said: jabbI'ID nguvmoHmeH poH vIghajbe'. HIq HoSghaj vItlhapmeH yIjaH! ChatGPT said: ChatGPT  majQa'! HIq HoSghaj DaneHchugh, vaj Daqmaj 'oH! jIHvaD yIjatlh: 'IvvaD bIH'e' 'e' DapoQ? DubelmoHchugh mIw'e' yIQIj, vaj mu'tlheghmey vIpojlaH! You said: vIpojmeH neH QubwI' jIHbe'. HIqvam jay' vIneH neH! DaH yIje'! ChatGPT said: ChatGPT  toH! batlh bIyajbe’! HIqvam DaneHchugh, vaj yIHu' jay'! poH tIq bIQangQo'! yIje' 'ej yIQuchchoH! majQa'!

ChatGPT query 12/7/2024

ChatGPT query 12/7/2024

Convert data from one format to another...

ChatGPT Session Here's a JSON array. Please convert it into CSV format.  [   { "color": "red", "value": "#f00" },   { "color": "green", "value": "#0f0" },   { "color": "blue", "value": "#00f" },   { "color": "cyan", "value": "#0ff" },   { "color": "magenta", "value": "#f0f" },   { "color": "yellow", "value": "#ff0" },   { "color": "black", "value": "#000" } ] ChatGPT said: ChatGPT  Here is the CSV format for the provided JSON array:  color,value red,#f00 green,#0f0 blue,#00f cyan,#0ff magenta,#f0f yellow,#ff0 black,#000

ChatGPT query 12/7/2024

ChatGPT query 12/7/2024

...summarize meeting notes, and much more.

ChatGPT Session: The text above is the detailed minutes from the American Society of Naturalists 2019 meeting. Please provide a concise summary of discussion around matters pertaining to the society's Journal The American Naturalist.  ChatGPT said: ChatGPT Summary of Discussions Pertaining to The American Naturalist  Editor’s Report:      New Initiatives:         “Just-accepted” articles published online upon production submission.         Option for authors to include a second abstract in another language.         Solicitation of proposals for special features showcasing diverse topics.      Submission and Acceptance Statistics (May 1, 2018 – April 30, 2019):         766 manuscripts submitted (5% increase).         169 accepted (22% acceptance rate).         Time to first decision: 44 days (unchanged).         Time to final acceptance: 190 days (+9% from previous period).      Social Media Growth:         Twitter followers: 13,760 (+18%).         Facebook followers: 5,932 (+9%).  Publisher’s Report:      Circulation and Online Engagement:         Paid circulation declined by 3.1% year-over-year.         Online access of full-text articles (HTML and PDF) increased by 19% from 2017 to 2018.     Membership and Community:         ASN membership decreased by 2.8% (-34 members).         Strong student community, low membership fees, and robust social media presence maintained.

ChatGPT query 12/7/2024

ChatGPT query 12/7/2024

With a trillion learned parameters interacting in ways that no human planned or designed, it is difficult to understand how these machines work.

It’s even more difficult to fix things when they fail.

LLMs fabricate, or “hallucinate”, prolifically—but we have little ability to explain why they do so, let alone how they settle upon the specific falsehoods they generate.

Eliminating these behaviors may be outright impossible.

Because we lack an adequate model of how LLMs do what they do, we cannot debug them the same way we debug a conventional program.

We can only play Whac-A-Mole in trying to fix their flaws with after-the-fact patches layered atop the existing architecture.

Why does that matter?

Tech leaders promise that these systems will get better over time. But it will be very hard to get LLMs to stop doing some of the things that make their use most problematic.

Photo: Carl Bergstrom

Photo: Carl Bergstrom

PRINCIPLE
Because LLMs are highly complex systems with emergent behavior, their actions are difficult to interpret and harder still to debug.

DISCUSSION
We've considered the challenge of debugging LLMs. Why else might we want to understand why they do what they do?

Photo: Carl Bergstrom

Photo: Carl Bergstrom

VIDEO

Coming Soon.