Conversion apparatus, conversion method, and program

By integrating kNN machine translation with perturbation and diversified beam search, the system addresses the lack of diversity in conventional machine translation, improving candidate sentence variety without compromising accuracy.

JP2024124959AInactive Publication Date: 2024-09-13NIPPON TELEGRAPH & TELEPHONE CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
JP2023032978
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2024-09-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Conventional machine translation systems struggle to output diverse translation candidate sentences due to issues like reduced diversity in beam search and overcorrection in cross-entropy loss, limiting the effectiveness of diversification methods.

Method used

The proposed solution involves using kNN machine translation with perturbation during k-neighborhood search, combined with diversified beam search, to expand the search range and generate more diverse translation candidates.

Benefits of technology

This approach enhances the diversity of translation candidates while maintaining translation accuracy and fluency, as confirmed by experimental results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024124959000001
    Figure 2024124959000001
Patent Text Reader

Abstract

To provide a technique that enables a variety of sequence candidates to be output in sequence transformation.SOLUTION: A conversion apparatus comprises: a conversion unit for converting a first sequence, which is a sequence of a plurality of elements, into a second sequence; a data store for storing a plurality of pairs of feature amounts and elements corresponding to the feature amounts; and a search unit for searching the data store while applying a perturbation using the feature amount obtained during the conversion from the first sequence to the second sequence by the conversion unit. The conversion unit generates the second sequence using the elements extracted from the data store by the search unit and the feature amounts obtained during the conversion.SELECTED DRAWING: Figure 11
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the technical field of machine translation. [Background technology]

[0002] In this specification, references are indicated by numbers such as "[1]", and the names of the references corresponding to the numbers are listed at the end of the specification.

[0003] In recent years, machine translation, which is a method of translation by computers, has become widespread. In machine translation, it is important that the machine translation system can output multiple, diverse and appropriate translation candidate sentences. The reason for this is that, for example, by using multiple diverse translation candidate sentences, the translation accuracy can be improved through downstream processing such as reranking [1] and manual post-editing [2]. [Prior art documents] [Non-patent literature]

[0004] [Non-Patent Document 1] Ashwin Vijayakumar, Michael Cogswell, Ramprasaath Selvaraju, Qing Sun, Stefan Lee, David Crandall, and Dhruv Batra. Diverse beam search for improved description of complex scenes. Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 32, No. 1, Apr. 2018. Summary of the Invention [Problem to be solved by the invention]

[0005] However, in the conventional techniques such as Non-Patent Document 1, multiple translation candidate sentences are output similarly, making it difficult to output a variety of translation candidate sentences. Note that this problem is not limited to translation, but can occur in sequence conversion.

[0006] The present invention has been made in consideration of the above-mentioned points, and has an object to provide a technique that enables a variety of sequence candidates to be output in sequence transformation. [Means for solving the problem]

[0007] According to the disclosed technology, a conversion unit that converts a first sequence, which is a sequence of a plurality of elements, into a second sequence; a data store that stores a plurality of pairs of features and elements corresponding to the features; a search unit that searches the data store while applying a perturbation using a feature amount obtained during the process of conversion from the first sequence to the second sequence by the conversion unit; The conversion unit generates the second sequence using the elements extracted from the data store by the search unit and features obtained during the conversion. A conversion device is provided. Effect of the Invention

[0008] The disclosed technology provides a technology that enables a variety of sequence candidates to be output in sequence transformation. [Brief description of the drawings]

[0009] [Figure 1] This is a diagram showing the encoder-decoder model. [Diagram 2] FIG. 1 is a diagram for explaining a beam search. [Diagram 3] FIG. 1 is a configuration diagram of a conversion device 100. [Figure 4] 1 is a flowchart illustrating an operation of the conversion device 100. [Diagram 5] FIG. 2 is a diagram for explaining a data store and a k-nearest neighbor search. [Figure 6] FIG. 1 is a diagram illustrating an image of a typical kNN probability calculation. [Figure 7] FIG. 2 is a diagram illustrating an example of a detailed configuration of a kNN search unit 150 in the first embodiment. [Figure 8] FIG. 13 is a diagram illustrating an image of adding noise to a query. [Figure 9] FIG. 11 is a diagram illustrating an example of a detailed configuration of a kNN search unit 150 in the second embodiment. [Figure 10] FIG. 13 is a diagram showing an image of Example 2. [Figure 11] FIG. 1 is a configuration diagram of a conversion device 100. [Figure 12] FIG. 2 illustrates an example of a hardware configuration of the apparatus. [Figure 13] FIG. 13 is a diagram showing experimental results. [Figure 14] FIG. 13 is a diagram showing experimental results. [Figure 15] FIG. 13 is a diagram showing experimental results. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] Hereinafter, an embodiment of the present invention (the present embodiment) will be described with reference to the drawings. The embodiment described below is merely an example, and the embodiment to which the present invention is applied is not limited to the following embodiment.

