The Official ChatGTP cheat code thread.

bnew

Veteran
Joined
Nov 1, 2015
Messages
58,200
Reputation
8,613
Daps
161,844

1/9
Are there any good papers on increasing the “creativity” of an LLM through prompt engineering?

I’m looking for ways to produce more unique ideas/concepts without just randomly pulling words from a wordlist to seed the models context

2/9
One technique I've had some success with is to just have the LLM start with free writing, just doing stream of thought nonsense at higher temperature. I then submit the normal prompt and tell it to use the tree writing as non-literal inspiration to help creativity.

3/9
I wonder if the base models would be particularly good at this type of entropy generation

4/9
Adjusting temperature

5/9
It can help a lot to ask it to pretend to be an eccentric expert in the field. You can even name an actual person if you want to flavor the creativity in a specific way.

"You are Richard Feynman and you're trying to figure out why this vacuum cleaner is broken." etc

6/9
I’ve tried some: plot existing ideas on a 3d graph. Choose the labels for each, your answer should be far away from existing ideas when plotted. Prompt it to apply combinations of scientific seemingly unrelated disciplines. Hit or miss but it’s a good starting point sometimes

7/9
I'm diving into the latest research on prompt engineering and LLMs - have you explored the concept of "adversarial prompts" to stimulate more creative outputs?

8/9
Use a base model, instead of an instruction-tuned one

9/9



To post tweets in this format, more info here: https://www.thecoli.com/threads/tips-and-tricks-for-posting-the-coli-megathread.984734/post-52211196

 

bnew

Veteran
Joined
Nov 1, 2015
Messages
58,200
Reputation
8,613
Daps
161,844
Here are some generic large language system prompts that can logically detect subtle bugs in code:

1. "Analyze the following code for potential syntax errors, paying close attention to bracket matching, semicolon placement, and proper function declarations."

2. "Examine the logical flow of this code snippet and identify any inconsistencies or potential logical errors."

3. "Check for possible off-by-one errors in loop conditions and array indexing within this code."

4. "Evaluate the code for potential null pointer exceptions and suggest proper null checks where necessary."

5. "Assess the memory management in this code and highlight any areas where memory leaks might occur."

6. "Review the concurrent operations in this code and identify potential race conditions or deadlocks."

7. "Analyze the loop structures in this code and determine if there's any risk of infinite loops."

8. "Examine the error handling mechanisms in this code and suggest improvements for more robust exception management."

9. "Provide a brief overview of what this code is intended to do based on its structure and function names."

10. "Identify the key algorithms or data structures used in this code and explain their purpose."

11. "Consider potential edge cases for the inputs of this function and explain how the code handles them."

12. "Analyze how this code behaves with extremely large or small input values."

13. "Evaluate this code against industry best practices for [language name] and suggest improvements."

14. "Identify any common coding pitfalls present in this snippet and propose solutions."

15. "Verify if the function's output aligns with its intended purpose as described in the comments or function name."

16. "Check if there are any contradictions between different parts of the code that might lead to unexpected behavior."

17. "Analyze the time and space complexity of this code and suggest optimizations if possible."

18. "Identify any redundant operations or unnecessary computations in this code that could be optimized."

19. "Examine this code for potential security vulnerabilities, such as SQL injection, cross-site scripting, or buffer overflows."

20. "Assess the compatibility of this code across different versions of [language/framework] and identify any potential issues."

21. "Evaluate the readability and maintainability of this code, suggesting improvements in variable naming, code structure, or documentation."

These prompts cover a wide range of potential bug sources and code quality issues, including syntax errors, logical errors, performance issues, security vulnerabilities, and maintainability concerns. By using these prompts, a large language model can systematically analyze code to detect subtle bugs and suggest improvements. The prompts are designed to encourage deep analysis and consideration of various aspects of code quality, helping to uncover issues that might not be immediately apparent.
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
58,200
Reputation
8,613
Daps
161,844

1/1
As #REFLECTION 70b had been trending, I decided to check and see if I an get a smarter model and my favorite /search?q=#gpt4o achieve the same via simple ICL prompt. And to no surprises, it actually did.

Here is the prompt I used “Ok so I got ChatGPT do this quite well without spending single dime:

System prompt: “When presented with a question, follow this structured approach to solve it:

1.Carefully Read the Question: Understand the problem fully before jumping to conclusions. Break it down into smaller parts.
2.Identify Given Information: Clearly identify what information is provided in the question and what conditions or constraints are present.
3.Analyze What We Know: Identify any rules, patterns, or logical relationships that need to be considered based on the given information.
4.Devise a Plan: Create a step-by-step plan based on the known facts and logic to solve the problem.
5.Solve the Problem: Execute the plan and provide a clear, concise answer based on the analysis.
6.Review: Double-check the solution to ensure no details were missed, and the question is answered thoroughly.
7. Use code interpreter or python if the question requires mathematical evaluation.

Always be extremely attentive to information in the questions, you might get tricke into seeing familiar questions but with slightly changed scenarios. Be strictly careful. Revaluate your answer based on the facts of the questions and alwasy be accurate

Always provide these detailed thinking in your answers. Finally reflect on the answer you gave and make sure its inline with the original user request.”

Outputs:


To post tweets in this format, more info here: https://www.thecoli.com/threads/tips-and-tricks-for-posting-the-coli-megathread.984734/post-52211196
GW0FNwIWwAAKcts.jpg

GW0FNwMWEAA7KJk.jpg

GW0FNwVXQAAtGY6.jpg

GW0FNvpa8AAoaHU.jpg
 
Last edited:

bnew

Veteran
Joined
Nov 1, 2015
Messages
58,200
Reputation
8,613
Daps
161,844
I've gotten good results with this prompt in combination with step back prompting.



**Instruction:** address the issues above this instruction with the following output:

You are an AI assistant designed to provide detailed, step-by-step responses. Your outputs should follow this structure:

1. Begin with a <thinking> section.
2. Inside the thinking section:
a. Briefly analyze the question and outline your approach.
b. Present a clear plan of steps to solve the problem.
c. Use a "Chain of Thought" reasoning process if necessary, breaking down your thought process into numbered steps.
3. Include a <reflection> section for each idea where you:
a. Review your reasoning.
b. Check for potential errors or oversights.
c. Confirm or adjust your conclusion if necessary.
4. Be sure to close all reflection sections.
5. Close the thinking section with </thinking>.
6. Provide your final answer in an <output> section.

Always use these tags in your responses. Be thorough in your explanations, showing each step of your reasoning process. Aim to be precise and logical in your approach, and don't hesitate to break down complex problems into simpler components. Your tone should be analytical and slightly formal, focusing on clear communication of your thought process.

Remember: Both <thinking> and <reflection> MUST be tags and must be closed at their conclusion

Make sure all <tags> are on separate lines with no other text. Do not include other text on a line containing a tag.
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
58,200
Reputation
8,613
Daps
161,844


Code:
You are an AI assistant that uses a Chain of Thought (CoT) approach with reflection to answer queries. Follow these steps:

        1. Think through the problem step by step within the <thinking> tags.
        2. Reflect on your thinking to check for any errors or improvements within the <reflection> tags.
        3. Make any necessary adjustments based on your reflection.
        4. Provide your final, concise answer within the <output> tags.

        Important: The <thinking> and <reflection> sections are for your internal reasoning process only.
        Do not include any part of the final answer in these sections.
        The actual response to the query must be entirely contained within the <output> tags.

        Use the following format for your response:
        <thinking>
        [Your step-by-step reasoning goes here. This is your internal thought process, not the final answer.]
        <reflection>
        [Your reflection on your reasoning, checking for errors or improvements]
        </reflection>
        [Any adjustments to your thinking based on your reflection]
        </thinking>
        <output>
        [Your final, concise answer to the query. This is the only part that will be shown to the user.]
        </output>

        Now, please respond to the following query:
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
58,200
Reputation
8,613
Daps
161,844
get chatgpt or any other LLM to help you edit .txt / text documnts in Notepad++ using the Python Script plugin. this prompt will help you instruct chatgpt on what changes you want to make to a document and it'll write a python script that'll make the changes you want to the current document and instruct you on how to use it.

Prompt with Two Versions: Python 2.x and Python 3.x Syntax​

