Artificial intelligence controller that procedurally tailors itself to an application

A method may include receiving a communication from a device at an artificial intelligence controller including state information for a software application component running on the device, the state information including information corresponding to at least one potential state change available to the software application component, and metrics associated with at least one end condition, interpreting the state information using the artificial intelligence controller, and selecting an artificial intelligence algorithm from a plurality of artificial intelligence algorithms for use by the software application component based on the interpreted state information; and transmitting, to the device, an artificial intelligence algorithm communication, the artificial intelligence algorithm communication indicating the selected artificial intelligence algorithm for use in the software application component on the device.

TECHNICAL FIELD

Embodiments described herein generally relate to artificial intelligence and in particular, but without limitation, to an artificial intelligence controller that selects an artificial intelligence algorithm for a software application component.

BACKGROUND

Many software applications rely on artificial intelligence (AI) to make decisions during normal operation. Games, in particular, use AI to determine state changes controlled by a computer, recommend state changes, and determine strategies. However, software applications are often limited to use of a prearranged AI algorithm for a given situation.

DETAILED DESCRIPTION

Presented herein are systems and methods for using an artificial intelligence (AI) controller to select an AI algorithm for use in a software application component. In the context of this disclosure, an AI controller is a simulated intelligence incorporating algorithms to satisfy conditions. AI in general in this disclosure may include aspects of machine learning, optimization using an objective function, incorporating feedback, or applying an algorithm to determine an output or set of outputs from an input or set of inputs. In this disclosure, an AI algorithm includes algorithms to solve particular technical problems based on state information and at least one end condition of a software application component. The AI algorithms may include, but are not limited to, a minmax algorithm, a Monte Carlo algorithm, a neural net algorithm, a decision tree algorithm, a Q-learning algorithm, or the like.

FIG.1illustrates an artificial intelligence (AI) algorithm selection system100, according to various embodiments. The system100includes a device102, an AI controller106, and an AI algorithm database108. In an example, the device102is a mobile device. In an example, the AI controller106is a network controller. In an example, the device102runs a software application, the software application including a software application component104. For example, the software application may be an app running on a mobile device, such as a game, a recommendation app, a map app, etc. In an example not shown, the device102may incorporate the AI controller106, the AI algorithm database108, or portions thereof.

In an example, the AI controller106receives state information and an end condition and selects an AI algorithm from a plurality of AI algorithms (e.g. from the AI algorithm database108) for the software application component104. The state information may include a number of entities in the software application component, what potential state changes are available to each of those entities at a given time (e.g., for a game like chess, moving a piece on the board), or the like. An end condition may include a score for an entity, such as a relative score for a player against other players (e.g., who is winning) a ranking, an absolute score, or a strategic value of a potential state change.

In an example, the AI controller106may simulate AI algorithms from the plurality of AI algorithms applied to the software application component104or aspects of the software application component104to select an AI algorithm. For example an AI algorithm may include a minmax algorithm, which is computationally complex but guaranteed to give an optimal solution or a Monte Carlo algorithm, which is computationally cheap, but gives a potentially suboptimal solution. In an example, if the AI controller106determines from the state information that there are many potential state changes and a solution is needed quickly, the AI controller106may select the Monte Carlo algorithm. In another example, if the AI controller106determines from the state information that an optimal solution is desirable, the AI controller106may select the minmax algorithm. For example, an optimal solution would be desirable when possible (e.g., a short computational time to determine the optimal solution), or when accuracy is preferable over timeliness (e.g., when a user selects this preference or when the AI controller106determines the current state information implies at a particularly important decision).

In an example, the AI algorithm database108may be downloaded to the device102periodically, in another example, the software application component104may receive a third-party update, which may alter the AI controller106to change an AI algorithm, add an AI algorithm, or drop an AI algorithm to be used in the software application component104. In an example, the state information may be identified by a third-party developer of the software application component. The state information may be filtered or normalized for use with the AI controller.

FIGS.2A-2Billustrate various views of a software application, according to various embodiments.FIG.2Aincludes the software application in a first state200A andFIG.2Bincludes the software application in a second state200B. In the first state200A, the software application includes relatively more pieces capable of movement than in the second state200B, which conversely has relatively fewer pieces capable of movement. For example a software application component of the software application depicted inFIGS.2A-2Bmay be a chess game. Using the chess game as an example, in the first state200A, there are many pieces202that may move or remain still. These potential movements may represent potential state changes available to the software application component. In chess, the objective is to checkmate the opposite king, which may represent an end condition. Another end condition in chess is a draw, which may be a best remaining outcome for a particular side. The second state200B, in contrast to the first state200A, has only one remaining moveable piece204when it is the top side's turn. The piece204may only legally move to one of the two adjacent squares, left or right.