[0011] Hereinafter, machine translation refers to machine translation using a neural network (referred to as neural machine translation). However, the technology according to the present invention is not limited to neural machine translation and can be applied to machine translation in general. Note that neural machine translation may be referred to as NMT (Neural Machine Translation).

[0012] Furthermore, the technology according to the present invention is not limited to translation, but can be applied in the general field of converting a sequence, which is a string of multiple elements. For example, the technology according to the present invention can be applied to converting sentences in the same language, converting sentences to images, converting images to sentences, and converting images to images. Note that a sentence is an example of a sequence, and words or tokens are examples of elements that make up a sequence.

[0013] (About the assignment) First, the problems of the technology according to the present embodiment will be described in detail. The problems described here are problems of the technology according to the embodiment. In the following description of the problems, the contents disclosed in the reference documents are publicly known, but the contents of the description of the problems are not publicly known.

[0014] As mentioned above, it is important for a machine translation system to output multiple, diverse and plausible translation candidates, because this allows for subsequent processing such as reranking[1] and manual post-editing[2] to improve the translation accuracy.

[0015] However, it is known that the beam search, which is the standard search algorithm for NMT systems, has a problem of reducing diversity, in that the multiple translation candidates output are almost identical [2,3,4]. In response to this problem, Vijayakumar et al. [3] and Freitag et al. [4] have proposed a variant of beam search (diversified decoding method, diversified beam search method) that promotes the diversity of translation candidates.

[0016] On the other hand, models trained using cross-entropy loss, a standard loss function for NMT systems, are known to have a problem with overcorrection[5]. Overcorrection is the phenomenon in which the output probability is excessively underestimated for predictions of a distribution that differs from the distribution of the training data, even if the prediction is valid. Therefore, simply applying the diversified decoding method described above to the probability distribution output by a standard NMT system may result in tokens that are valid but have a low output probability and are difficult to include in translation candidates, limiting the effect of improving diversity.

[0017] Therefore, it appears that overcorrection needs to be addressed to maximize the effectiveness of diversified decoding techniques.

[0018] As mentioned above, as a variant of beam search (diversified beam search method) that promotes the diversity of translation candidates, Vijayakumar et al. [3] proposed Diverse Beam Search (DBS), a beam search that penalizes token overlap between beams, and Freitag et al. [4] proposed a method to determine the maximum number of candidates that share the same partial hypothesis. However, these methods do not explicitly deal with overcorrection, and there are tokens that are valid but have a low output probability and are unlikely to be included in the output candidates, which is thought to limit the effect of improving diversity.

[0019] (Outline of the embodiment) In this embodiment, we use kNN machine translation [6], a type of example-based machine translation method, as a means to deal with over-correction. Yang et al. [7] have suggested that kNN machine translation can deal with the problem of over-correction because it can search and extract many valid target tokens by k-nearest neighbor search from example data at the time of decoding. However, the k-nearest neighbor search in kNN machine translation limits the search targets, which reduces diversity.

[0020] Therefore, in this embodiment, kNN machine translation is applied, and a method is adopted in which the range in which words (which may be called tokens) are searched for is probabilistically expanded by adding perturbations during k-nearest neighbor search in kNN machine translation. In this embodiment, this method is used in combination with a diversified decoding method to achieve diversification of translation candidates while maintaining translation performance.

[0021] It is also possible not to use the diversified decoding method in combination with the method of adding perturbations during k-nearest neighbor search in kNN machine translation. In other words, it is possible to use the method of adding perturbations during k-nearest neighbor search in kNN machine translation and a general decoding method (such as a decoding method using a general beam search).

[0022] (About machine translation models and beam search) Before describing the device configuration and device operation in this embodiment, an example of a machine translation model used in this embodiment and a beam search used in the decoder will be described below.

[0023] In this embodiment, a general encoder-decoder model is used as the machine translation model. The machine translation model in this embodiment has been trained in advance.

[0024] An example of the basic configuration of an encoder-decoder model is shown in Figure 1. As shown in Figure 1, the encoder-decoder model has an encoder 1 and a decoder 2. In machine translation, a source language sentence (which may also be called a source sentence) is input to encoder 1 as an input sentence (word sequence).

