A Fun Weekend Project: Q&A Chatbot Trained on My Own Content

Any book can now be transformed into a chatbot that can answer questions about its content. It doesn’t to have to be a book either. It can also be your own content. For example, you can use your own notes or favorite articles and ask any question about what’s mentioned in them — just as you would ask ChatGPT.

You can do this by fine-tuning OpenAI’s language models (GPT) on your own data. All you will need is the OpenAI API and two open-source libraries (LlamaIndex and Langchain). You can run this in a Google Colab (Jupyter) notebook for free. If this sounds interesting, here is how:

Steps

1. Open AI. Sign up for Open AI and get an API key.

2. Upload your content to GitHub.

3. Use a Colab notebook.

  • To simplify things, we’ll use Google Colab. It runs in the cloud, so you won’t need to install anything on your laptop.
  • To get started quickly, re-use a public Colab that has all the necessary code. This way you would only need to make a few changes. For example, you can copy this Colab (credit goes to Dan Shipper) to your Google Drive. For context, see Dan’s article in Lenny’s newsletter and this video walkthrough by Irina Nik.
  • Replace the GitHub link with your own.
  • Change runtime type to GPU (Menu: Runtime -> Change runtime type).
  • Run all the Colab cells.
  • Enter your OpenAI API code when prompted.
  • Ask any question when prompted.

And that’s it!


You can find a copy of the complete code below:

Continue reading

ChatGPT Use Cases ~2 Months In

It has been just over two months since the release of ChatGPT. During this time, I have explored various use cases and compared different tools. In this post, I would like to share the two uses for ChatGPT that have proven to be the most valuable so far. Of course, it can be used for a thousand other things, but these two have personally stood out to me as the most consistently useful.

Use Cases

I have found that ChatGPT is most consistently useful in the role of an expert, tutor, and editor.

1. Expert and Tutor

When: I want to learn X.

Expertise vs Tutoring

These are very similar conceptually, but I would make a small distinction:

  • Expertise. At times, I may want to get a brief overview (tldr) of a topic. This could be viewed as a quick chat with an expert. For example, if I wanted a brief summary of the life extension industry, but didn’t want to dive too deep, I could think of it as a quick chat with a friend who works in the industry.
  • Tutoring: In other instances, I may want to dive deeper into a specific topic and ask a series of questions. For instance, while I was learning about machine learning with PyTorch, I found ChatGPT to be very helpful as a tutor.”

How

  • Know Where to Start. If I don’t know where to begin, a general introductory question might be helpful, such as “What are the most important topics to master in order to learn X?”
  • Troubleshoot. If I encounter a specific problem or question, it’s best to address it directly. I’ve found that this approach works particularly well with programming questions, at least at a basic level.

Best Practices

  • Creative Prompting: Sometimes, getting creative with prompts can help. For example, instead of asking, “Explain general relativity as if I’m five years old,” it may be helpful to try, “Explain general relativity as if I’m five years old. Please respond as a physics professor at MIT who is good at communicating complex ideas without dumbing them down.”
  • Follow-up: In my experience, one of the main advantages of ChatGPT over traditional search engines and previous-generation AI assistants or chatbots is its interactivity and ability to maintain the thread of the conversation. So, just like with a real tutor, it may be helpful to ask for explanations in a different way, provide an example, elaborate on a particular point, or step back and explain how a certain concept fits into the big picture.

3. Editor

When: I want to change anything about a text.

How

Some examples include:

  • Checking grammar
  • Summarizing or rephrasing the text
  • Getting ideas on what else to consider and think about
  • Analyzing the argument. For example, “What are the likely influences behind this text?” or “What are the strongest counter-arguments to this?”

Context

Lessons and Challenges

  1. Hallucinations and Validation. Of course, one must watch out for hallucinations. That’s why I find that using ChatGPT in combination with Google may work best. The first step may be asking ChatGPT to provide an initial overview of a topic to save time reading long articles from the Google’s organic results that have been SEO’d in and out. And the next step may be to search for specific sub-topics — sometimes using search syntax/operators to find exact matches or limit the search to certain websites.
  2. Common Knowledge vs. Advanced/Niche Topics: I’ve found that ChatGPT is very good at summarizing and explaining common non-controversial knowledge, but is more likely to hallucinate or struggle when dealing with advanced or niche topics that may only be covered by a just few papers or blog posts. Another way to think about this is to consider how likely it is that this topic was prominent in the training dataset.

What I’ve Tested

Despite still relying on Google for the majority of my searches, I have come to the conclusion that ChatGPT — especially when combined with Google — is better or comparable for a specific subset of my use cases and queries. Depending on the question or query, I have also found Perplexity.ai, Neeva, You.com/chat, and Elicit.org to be worth trying out.

What’s Next

I am looking forward to trying Microsoft’s integration of ChatGPT with Bing and Google’s integration of Bard with Google Search. I find the intersection of search and conversational AI to be particularly intriguing, as these two tools are some of the best resources for organizing and retrieving information that we have today.




Examples

Please see — or skip — the three examples of actual “conversations” below:

Continue reading

A Happy Job Launch

Today, my co-founder and I are launching the product we’ve been working on for months. It’s an odd time to launch anything, but we’re proud of what we’ve built, and we hope that our product can also help some people who were recently laid off.

A Happy Job is a team-based and culture-centric recruiting platform. We help job-seekers — initially engineers — find teams that are actively hiring and fit their preferences. Search by product type, tech stack, team set-up, culture, values, working styles, or perks.

If you’d like to learn more, keep reading.

Continue reading

Favorite Books of 2018 (and early 2019)

