Multiagent debate
There are provided solutions for multiagent debate. In a method, a first and a second response representation are determined by a first and a second agent in a plurality of agents based on a first query representation for a query in a natural language, respectively, and the first and second response representations are convertible to a first and a second answer to the query in the natural language, respectively. A second query representation is obtained based on the first query representation, and at least one of the first and second response representations. A response representation is determined based on the second query representation by at least one of the first and second agents, and the response representation is convertible to an answer to the query in the natural language. These agents communicate in an embedding space without a conversion between a natural language format and an embedding format.
1 . A computer-implemented method for replying to a user query based on multiagent debate, comprising:
receiving, by a computing device and from a user device, a query in a natural language;
transmitting, by the computing device, a first query representation for the query to a first and a second agent in a plurality of agents, the first query representation being in an embedding space of a tokenizer that is shared among the plurality of agents;
receiving, by the computing device, a first and a second response representation determined by the first and the second agents in the plurality of agents based on the first query representation for the query in the natural language, respectively, the first and second response representations being in the embedding space and being convertible to a first and a second answer to the query in the natural language, respectively;
obtaining, by the computing device, a second query representation based on the first query representation, and at least one of the first and second response representations, the second query representation being in the embedding space;
transmitting, by the computing device, the second query representation to the first and second agents;
receiving, by the computing device, a response representation determined based on the second query representation by at least one of the first and second agents, the response representation being in the embedding space and being convertible to an answer to the query in the natural language; and
converting, by the computing device, the response representation from the embedding space of the tokenizer into the answer in the natural language and providing the answer to the user device.
2 . The method of claim 1 , wherein determining the response representation comprises:
determining a third response representation by the first agent based on the second query representation, and determining a fourth response representation by the second agent based on the second query representation, the third and fourth response representations being convertible to an answer to the query in the natural language; and
selecting, from the third and fourth response representations, the response representation for generating an answer to the query in the natural language.
3 . The method of claim 2 , wherein determining the response representation further comprises:
obtaining a third query representation based on the second query representation, and at least one of the third and fourth response representations; and
determining the response representation based on the third query representation by at least one of the first and second agents.
4 . The method of claim 2 , wherein selecting the response representation comprises: selecting the response representation from the third and fourth response representations based on respective distributions related to respective vocabularies that are determined according to the third and fourth response representations, the respective vocabularies are included in a vocabulary table shared among the plurality of agents.
5 . The method of claim 1 , wherein the answer comprises a previous portion including at least one vocabulary and a current vocabulary that follows the previous portion, the at least one vocabulary and the current vocabulary are included in a vocabulary table shared among the plurality of agents, and determining the first response representation by the first agent based on the first query representation comprises:
obtaining, based on the first query representation and a previous representation for the previous portion, a current representation for the current vocabulary by the first agent; and
determining the first response representation based on the previous representation and the current representation.
6 . The method of claim 5 , wherein obtaining the current representation comprises:
determining a distribution related to a plurality of vocabulary representations respectively corresponding to a plurality of vocabularies that are defined in a vocabulary table shared among the plurality of agents; and
determining the current representation by weighting the plurality of vocabulary representations according to the distribution.
7 . The method of claim 1 , further comprising: generating the answer to the query in the natural language based on the response representation by converting the response representation into at least one vocabulary that are defined in a vocabulary table shared among the plurality of agents.
8 . The method of claim 7 , wherein the response representation comprises a plurality of vocabulary representations, and generating the answer comprises: generating a plurality of vocabularies based on the plurality of vocabulary representations according to a tokenizer, the tokenizer describing an association relationship between a vocabulary in a plurality of vocabularies that are defined in the vocabulary table and a vocabulary representation for the vocabulary.
9 . The method of claim 8 , wherein with respect to a vocabulary representation in the plurality of vocabulary representations, the generating is ended in response to any of:
a determination that the vocabulary representation corresponds to an end vocabulary in the vocabulary table; or
a determination that a size of the generated vocabularies reaches a predetermined threshold.
10 . The method of claim 1 , wherein obtaining the second query representation comprising: combining the first query representation, and at least one of the first and second response representations.
11 . The method of claim 1 , further comprising: determining a fifth response representation by a third agent in the plurality of agents based on the first query representation, the fifth response representation being convertible to an answer to the question in the natural language; and
wherein obtaining the second query representation further comprises: determining the second query representation based on the first query representation, and at least one of the first, second, and fifth response representations.
12 . The method of claim 11 , wherein determining the response representation further comprises: determining the response representation based on the second query representation by at least one of the first, second, and third agents.
13 . An electronic device, comprising a computer processor coupled to a computer-readable memory unit, the memory unit comprising instructions that when executed by the computer processor implements a method for replying to a user query based on multiagent debate, the method comprising:
receiving by a computing device and from a user device, a query in a natural language;
transmitting, by the computing device, a first query representation for the query to a first and a second agent in a plurality of agents, the first query representation being in an embedding space of a tokenizer that is shared among the plurality of agents;
receiving, by the computing device, a first and a second response representation determined by the first and the second agents in the plurality of agents based on the first query representation for the query in the natural language, respectively, the first and second response representations being in the embedding space and being convertible to a first and a second answer to the query in the natural language, respectively;
obtaining, by the computing device, a second query representation based on the first query representation, and at least one of the first and second response representations, the second query representation being in the embedding space;
transmitting, by the computing device, the second query representation to the first and second agents:
receiving, by the computing device, a response representation determined based on the second query representation by at least one of the first and second agents, the response representation being in the embedding space and being convertible to an answer to the query in the natural language; and
converting, by the computing device, the response representation from the embedding space of the tokenizer into the answer in the natural language and providing the answer to the user device.
14 . The device of claim 13 , wherein determining the response representation comprises:
determining a third response representation by the first agent based on the second query representation, and determining a fourth response representation by the second agent based on the second query representation, the third and fourth response representations being convertible to an answer to the query in the natural language; and
selecting, from the third and fourth response representations, the response representation for generating an answer to the query in the natural language.
15 . The device of claim 14 , wherein determining the response representation further comprises:
obtaining a third query representation based on the second query representation, and at least one of the third and fourth response representations; and
determining the response representation based on the third query representation by at least one of the first and second agents.
16 . The device of claim 14 , wherein selecting the response representation comprises: selecting the response representation from the third and fourth response representations based on respective distributions related to respective vocabularies that are determined according to the third and fourth response representations, the respective vocabularies are included in a vocabulary table shared among the plurality of agents.
17 . The device of claim 13 , wherein the answer comprises a previous portion including at least one vocabulary and a current vocabulary that follows the previous portion, the at least one vocabulary and the current vocabulary are included in a vocabulary table shared among the plurality of agents, and determining the first response representation by the first agent based on the first query representation comprises:
obtaining, based on the first query representation and a previous representation for the previous portion, a current representation for the current vocabulary by the first agent; and
determining the first response representation based on the previous representation and the current representation.
18 . The device of claim 17 , wherein obtaining the current representation comprises:
determining a distribution related to a plurality of vocabulary representations respectively corresponding to a plurality of vocabularies that are defined in a vocabulary table shared among the plurality of agents; and
determining the current representation by weighting the plurality of vocabulary representations according to the distribution.
19 . The device of claim 13 , further comprising: generating the answer to the query in the natural language based on the response representation by converting the response representation into at least one vocabulary that are defined in a vocabulary table shared among the plurality of agents.
20 . A non-transitory computer program product, the non-transitory computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by an electronic device to cause the electronic device to perform a method for replying to a user query based on multiagent debate, the method comprising:
receiving, by a computing device and from a user device, a query in a natural language;
transmitting, by the computing device, a first query representation for the query to a first and a second agent in a plurality of agents, the first query representation being in an embedding space of a tokenizer that is shared among the plurality of agents;
receiving, by the computing device, a first and a second response representation determined by the first and the second agents in the plurality of agents based on the first query representation for the query in the natural language, respectively, the first and second response representations being in the embedding space and being convertible to a first and a second answer to the query in the natural language, respectively;
obtaining, by the computing device, a second query representation based on the first query representation, and at least one of the first and second response representations, the second query representation being in the embedding space;
transmitting, by the computing device, the second query representation to the first and second agents;
receiving, by the computing device, a response representation determined based on the second query representation by at least one of the first and second agents, the response representation being in the embedding space and being convertible to an answer to the query in the natural language; and
converting, by the computing device, the response representation from the embedding space of the tokenizer into the answer in the natural language and providing the answer to the user device.