Semi-sorted batch processing with variable length input for efficient training
Semi-sorted batch processing addresses high zero padding rates in machine learning models by randomly perturbing sample lengths, enhancing training efficiency and accuracy through balanced randomness and reduced computational costs.
Patent Information
- Application Number
- JP2023528496
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-11-30
- Filing Date
- 2021-11-10
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-11-10
AI Technical Summary
Existing machine learning models trained with random batch processing for variable-length data suffer from high zero padding rates, leading to increased computational costs and reduced model learning accuracy due to the loss of randomness in data arrangement.
Implement semi-sorted batch processing by randomly perturbing the length of variable-length training samples to maintain randomness while reducing zero padding, using a single-step sorting process that balances randomness and efficiency.
This approach reduces computational costs and maintains model performance by balancing randomness and efficiency, improving training speed and accuracy in sequential model training.
Smart Images

Figure 0007544975000008 
Figure 0007544975000011 
Figure 0007544975000006
Abstract
Description
[Technical field]
[0001] This application relates generally to technically inventive and unconventional solutions that are necessarily rooted in computer technology and result in specific technical improvements. In particular, this application relates to techniques for training machine learning neural networks. [Background technology]
[0002] Machine learning (ML) models are used to recognize patterns in variable-length data, such as deriving text from variable-length audio input (automatic speech recognition (ASR) using waveforms), natural language processing to predict the next word in a phrase, and speech synthesis (text-to-speech).
[0003] Such models need to be trained using sequential training data with time information. The word "sequential" means that the predicted outcome is determined not only from the current data but also from previous data. Random batching is commonly used as the default batching strategy for sequential model training with variable length training data. However, it results in a relatively high zero padding rate (ZPR). ZPR refers to the need to add zeros to short samples so that all data are of the same length for efficient training, and ZPR is the ratio of the total number of added zeros to the total sample length after padding. As understood herein, a high ZPR entails a significant increase in computational cost.
[0004] To reduce the ZPR, instead of random batching, samples can be sorted by length before batching, rather than randomly ordering the samples. As recognized herein, this reduces the ZPR, but also completely removes the randomness of the data, which is bad for model training and improving accuracy. Summary of the Invention
[0005] The principle adds a random length perturbation to the actual length of the variable-length training samples to sort the samples. Without the addition of the perturbation, only the strictly sorted samples described above can be obtained. The resulting sample sequence contains actual samples with actual lengths. In this way, the samples are sorted by a randomized pseudo-length, but some randomness is maintained in the length of each batch.
[0006] This technique, referred to herein as semi-sorted batching, balances ZPR reduction (for improved training speed) and data randomness (for maintaining similar model performance compared to random batching). This batching method is useful for any sequential model training as long as the input samples are variable in length. Semi-sorted batching also provides a parameter that can be used to tune the randomness level, which helps to find a "sweet spot" between random and strictly sorted batching, providing a good balance between model training efficiency and training randomness.
[0007] Furthermore, unlike bucket batching (samples are first sorted and then split into different buckets, where the bucket size is a multiple of the batch size) and alternating sort batching (samples are first split into bins, and then samples within each bin are sorted alternately, with odd bins sorted in ascending order and even bins sorted in descending order), our technique does not require two steps, but only one step of sorting samples into batches with randomly perturbed lengths.
[0008] Thus, the device includes at least one computer storage that is not a transitory signal, and the at least one computer storage includes instructions that, when executed by at least one processor, randomly perturb each numerical representation of the length of each machine learning (ML) training sample to establish a respective pseudo-length. The instructions are executable to sort the ML training samples by the pseudo-length and train at least one ML model by inputting a batch of ML training samples derived from the sorting of the ML training samples. It should be noted that this sorting technique may also be used in the testing (inference) phase and validation phase.
[0009] In an exemplary embodiment, the instructions are executable to randomly perturb each numerical representation of at least some of the lengths of the ML training samples. Optionally, the instructions may be executable to randomly perturb each numerical representation of all of the lengths of the ML training samples.
[0010] In the implementations discussed herein, the ML training samples have variable lengths. As an example, the ML samples can include waveforms of variable length and the ML model can be configured for automatic speech recognition (ASR). Or, the ML samples can include phrases of variable length and the ML model can be configured for natural language processing. Furthermore, the ML samples can include text strings of variable length together with waveforms of variable length and the ML model can be configured for speech synthesis training. During TTS training, waveforms are required, but during inference, only text is required. Combinations of the above can be implemented.
[0011] In an exemplary embodiment, the instructions may be executable to randomly perturb each numerical representation of the length at least in part by adding a randomized value to each respective numerical representation. In some implementations, each randomized value may be randomly selected from a distribution of values between one-half the difference between the longest and shortest sample lengths among the ML samples minus one-half the difference between the longest and shortest sample lengths. If necessary, the distribution may be multiplied by a randomization factor. The distribution of values may have a mean of zero or may be a uniform distribution.
[0012] In another aspect, the method includes randomly perturbing actual lengths of the variable length training samples to render a pseudo length. The method further includes arranging the variable length training samples using the pseudo length to render an arrangement of the variable length training samples, and training at least one machine learning (ML) model using the arrangement of the variable length training samples.
[0013] In another aspect, the apparatus includes at least one processor adapted to arrange a plurality of variable length samples for each length based on each combination of real sample lengths and randomized lengths. The processor is adapted to input the arranged variable length samples for each respective length to at least one neural network in a training phase, an inference phase, a validation phase, or any combination of testing, inference, and validation. The processor is further adapted to run the at least one neural network based at least in part on the samples.
[0014] The details of the present application, both as to its structure and operation, can best be understood in reference to the accompanying drawings, in which like reference numerals refer to like parts, and in which: [Brief description of the drawings]
[0015] [Figure 1]1 is a block diagram of an exemplary system consistent with present principles. [Diagram 2] We present variable-length training samples for machine learning (ML) and a numerical representation of randomly perturbing the sample lengths for sorting. [Diagram 3] Exemplary logic consistent with the present principles is illustrated in exemplary flow chart form. [Figure 4] We show a sequence of fully randomly sorted (batch sorted) training samples for comparison with the semi-sorted sequence of FIG. 6 consistent with the present principles. [Diagram 5] 7 shows a sequence of fully sorted training samples for comparison with the semi-sorted sequence of FIG. 6 consistent with the present principles. [Figure 6] Here is a semi-sorted sequence that is consistent with the present principles: [Figure 7] The ZPR curve for bucket batch processing is shown for comparison with the smoother curve for semi-sorted batch processing shown in FIG. [Figure 8] The ZPR curve for the sorted batch process is shown for comparison with the smoother curve for the semi-sorted batch process shown in FIG. [Figure 9] A smoother curve for semi-sorted batch processing is shown. [Figure 10] For comparison with the semi-sorted batch processing shown in FIG. 12, the batch length of the bucket batch processing is shown. [Figure 11] For comparison with the semi-sorted batch processing shown in FIG. 12, the batch length of the sorted batch processing is shown. [Figure 12] Indicates the batch length of the semi-sort batch process. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0016] With reference to FIG. 1, the present disclosure generally relates to a computer ecosystem including aspects of a computer network that may include computing devices such as, but not limited to, consumer electronics (CE) devices. The system herein may include a server component and a client component connected via a network such that data can be exchanged between the client component and the server component. The client components may include one or more computing devices including portable televisions (e.g., smart TVs, Internet-enabled TVs), portable computers such as laptops and tablet computers, as well as smartphones and other mobile devices including additional examples described below. These client devices may operate in a variety of operating environments. For example, some of the client computers may employ, by way of example, Microsoft® operating systems, or Unix® operating systems, or operating systems manufactured by Apple Computer® or Google®. These operating environments may be used to execute one or more browsing programs, such as browsers created by Microsoft® or Google® or Mozilla®, or other browser programs that can access websites hosted by Internet servers as described below.
[0017] The server and / or gateway may include one or more processors that execute instructions that configure the server to receive and transmit data over a network such as the Internet. Alternatively, the clients and servers may be connected via a local intranet or a virtual private network. The server or controller may be instantiated by a gaming console such as a Sony PlayStation®, a personal computer, or the like.
[0018] Information may be exchanged between the client and the server over a network. For this purpose and for security, the server and / or client may include firewalls, load balancers, temporary storage, and proxies, as well as other network infrastructure for reliability and security.
[0019] As used herein, instructions refer to computer-implemented steps for processing information within a system. Instructions may be embodied in software, firmware, or hardware and may include any type of programmed step performed by a component of the system.
[0020] The processor may be a general purpose single chip processor or a general purpose multi-chip processor capable of implementing logic through various lines such as address lines, data lines, and control lines, as well as registers and shift registers.
[0021] The software modules described herein by flowcharts and user interfaces may include various subroutines, procedures, etc. Without limiting the disclosure, the logic specified to be performed by a particular module may be redistributed among other software modules and / or consolidated into a single module and / or made available in a shareable library. Although a flowchart format may be used, it will be understood that the software may be implemented as a state machine or other logical method.
[0022] The principles described herein may be implemented as hardware, software, firmware, or a combination thereof. Accordingly, the illustrative components, blocks, modules, circuits, and steps have been described in terms of their functionality.
[0023] In addition to what has been suggested above, the logic blocks, modules, and circuits described below may be implemented or performed using a general purpose processor, a digital signal processor (DSP), a field programmable gate array (FPGA), or other programmable logic devices such as application specific integrated circuits (ASICs), discrete gates, or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A processor may be implemented by a controller or state machine, or a combination of computing devices.
[0024] The functions and methods described below, when implemented in software, can be written in a suitable language, such as, but not limited to, C#, or C++, and can be stored on or transmitted over a computer-readable storage medium, such as a random access memory (RAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), other optical disk storage, such as a compact disk read-only memory (CD-ROM) or a digital versatile disk (DVD), magnetic disk storage or other magnetic storage devices, including removable thumb drives, etc. A computer-readable medium can be established by a connection. Such connections can include, by way of example, hardwire cables, including optical fiber and coaxial wire, as well as digital subscriber lines (DSL) and twisted pair wires.
[0025] Components included in one embodiment may be used in other embodiments in any suitable combination. For example, any of the various components described herein and / or illustrated in the figures may be combined, interchanged, or excluded from other embodiments.
[0026] A "system having at least one of A, B, and C" (also "a system having at least one of A, B, or C" and "a system having at least one of A, B, C") includes systems having A alone, B alone, C alone, A and B together, A and C together, B and C together, and / or A, B, and C together, etc.
[0027] 1, there is shown an example system 10 in accordance with the present principles that may include one or more of the example devices described above and further below. It should be noted that the computerized devices depicted in the figures herein may include some or all of the components described for the various devices in FIG.
[0028] The first of the exemplary devices included in system 10 is a computer 12, which, like the other computers described herein, is configured to execute the present principles (e.g., to communicate with other computing devices to execute the present principles, to execute the logic described herein, and to perform any other functions and / or operations described herein).
[0029] Thus, to implement such principles, computer 12 may be established by some or all of the components shown in FIG. 1. For example, computer 12 may include one or more displays 14, which may be implemented by flat screens with high or ultra-high resolution "4K" or higher resolution, and may or may not be touch-enabled to receive user input signals via touching the display. Computer 12 may also include one or more speakers 16 for outputting audio in accordance with the present principles, and at least one additional input device 18, such as, for example, an audio receiver / microphone, for inputting audible commands to computer 12 to control computer 12. Exemplary computer 12 may further include one or more network interfaces 20 for communicating over at least one network 22, such as the Internet, other wide area networks (WANs), local area networks (LANs), personal area networks (PANs), etc., under the control of one or more processors 24. Interface 20 may thus be, without limitation, a Wi-Fi transceiver, which is an example of a wireless computer network interface, such as, but not limited to, a mesh network transceiver. Interface 20 may be, but is not limited to, a Bluetooth transceiver, a Zigbee transceiver, an IrDA transceiver, a wireless USB transceiver, a wired USB, a wired LAN, a power line, or a MoCA. Of course, processor 24 controls computer 12 to implement the present principles, including other elements of computer 12 described herein, such as controlling display 14 to present images and receiving input therefrom. It should also be noted that network interface 20 may be, for example, a wired or wireless modem or router, or other suitable interface, such as, for example, a wireless telephony transceiver or a Wi-Fi transceiver as described above.
[0030] The processor 24 may have access to one or more machine learning (ML) models 25, such as, but not limited to, one or more neural networks consistent with the present principles.
[0031] In addition to the above, computer 12 may also include one or more input ports 26, such as a High Definition Multimedia Interface (HDMI) port or a USB port for physically connecting to another computing device (e.g., using a wired connection), and / or a headphone port for connecting headphones to computer 12 to present audio from computer 12 to a user through the headphones. Computer 12 may further include one or more computer memories 28, such as non-transitory disk-based storage or solid-state storage, possibly embodied in the computer housing as a standalone device, or inside or outside the computer housing as a personal video recording device (PVR) or video disc player, or as a removable memory medium. In some embodiments, computer 12 may also include a graphics processing unit (GPU) 30 and / or a field programmable gate array (FPGA) 32. The GPU and / or FPGA may be used by computer 12 for artificial intelligence processing, such as, for example, training a neural network in accordance with the present principles and performing operations (e.g., inference) of the neural network. However, it should be noted that the processor 24 may also be used for artificial intelligence processing, such as when the processor 24 is a central processing unit (CPU).
[0032] 1, in addition to computer 12, system 10 may include one or more other computing device types that may include some or all of the components shown for computer 12. In one example, a first device 34 and a second device 36 are shown and may include components similar to some or all of the components of computer 12. Fewer or more devices than shown may be used.
[0033] System 10 may also include one or more servers 38. Server 38 may include at least one server processor 40, at least one computer memory 42, such as disk-based or solid-state storage, and at least one network interface 44 that, under the control of server processor 40, allows communication with other devices of FIG. 1 over network 22, and may, in effect, facilitate communication between servers, controllers, and client devices in accordance with the present principles. It should be noted that network interface 44 may be, for example, a wired or wireless modem or router, a Wi-Fi transceiver, or other suitable interface, such as, for example, a wireless telephony transceiver.
[0034] Thus, in some embodiments, server 38 may be an Internet server and may include or perform "cloud" functions such that devices of system 10 may access the "cloud" environment via server 38 in an exemplary embodiment. Alternatively, server 38 may be implemented by a gaming console or other computer in the same room or nearby as the other devices shown in FIG.
[0035] The devices described below may incorporate some or all of the elements described above.
[0036] FIG. 2 illustrates a set of variable length ML engine training samples 200, which for simplicity are denoted in FIG. 2 as Sample 1, Sample 2, ..., Sample N, where samples are represented with a subscript "i", where "i" is the number of samples from Sample 1 to Sample N. N 1 shows the i-th sample through 1. Without limitation, the samples 200 may be, for example, variable length waveforms for training the ML model 25 of FIG. 1 for automatic speech recognition (ASR), or variable length phrases for training an ML model for natural language processing, or variable length text strings for training an ML model for speech synthesis.
[0037] Each sample i 200 is each length i 202, which may be expressed temporally, such as the number of seconds of a training recording, or spatially, such as the number of text words or characters to convert to synthetic speech. i Here is x i Each length value is expressed as a number, here denoted as ε i The length is randomly perturbed by adding a negative or positive random value 204, denoted by .
[0038] This is further illustrated in Figure 3. Beginning at block 300, each numerical representation of the length of each machine learning (ML) training sample 200 is randomly perturbed to establish a respective pseudo-length. In one embodiment, this is done by randomly selecting a respective random value 204 for each sample 200 and adding that random value 204 to each actual length 202 of the sample.
[0039] Proceeding to block 302, the samples are sorted by their respective pseudo-lengths to generate a sequence of M samples at block 304, where M is an integer less than N (the total number of samples), to establish multiple batches of samples to be provided to an ML model or engine for training at block 306. Thus, the batches are derived from a sort of ML training samples based on pseudo-lengths. The samples in each batch retain their original data and actual original length. The pseudo-lengths are used only to sort the samples. Some or all of the samples may be perturbed as described. Substantially all of the samples, e.g., at least 90%, may be perturbed as described. It should be noted that when sorting the samples by pseudo-length, additional steps such as binning (which must be done in a strictly sorted batch process) or bucketing (which must be done in a randomized batch process) are not required, since some randomization is inherently achieved during sorting. The trained ML model is then used at block 308 to render relevant predictions from non-training data based on the training at block 306.
[0040] In an example embodiment, each randomized value may be randomly selected from a distribution of values between the difference between the longest and shortest sample lengths in the samples minus one-half the difference between the longest and shortest sample lengths plus one-half the difference between the longest and shortest sample lengths. Furthermore, the distribution of values may be multiplied by a randomization factor to "tune" the technique to optimize the tradeoff between reducing ZPR and achieving adequate randomization. This is mathematically symbolized below:
[0041] Naturally, compared to strictly sorted batch processing, our semi-sorted batch processing (SSB) uses randomized length ε i The sample length x i We perturb the sample length by adding to the randomized length ε iis a random variable uniformly distributed within (-a / 2,a / 2), where a is a bound determined by the difference between the lower and upper sample lengths (the longest and shortest sample lengths) and a local randomization factor (LRF) r ∈ [0,∞).
number
[0042] The symbol "U" in the above formula indicates that the distribution is uniform. i A Gaussian distribution of r may be used instead, or in general any distribution with mean zero. By tuning r from 0 to ∞, the randomness of SSB is intermediate between that of SB (r=0) and that of random batching (r=∞). In practice, the randomization factor r may only need to be tuned between zero and 1.
[0043] This is further illustrated in Figures 4-6. Figure 4 shows a randomized batch process where batch 400 contains samples 402 of any length, with the length reflected on the y-axis. Figure 5 shows the result of a strictly sorted batch process where batch 500 of samples 502 contains samples that decrease monotonically from longest to shortest length. Although it is also possible to sort from shortest to longest length, it is better to sort in descending order, because having the longest length batch at the front provides an early test of the computer's ability to ensure that subsequent training will be successful if the first batch is successfully processed.
[0044] In contrast, Figure 6 shows the results of the present technique in which a batch 600 is not fully randomized as in Figure 4, and contains samples 602 that generally decrease in length along the x-axis, but do not decrease monotonically from longest to shortest. This is because the samples are sorted by pseudo-length, rather than the actual length shown in Figure 6.
[0045] Figure 7 shows the ZPR on the y-axis versus bucket size on the x-axis for a randomized batch process that introduces a discontinuity 700. Figure 8 similarly shows the number of bins versus ZPR for a strictly sorted batch process, and also shows the discontinuity 800.
[0046] In contrast, Figure 9 shows the above randomization factor "r" for ZPR, which exhibits an advantageously smooth curve 900. This shows that the randomness level for the ZPR curve using tuning parameter "r" with semi-sorted batch processing allows for smoother tuning of the randomness level than is provided by the random and strictly sorted batch processes.
[0047] 10-12 show the corresponding batch lengths on the y-axis for the random batch process, the strictly sorted batch process, and our semi-sorted batch process, which correspond to the batch numbers on the x-axis, when the tuning parameters (randomization function “r” for semi-sorted batch process, bucket size for random batch process, and number of bins for strictly sorted batch process) have approximately the same random level (similar ZPR and average batch length).
[0048] It should be noted that our batching algorithm can be used not only to save time during training, but also to save time during testing (inference). Essentially, when batching of groups of samples is required for efficient computation, our batching algorithm will save time compared to random batching.
[0049] For example, during testing (or inference), one may test one sample at a time (e.g., you input one sentence into the model and the model generates a synthetic waveform for that sentence), but if there are many sentences (or texts) to infer, the present batch processing techniques may be used to generate output waveforms in batches.
[0050] For validation (testing during training), the validation dataset is tested once per checkpoint and can provide feedback on the performance of the current checkpoint model. This validation set contains many samples that can be batched according to the principles and inputs to the ML model.
[0051] Of course, while the present principles have been described with reference to certain illustrative embodiments, these are not intended to be limiting, and various alternative configurations may be used to implement the subject matter claimed herein.
Claims
1. at least one computer storage device that is not a transitory signal and that is configured to receive, by at least one processor, Randomly perturbing each numerical representation of the length of each machine learning (ML) training sample to establish a respective pseudolength; sorting the ML training samples by pseudolength; and training at least one ML model by inputting a batch of ML training samples derived from said sorting of said ML training samples; said computer storage including instructions executable to Including, the device.
2. The device of claim 1 , wherein the instructions are executable to randomly perturb each numerical representation of a length of at least a portion of the ML training samples.
3. The device of claim 1 , wherein the instructions are executable to randomly perturb each numerical representation of every length of the ML training samples.
4. The device of claim 1 , wherein the ML training samples have a variable length.
5. The device of claim 4 , wherein the ML training samples include variable length waveforms, and the ML model is configured for automatic speech recognition (ASR).
6. The device of claim 4 , wherein the ML training samples include phrases of variable length, and the ML model is configured for natural language processing.
7. The device of claim 4 , wherein the ML training samples include text strings of variable length, and the ML model is configured for speech synthesis.
8. 2. The device of claim 1, wherein the instructions are executable to randomly perturb each numerical representation of length, at least in part, by adding a randomized value to each respective numerical representation.
9. 9. The device of claim 8, wherein each randomized value is randomly selected from a distribution of values between minus half the difference between the longest and shortest sample lengths in the ML training samples and plus half the difference between the longest and shortest sample lengths.
10. 10. The device of claim 9, wherein each randomized value is randomly selected from the distribution of values between the longest sample length minus half the difference between the shortest sample length and the longest sample length plus half the difference between the longest sample length and the shortest sample length multiplied by a randomization factor.
11. The device of claim 9 , wherein the distribution of values has a mean of zero.
12. The device of claim 11 , wherein the distribution is a uniform distribution.
13. The device of claim 1 , comprising the at least one processor for executing the instructions.
14. The method of claim 13, further comprising: randomly perturbing the actual lengths of the variable length training samples to establish pseudo lengths; Arranging the variable length training samples using the pseudo length to establish an arrangement of the variable length training samples; training at least one machine learning (ML) model using said arrangement of variable length training samples; A method comprising:
15. The method of claim 14 , comprising using the ML model to predict from non-training data.
16. 15. The method of claim 14, wherein the variable-length training samples include variable-length waveforms and the ML model is configured for automatic speech recognition (ASR).
17. 15. The method of claim 14, wherein the variable length training samples include phrases of variable length, and the ML model is configured for natural language processing.
18. 15. The method of claim 14, wherein the variable length training samples include variable length text strings and the ML model is configured for speech synthesis.
19. At least one processor, Based on each combination of real sample length and randomized length, arrange a plurality of variable length samples for each length; inputting the variable length samples arranged for each respective length into at least one neural network during a training phase, an inference phase, a validation phase, or any combination of testing, inference, and validation; and Executing the at least one neural network based at least in part on the samples. The at least one processor adapted to 13. An apparatus comprising:
20. The at least one processor generates randomized lengths ε 1 , ε 2 , ε 3 , ε 4 , ε 5 , ε 6 , ε 7 , i Each real sample length x i adapted to establish each said length at least in part by adding a is a bound determined by the difference between the lower and upper bounds of the sample length and a randomization factor r ∈ [0,∞]; [0010] 20. The apparatus of claim 19, wherein:
Citation Information
Patent Citations
Apparatus and method for processing information and program
JP2011059815A