An AI algorithm may be used for various purposes in the software application component. In an example, the AI algorithm may be used to recommend one or more potential moves to a player-controlled side. In another example, the AI algorithm may be used to determine a next move for a computer-controlled side. Given a number of potential state changes (moves) for the top side, a particular AI algorithm may be more appropriate than others.

For example, in the first state200A, exhaustively running an algorithm to find a solution to the board that guarantees a particular end condition, such as a minmax algorithm, may take too long to run on a device, may be difficult or impossible to implement, or may require more processing power than is available. Instead, given the potential state changes in the first state200A, an AI controller may select an approximating AI algorithm, such as a Monte Carlo algorithm.

In other examples, the software application component may be another type of game or app, and may include other types of potential state changes or end conditions. In an example, a predetermined skill level for a side or a particular strategy may be used as state information to select an appropriate AI algorithm. For example, a strategy may include focusing on performance, high quality, trap avoidance, minimizing time, effectiveness of the AI (e.g., ruthlessness), such as high difficulty, medium, or low, balanced performance, or the like.

The chess example shown inFIGS.2A-2Bis a turn-based game. In another example, a real-time solution may be given for real-time gains. For example, the AI controller may be given a small time constraint, such as to reevaluate periodically (e.g., every 10thof a second or so) and output a strategy based on state changes and the small time constraint.

As the example game illustrated inFIGS.2A-2Bprogresses from the first state200A to the second state200B and the state information changes, an AI algorithm that was selected at the first state200A may no longer be a proper AI algorithm for the second state200B. The AI controller may dynamically change the AI algorithm, such as in response to each state change represented by a move, skill level change, possible end conditions, or the like. The dynamic change of AI algorithm provides for a degree of flexibility, such as for an AI opponent, that is more accurate or provides a better experience (e.g., matches the skill level of a player) or performance than relying on any one AI algorithm for the duration of the game.

FIG.3illustrates an AI controller302, according to various embodiments. The AI controller302includes a processor304and memory306. The AI controller302includes AI algorithm determination component308and transmission reception component310, which may be implemented by the processor304. The AI controller302may be used to select an AI algorithm from a plurality of AI algorithms for use in a software application component. For example, the transmission reception component310may be used to receive a communication from a device including state information for a software application component running on the device, the state information including information corresponding to at least one potential state change available to the software application component, and metrics associated with at least one end condition.

The AI algorithm determination component308may be used to interpret the state information and select an AI algorithm from a plurality of AI algorithms for use by the software application component based on the interpreted state information. The transmission reception component310may be used to transmit an AI algorithm communication indicating the selected AI algorithm (e.g., selected by the AI determination component308) for use in the software application component on the device. The plurality of AI algorithms may be stored in the memory306, or in an external database. The processor304may be used to implement the components308or310to perform operations. In an example, the AI controller302may be run as a network service, run on a local device, or run partially as a cloud service and partially on a local device.

FIG.4illustrates a flowchart of a method400to select an AI algorithm for use in a software application component, according to various embodiments. At operation402, the method400includes receiving a communication from a device, the communication including state information (e.g., such as a structured file format like XML) for a software application component running on the device. In an example, the state information includes information corresponding to at least one potential state change available to the software application component, and metrics associated with at least one end condition. The at least one potential state change may include a move for a piece in a game, a group of moves, a street or turn in a map, a rating, etc. The at least one end condition may include conditions to cause a game to come to an end, a destination on a map, a recommendation for a restaurant or attraction to visit, or the like.

For example, using a map app, an end condition may include finding an optimal route (e.g., quickest, least traffic, no highways, etc.) to a destination. The potential state changes include streets, turns, etc., To find the optimal route, the AI controller may provide each AI algorithm the possible routes, and select which AI algorithm should be used to predict the optimal route given the potential state changes, time limits, computational limits, etc. In another example, the method400may include determining an AI algorithm for use in routing airplanes, packages, or other shipments or traffic to find the optimal routes to get to different locations.

