How to scale learning curves with ChatGPT
One way to think about how ChatGPT will change education
I’m in the middle of teaching myself Python, and ChatGPT has been a boon. One of the fun things that you can do with ChatGPT is look at Python scripts that it creates for you. Here’s a simple script it wrote me for calculating linear regressions:
# Import the necessary packages
import numpy as np
from sklearn.linear_model import LinearRegression
# Define the input values
x = np.array([1, 2, 3, 4, 5]).reshape((-1, 1))
y = np.array([1, 4, 9, 16, 25])
# Create the regression model
model = LinearRegression()
# Fit the model to the data
model.fit(x, y)
# Print the model coefficients
print(model.coef_)
print(model.intercept_)
# Predict the response for a new set of values
x_new = np.array([6, 7, 8, 9, 10]).reshape((-1, 1))
y_new = model.predict(x_new)
print(y_new)
Now is this accurate? I have no clue. Is it free of errors? Still have no clue. Is the code optimized? Is it secure? Again: no clue.
That’s not where ChatGPT helps you scale learning curves quickly. Those are all important questions to be answered, and no doubt someone who is expert in Python ought to be able to answer those questions. I’m not an expert in Python. But I am learning it. And the syntax is often inscrutable. What in the world does from sklearn.linear_model import LinearRegression
mean?
Well, it turns out I can ask ChatGPT what this means. It gives the following response:
LinearRegression
is a class in theLinearModel
module of thesklearn
library in Python.
from sklearn.linear_model import LinearRegression
is a statement that imports theLinearRegression
class from thelinear_model
module of thesklearn
library and makes it available for use in your program.
LinearRegression
is a machine learning model that is used for fitting a linear equation to a set of independent (input) and dependent (output) variables, with the goal of predicting the value of a dependent variable based on the values of the independent variables. This model is used for regression tasks, where the output is a continuous value.
It then helpfully provides a sample script:
from sklearn.linear_model import LinearRegression
# Create an instance of the LinearRegression class
model = LinearRegression()
# Fit the model to the training data
model.fit(X_train, y_train)
# Use the model to make predictions on the test data
predictions = model.predict(X_test)
There’s no reason a student can’t do the same thing I’m doing here. In fact, here’s Wharton professor Ethan Mollick writing about this very issue:
The goal of education is straightforward: to permanently change someone’s knowledge about the world.
In order to do that, students need to be able to transfer what is learned in the classroom to other contexts. Transfer is difficult because it requires deep understanding of a concept. Initially, when students learn about a new concept in one context, they often fail to recognize that concept when they encounter it again in a new context. For instance, in a math class (context 1), students may learn about how to compare percentages and decimals but when faced with a food label (context 2) or a medical decision (context 3) students may fail to apply that knowledge. This is the case because a) students tend to focus on the concrete aspects of any given problem or situation and b) applying knowledge to a new context requires a deep understanding of the underlying structure of a concept. To use what they previously learned students need to recognize that the former problem (from math class) is the same problem (ah, just like in math class!) in a new context.
In a very real sense, this is what I’m doing when I am interrogating ChatGPT about Python syntax that it uses in scripts it writes for me. Let me make this more concrete. I am simultaneously learning Python and ChatGPT (and generative AIs more generally). Why not combine the two tools? Learn Python by interrogating ChatGPT. At some point I will have accumulated enough knowledge that I will be able to sit in front of my laptop, fire up Replit, and pound out some code. I will be able to transfer the knowledge, to use Mollick’s term.
There’s an important caveat here: this method isn’t sufficient, and it may not even be necessary. But it’s a new option for learning a new skill. The main problem with this option is that, at least at present, ChatGPT isn’t free of errors. Indeed, it has been accused of being hallucinatory. So a student who avails himself of this method has to be aware of ChatGPT’s limits, and work around them.
ChatGPT lets me scale this learning curve more quickly. Maybe it doesn’t work for everyone. Maybe there are other tools or other methods which achieve the same effect. But for a certain type of student, ChatGPT and related tools will revolutionize education. It allows students to integrate vast quantities of knowledge much more rapidly than they could previously.