Version 1: Using Python 2.x Syntax​

Prompt: Hello I need assistance with a task in Notepad++. I would like to use the PythonScript plugin to write a Python script that performs a specific operation on a document. Here, I will be using Python 2.x syntax. Please provide a step-by-step guide on how to create and run a Python script using the PythonScript plugin in Notepad++, including any necessary code snippets and explanations.

My Request/Needs:
[Insert your specific request or needs here.] Thank you!

Version 2: Using Python 3.x Syntax​

Prompt: Hello I need assistance with a task in Notepad++. I would like to use the PythonScript plugin to write a Python script that performs a specific operation on a document. Here, I will be using Python 3.x syntax. Please provide a step-by-step guide on how to create and run a Python script using the PythonScript plugin in Notepad++, including any necessary code snippets and explanations.

My Request/Needs:
[Insert your specific request or needs here.] Thank you


edit:

you can get it to amend your the response and initial prompt and follow a format like this to get better results:

**Prompt:**

Hello I need assistance with a task in Notepad++. I would like to use the PythonScript plugin to write a Python script that performs a specific operation on a document. Here, I will be using Python 3.x syntax. Please provide a step-by-step guide on how to create and run a Python script using the PythonScript plugin in Notepad++, including any necessary code snippets and explanations.

1. **Reading the Document**: The script should read the entire content of the document and split it into lines.
2. **User Input for Finding Value**: It should prompt the user to enter a value to find in the document.
3. **User Input for New Value**: It should prompt the user to enter a new value that will replace the found value.
4. **Using Regular Expressions**: The script should use a regular expression to find lines that match the pattern of a number followed by the user-specified value.
5. **Recreating the Lines**


edit 2:

for smaller LLMs you this might help..

Version 1: Using Python 2.x Syntax​

Prompt: Hello I need assistance with a task in Notepad++. I would like to use the PythonScript plugin to write a Python script that performs a specific operation on a document. Here, I will be using Python 2.x syntax. Please provide a step-by-step guide on how to create and run a Python script using the PythonScript plugin in Notepad++, including any necessary code snippets and explanations.

** Note: The script must include the line ```content = editor.getText()``` to get the current document content. **
** Note: **
```
import re
from Npp import notepad, editor
```
** Important: The script must be compatible with Python 2.x syntax. **

My Request/Needs:
[Insert your specific request or needs here.]

Thank you!

Version 2: Using Python 3.x Syntax​

Prompt: Hello I need assistance with a task in Notepad++. I would like to use the PythonScript plugin to write a Python script that performs a specific operation on a document. Here, I will be using Python 3.x syntax. Please provide a step-by-step guide on how to create and run a Python script using the PythonScript plugin in Notepad++, including any necessary code snippets and explanations.

** Note: The script must include the line ```content = editor.getText()``` to get the current document content. **
** Note: **
```
import re
from Npp import notepad, editor
```
** Important: The script must be compatible with Python 3.x syntax. **

My Request/Needs:
[Insert your specific request or needs here.]

Thank you!
 
Last edited:

bnew

Veteran
Joined
Nov 1, 2015
Messages
58,200
Reputation
8,613
Daps
161,844
made an additional change to my prompt because sometimes it kept responding with python 3.x syntax after a while even when initially instructed to give python 2.x compatible code.

prompt:

Hello I need assistance with a task in Notepad++. I would like to use the PythonScript plugin to write a Python script that performs a specific operation on a document. Here, I will be using Python 2.x syntax.

Please provide a step-by-step guide on how to create and run a Python script using the PythonScript plugin in Notepad++, including any necessary code snippets and explanations.

** Note: The script must include the line ```content = editor.getText()``` to get the current document content. **
** Note: **
```
import re
from Npp import notepad, editor
```
** Important: Show two script version, one must be compatible with Python 2.x syntax and another Python 3.x **

My Request/Needs:
I need a python script that can intelligently split a document at 12900-13000 characters without breaking up sentences or paragraphs. separate by putting 10 empty new lines for each split but otherwise keep the document intact.

Thank you!


the response

