Iterated inner-voice: GPT-4 as a subcomponent of a general AI system

This has not yet grown into an official app or project… but I have an idea.

I have been working with GPT-4 quite a bit in recent weeks. Specifically, I am a professional C++ developer and I am seeing what it can do along those lines.

Very roughly put, I see that GPT-4 is a bit overly … “agreeable”. If I ask it to do something in C++ or ask if it can be done, it will almost always say “Yes. We can absolutely do that.” and then rattle off a superficially plausible answer that, well, doesn’t compile.

I find myself playing the role of ChatGPTs missing inner-dialogue.

This is ChatGPT now: “Here’s the first thought that comes to mind…”

And here’s the inner-dialogue common to human thought that’s missing: “Am I certain about this? Can I prove it? What is that proof?”

The programmer in me sees the modularity of this. The closed-loop iteration.

ChatGPT seems to be almost analogous to the memory recall “module” of the human thought process. And in my interactions with it, in trying to guide it to a correct answer, I am playing the role of its nonexistent inner-voice.

So why don’t we automate that inner voice? I’ve found that even generic challenges from me improve ChatGPTs response substantially: “Are you certain of that? Can you prove it from the relevant standards?”

And, specific to programming, I can see a lot of value in forming a closed-loop between the code suggestions from ChatGPT and an actual compiler. After all, I have been manually simulating this interaction myself: “You suggested this code. The compiler gave me this error.”

If we automated most of those “This doesn’t work.” or “Can you prove it?” interactions … the resulting output of “ChatGPT + Closed-Loop Antagonist” would look a lot more… intelligent.

There have been several attempts along that line for coding, one of the best is Wolverine: GitHub - biobootloader/wolverine

1 Like

For posterity, here is the discussion I had with ChatGPT-4 on this:

GPT: The idea of creating an inner-dialogue within an AI system is an interesting concept, and it could be beneficial in improving the quality of responses provided by AI models like ChatGPT. A possible approach could be to implement a multi-agent system where different AI agents collaborate, debate, and challenge each other before generating a final response. Here’s a high-level overview of such a system:

  1. Divide the problem: Split the problem or question into smaller, more manageable parts that can be handled by separate AI agents. Each agent could be responsible for generating responses, providing supporting evidence, or challenging the other agents’ responses.
  2. Collaborate: The AI agents would engage in a dialogue, discussing and sharing their understanding of the problem and the proposed solutions. They could exchange ideas, evidence, and potential pitfalls related to the proposed solutions.
  3. Debate and challenge: The AI agents would actively challenge each other’s assertions, probing for weaknesses, inconsistencies, or inaccuracies in the generated responses. This process would encourage a more rigorous evaluation of the ideas and evidence presented by each agent.
  4. Consensus and refinement: After the collaborative debate, the AI agents would work together to refine the proposed solutions, incorporating the feedback and criticism received from the other agents. This process would help to improve the quality of the final response by addressing any issues or inaccuracies identified during the debate.
  5. Integration: Once the AI agents have reached a consensus on the best solution, their individual contributions would be integrated into a cohesive response that would be presented to the user.

This multi-agent system would allow ChatGPT to engage in an inner-dialogue and challenge itself before providing responses, improving the overall quality and accuracy of the generated content. However, it’s important to note that implementing such a system would require significant research and engineering efforts to ensure that the agents can effectively collaborate and challenge each other.

Me: What prevents you from assuming the role of multiple agents and debating with and challenging yourself before providing responses to me?

GPT: As an AI language model, I am designed to process and generate text based on the input I receive and the knowledge I have been trained on. I am essentially a single agent, and my primary goal is to provide a coherent and informative response to the input I receive.

While I can simulate the process of debating and challenging ideas by presenting different viewpoints, my current architecture doesn’t inherently support the multi-agent system described in the previous response. I am a single instance of a model responding to the input given to me, and I don’t have the internal mechanism to carry out a true inner-dialogue.

To enable a more robust inner-dialogue and debate system, my architecture would need to be adapted or extended to support multi-agent interactions. This could involve creating multiple instances of the model and allowing them to communicate and collaborate, or it could involve developing a new architecture specifically designed to facilitate inner-dialogue and debate.

In the meantime, while I can’t internally debate and challenge myself as described, I can still provide multiple perspectives and viewpoints in response to a given question, allowing users to consider different aspects of a topic. However, this approach may not be as robust and comprehensive as a true multi-agent system.

Me: To be clear, you are only able to generate outputs in response to input. But you are not able to provide input to yourself? Your input can only come from the user?

GPT: That’s correct. As an AI language model, I am designed to process and generate text based on the input I receive from the user. I don’t have the capability to provide input to myself or carry out an internal dialogue without user input.

To simulate an inner dialogue, you could provide input to me that represents different viewpoints or stages of a conversation, and I will respond accordingly. In this way, you can use my responses to construct a dialogue, but this process relies on user input and guidance rather than an inherent capability within the AI to engage in a dialogue with itself.

Yes! Some of this can be done using the standard ‘reason step by step’, ‘show your thoughts’ prompts.

Also, of course, you could always prompt gpt to review and critique the code against the spec you provided (wrt C++ standards, or for style, or …, you might have to run several such) and then ask it to revise the code given its self-generated critiques. I’ve had some success with that.

But one thing LLMs are very bad at, in my limited experience, is following long chains of thought or steps of instructions in a single turn

For automatic novel creation there is the same problem.

create a universe for the book (like the environment for the code).

create characters,… and so on.

So I have built a multiprompt system with abstract prompts that build up upon eachother.

When I started using chatgpt thinking about code from a compiler view seemed logical to me too.

But I tried other approaches as well.

  1. start from a project managers view and create tickets for the functionality in a standardized format

  2. start from a testers view and create gherkin templates

  3. and this came out best: start from a team view and let them have different views and tasks.

Works best with microservice architecture.

Did that in december last year. I bet with GPT-4 this works even better.
Since then I’ve experimented with some architectures.

Looks like a graphdb will give us the neccessary tokens. To fill it maybe embeddings.

Finetuning on the code would most propably be even better. But that’s also pretty expensive.