[0025] The encoder 1 extracts features (specifically, vectors) from the input sentence and inputs the features to the decoder 2. The decoder 2 uses the features input from the encoder 1 to generate a hidden state (specifically, vectors) for each time step (which may also be called time), and uses the hidden state to output translated words at the corresponding time step. The sequence of translated words becomes the output sentence. The hidden state may also be called an intermediate state or a feature.

[0026] In outputting the above translated words, more specifically, the decoder 2 generates the probability of each word in a word set (vocabulary), and outputs words with high scores (probabilities) as translated words.

[0027] However, when a series of words is output as an output sentence using the above method, it is difficult to output an appropriate sentence. Therefore, a beam search is used to set a beam width and search for a sentence.

[0028] An overview of beam search will be explained with reference to Figure 2. In Figure 2, the beam width is set to 2. A, B, etc. are each translation words. In Figure 2, after A is obtained first, AB and AC are obtained as the top two scoring sentences. After AB, D and K are obtained, and after AC, C and M are obtained. At this time, out of ABD, ABK, ACC, and ACM, ABD and ACM are selected as the top two scoring sentences. The same process is repeated, and finally two sentences remain. Each of these two sentences is a translation candidate sentence.

[0029] In DBS, which is one of the diversified beam search methods expected to be used in this embodiment, a penalty is imposed on translated words (tokens) that have already been output, suppressing word duplication between beams (candidate sentences). This makes it possible to generate more diverse translation candidate sentences than when using a normal beam search. Note that the diversified beam search method used in this embodiment is not limited to DBS, and for example, nucleus sampling (https: / / arxiv.org / pdf / 1904.09751.pdf) may be used.

[0030] (Example of device configuration) Fig. 3 shows an example of the configuration of the transformation device 100 in this embodiment. As shown in Fig. 3, the transformation device 100 has an input unit 110, an encoding unit 120, a decoding unit 130, an output unit 140, a kNN search unit 150, and a data store 160. The data store may be called a data storage unit 160. The basic operation of each functional unit will be described following the procedure of the flowchart in Fig. 4.

[0031] In S101, the input unit 110 inputs a sentence. The encoding unit 120 corresponds to the encoder 1 shown in Fig. 1. In S102, the encoding unit 120 generates features from the input sentence and passes the features to the decoding unit 130.

[0032] The decoding unit 130 corresponds to the decoder 2 shown in Fig. 1. In S103, a hidden state vector (which may be called a feature) is generated for each time i based on the feature obtained from the encoding unit 120, and is passed to the kNN search unit 150. In S104, the kNN search unit 150 searches the data store 160 using the hidden state vector as a query, and extracts words (translated words) corresponding to the nearby cases. The operation of the data store 160 and the kNN search unit 150 will be described in detail later.

[0033] In S105, the decoding unit 130 receives the translation words (and probabilities) extracted as neighborhood examples from the kNN search unit 150 for each time i, performs a beam search by a diversified beam search method using the received translation words (and probabilities), generates one or more translation candidate sentences, and passes the one or more translation candidate sentences to the output unit 140. The output unit 140 outputs the translation candidate sentences.

[0034] (About kNN machine translation) Before describing in detail the configuration and operation of the kNN search unit 150 that performs searches by applying perturbations, we will first explain the operation of the kNN search unit 150 and data store 160 when performing kNN machine translation using the existing method disclosed in Reference [6].

[0035] kNN machine translation is a technique that applies the mechanism of k-nearest neighbor search to inference in a machine translation model in the two steps shown below (data store construction and decoding), and can achieve better inference by directly accessing large-scale example data.

[0036] <Data store construction> First, a data store is constructed. The data store may be constructed by any device. For example, the data store may be constructed by the conversion device 100, or may be constructed by a device other than the conversion device 100. Here, it is assumed that the data store is constructed by the conversion device 100.

[0037] First, training data is input to the machine translation model. This machine translation model may be the machine translation model of the conversion device 100 (i.e., the encoding unit 120 and the decoding unit 130), or may be a machine translation model other than the machine translation model of the conversion device 100. Here, the description will be given assuming that the machine translation model of the conversion device 100 (i.e., the encoding unit 120 and the decoding unit 130) is used.