In an example, the at least one potential state change available to the software application component includes an active potential state change where a representative entity changes a position with respect to a game area (e.g., a game area on a display, a stored representation of a game area, a map, or the like) and an inactive potential state change where a representative entity remains still. For example, in a game, a potential state change may include a move or inaction by a piece. In an example, the metrics associated with the at least one end condition include at least one of a relative set of scores, an absolute set of scores, or a ranking of players. In an example, the software application component is a game and the state information for the software application component includes a win condition.

At operation404, the method400includes interpreting the state information. In an example, interpreting the state information includes parsing the state information. At operation406, the method400includes selecting an AI algorithm from a plurality of AI algorithms for use by the software application component based on the interpreted state information.

In an example, selecting the AI algorithm includes comparing the state information to conditions in a database. The conditions may include previously used AI algorithms for given state information, including relative success or satisfaction with the AI algorithms and the given state information. The conditions may include threshold potential state changes (e.g., when above a threshold, a first set of AI algorithms is included in the plurality of AI algorithms and when below the threshold, a second set of AI algorithms is included in the plurality of AI algorithms). The conditions may change depending on the software application component where the AI algorithm is to be applied (e.g., the plurality of AI algorithms may be predetermined for a specific software application component or for a type of software application component).

In another example, an AI controller may determine and associate a score for the plurality of AI algorithms and select an AI algorithm based on the score. In one example an AI algorithm with the highest (or lowest) score is selected. The determined score may be dependent on the potential state changes or the end condition, computational complexity, an anticipated or approximate time to an output, a skill level, or the like. In an example, selecting the AI algorithm includes evaluating a computational complexity of simulating the software application component using the state information for the plurality of AI algorithms. In an example, the AI algorithm is selected from a minmax algorithm, a Monte Carlo algorithm, a neural net algorithm, a decision tree algorithm, a Q-learning algorithm, or the like.

At operation408, the method400includes transmitting an AI algorithm communication, the AI algorithm communication indicating the selected AI algorithm for use in the software application component on the device. In an example, the AI algorithm communication includes at least one AI algorithm. In another example, the AI algorithm communication includes an identity of at least one AI algorithm that is stored locally on the device.

FIG.5illustrates a flowchart of a method to use a selected AI algorithm in software application component, according to various embodiments. At operation502, the method500includes running a software application component on a device. At operation504, the method500includes sending state information from the software application component to an AI controller. Operation504may include selecting state information to send to the AI controller. For example, the software application component may select some state information to send and exclude other state information based on predetermined criteria specific to the software application component. At operation506, the method500includes receiving an AI algorithm communication indicating a selected AI algorithm for use in the software application component on the device. The AI algorithm communication may include the AI algorithm or may include an identifier of the AI algorithm, which may be stored locally on the device.

At operation508, the method500includes using the selected AI algorithm in the software application component. The selected AI algorithm may be a previously unused AI algorithm or may be an AI algorithm already previously used. To implement the selected AI algorithm in the software application component, the software application component may run scenarios or probabilities using the selected AI algorithm on current state information of the software application component. For example, the software application component may use the selected AI algorithm to determine and recommend a state change, to determine a computer-controlled state change, or determine and recommend a strategy (e.g., a plurality of state changes or a potential future state change).

EXAMPLE COMPUTER SYSTEM

Example computer system600includes at least one processor602(e.g., a central processing unit (CPU), a graphics processing unit (GPU) or both, processor cores, compute nodes, etc.), a main memory604and a static memory606, which communicate with each other via a link608(e.g., bus). The computer system600may further include a video display unit610, an alphanumeric input device612(e.g., a keyboard), and a user interface (Up navigation device614(e.g., a mouse). In one embodiment, the video display unit610, input device612and UI navigation device614are incorporated into a touch screen display. The computer system600may additionally include a storage device616(e.g., a drive unit), a signal generation device618(e.g., a speaker), a network interface device620, and one or more sensors (not shown), such as a global positioning system (GPS) sensor, compass, accelerometer, or other sensor.

The storage device616includes a machine-readable medium622on which is stored one or more sets of data structures and instructions624(e.g., software) embodying or utilized by any one or more of the methodologies or functions described herein. The instructions624may also reside, completely or at least partially, within the main memory604, static memory606, and/or within the processor602during execution thereof by the computer system600, with the main memory604, static memory606, and the processor602also constituting machine-readable media.