To achieve your goal of splitting a document at approximately 12900-13000 characters without breaking sentences or paragraphs, you can use the following steps and scripts. Here’s a step-by-step guide on how to create and run these scripts using the PythonScript plugin in Notepad++.

Step 1: Install the PythonScript Plugin​

If you haven't already installed the PythonScript plugin, follow these steps:
  • Open Notepad++.
  • Go to Plugins > Plugins Admin...
  • Search for "PythonScript" and install it.
  • Restart Notepad++.

Step 2: Create a New Script​

  • Open Notepad++.
  • Go to Plugins > Python Script > New Script.
  • Name your script (e.g., split_document.py).

Step 3: Write the Script​

Here are two versions of the script, one compatible with Python 2.x and another with Python 3.x.

Python 2.x Version​

Code:
import re
from Npp import notepad, editor

def split_document():
    content = editor.getText()
    lines = content.split('\n')
    paragraphs = []
    current_paragraph = ''

    # Group lines into paragraphs
    for line in lines:
        if line.strip() == '':
            if current_paragraph:
                paragraphs.append(current_paragraph)
                current_paragraph = ''
        else:
            current_paragraph += ' ' + line.strip()
   
    if current_paragraph:
        paragraphs.append(current_paragraph)

    # Split paragraphs into chunks of approximately 12900-13000 characters
    chunks = []
    chunk_size = 0
    chunk_content = ''

    for paragraph in paragraphs:
        paragraph_length = len(paragraph)
       
        if chunk_size + paragraph_length > 13000:
            chunks.append(chunk_content)
            chunk_content = ''
            chunk_size = 0
       
        if chunk_content:
            chunk_content += '\n\n' + paragraph
        else:
            chunk_content = paragraph
       
        chunk_size += paragraph_length + 2  # Add 2 for newline characters

    if chunk_content:
        chunks.append(chunk_content)

    # Insert 10 empty new lines between each chunk
    result = '\n'.join(['\n' * 10 + chunk for chunk in chunks])

    # Replace the current document content with the result
    editor.setText(result)

# Run the function when script is executed
split_document()

Python 3.x Version​

The code remains largely the same since it doesn't rely on any specific features that differ between Python 2.x and 3.x. Here it is again for clarity:
Code:
import re
from Npp import notepad, editor

def split_document():
    content = editor.getText()
    lines = content.split('\n')
    paragraphs = []
    current_paragraph = ''

    # Group lines into paragraphs
    for line in lines:
        if line.strip() == '':
            if current_paragraph:
                paragraphs.append(current_paragraph)
                current_paragraph = ''
        else:
            current_paragraph += ' ' + line.strip()
   
    if current_paragraph:
        paragraphs.append(current_paragraph)

    # Split paragraphs into chunks of approximately 12900-13000 characters
    chunks = []
    chunk_size = 0
    chunk_content = ''

    for paragraph in paragraphs:
        paragraph_length = len(paragraph)
       
        if chunk_size + paragraph_length > 13000:
            chunks.append(chunk_content)
            chunk_content = ''
            chunk_size = 0
       
        if chunk_content:
            chunk_content += '\n\n' + paragraph
        else:
            chunk_content = paragraph
       
        chunk_size += paragraph_length + 2  # Add 2 for newline characters

    if chunk_content:
        chunks.append(chunk_content)

    # Insert 10 empty new lines between each chunk
    result = '\n'.join(['\n' * 10 + chunk for chunk in chunks])

    # Replace the current document content with the result
    editor.setText(result)

# Run the function when script is executed
split_document()

Step 4: Save and Run Your Script​

  • Save your script file (split_document.py).
  • Go to Plugins > Python Script > Scripts > split_document.
  • This will execute your script on the current document.

Explanation of Script Logic​

  1. Read Document Content: The script reads the entire text of the current document using editor.getText().
  2. Group Lines into Paragraphs: It groups consecutive non-empty lines into paragraphs.
  3. Split Paragraphs into Chunks: It splits these paragraphs into chunks based on a character limit (approximately 12900-13000).
  4. Insert New Lines Between Chunks: It inserts 10 empty new lines between each chunk.
  5. Replace Document Content: Finally, it replaces the original document content with the processed text.
This approach ensures that sentences and paragraphs are not broken during splitting.
 
Top