[0038] A word (which may be called a token) on the target language side in the training data is used as a key, and a hidden layer representation (called a hidden state vector) corresponding to the word, generated by the decoding unit 130, is used as a value, and these key-value pairs are stored in the data store 160. The key-value pairs are stored in the data store 160 for each training data (pair of source sentence and target sentence) and for each time point i.

[0039] The training data consists of a set of source sentences S and a set of target sentences T, so we write it as (S, T). The hidden state vector at time i for the source sentences s∈S and the target sentences t∈T in the training data is expressed as f(s,t <i ), the data store D is expressed by the following formula (1). <i represents the part of the target sentence up to the time i. In other words, the hidden state vector at time i is expressed as a function f of "the source sentence s and the part of the target sentence before the position of the target sentence corresponding to time i". Also, t i is the word (token) at time position i in the target sentence.

[0040]

number

[0041] <Decoding> Next, a translation for the input sentence x is obtained using the data store 160. Specifically, the process is as follows.

[0042] By inputting an input sentence x to the encoding unit 120, the decoding unit 130 generates a hidden state vector h i and passes it to the kNN search unit 150. As shown in the lower part of Fig. 5, at time i, a string of translated words up to time i (a string of generated tokens) is obtained.

[0043] As shown in FIG. 5, the kNN search unit 150 searches for a hidden state vector h i Let y be the translation word (output token) you want to find. i The data store 160 is searched using the hidden state vector h i It is a set of k hidden state vectors (or a set of k words corresponding to the k hidden state vectors) when k hidden state vectors are extracted in order of distance from each other. k is a predetermined integer of 1 or more.

[0044] The kNN search unit 150 searches for a query h i The k-nearest neighbor probability p kNN is calculated using the following formula (2). In formula (2), d(·) is the distance function, and T is the temperature parameter of the softmax function. For example, by making T larger than 1, it is possible to flatten the word probability distribution.

[0045]

number

[0046] An image of the normal kNN probability calculation is shown in Figure 6. In the example of Figure 6, turtles and two point turtles are obtained as a set N of k neighbors of a query, and the kNN probabilities (k neighbor probabilities) of each are obtained as 0.25 and 0.75.

[0047] Finally, y i The output probability of k-nearest neighbor p kNN and the output probability p MT It is calculated by linear interpolation as shown in the following formula (3), where λ is a hyperparameter that determines the weight of the k-nearest neighbor probability.

[0048]

number

[0049] It has been reported that kNN machine translation can improve translation accuracy without additional model training, and Yang et al. [7] suggest that the reason for the improvement in translation accuracy is the countermeasure against overcorrection by k-nearest neighbor search. In addition, methods to further improve translation performance [8] and overcome the slowness of inference [9,10] have been proposed as variants of kNN machine translation. On the other hand, there is no conventional technology that utilizes kNN machine translation to improve diversity.

[0050] (Proposed method: kNN-Diversify Decoding) In this embodiment, the decoding unit 130 generates multiple translation candidate sentences by a diversified beam search method using output words having probabilities calculated by the above-mentioned kNN search unit 150, thereby generating multiple valid and diverse translation candidate sentences.

[0051] In addition, in order to solve the problem that the range of the k-nearest neighbor search is limited in conventional kNN machine translation and to further improve diversity, the kNN search unit 150 may use a method of probabilistically expanding the search range when performing a k-nearest neighbor search in the data store 160.

[0052] By using this method, it is expected that the k-nearest neighbor search will improve the output probability of valid tokens that are not usually included in the top output probability. Furthermore, by widely searching the output words with that probability distribution using the diversified beam search method, it is possible to generate more valid and diverse translation candidates than by combining the conventional kNN search unit and the diversified beam search method.

[0053] In order to probabilistically expand the search range when performing a k-nearest neighbor search, the kNN search unit 150 adds perturbations during the k-nearest neighbor search. Two specific examples of this method are described below as Example 1 and Example 2. In the following, the example using the kNN search unit 150 already described will be called the "basic example." The following will mainly describe the parts that are different from the basic example.

[0054] <Example 1: Adding noise> First, a first embodiment will be described. In the first embodiment, a kNN search unit 150 adds a noise vector to a query for k-nearest neighbor search. A detailed configuration example of the kNN search unit 150 in the first embodiment is shown in FIG. 7. As shown in FIG. 7, the kNN search unit 150 in the first embodiment includes a neighboring case search unit 151 and a noise addition unit 152.

[0055] The noise adding unit 152 adds noise to the query (hidden state vector). The neighboring case searching unit 151 uses the query with noise added thereto to perform k-nearest neighbor search by the method described in the basic example, and extracts words.

