- AI
- A
Multi-agent scheme in ChatGPT or the benefits of schizophrenia
This story is a real case about one of the ways to make ChatGPT do exactly what you want, rather than what it ends up doing.
Spoiler: As a result, I got from ChatGPT what I wanted. However, the path I had to take strongly resembles a comedy with elements of a detective story.
Spoiler: The prompt is present. It may be useful for sorting weakly structured text arrays of information.
Task conditions:
I needed to write a script for a documentary video lasting about an hour, with elements of analytics. Let's assume it's about Elon Musk (all names and details are fictional and have no relation to our reality).
Search
With the help of ChatGPT, I gathered initial information wonderfully:
I tasked it to search in both Russian and English sources, with links to the original source.
I set the style of presentation. After all, it doesn't just search for information, it RETELLS it. So let it at least retell it in the desired style, not in its friendly-dumb-politically correct sterilized manner.
I often agreed to its suggestions that it could provide additional details.
If an interesting nuance emerged, I asked for information about it as well.
In short, I was satisfied.
I sincerely recommend ChatGPT for situations where a deep search on mass topics is needed.
In the end, I had a 120-page file with poorly structured information.
Poorly structured because when you ask it to “tell in all details,” it starts with the background and ends with conclusions. And I constantly deviated from the main thread to gather additional information.
Next, I had to organize this 120-page file, otherwise I would have drowned in it.
Attempt 1
The first logical thought: to ask ChatGPT to sort this file according to a timeline, that is, in chronological order. It's a logical thought, right?
Two things became clear:
120 pages won't fit into it. Well, that's okay, I can try in parts.
It had already forgotten what it had found and retold to me.
Here is the second one - it's critical. It makes sorting impossible.
Attempt 2
Okay, I decided to try feeding it the information it gathered itself and retelling it to me according to the timeline.
ChatGPT has 2 problems that really annoy me:
The friendly-dumb American style of presentation. Regarding the term “dumb,” the complaints are not against me, but against Mikhail Zadornov, who revealed and justified this fact.
It sterilizes the material. Specific names, dates, and geographical names disappear from the material. What remains is a hollow retelling with the narrative “for all good against all bad.”
This can be fought against, but one must remember this feature of its.
I didn’t remember, and the material that ChatGPT produced for me resembled a sweet, jelly-like fairy tale.
There are two options:
Train ChatGPT. But I am working on different texts, and I am not sure that a trained version won’t ruin all subsequent materials for me.
In each prompt, give it instructions about the writing style and about preserving factual data. Although, it might not help.
Attempt 3
Okay, I set the style of presentation. I firmly instructed it to preserve all factual data. I categorically ordered it to write all the details!
The result turned out to be… well, let's say, paradoxical.
It told me in the required style, with a lot of details.
However, I suddenly came across some new names and events.
I thought, could this be information from that part of the raw material that I haven’t read yet?
But the fact that the mother of the conditional Elon Musk was now called something else instilled vague doubts in me…
It turned out that it had indeed made up half of it itself and qualitatively embedded it into the original information.
So the experiment failed again.
Attempt 4
But I am persistent. I am too lazy to sort through the information manually all day. I would rather spend two days making the computer do it!
I asked ChatGPT how it would advise solving the problem that arose.
It suggested marking up the original material. To which I ultimately had to agree.
I made the markup. I firmly ordered not to change the original text under any circumstances. I sent it for execution.
And what? Do you think that's where it all ended?
After receiving the material from ChatGPT, I quickly looked at what I got and rejoiced! The material that was in front of me was organized according to my identifiers!
Then I checked the volume of the original material that I fed to GPT and the one I received from it.
The received material was about 2 times smaller(((
No, I understand that there was a lot of duplicated information in the original material because I conducted multiple searches. But the question is what it removed - less or more suitable information blocks for me?
Then we had a conversation. To put it concisely, I will summarize in my own words:
I: Listen, but this is not all the information...
He: All of it.
I: Return the text to its pre-editing state.
He: Returned.
I: But look, here is the phrase “XXX”, and it is missing in the final document?
He: There is no phrase “XXX” here.
I: And what is this?
He: This phrase is absent in the template of the processed document. Update the template?
I: Well, update it.
He: I cannot update the template, possibly due to too complex formatting. And in general, you have run out of your limit, further work is possible in 3 hours.
Attempt 5
I was about to give up and do it manually. But then the information popped into my head that GPT is based on vectorization.
That is, I see text. And instead of this text, it sees numbers.
And if I have two blocks of text in front of me that are very similar, then it sees the same number. And why does it need two identical numbers? One is enough.
This gave me a solution. I decided to use an agent-based scheme.
Here’s what ChatGPT says about it: This can be an effective and structured way to solve complex problems. This approach is called multi-agent scheme and works similarly to a conveyor, where the result of one stage is passed to the next.
It turns out that if you induce schizophrenia in ChatGPT, that is, a split (disorder, etc.) of personality, you can better control each individual stage of information processing. Because for these separate personalities within GPT, the task is simplified, as the mutual influence of the stages of information processing is reduced.
Further, it’s not interesting; everything worked after that.
Only, it’s better to upload files for processing in TXT format. In this case, the final file that ChatGPT offers to download is also in TXT format. When trying to upload a file in PDF, the final file is generated on a canvas. And there, unexpected things can happen. Or a third agent is needed to display it on the canvas. Schizophrenia is like that… multifaceted.
Here’s a working prompt:
We have a multi-stage task: we need to sort the text into semantic blocks.
Terms:
- Source document: the text that is sent for processing.
- Final document: the text resulting from the processing.
- Identifier: five characters in the format "::NNN", where "NNN" is three digits.
- Text block: an immutable block of text that starts with an identifier and ends before the next identifier or at the end of the document.
Important: text blocks cannot be changed, shortened, rephrased, reformatted, or excluded. They can only be reordered.
Processing steps:
We use two agents — an analyst and an archivist. Each performs their part of the work.
1. Analyst:
- Identifies text blocks in the source document.
- Passes each text block along with its identifier to the archivist.
2. Archivist:
- Receives text blocks and identifiers from the analyst.
- Inserts the text block into the final document.
Insertion order:
1. If there are already blocks with the same identifier in the final document, the new block is placed after them.
2. If there are no blocks with that identifier, the new block is placed after all blocks with smaller identifiers.
Example:
Source document:
::002
This is the text of block 002.
::001
This is the text of block 001.
::003
This is the text of block 003.
Final document:
::001
This is the text of block 001.
::002
This is the text of block 002.
::003
This is the text of block 003.
END
Write comment