Using ChatGPT to bootstrap a new skill
I don’t know if there are many people with an internet connection who haven’t heard of ChatGPT at this point. It’s taken the world by storm, breaking any record one could think of in terms of spread. I don’t think there’s a lot on the subject I can say that hasn’t already been said, and I can’t remember the last time I was this excited to watch a new technology develop.
Instead, I’d like to use this first blog post of mine to write about how I’ve been using ChatGPT myself. It seems only fair, as it helped me bootstrap this website!
Why use ChatGPT?
A lot has been said about whether ChatGPT really “knows” the responses it returns. The two “steel man” sides of the argument go something a bit like this.
On the one hand, there is an apparent mapping of meaning that the LLM performs during its training process in order to successfully achieve its training goals. This mapping of meaning seems to be a form of knowledge abstraction that cannot be meaningfully differentiated from the abstraction that takes place when organic beings learn, and is effectively analogous to the acquisition of knowledge. This knowledge is utilised every time ChatGPT parses a question and returns an answer. This is why ChatGPT can understand different phrasing, choice of words, register, and languages when parsing queries. It’s an excellent translator. Noam Chomsky’s examples of things ChatGPT cannot understand (in his recently published piece on the topic) are all easily proven wrong (by just actually trying it).
On the other hand, ChatGPT does get things wrong. Maybe no more or less than any human being suffering from a particularly bad case of the Dunning-Krueger effect, but most would agree that there is quite an uncanny valley feeling generated by ChatGPT’s complete inability to exercise judgment. It will believe in earnest anything you tell it. And accordingly, ChatGPT’s answers will be something analogous to an average of the training data it deems relevant (in a loss function optimisation sense) to the question. While this does seem to work quite well in averaging out a lot of error, it will also ust return total nonsense if a user ventures into a topic that it has seen little prior data on.
The debate is philosophically really interesting, particularly when steering clear of value judgments or debates on sentience. But regardless of what’s going on, it doesn’t really influence my use of the tool much. The only thing that really matters is: is it useful? And the answer is emphatically yes.
My experience is that at the moment, ChatGPT is useful in three ways:
- As a search engine and “sounding board” to help process learning content during the learning process
- As a coding assistant to quickly generate boilerplate, especially when using languages or libraries with which
- As a note-generator to quickly return well curated summaries on a given topic one is partially but not wholly familiar
Together, these three uses make ChatGPT particularly great as a tool to quickly bootstrap new skills. I will give some examples for how I’ve started using ChatGPT in each of these three ways, before describing how I used these things together to quickly make this website in one evening.
Using ChatGPT as a sounding board
I’ve recently been studying statistics and machine learning, something I’ll probably write about extensively in the future, and I’ve been reading a lot of textbooks to understand the theory, while relying on various online video courses to learn the practical side of things.
One thing I’ve unfortunately discovered is that my maths just isn’t as good or as quick as it was in university. This isn’t in itself unexpected - it’s not like I need to integrate by parts on any daily basis - but it does mean that I haven’t been able to rely on what I think of as “mathematical bruteforcing” in order to understand some of the contents I’m studying. To some extent this is a good thing. I think there are quite a few concepts from quantum physics and quantum computing that I never really understood in university, because I could just rely on my confidence with linear algebra and calculus to solve problems and finish exams.
Consequently, I’ve been relying a lot more on intuition when studying statistics and machine learning than I once might have done. But as anyone who has independently studied anything has discovered, there will inevitably be things that just don’t immediately click, and not even multiple text books help.
Personally, I really like worked examples to understand a concept. Sure, the theory and abstracted proofs are important, but it’s only in seeing the application and effect of a concept that I really begin to understand it, and often textbooks are light on such examples, or present them at an already quite abstract level that may be suitable for the intended audience, but is harder to follow by someone studying independently and with no one to ask.
A great solution to this is videos of tutorials and lectures uploaded to or for youtube. Another great solution is using ChatGPT. ChatGPT can provide simple worked examples of mathematical problems, and one can tell it what they did and didn’t understand in order to prompt it to elaborate. I have used ChatGPT to understand the history and motivation of various statistical distributions (Something that is often excluded from statistics textbooks and I’m still baffled as to why. Surely the reason why a mathematical concept was invented is of interest?); the relationship between the “i.i.d” assumption and the central limit theorem; the difference between using Gini impurity and entropy when fitting decision tree classifiers; and the use of the Bayes Information Criterion, Akaike Information Criterion and Vapnik-Chervonenkis dimension in classification model evaluation.
ChatGPT isn’t perfect. One does have to take care and engage with the material critically. ChatGPT can get things wrong. But in terms of getting a perfectly curated attempt at an explanation quickly, it’s unrivalled, and can save a great deal of time.
Generating boilerplate code
This is probably one of the most widespread and well-noted uses of ChatGPT, and it’s been widely acknowledged by the developers and companies working on this technology as a particularly exciting use case.
Personally, I hadn’t really been a “coder” before. I did some programming in university, but not a lot. And my study of machine learning required me to begin learning Python, which has become something of a go-to programming language for all things data science (it seems largely due to its adoption by scientist and because of the large number of convenient libraries that have been written for it, rather than any inherent suitability of the language itself).
Because this is a fairly new area of exploration for me, I often find that, much like when learning a language, I can understand a lot more code than I can write. Or rather, to write the generic code that I can understand with ease still requires a lot of effort, as I am constantly forgetting syntaxes, naming conventions, the order of operations etc. Particularly with libraries like scikit learn. I often know what I want to do, but it takes me a lot of sifting through documentation to remind myself exactly how to do it.
Using ChatGPT to quickly write the boilerplate is a game changer for me. Sure, it gets things wrong. Of course, I need to make sure it works. Yes, I need to adapt everything it writes to the problem at hand. No, I can’t get it to generate code I don’t understand. But having a straw-man to work with often speeds up my work flows 2x.
Perhaps if/when I have more experience and a larger library of prior work, it will no longer be so useful. But for now, it’s a tool as essential to my work as VS code or jupyter notebooks.
Speeding up search and collating notes
I’m not really a note-taker. I just naturally started copy and pasting the explanations of difficult concepts and code snippets that I had been generating so that I could revisit them in the future. It often need to think through a concept or use a tool three or four times before it starts to stick in my memory. So having those previously generated responses to hand was useful.
Before I knew it, I had a library of notes and materials perfectly curated to the particularities of my learning requirements at basically zero effort. It has massively sped up my acquisition of new skills, and I am constantly revisiting these for inspiration when working on a problem that is relevant to these studies.
Which finally brings me onto why I wanted to write this blog post. For me, this use of ChatGPT to quickly go “from zero to one” in new areas of study or in acquisition of new skills has been if not life changing, then at least unbelievably convenient. I was able to get this website up and running in half a day by engaging with ChatGPT in the three ways outlined here. Here’s how I did it.
Bringing it all together: bootstrapping new skills
Where I’d got to with my website
I’d wanted to have a personal website for a long time, and put it off for many years. I didn’t have any formal education in programming until I reached university, where my experience was limited to a couple of courses using Java and Mathematica for programming in a scientific context.
These were great an interesting courses, but not really any help in developing a website. And while I had a basic understanding of the HTML/CSS/JavaScript building blocks of a website, there is a dizzying array of options for how to actually build something, with probably thousands of JavaScript paradigms available, each one solving nuanced problems and use cases of which I had no experience. That’s all before you even get to server-side.
So how do you get started? Well I just built something from scratch. Built some basic HTML structures, picked some OK-looking styles, and decided I don’t really need JavaScript. The final bit was getting a blog up and running, and that’s where I hit a wall.
I quickly realised a static website of the type I had built would become quite painful if I wanted to regularly deploy blog posts to it. I discovered that what I needed was a content management system. Some search engine queries lead me to Wordpress (honestly? I still don’t really get it) and then Django (the tutorial alone being so complicated I couldn’t believe there wasn’t a better option). I felt pretty stuck and worked on some other things for a week weeks.
Revisting the problem - with ChatGPT
It was the demo of GPT-4 that made me revisit the subject. The bit where the demonstrator uploads his drawing of a website and ChatGPT dutifully converts it into a fully functioning site. My jaw dropped. I didn’t have access to GPT-4, but I had used ChatGPT to generate some boiler plate, and to help me understand some topics in machine learning. May be it could help me solve my CMS problem?
So I asked it.
Hi, I have a Github Pages website that is currently static - it is just a few html pages and some basic CSS rules. I want to add a blog to this website, and I want to use a CMS to manage this blog. But I want to keep the site on Github Pages, I don’t want to redeploy it anywhere else. What options do I have?
There are several options you can consider to add a CMS-powered blog to your existing static website hosted on Github Pages. Here are three popular options:
- Jekyll: Jekyll is a static site generator that is natively supported by Github Pages. It allows you to create a blog by writing posts in Markdown format and generating static HTML pages from them. You can then publish these pages to your Github Pages site. Jekyll also has a built-in templating system, which allows you to customize the look and feel of your blog.
- Hugo: Hugo is another popular static site generator that can be used to create a blog. Like Jekyll, Hugo generates static HTML pages from content written in Markdown format. It also has a built-in templating system, which allows you to customize your blog’s appearance.
- Forestry.io: Forestry.io is a CMS that integrates with static site generators like Jekyll and Hugo. With Forestry.io, you can create and manage content for your blog using a simple and intuitive web interface. Once you’ve created your content, Forestry.io generates static HTML pages that can be published to your Github Pages site. Forestry.io also provides a number of useful features, such as version control for your content and an easy-to-use media library.
Regardless of which option you choose, you should be able to add a CMS-powered blog to your existing Github Pages site without having to move it to a different hosting provider.
I decided, as an experiment, to just go with everything it said. Jekyll was number 1, and natively supported by Github Pages? Sounds great. But what’s the deal with it being static? I thought CMS were meant to be dynamic?
Can you tell me more about Jekyll? Is it a program I run on my computer, and use to push pages into the static site? So each update has to be a separate static page? What if I wanted one of those websites with “infinite scroll” through blog posts?
Yes, Jekyll is a static site generator that you can run on your computer to create static HTML pages that can be deployed to your Github Pages site. You write your content in Markdown format, and Jekyll will convert it to HTML pages that can be served to visitors of your website.
When you make updates to your content, you will need to regenerate your static site using Jekyll and then push the updated HTML pages to your Github Pages repository. So yes, each update will create a new static page. However, Jekyll does provide features for creating index pages that can automatically display a list of your blog posts, so you can achieve an “infinite scroll” effect.
For example, you can create a blog index page that lists all your blog posts in reverse chronological order, with the most recent post at the top. Each blog post would be a separate static HTML page, but visitors to your blog would be able to navigate through the posts by clicking on links to the previous or next post, or by scrolling down the page to see older posts.
Jekyll also provides templates that you can use to control the layout and styling of your blog. You can use these templates to create a consistent look and feel for your blog, and to add features like tags, categories, and author bios.
Overall, Jekyll is a flexible and powerful tool for creating a static blog, and it is a great choice if you want to keep your site on Github Pages and have full control over the HTML and CSS of your site.
OK. I’m convinced! So how do I get started?
Interesting. Is there a steep learning curve to Jekyll? How do I get started on windows?
The learning curve for Jekyll depends on your level of experience with web development and Markdown. If you are already familiar with HTML, CSS, and Markdown, you should be able to pick up Jekyll fairly quickly.
Getting started with Jekyll on Windows is fairly straightforward. Here are the steps you can follow:
- Install Ruby: Jekyll is built with Ruby, so you’ll need to install Ruby on your Windows machine first. You can download the RubyInstaller for Windows from the official Ruby website: https://rubyinstaller.org/downloads/. Choose the version that matches your operating system and processor architecture (32-bit or 64-bit).
Install Jekyll: Once you’ve installed Ruby, you can install Jekyll by opening a command prompt and running the following command:
gem install jekyll bundler
This will install Jekyll and the Bundler gem, which is used to manage Jekyll’s dependencies.
Create a new Jekyll site: Once Jekyll is installed, you can create a new Jekyll site by running the following command:
jekyll new myblog
This will create a new Jekyll site in a directory named “myblog”. You can replace “myblog” with the name of your own site.
Start the Jekyll server: Once your site is created, you can start the Jekyll server by running the following command:
cd myblog bundle exec jekyll serve
This will start the Jekyll server and make your site available at http://localhost:4000. You can view your site in your web browser by visiting that URL.
From here, you can start customizing your Jekyll site by editing the files in the “_posts”, “_layouts”, and “_includes” directories. You can also add new pages and blog posts by creating new Markdown files in the “_posts” directory.
There are many resources available online to help you learn more about Jekyll and how to use it effectively. The official Jekyll website (https://jekyllrb.com/) is a great place to start, as it provides comprehensive documentation and a variety of tutorials and examples.
Obviously I’d be exaggerating if I said that was all there was to it. But in about 10 minutes I had a simple template generated and working on my computer. This was the perfect starting point to start editing the template to my liking. It was the static website I needed but with a convenient way to manage blogging.
I asked ChatGPT how to go about configuring this:
How do I get started editing this to customise it for my use case? And do I need to stop the server running before doing that?
Great to hear that you’ve successfully set up your Jekyll site!
To customize the site for your use case, you can edit the files in your site directory using your favorite text editor. The main files you’ll want to edit are:
_config.yml
: This file contains configuration settings for your Jekyll site, such as the site title and description, URL, and other settings.index.md
and other Markdown files in the root directory: These files contain the content for your site, written in Markdown syntax._layouts
: This directory contains the templates that define the overall structure and design of your site. You can edit these templates to customize the look and feel of your site._includes
: This directory contains reusable snippets of code that can be included in your layouts, such as headers, footers, and navigation menus.You can make changes to these files while your Jekyll server is running. Jekyll will automatically rebuild your site and update the server with your changes as you save your changes to the files.
If you want to see your changes immediately, you can refresh your browser while the Jekyll server is running, and your changes should be visible. However, if you make changes to the
_config.yml
file, you will need to stop and restart the Jekyll server for the changes to take effect.To stop the Jekyll server, you can press
Ctrl+C
in the terminal window where the server is running.
From there I set off. It took me the rest of the morning to copy the minima template into my working folder and start tweaking the HTML and CSS elements to my liking. The most difficult bit was adding an additional SVG graphic, but a few search engine queries helped me achieve that. I had a good enough foundation now that I knew for what to search for any given problem.
Reflections
I really wanted to write a blog post today just to have something on my newly designed website. And what better to write about than the great technology that helped me build it? As I was writing this post in a cafe, a student sat down next to me and started studying on his iPad. He was reading a chemistry textbook, and before long, I noticed in my peripheral vision a familiar black and green theme. Sure enough, the student was asking ChatGPT about the chemical reactions in his textbook that he didn’t quite understand.
The philosophical debate around and implications of AI technology is fascinating (though also a little toxic) and will only grow in importance as the technology improves. Indeed, the speed at which the technology is advancing, is breath taking, and I think this is the first technological innovation since the first smart phones that has excited me on a primitive, un-thinking level (I just can’t excited by the banality and blatantly immoral deployment of cryptocurrencies). It is unquestionably sci-fi. I’m sure there will be problems, I believe AI has the potential to create very serious social problems and I’m not convinced our modern societies or political institutions are well-equipped to deal with them. But my inner child just can’t wait to see what happens next.