[0056] 8 shows an image of adding noise to a query. In the example of FIG. 8, the noise adding unit 152 adds the output word y i Intermediate representation for h i to the noise vector z i h added i +z i as a query, and passes the query to the neighboring case search unit 151. The neighboring case search unit 151 uses the query to perform the same operation as the kNN search unit 150 described in the basic example.

[0057] That is, the neighborhood example search unit 151 performs a k-nearest neighbor search on the data store 160 to obtain k-nearest neighbors N'. Then, as in Equation 2, the k-nearest neighbor probability is calculated from the obtained N'.

[0058] In the example shown in Figure 8, the result of searching the k nearest neighbors is y i As a result, we get turtle, slider, and terrain, with the respective probabilities being 0.23, 0.33, and 0.46.

[0059] <Example 1: Specific example of adding noise> The noise adding unit 152 adds, for example, a noise vector z i For each time and beam, we use a white Gaussian noise of norm 1, n i With mean m and variance s 2 A random variable a that follows a normal distribution i That is, the noise adding unit 152 generates the noise as a product of z i =a i ×n i As the noise vector z i The parameters m and s can be determined, for example, by using one of the following two methods (Method 1 and Method 2).

[0060] <Method 1: Static noise> In the simplest method, the noise adding unit 152 adds a hyperparameter h m , h s Using m=h m , s=h s By using the above method, static noise is generated. This method probabilistically expands the range of the k-nearest neighbor search without requiring any additional inference cost, and is expected to diversify translation candidate sentences. m , h s can be determined, for example, by performing a preliminary survey of the distribution of data store 160.

[0061] <Method 2: Adaptive noise> Method 2 is a method that does not require a prior investigation of the distribution of the data store. In method 2, the noise addition unit 152 determines the noise magnitude based on the distribution obtained in advance by performing a k-nearest neighbor search at each time. The noise obtained in this way is called adaptive noise.

[0062] Specifically, the noise adding unit 152 performs a normal k-nearest neighbor search on the data store and calculates the maximum distance d max and the standard deviation of the distance to the k nearest neighbors d std We obtain the hyperparameter h m , h s Using m=h m ×d max , s=h s ×d std In this method, the noise magnitude can be determined based on the k-nearest neighbor distribution at each time, so there is no need to investigate the distribution of the data store in advance. However, since the k-nearest neighbor search is performed twice at each time, additional inference costs are required.

[0063] <Example 2: Randomized k-nearest neighbors> Next, a description will be given of Example 2. In Example 2, the range of the k-nearest neighbor search is probabilistically expanded without requiring a prior investigation of the distribution of the data store or additional inference costs, which were drawbacks in Example 1. For this purpose, a randomized k-nearest neighbor that samples a portion of the neighboring points is introduced.

[0064] 9 shows a detailed configuration example of the kNN search unit 150 in the second embodiment. As shown in FIG. 9, the kNN search unit 150 in the second embodiment includes a neighborhood example search unit 151 and a neighborhood randomization unit 153.

[0065] The neighborhood example search unit 151 extracts floor(h×k) neighborhoods using a hyperparameter h that satisfies h>1. The neighborhood randomization unit 153 obtains a randomized k neighborhood N' by uniformly randomly sampling k points from the floor(h×k) neighborhood points. Note that floor(x) is the largest integer equal to or less than x. Subsequent operations are the same as those performed in the kNN search unit 150 in the basic example after obtaining the k neighborhood. FIG. 10 shows an image of the second embodiment. The example in FIG. 10 is an example where h=2.

[0066] In the second embodiment, more neighboring points can be included in the search range, so that translation candidate sentences can be diversified. In addition, there is no need to investigate the distribution of the data store in advance, and a k-nearest neighbor search is performed only once at each time, so no additional inference cost is required.

[0067] (Other configuration examples) In the above example, the kNN search unit 150 and the data store 160 are based on the technology disclosed in Reference [6], but the kNN search unit 150 and the data store 160 are not limited to those based on this technology. For example, the data store 160 can be generated as a collection of pairs of words and features generated from bilingual pairs by any method. In addition, the kNN search unit 150 may be any functional unit that can execute a method for performing a k-nearest neighbor search.

[0068] As described above, the technology according to the present invention is applicable to the field of sequence conversion, not limited to translation. An example of the configuration of a conversion device 100 from this perspective is shown in FIG.

