• No se han encontrado resultados

Quantum Sampler

In document facultad de ingeniería y computación (página 51-56)

All the test for the overall Quantum Sampler are done with DWave quantum computer.

We use the default values described at the beginning of this chapter. Additionally, we use a domain of [-10000, 10000], and 1-best-greedy search to compare the proposed method . Likewise the argmax tests, these sequences also start with a default score of 1.0.

The quantity of tests done is not high because of the limits on credits to use the quantum computer. Additionally, because of the size of the QPU, only small ms are tested.

The tests done for the overall Quantum Sampler involves decoding sequences from 2 to 5 time-steps long. The answers when decoding more than one time-step are not one-hot vector encoding. However, when 1-greedy search is executed towards this new search-space, encouraging results are encountered.

At table 5.1 the results for 2 time-steps are displayed. A total of 9 tests are displayed in which only one test fails to be greater or equal that its greedy counterpart. However, the di↵erence is quite small.

m QA Greedy Real Generated Sequence Di↵erence 2

2.31 2.34 2.41 [[-1, 1], [-1, 1]] -0.03 2.72 2.46 2.82 [[1, -1], [1, -1]] 0.26

0.99 0.99 1.47 [[-1, 1], [-1, 1]] 0

3

2.58 2.58 2.8 [[-1, -1, -1], [-1, 1, -1]] 0 1.81 1.56 2.84 [[1, -1, 1], [1, -1, 1]] 0.25 2.61 2.61 2.61 [[1, -1, -1], [1, -1, -1]] 0 4

2.59 2.2 2.92 [[1, -1, -1, -1], [1, -1, -1, 1]] 0.39 2.83 2.07 2.92 [[-1, 1, 1, -1], [1, -1, 1, -1]] 0.76 2.74 2.74 2.76 [[-1, 1, 1, -1], [-1, -1, -1, -1]] 0

Table 5.2: Tests for 2 time-steps. Columns from 1 to 4 have the scores of the proposed quantum sampler, 1-best-greedy sampler, and the real result respectively. The generated sequence is the output of the proposal, and the di↵erence is given by the subtraction of the third column to the second column. Numbers in bold of the second column highlight results whose value is better. While numbers underlined in the same column highlight global optimal answers.

m QA Greedy Real Generated Sequence Di↵erence 2

3.11 3.06 3.2 [[-1, 1], [-1, 1], [-1,1]] 0.05 3.36 3.36 3.72 [[-1, 1], [-1, -1], [1, -1]] 0 1.09 1.09 2.05 [[-1, 1], [-1, 1], [-1, 1]] 0 3

3.46 2.91 3.83 [[-1, -1, 1], [-1, 1, -1], [-1, -1, 1]] 0.55 2.71 1.18 3.74 [[1, -1, 1], [1, -1, 1], [1, 1, -1]] 1.53 3.58 3.58 3.58 [[1, -1, -1], [1, -1, -1], [1, -1, 1]] 0

Table 5.3: Results of 6 tests for 3 time-steps.

According to table 5.1 on 44.44% of the test-cases our proposal found a better answer. Additionally we can say that in in 55.55% (i.e. 5 tests out of 9) the QA sampler finds either a better or a global optimal solution.

The reader may have notice that the generated sequence is not a one-hot encoding vector. When a time-step does not contain a solution at all, then we choose greedily among all tahn values for this time-step.

In another scenario, we may found more various ones for a time-step. In this scenario, we choose greedily among the tahn values that correspond to the activated indices. For example, look at the first time-step of the second test for m = 3 in table 5.1. This time-step have indices 0 and 2 activated, therefore only the highest value among thetahn values that correspond to indices 0 and 2 is chosen.

The same procedure to test 2 time-steps is applied to test 3 time-steps. In these tests the results improve, since the percentage of answer that either improve greedy-based samplers or find global optimums increase to 83.33%. The reader can notice that the output sequence is indeed pruning search space and guiding the search space toward better answers in most of the test-cases.

The results of 20 test-cases for 4 time-steps are described next by Figure 5.11. Notice

how the results of our QA sampler tends to always stay close to the real result. When the greedy sampler fails to find global optimum is very far from the answers compared to the scenario when the QA sampler fails. The total sum of scores for the QA sampler is 51.69, while the greedy sampler sums 37.93.

In these test-cases our sampler outputs on 35% of the test-cases better answers than the greedy approach. While in 45% of the cases it outputs a global optimum. Is important to reveal that only 0.78% of all possible answers are global optimums, therefore we can conclude that our sampler is able to track global optimums. Only in 3 out of the 20 test-cases our sampler gives a slightly worst answer that the greedy approach.

Figure 5.11: Results of 20 tests for 4 time-steps that compares the proposed quantum sampler, 1-best-greedy sampler, and the global optimal. Test are done with m= 2.

.

Figure 5.12: Results of 10 tests for 5 time-steps that compares 1-best-greedy sampler and the proposed quantum sampler. Test are done with m= 2.

.

Finally, Figure 5.12 displays the results for 5 time-steps. Results for 5 time-steps are as well encouraging, since it only fails to output a score better than the greedy approach

in one of these test-cases. In 70% (i.e 7 out 10 tests) it outputs a better answer than the greedy approach.

Chapter 6

Conclusion and Future Works

This work gives insights to start including quantum technologies to NLP. At the very first chapters, it is shown why it is important to keep the ongoing research and encourage even more of these. Moreover, it is also highlighted the need to develop a new kind of sampler and how quantum computers can be useful due to their nature.

The contributions of this work are given by the various ISING models developed for sigmoid of a summation, XNOR quantum gate (sign extraction), argmax function, and even the whole quantum RNN for sampling.

The individual components that build the quantum RNN has been proved, empiri- cally, that they can indeed compute what they claim. While the overall proposal shows that indeed the search space can be computed more e↵ectively since we demonstrated the the outputs tends to always stay close to the global optimum.

As far as we know, we can claim that this is the first sampler for NLP done based on QA, and it was tested on a real quantum computer.

6.1 Problems Encountered

The problems encountered throughout the development of this work are three:

• Access to the Quantum Computer: The access to the quantum computer is still somehow restricted. The quota given each month is not enough for exhaustive testing in research. This quota also includes programming and reading time, and in most situations, sampling only one time is not enough to get the actual result.

Also more annealing time can be tested, however, this can increment a lot the time spent on the quantum computer.

• QPU: Even though QA is one of the most advanced paradigms with 2040 pro- grammable qubits, it is still a small amount for read world data. Moreover, because of the architecture (i.e k4,4 graph) qubits are not fully connected and ancillas must be created.

• Control of the quantum environment: During testing we noticed that sometimes the computer gives wrong answers for all tests, even though testing with the same parameters can also give all the right answers.

In document facultad de ingeniería y computación (página 51-56)

Documento similar