chatGPT infinite glitch. I asked to use other library instead of java.net.URL since it was depricated

I asked to use other library instead of java.net.URL since it was depricated. It suggested to use apache.http and started writing the code but was stuck at only importing the same library on loop.

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.hc.client5.http.classic.methods.HttpGet;
import org.apache.hc.client5.http.classic.methods.CloseableHttpResponse;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org.apache.hc.client5.http.classic.methods.classic.CloseableHttpResponseBase;
import org

You can go back to this output and press regenerate.

What happens is the token selection is a random procedure based on probabilities.

There might have been a better way to proceed, but the same token was selected instead by the sampler.

Then it looks like a pattern, which sometimes the AI can’t escape from. The base untrained AI is very likely to go into repeats, and this behavior can sometimes still be seen in one trained for chat and following instructions.

Here I use davinci-002, a base model, knowing that it will exhibit the same symptom, first a multi-line pattern, then a single line repeated: