This invention relates in general to the mining process used by blockchain networks, and more specifically to blockchain networks using Proof of Work (PoW) based on training of machine learning based models.
Miners of crypto-currencies validate transactions by guessing numbers (“nonces”) in the hopes of finding a number whose hash, in combination with other transaction related data, is below a target level set by a difficulty parameter. The mining process consumes a very large amount of electricity. For example, it is estimated that the power usage of the Bitcoin network consumes several hundred KWh (kilo watt hours) of energy per transaction. The amount of energy used by the Bitcoin network exceeds the power usage of several countries, for example, countries as large as Ireland. Furthermore, if energy that causes pollution, for example, coal-fired power plants are used for the powering the process, the energy consumption also causes pollution leading to environmental concerns. Accordingly, a huge amount of energy is wasted for generating numeric values that have no use other than validation of transactions. Conventional PoW-based crypto-currency technologies therefore cause a huge amount of electricity to be wasted.
Systems and methods are disclosed herein for implementing a coordinator system that delegates tasks for training machine learning models to computing devices. When the computing devices successfully complete the tasks, a token that corresponds to the task may be released to the computing devices; when the computing devices are not successful, the token may be withheld from release. Further, as a byproduct of completing the task (e.g., an error value calculated for the trained machine learning model), a nonce may be generated. The nonce may be packed into a valid candidate block, which may be distributed to the computing devices (e.g., that make up the distributed network hosting the blockchain) for use in attempting to add a new block to the blockchain, which may yield a so-called block reward in the form of, e.g., a coinbase transaction.
In some embodiments, determining whether the computing devices successfully have completed the tasks involves determining whether the trained version of the machine learning model satisfies the acceptance criterion. To this end, a processor may determine a measure of accuracy of the completed task, e.g., by predicting results from a labelled dataset. The processor may determine a first aggregate value based on the predicted results. The processor may also determine a second aggregate value based on results of the trained version of the machine learning model. The processor may then determine, as a measure of accuracy, an error value based on a difference between the first aggregate value and the second aggregate value, and determine that the trained version of the machine learning model satisfies the acceptance criterion based on whether the error value is less than an error threshold value.
In some embodiments, the coordinator system assigns tasks to train additional machine learning models using additional training sets based, e.g., on tasks established in a task queue. The coordinator system may be decentralized, and management of the tasks may be enforced by distributed data structures.
The features and advantages described in the following detailed description are not all-inclusive. Many additional features and advantages will be apparent to one of ordinary skill in the art in view of the drawings, specification, and claims hereof.
Figure (
The figures depict various embodiments of the present invention for purposes of illustration only. One skilled in the art will readily recognize from the following discussion that alternative embodiments of the structures and methods illustrated herein may be employed without departing from the principles of the invention described herein.
Embodiments utilize processing resources of crypto-currency miners for performing valuable computation. For example, the processing resources of crypto-currency miners are used to train machine learning based models. Accordingly, computing devices participating in a blockchain network generate a nonce that is a numeric value associated with training of a machine learning based model.
System Environment
Figure (
The blockchain network 110 comprises a plurality of computing devices 100. A miner is a computing device 100 that demonstrates proof of work for new blocks to be added to the blockchain. Conventional blockchains demonstrate proof of work by repeated hashing to find a nonce for a new block to be added to the blockchain. A nonce is a field in the block whose value is set so that the hash of the block satisfies certain predefined criterion, for example, the hash must have a run of leading zeros of a predetermined size. Conventional techniques for generating nonces spend huge processing resources for generating values that have no other use than to add a block to the blockchain.
Embodiments generate nonces based on useful work that is performed by computing devices rather than repeated hashing, thereby using the processing resources of the miners to perform tasks that have value other than just adding a block to the blockchain. For example, the tasks comprise training of machine learning models. In an embodiment, the tasks represent training of machine learning models associated with personal Artificial Intelligence.
In an embodiment, the nonce is based on numerical byproduct value(s) generated as a result of training the machine learning model, for example, a measure of accuracy of the training model. An example of measure of accuracy used is an error metric representing an aggregate error of the results of the trained machine learning model obtained by predicting results from a labelled dataset and comparing the predicted results with known results. Examples of error metrics for machine learning models used by embodiments include r-squared error, mean squared error, F-score, cross entropy, KL divergence, and so on. A computing device 100 of the blockchain network 110 uses the numeric value of the error metric as the nonce. In some embodiments, the computing device 100 determines the nonce value based on weights of the model, for example, by determining an aggregate value based on one or more weights of the model. For example, the computing device 100 may determine the nonce as the sum of all weights, an average of all weights, or a hash value based on the weights.
The computing device 100 comprises a task processing module 125 and a block store 145. In an embodiment, the block store 145 stores a set of blocks, each block comprising a plurality of records. The block store 145 is replicated across computing devices of the blockchain network 110. The block store 145 is also referred to as a ledger that stores information including transactions, for example, transactions describing transfer of cryptocurrency from one user account to another.
The coordinator system 120 comprises a task queue 150 and a result verification module 160. The task queue 150 comprises training tasks 155. The task provider systems 130 provide tasks to a coordinator system 120 for adding to the task queue 150. In an embodiment, the task provider system 130 generates tasks for training machine learning models and provides the tasks comprising details of the machine learning model to be trained and the training data. The task provider system 130 also associates the provided task with a stake (interchangeably used with the word “token” herein) representing a compensation to the computing device 100 that trains the model to an acceptable level. In an embodiment, a user account associated with the task provider system deposits some amount in a financial account for providing to a user account associated with the computing device 100 that provides the winning nonce.
The computing device 100 that completes the training of the model and provides the results is provided the compensation if the trained model is determined to satisfy an acceptance criteria. A user associated with the computing device 100 that completes a task of training a machine learning model also receives a chance at earning cryptocurrency since a numerical value associated with the trained model is used as a nonce. If a hash value generated by adding the nonce to a block satisfies a predetermined criteria, for example, if the hash value has a leading run of zeros, a user account associated with the computing device that provided the nonce is compensated with a predetermined amount of cryptocurrency.
In an embodiment, a computing device 100 is given the chance to be considered for being compensated based on the value of nonce independent of whether the model trained by the computing device is determined to be acceptable. Accordingly, a computing device 100 could potentially provide a nonce that generates the winning hash value, thereby receiving cryptocurrency but still not receive the stake associated with the task if the trained model is determined to be unacceptable by the provider system 130.
The coordinator system 120 provides the training tasks to computing devices 100. The task processing module 125 of the computing device 100 performs the processing associated with a training task 155 received from the coordinator system 120. The computing device 100 provides the result of performing the training task 155 to the coordinator system 120. The result verification module 160 performs the verification of the result to determine whether the result is an acceptable result. In an embodiment, the result verification module 160 comprises a user interface that presents the results to a user for manual verification of the result. In an embodiment, a computing device 100 is allowed to execute a task only once, thereby preventing a computing device to repeatedly execute the same task in an attempt to get multiple opportunities to provide a nonce without performing useful work.
The computing devices 100 can be a personal computer (PC), a desktop computer, a laptop computer, a notebook, a tablet PC executing an operating system, for example, a Microsoft Windows®-compatible operating system (OS), macOS®, and/or a Linux distribution. In another embodiment, the computing device 100 can be any device having computer functionality, such as a personal digital assistant (PDA), mobile telephone, smartphone, wearable device, etc.
The interactions between a computing device 100 and other computing devices are typically performed via a network, for example, via the Internet. The network enables communications between various processors. In one embodiment, the network uses standard communications technologies and/or protocols. The data exchanged over the network can be represented using technologies and/or formats including the hypertext markup language (HTML), the extensible markup language (XML), etc. In addition, all or some of links can be encrypted using conventional encryption technologies such as secure sockets layer (SSL), transport layer security (TLS), virtual private networks (VPNs), Internet Protocol security (IPsec), etc. In another embodiment, the entities can use custom and/or dedicated data communications technologies instead of, or in addition to, the ones described above.
System Architecture
The computing devices 100 that are part of the blockchain network 110 include a block store 145 that comprises a plurality of records. The block store 145 is replicated across computing devices of the blockchain network 110. The blockchain network interface 250 performs interactions related to the blockchain protocol, for example, performing replication of the data stored in the block store 145. The block store 145 is also referred to as a ledger that stores information including transactions, for example, transactions describing transfer of any entity from one user to another. Examples of entities transferred include values representing an amount of a cryptocurrency, for example, bitcoin.
The task processing module 125 performs processing of tasks received from the coordinator system 120. The task processing module 125 comprises modules including a coordinator system interface 210, a training module 220, a model evaluation module 230, and a training data store 240. In other embodiments, the task processing module 125 may include additional, fewer, or different modules than those shown in
The coordinator system interface 210 module performs interactions with the coordinator system 120 to request and receive tasks from the coordinator system 120. In an embodiment, a task received comprises information describing a machine learning model and training data for training the machine learning model. The coordinator system interface 210 stores the received training data in the training data store 240. The training module 220 trains the received machine learning model using the training data provided with the task.
The model evaluation module 230 evaluates the machine learning model to determine whether the machine learning model has been trained to a sufficient level. In an embodiment, the model evaluation module 230 predicts results for a set of test data based on known results from existing tests and determines an aggregate value based on the predicted results. The model evaluation module 230 also determines a corresponding aggregate value based on the known results from the existing tests for the set of tests. The model evaluation module 230 determines an error value based on a difference between the aggregate predicted result value and the aggregate known result value. The model evaluation module 230 determines that the machine learning model is sufficiently trained if the computed error value is less than an error threshold value associated with the task.
The task queue 150 includes one or more tasks, for example, training tasks 155. The tasks in the task queue 150 may be received from one or more task provider systems 130. The details of a training task are described in connection with
The coordinator system interface 320 allows systems such as task provider system 130 or computing devices 100 to interact with the task queue 150. In an embodiment, the coordinator system interface 320 provides application programming interfaces (APIs) for remotely interacting with the task queue 150. For example, the task provider system 130 may invoke a task submission API to add a task to the task queue 150. As another example, a computing device 100 may invoke a task retrieval API for accessing a task from the task queue 150 for processing. The computing device 100 may further invoke a result submission API for submitting a result of training a machine learning model to the coordinator system 120.
The result verification module 160 determines whether a computing device 100 successfully completed a task retrieved from the task queue 150. In an embodiment, the result verification module 160 verifies the results of training a machine learning model submitted by a computing device 110. For example, the result verification module 160 may select a set of tests having known results and execute the trained model to determine an aggregate measure indicating a degree to which the results predicted by the trained model match the corresponding known results.
Processes
The blockchain network interface 250 of the computing device 100 broadcasts 540 the trained model, the training data, and the cost metric value obtained from the trained model. The computing device 100 also provides the trained model to the coordinator system 120. The coordinator system 120 evaluates the trained model. In an embodiment, the coordinator system 120 provides a user interface to users of the task provider system 130 allowing them to validate the trained model and determine whether the model is trained to a satisfactory level. If the users of the task provider system 130 approve the trained model by indicating that the model is trained to a satisfactory level, the users of the computing device are provided the stake associated with the training task. The computing device 100 receives 550 the stake associated with task if the trained model was determined to be acceptable.
In an embodiment, a user may review the trained model, for example, by executing it using datasets with known results and observing the quality of the generated results. If the coordinator system 120 determines that the trained model is acceptable, the coordinator system 120 releases a stake associated with the task to the computing device, for example, by providing compensation to a user account associated with the computing device.
In an embodiment, the coordinator system 120 is decentralized, such that the task submission interface, task queue manager, etc., are handled by smart contracts. A smart contract (also referred to herein as a distributed data structure) is a protocol that digitally enforces the performance of a contract. For example, the terms of the agreement between buyer and seller in a smart contract may be directly written into lines of code. The code and the agreements of the smart contract are stored in a blockchain network. Smart contracts permit trusted transactions and agreements among disparate parties without using a central authority or external enforcement mechanism. In order to be completely transparent regarding the coordinator system's implementation the systems shown in
The data may be submitted to the coordinator system in a homomorphically encrypted form which is irreversible without knowledge of a private key owned by the client/user. The data may be submitted to the coordinator system in an encoded form that is not readily observable. This is different from encryption in that, if the encoding process is known a priori, it can be easily reversed.
The processor receives 806 a trained version of the machine learning model (e.g., in accordance with the task). A nonce may be generated as a byproduct of the trained version (e.g., based on an error value associated with how well the machine learning model is trained). The processor, in response to receiving the trained version, determines 808 whether the trained version of the machine learning model satisfies an acceptance criterion (e.g., based on predictive data, as described above). The processor, in response to determining that the trained version of the machine learning model satisfies the acceptance criterion, causes 810 release of a token to a user of the client device (e.g., a stake associated with completion of the task).
Alternative Applications
The features and advantages described in the specification are not all inclusive and, in particular, many additional features and advantages will be apparent to one of ordinary skill in the art in view of the drawings, specification, and claims. Moreover, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter.
The foregoing description of the embodiments of the invention has been presented for the purpose of illustration; it is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Persons skilled in the relevant art can appreciate that many modifications and variations are possible in light of the above disclosure.
Some portions of this description describe the embodiments of the invention in terms of algorithms and symbolic representations of operations on information. These algorithmic descriptions and representations are commonly used by those skilled in the data processing arts to convey the substance of their work effectively to others skilled in the art. These operations, while described functionally, computationally, or logically, are understood to be implemented by computer programs or equivalent electrical circuits, microcode, or the like. Furthermore, it has also proven convenient at times, to refer to these arrangements of operations as modules, without loss of generality. The described operations and their associated modules may be embodied in software, firmware, hardware, or any combinations thereof.
Any of the steps, operations, or processes described herein may be performed or implemented with one or more hardware or software modules, alone or in combination with other devices. In one embodiment, a software module is implemented with a computer program product comprising a computer-readable medium containing computer program code, which can be executed by a computer processor for performing any or all of the steps, operations, or processes described.
Embodiments of the invention may also relate to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, and/or it may comprise a general-purpose computing device selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a tangible computer readable storage medium or any type of media suitable for storing electronic instructions, and coupled to a computer system bus. Furthermore, any computing systems referred to in the specification may include a single processor or may be architectures employing multiple processor designs for increased computing capability.
Finally, the language used in the specification has been principally selected for readability and instructional purposes, and it may not have been selected to delineate or circumscribe the inventive subject matter. It is therefore intended that the scope of the invention be limited not by this detailed description, but rather by any claims that issue on an application based hereon. Accordingly, the disclosure of the embodiments of the invention is intended to be illustrative, but not limiting, of the scope of the invention, which is set forth in the following claims.
This application claims the benefit of U.S. Provisional Patent Application No. 62/648,849, filed Mar. 27, 2018, the disclosure of which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | |
---|---|---|---|
62648849 | Mar 2018 | US |