[0069] 11 includes a conversion unit 170, a search unit 180, and a data store 190. In an example in which this is applied to translation, the conversion unit 170, the search unit 180, and the data store 190 correspond to "encoding unit 120+decoding unit 130", the kNN search unit 150, and the data store 160, respectively.

[0070] The conversion unit 170 converts a first sequence, which is a string of multiple elements, into a second sequence. The data store 190 stores multiple pairs of features and elements corresponding to the features. The search unit 180 searches the data store 190 while applying perturbations, using the features obtained in the process of conversion from the first sequence to the second sequence by the conversion unit 170. The conversion unit 170 generates the second sequence using the elements extracted from the data store 190 by the search unit 180.

[0071] (Hardware configuration example) The conversion device 100 described in this embodiment can be realized, for example, by causing a computer to execute a program. This computer may be a physical computer or a virtual machine on the cloud.

[0072] That is, the conversion device 100 can be realized by executing a program corresponding to the processing performed by the conversion device 100 using hardware resources such as a CPU and memory built into a computer. The program can be recorded on a computer-readable recording medium (such as a portable memory) and stored or distributed. The program can also be provided via a network such as the Internet or email.

[0073] Fig. 12 is a diagram showing an example of the hardware configuration of the computer. The computer in Fig. 12 includes a drive device 1000, an auxiliary storage device 1002, a memory device 1003, a CPU 1004, an interface device 1005, a display device 1006, an input device 1007, an output device 1008, and the like, all of which are connected to one another via a bus BS. The computer may further include a GPU.

[0074] The program for realizing the processing on the computer is provided by a recording medium 1001 such as a CD-ROM or a memory card. When the recording medium 1001 storing the program is set in the drive device 1000, the program is installed from the recording medium 1001 to the auxiliary storage device 1002 via the drive device 1000. However, the program does not necessarily have to be installed from the recording medium 1001, but may be downloaded from another computer via a network. The auxiliary storage device 1002 stores the installed program as well as necessary files, data, etc.

[0075] The memory device 1003 reads out and stores the program from the auxiliary storage device 1002 when an instruction to start the program is received. The CPU 1004 realizes functions related to the conversion device 100 in accordance with the program stored in the memory device 1003. The interface device 1005 is used as an interface for connecting to a network, etc. The display device 1006 displays a GUI (Graphical User Interface) or the like according to a program. The input device 1007 is composed of a keyboard and mouse, buttons, a touch panel, etc., and is used to input various operation instructions. The output device 1008 outputs the results of calculations.

[0076] (Summary of the embodiment and effects) The technique according to the present embodiment makes it possible to output a variety of sequence candidates in sequence conversion. More specifically, this is as follows.

[0077] In this embodiment, kNN machine translation is applied, which can take into account words that are not usually included in translation candidate sentences by using a neighborhood search from example data to generate translation candidate sentences, and a method is adopted in which perturbations are applied during the neighborhood search to probabilistically expand the search range. This makes it possible to improve the diversity of translation candidates while maintaining translation accuracy. In addition, the diversity can be controlled by adjusting the magnitude of the perturbation. This effect has been confirmed by experiments, which are described below.

[0078] (About the experiment) <Data, Model, and Hyperparameters> The experiments are broadly divided into two settings: domain adaptation and general domain. In the domain adaptation experiments, we use five domain data sets [12, 13]: German-English Koran, IT, Medical, Law, and Subtitles. In the general domain experiments, we use the WMT'19 German-English translation data set. In both experiments, we use the WMT'19 German-English pre-trained model

[15] available in the fairseq library

[14] to build the data store and translate the test data.

[0079] The beam width was set to 20, and the hyperparameters of the proposed method were selected to be the best ones for the development data. DBS was used as the diversified decoding method. The number of groups in DBS was set to 20, and the diversity strength was set to 0.5. We also performed experiments with Neucleus Sampling

[11] , and the results were roughly similar to those of DBS.

[0080] <Evaluation index> Translation capabilities: Translation performance is evaluated using Oracle BLEU, Median BLEU, and average sentence length ratio. Oracle BLEU (BLEU@N) is the BLEU when the sentence with the highest sentence-level BLEU

[16] is selected from the N-best candidate sentences, and corresponds to the upper bound of performance achieved by reranking. In the experiments, we report BLEU@1 and BLEU@20. Note that BLEU@1 (Oracle BLEU for 1-best translation) is the normal BLEU. Median BLEU (MedBLEU) is the BLEU when the sentence with the median sentence-level BLEU is selected from the N-best candidate sentences, and indicates the overall average translation quality.

