A Python walkthrough of using GPT to double-check its answer using GPT-J in Colab

Large language models have a problem where they tend to just make stuff up. This can be because of the training data, the prompt, or even just ambiguity. This can be mitigated by engineering the prompt to have GPT sanity check its output, and it works with both GPT3 and GPT-J (the latter of which you can use for free).

What do I mean by a sanity check? Well, it turns out by setting up your prompts to double check the output using something like:

Initial Answer: 6394 + 250 = 6643
Double Checking: 6643 looks wrong. …

Fitting models of Google Search to Search Trends and News Articles

This post integrates data from a limited sample of newspaper coverage with Google Search trends to model interactions between the two. In these examples, the preliminary analysis finds news coverage useful for forecasting search trends but small and mixed results in the other direction. These examples were selected to be done with limited resources and time in a blog post, but everything’s general purpose enough that you can swap in your own topics or data and it should be enough to get you started.

This is the third post in a series of blog posts demonstrating modeling news with Python…


Earlier I wrote a bit about getting news stories to start modeling and now I’ll play around a bit with how to forecast coverage and measure if a model’s any good.

I’ll start this post using an off the shelf neural network from fast.ai to generate some models of publisher daily production using just some articles from a set of publishers, evaluate the fit of the model, and then show why these models aren’t that great for the limitations of the dataset we’re dealing with (entirely arbitrary limitations to make it easy to run the code, messing with granularity and…


There are a lot of news outlets out there with a lot of diverse views. That’s good in one sense, but in another sense it’s rather impossible for anyone to read everything every day much less anyone that gets busy for a few days. However, the news is just a bunch of events happening over time, and so that suggests there’s a way to model it so we can understand some of what’s going on.

Forecasting news trends can be thought of as similar to what people already try to do with the stock market, where we know there are…


Yeah, Trump’s foreign policy helps the Russians, but that doesn’t mean he’s colluding. Let’s talk about game theory.

Photo by Daniel von Appen on Unsplash

As Russia continues to attempt to manipulate the discourse in the US going into the 2018 midterms, it’s worth looking at what everyone’s arguing about. The left tends to argue that Trump colluded with the Russians to overthrow American democracy. Meanwhile, the right rebuts that the Russian interference did not have an impact on votes at all. It’s possible one side is entirely correct, although as in most disagreements over complex issues, it’s more likely that both parties are partially right and partially wrong.

There’s mounting evidence that Russia has interfered in the discourse. So far, the US Government has…


CIA Deputy Director Gina Haspel testifies before the Senate Intelligence Committee, May 9, 2018.

With Haspel’s Senate Intelligence Committee nomination vote tomorrow, Haspel still refuses to call enhanced interrogation immoral.

During the Nuremberg Trials after World War II, those accused of war crimes attempted to justify their actions by saying that they were merely following orders. The world decided that this defense, known now as the Nuremberg Defense, was not acceptable. Since then, the free world has held that government officials who receive orders which violate human rights should be held liable for following those orders.

Throughout the the course of Haspel’s hearing with the Senate Intelligence Committee last week, Haspel used the Nuremberg Defense to justify the CIA’s enhanced interrogation program during the early years of the War on…


There has been a lot of confusion in the last week over how Facebook gets its data. To clear some of that up, I created a Facebook Ads account and looked at the sorts of data Facebook uses to target users.

Overview:

  • Facebook obtains data on users from third party services including Oracle Data Cloud and Epsilon, and indirectly from Shopper’s Voice.
  • Facebook Pixel appears to store user web activity for at least 180 days.
  • Facebook acquires offline data from Facebook Business users in addition to the third party data services listed above, which they appear to store for at least 2 years.

Why Facebook Data Matters:

Last week, committees in both chambers of Congress held hearings with Facebook’s CEO Mark Zuckerberg. A whistle-blower who had worked for a data-analysis company, Cambridge Analytica, claimed that Cambridge Analytica had quietly acquired data on millions of Facebook users…


CIA Director Mike Pompeo speaks to the Senate Foreign Relations Committee on Thursday, April 12, 2018. Source: C-SPAN

On Thursday, CIA Director, Mike Pompeo, clarified his view of foreign information campaigns targeting Americans. “It’s a real threat, one that has been under-appreciated for years now. It has become cheaper, faster, less attributable,” he said. Pompeo was responding to a question from Senator Rob Portman (R-Ohio) during the Senate Foreign Relations Committee hearing on his nomination for the next Secretary of State.

This was a refreshing acknowledgement from a member of an administration that has constantly denied or undermined claims of foreign propaganda influencing elections. It is consistent with Pompeo’s concerns about interference in the 2018 elections. …

Matt Brockman

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store