Could I greasemonkey the website to show the content without all the unnecessary markup, instead of trying to get ChatGPT to change its output?
The markdown of lists is quite natural written language still.
1. my list item
2. second item
becomes
- my list item
- second item
The path to something that is useful by transformation is not clear. HTML has lists as ordered <ol>
, or unordered <ul>
- example1
- example2
- example1
- example2
ChatGPT’s HTML:
<ol><li>example1</li><li>example2</li></ol><ul><li>example1</li><li>example2</li></ul>
Replacing numbers with bullets in HTML is a possibility if you just don’t like them counted, by altering just one type of tag and its closure. You would have to target the specific classes of output messages instead of all usage throughout the whole page and site.
However, I can counter them easily in custom instructions.
-
before:
-
after, trying over and over, regenerating with different models:
That doesn’t last very long. ChatGPT starts ignoring the custom instruction by message three, and by message five it is doing all text in numbered lists exclusively. I can see in each message how the format deteriorates a little. I amend each prompt with [Write one continuous paragraph] now. It lasts a message or two until it starts ignoring it again. Hence the title of the thread.
I literally just want continuous text, like a book:
“There is much to say. Example one is interesting. Example two also. Caveat one should be considered. Caveat two also. Conclusion in the end.”
So I should pretty much just auto-replace all the HTML formatting tags with spaces.
This Tampermonkey script seems to do the job.
// ==UserScript==
// @name Remove Lists from ChatGPT Responses
// @namespace http://tampermonkey.net/
// @version 3.3
// @description Remove all lists from ChatGPT's responses while preserving code blocks and ensuring proper formatting.
// @match *chatgpt.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
//Generate a unique placeholder
function generatePlaceholder() {
return 'CODE_PLACEHOLDER_' + Math.random().toString(36).substr(2, 9);
}
//Protect code blocks by replacing them with placeholders
function protectCodeBlocks(container) {
const codeBlocks = [];
container.querySelectorAll('pre, code').forEach(block => {
const placeholder = document.createTextNode(generatePlaceholder());
codeBlocks.push({ placeholder, block });
block.parentNode.replaceChild(placeholder, block);
});
return codeBlocks;
}
//Restore code blocks from placeholders
function restoreCodeBlocks(container, codeBlocks) {
codeBlocks.forEach(({ placeholder, block }) => {
placeholder.parentNode.replaceChild(block, placeholder);
});
}
//Remove all list tags
function removeLists(container) {
//Replace each <li> with its content followed by a line break
container.querySelectorAll('li').forEach(li => {
const fragment = document.createDocumentFragment();
//Append the content of the <li>
while (li.firstChild) {
fragment.appendChild(li.firstChild);
}
//Add a line break after the content
fragment.appendChild(document.createElement('br'));
//Replace the <li> with the fragment
li.parentNode.replaceChild(fragment, li);
});
//Remove any remaining <ul> and <ol> elements by replacing them with their content
container.querySelectorAll('ul, ol').forEach(list => {
const fragment = document.createDocumentFragment();
while (list.firstChild) {
fragment.appendChild(list.firstChild);
}
list.parentNode.replaceChild(fragment, list);
});
}
//Remove multiple consecutive <br> tags
function removeExtraLineBreaks(container) {
container.querySelectorAll('br + br').forEach(br => {
br.remove();
});
}
function adjustParagraphs(container) {
container.querySelectorAll('p').forEach(p => {
p.style.margin = '0.5em 0'; // You can adjust the margin values here
p.style.padding = '0';
});
}
//Adjust spacing around specific tag combinations
function adjustSpacing(container) {
//Remove <br> directly before <p> tags
container.querySelectorAll('br + p').forEach(p => {
const br = p.previousSibling;
if (br && br.nodeName.toLowerCase() === 'br') {
br.remove();
}
});
//Remove <br> directly after </p> tags
container.querySelectorAll('p').forEach(p => {
const br = p.nextSibling;
if (br && br.nodeName.toLowerCase() === 'br') {
br.remove();
}
});
//Adjust margin for <p> tags that directly follow code blocks
container.querySelectorAll('pre + p, code + p').forEach(p => {
p.style.marginTop = '0.5em'; // Reduce the top margin
});
//Adjust margin for <p> tags that are followed by <strong> elements
container.querySelectorAll('p strong').forEach(strong => {
const p = strong.closest('p');
if (p) {
p.style.marginBottom = '0.25em'; // Reduce the bottom margin
}
});
}
function processMessage(container) {
if (container.dataset.processed) return;
container.dataset.processed = 'true';
const codeBlocks = protectCodeBlocks(container);
removeLists(container);
removeExtraLineBreaks(container);
restoreCodeBlocks(container, codeBlocks);
adjustParagraphs(container);
adjustSpacing(container);
}
//Process all existing messages
function processAllMessages() {
document.querySelectorAll('[data-message-author-role="assistant"] .markdown').forEach(processMessage);
}
//Observe for new messages
const observer = new MutationObserver(() => {
processAllMessages();
});
observer.observe(document.body, { childList: true, subtree: true });
processAllMessages();
})();
A typical o1 prompt:
I was thinking: if the output is hardcoded to be content-filtered numbered lists through manually structured training data, instead of being trained from actual content, doesn’t that mean that the LLM responses have become scripted, and it has lost some of its “AI’nes”?
-
Your Thoughts: Yes, the output of OpenAI models are extremely trained, supervised, patterned. “As an AI language model”…
-
Without Training: In contrast, the only way you get a list out of a base completion engine such as
davinci-002
is by asking for it, or starting the list yourself.
-
Completions: There is nobody home there to give your desires to, and completions was rendered basically useless with the loss of GPT-3 models. (The dumb AI given now as ‘davinci’ can barely figure out if unordered list starts with an asterisk, hyphen, or a number)
The only way to stop it from making lists to repeat the request in every prompt. I simply created a habit to append [Write continuously.]
to every single message. If I forget it one time, it will start making numbered lists again, even if I wrote it after 20 messages in that thread.
This is what ChatGPT generated code looks like:
# Start of the program. Initialize variables.
# Step 1: Define the variable 'a' and assign it the value of 5.
# This will store one of the numbers we want to add.
a = 5 # 'a' is now 5.
#An if sentence
if a < 4:
#This is in an if sentence, but you didn't see that because the code is splattered so far apart that nothing is recognizable.
print(sum) # Outputs: 8
# Define the variable 'b' and assign it the value of 3.
# This will store the other number we want to add.
b = 3 # 'b' is now 3.
# Perform addition.
# This step adds the values stored in 'a' and 'b'.
# Addition is a mathematical operation that combines numbers.
# Here, we add 'a' (5) and 'b' (3) to get 8.
sum = a + b # sum is now the result of 5 + 3.
# Step 4: Print the result to the screen.
You forgot
the
Grammar lines.