[0081] The average sentence length ratio (AveLen) is the average ratio of the sentence length of the translation candidates to the sentence length of the reference translation.

[0082] Diversity: We use the BLEU based discrepancy metric (DP)

[17] to measure the diversity of translation candidates. DP is an index that indicates the number of unique n-grams contained in the output candidate sentences, and a higher DP indicates higher diversity.

[0083] Fluency: We use the pseudolog-likelihood score (PLL)

[18] as an indicator of the fluency of translation candidates. In our experiments, we report the average PLL across all translation candidates (AvePLL) and the average maximum / minimum PLL values ​​(MaxPLL / MinPLL) for each N-best candidate sentence. We also report the AvePLL of the reference translation for comparison. We used the multilingual BERT

[19] MLM model to calculate PLL.

[0084] <Experimental Results> Domain Adaptation: The results of averaging across domains are shown in Figure 13. The proposed method, kNN+DBS, improved DP compared to DBS. BLEU@20 decreased compared to kNN, but the decrease was about the same as the difference between the baseline and DBS. In addition, adding perturbations improved DP and BLEU@20 compared to kNN+DBS. There was no significant difference in BLEU and DP depending on the type of perturbation. kNN has a slightly lower PLL compared to the baseline, but the proposed method's PLL is almost unimpaired compared to kNN, and the difference is small compared to the PLL of the reference translation. From the above, it can be seen that the proposed method can improve the diversity of translation candidates without reducing translation accuracy and fluency by setting domain adaptation.

[0085] General domain: The evaluation results are shown in Figure 14. Comparing the proposed method, kNN+DBS, with DBS, DP and various BLEUs are improved, and adding perturbations further improves DP while maintaining BLEU. In addition, the PLL of the proposed method is higher than that of the reference translation, and does not decrease when compared to the baseline. Therefore, even in general domains, the proposed method promotes diversification while maintaining translation accuracy and fluency.

[0086] <Trade-off between translation performance and diversity> To observe the effect of the magnitude of perturbation on translation accuracy and diversity, the relationship between the magnitude of perturbation and DP and BLEU in a randomly selected k neighborhood in the IT domain is shown in Figure 15. Figure 15 shows the effect of the magnitude of perturbation h (horizontal axis) on translation accuracy and diversity (vertical axis) in a randomly selected k neighborhood in the IT domain. The score for h=1 is the value without perturbation, i.e., DBS+kNN. Figure 15 shows that there is a trade-off between DP and various BLEUs, and that the proposed method can adjust diversity and translation accuracy by changing the magnitude of perturbation.

[0087] Although the present embodiment has been described above, the present invention is not limited to such a specific embodiment, and various modifications and variations are possible within the scope of the gist of the present invention described in the claims.

[0088] (References) [1] Jiwei Li and Dan Jurafsky. Mutual information and diverse decoding improve neural machine translation. arXiv preprint arXiv:1601.00372, 2016. [2] Kevin Gimpel, Dhruv Batra, Chris Dyer, and Gregory Shakhnarovich. A systematic exploration of diversity in machine translation. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1100- 1111, Seattle, Washington, USA, October 2013. Association for Computational Linguistics. [3] Ashwin Vijayakumar, Michael Cogswell, Ramprasaath Selvaraju, Qing Sun, Stefan Lee, David Crandall, and Dhruv Batra. Diverse beam search for improved description of complex scenes. Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 32, No. 1, Apr. 2018. [4] Markus Freitag and Yaser Al-Onaizan. Beam search strategies for neural machine translation. In Proceedings of the First Workshop on Neural Machine Translation, pp. 56-60, Vancouver, August 2017. Association for Computational Linguistics. [5] Wen Zhang, Yang Feng, Fandong Meng, Di You, and Qun Liu. Bridging the gap between training and inference for neural machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4334-4343, Florence, Italy, July 2019. Association for Computational Linguistics. [6] Urvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. Nearest neighbor machine translation. In International Conference on Learning Representations, 2021. [7] Zhixian Yang, Renliang Sun, and Xiaojun Wan. Nearest neighbor knowledge distillation for neural machine translation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 5546-5556, Seattle, United States, July 2022. Association for Computational Linguistics. [8] Xin Zheng, Zhirui Zhang, Junliang Guo, Shujian Huang, Boxing Chen, Weihua Luo, and Jiajun Chen. Adaptive nearest neighbor machine translation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pp. 368-374, Online, August 2021. Association for Computational Linguistics. [9] Dexin Wang, Kai Fan, Boxing Chen, and Deyi Xiong. Efficient cluster-based k-nearest-neighbor machine translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2175-2187, Dublin, Ireland, May 2022. Association for Computational Linguistics.