Here are some books I’ve enjoyed more than others in the last 14 months or so. I’ve included some notable quotes but not all are equally representative of the book contents.

Enlightenment Now by Steven Pinker

“What is progress? You might think that the question is so subjective and culturally relative as to be forever unanswerable. In fact, it’s one of the easier questions to answer. Most people agree that life is better than death. Health is better than sickness. Sustenance is better than hunger. Abundance is better than poverty. Peace is better than war. Safety is better than danger. Freedom is better than tyranny. Equal rights are better than bigotry and discrimination. Literacy is better than illiteracy. Knowledge is better than ignorance. Intelligence is better than dull-wittedness. Happiness is better than misery. Opportunities to enjoy family, friends, culture, and nature are better than drudgery and monotony. All these things can be measured. If they have increased over time, that is progress.”

21 Lessons for the 21st Century by Yuval Harari

“Homo sapiens is just not built for satisfaction. Human happiness depends less on objective condition and more on our own expectations. Expectations, however, tend to adapt to conditions, including to the condition of other people. When things improve, expectations balloon, and consequently even dramatic improvement in conditions might leave us as dissatisfied as before.”

Culture Code by Daniel Coyle

“Give a good idea to a mediocre team, and they’ll find a way to screw it up. Give a mediocre idea to a good team, and they’ll find a way to make it better. The goal needs to be to get the team right, get them moving in the right direction, and get them to see where they are making mistakes and where they are succeeding.”

Continue reading

Monthly newsletter: technology, startups, business growth and marketing

Monthly Newsletter: Issue 6

Hi, this is an issue of my monthly newsletter. I’ve picked a few interesting articles on technology, startups, growth, marketing and other topics for you.

I hope you enjoy the read with your morning cup of coffee. Let me know what you think! ~Max

Technology and Startups

Growth and Marketing

Continue reading

Monthly newsletter: technology, startups, business growth and marketing

Monthly Newsletter: Issue 5

Hi, this is an issue of my monthly newsletter. I’ve picked a few interesting articles on technology, startups, growth, marketing and other topics for you.

I hope you enjoy the read with your morning cup of coffee. Let me know what you think! ~Max


Technology and Startups

Growth and Marketing

Continue reading

Monthly newsletter: technology, startups, business growth and marketing

Monthly Newsletter: Issue 4

Hi, this is an issue of my monthly newsletter. I’ve picked a few interesting articles on technology, startups, growth, marketing and other topics for you.

Hope, you enjoy the read with your morning cup of coffee. Let me know what you think! ~Max


Technology and Startups

Continue reading

Monthly newsletter: technology, startups, business growth and marketing

Monthly Newsletter: Issue 3

This is an issue of my monthly newsletter. Main topics: technology, startups, business growth, and marketing. See other issues on my blog or subscribe. ~Max


Now, get a cup of coffee and enjoy!

Technology and Startups

Growth and Marketing

Continue reading

Monthly newsletter: technology, startups, business growth and marketing

Monthly Newsletter: Issue 2

This is an issue of my monthly newsletter. Main topics: technology, startups, business growth, and marketing. See other issues on my blog or subscribe. ~Max


Now, get a cup of coffee and enjoy!

Technology and Startups

Growth and Marketing

  • Intercom on Marketing (ebook). A good intro to marketing and, in particular, product marketing that will be interesting to those who are relatively inexperienced.
  • How to Design Marketing Campaigns. Basics of marketing segmentation, messaging hierarchy, and campaign management – this article will be useful to those who’re new to marketing or looking for a refresher.
  • HubSpot’s Pricing Page Redesign → MQL Conversions 165%↑ & Free Sign-Ups 89%↑. How: research first – usability testing, internal feedback, and customer intelligence; then design based on insights and A/B test.
  • What’s next in growth?” (video) talk by Andrew Chen who leads the rider growth at Uber. Andrew recommends you ignore “growth hacks” and focus on fundamentals that worked for decades. E.g. user referrals, shareable content, and using discounts to jumpstart demand for new products.

Continue reading

Monthly Newsletter: Issue 1

This is an issue of my monthly newsletter. Main topics: technology, startups, business growth, and marketing. See other issues on my blog or subscribe. ~Max

Technology and Startups

  • Ten-year Futures – a presentation by A16z. New technologies enable new use cases. Seeing them, as well as non-obvious “second order” effects, is key. E.g. mobile enabled Instagram, Instacart, and ride-sharing.
  • Decrypting Crypto – another presentation by A16z. Bitcoin is a combination of three old technologies: hashcash, public key cryptography, and distributed ledger. Value of cryptocurrencies goes beyond the traditional store of value and medium of exchange. E.g. tokens can help bootstrap new protocol-level innovation and incentivize developers, customers, and investors to contribute.
  • AlphaGo Zero masters the game of Go from scratch. The ML algorithm learned the game without any pre-existing understanding of rules or strategies. Building a general or at least a-little-bit-less-narrow AI appears to be a big priority for DeepMind. Perhaps this can count as a small step in this direction?
  • Delivering blood with drones in Rwanda – a TED talk by the founder of Zipline. What an amazing application of new technology and a case study in social entrepreneurship.
  • Tacotron 2 is a new text-to-speech technology by Google that is (almost?) indistinguishable from a human voice. If Google manages to make it less computationally demanding and ship it as part of the Android OS, all kinds of interesting use cases will be made possible. I personally will listen to more of my Pocket articles in audio.
  • Magic Leap is launching its SDK, shipping in 2018. AR/VR is already quite a saturated market. It’s not entirely clear yet how hyped Magic Leap technology will compare to Microsoft HoloLens, as well as to VR headsets: HTC Vive and Oculus Rift.

Continue reading