[10] Yuxian Meng, Xiaoya Li, Xiayu Zheng, Fei Wu, Xiaofei Sun, Tianwei Zhang, and Jiwei Li. Fast nearest neighbor machine translation. In Findings of the Association for Computational Linguistics: ACL 2022, pp. 555-565, Dublin, Ireland, May 2022. Association for Computational Linguistics.

[11] Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. In International Conference on Learning Representations, 2020.

[12] Philipp Koehn and Rebecca Knowles. Six challenges for neural machine translation. In Proceedings of the First Workshop on Neural Machine Translation, pp. 28-39, Vancouver, August 2017. Association for Computational Linguistics.

[13] Roee Aharoni and Yoav Goldberg. Unsupervised domain clusters in pretrained language models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7747-7763, Online, July 2020. Association for Computational Linguistics.

[14] Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations), pp. 48-53, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics.

[15] Nathan Ng, Kyra Yee, Alexei Baevski, Myle Ott, Michael Auli, and Sergey Edunov. Facebook FAIR's WMT19 news translation task submission. In Proceedings of the Fourth Conference on Machine Translation (Volume 2: Shared Task Papers, Day1), pp. 314-319, Florence, Italy, August 2019. Association for Computational Linguistics.

[16] Boxing Chen and Colin Cherry. A systematic comparison of smoothing techniques for sentence-level BLEU. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pp. 362-367, Baltimore, Maryland, USA, June 2014. Association for Computational Linguistics.

[17] Raphael Shu, Hideki Nakayama, and Kyunghyun Cho. Generating diverse translations with sentence codes. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1823-1827, Florence, Italy, July 2019. Association for Computational Linguistics.

[18] Julian Salazar, Davis Liang, Toan Q. Nguyen, and Katrin Kirchhoff. Masked language model scoring. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 2699-2712, Online, July 2020. Association for Computational Linguistics.

[19] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171-4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics.

[20] Jeff Johnson, Matthijs Douze, and Herv´e J´egou. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, Vol. 7, No. 3, pp. 535-547, 2019.

Explanation of Symbols

[0089] 1 Encoder 2 Decoder 100 Converter 110 Input section 120 Encoding section 130 Decoding section 140 Output section 150 kNN search unit 151 Nearest Case Search Unit 152 Noise Adder 153 Neighborhood Randomization 160 Datastores 170 Conversion unit 180 Search Department 190 Datastore 1000 Drive Device 1001 Recording media 1002 Auxiliary storage 1003 Memory device 1004 CPU 1005 Interface device 1006 Display device 1007 Input Device 1008 Output device

Claims

1. a conversion unit that converts a first sequence, which is a sequence of a plurality of elements, into a second sequence; a data store that stores a plurality of pairs of features and elements corresponding to the features; a search unit that searches the data store while applying a perturbation using a feature amount obtained during the process of conversion from the first sequence to the second sequence by the conversion unit, The conversion unit generates the second sequence using the elements extracted from the data store by the search unit and features obtained during the conversion. Conversion device.

2. The search unit generates a noisy feature by adding noise to the feature obtained in the process of converting the first sequence to the second sequence, and extracts a predetermined number of elements in the vicinity of the noisy feature from the data store. The conversion device according to claim 1 .

3. The search unit acquires elements in a number greater than a predetermined number that are in the vicinity of a feature obtained in the process of converting the first sequence to the second sequence, and extracts the predetermined number of elements from the acquired plurality of elements. The conversion device according to claim 1 .

4. The conversion unit uses the elements extracted from the data store by the search unit and generates the second sequence using a diversified beam search method. The conversion device according to claim 1 .

5. 1. A computer implemented method of converting, comprising: the computer includes a conversion unit that converts a first sequence, which is a sequence of a plurality of elements, into a second sequence, and a data store that stores a plurality of pairs of feature amounts and elements corresponding to the feature amounts; a search step of searching the data store while applying a perturbation using a feature amount obtained during the process of converting the first sequence to the second sequence by the conversion unit; generating the second sequence by the conversion unit using the elements extracted from the data store by the searching step and features obtained during the conversion; A conversion method comprising:

6. A program for causing a computer to function as each unit in the conversion device according to any one of claims 1 to 4.

Citation Information

Cited By

  • Information processing device, vector generation method

    JP2026112299A