What you will learn in Grokking AI Algorithms, Second Edition
Chapter by chapter
Concepts explained in this book
- language modelA large language model is a neural language model trained on large text corpora to process and generate human language.
- objective functionTraining loss is the loss computed on the examples used to fit a model.
- fitnessA fitness function evaluates candidate solutions and assigns numerical values representing their performance according to an optimization objective.
- parameterA neural network weight is a learned numerical parameter that determines the strength of a connection or contribution between network units.
- heuristicA heuristic is a problem-specific rule or set of rules that evaluates states or solutions to guide search when no clear method for finding an optimal solution is available.
- reward signalA score is a numerical evaluation assigned to an output or state to indicate its favorability according to an evaluator.
- embeddingAn input vector is an ordered one-dimensional array of values supplied to a computational layer.
- action-value functionA Q-function maps a state-action pair to the expected cumulative reward obtained by taking the action and subsequently following a policy.
- feature mapA feature map is a spatially organized array of activation values representing learned features at different locations in an input or intermediate image representation.
- discount factorA discount factor is a reinforcement-learning hyperparameter that determines how strongly future rewards contribute to the value of a current decision.
- trajectoryAn episode is a complete reinforcement-learning trial consisting of the states and actions from an initial state until a terminal outcome.
- neuronA neural-network node is a computational unit that combines weighted signals and transforms them into an activation.
- hidden layerA hidden layer is an intermediate computational layer in a neural network whose units receive inputs from preceding layers and pass transformed values to subsequent layers.
- activation functionAn activation function is a nonlinear or linear mathematical function that transforms a neuron's weighted input before passing the result onward.
- convolutional layerA convolutional layer is a neural-network layer that applies shared filters to local regions of an input representation while preserving spatial organization.
- particleA particle is a candidate solution in particle swarm optimization whose position represents values in the problem search space and whose movement is adjusted during search.
- attentionAttention is a neural-network mechanism that weights relationships among input representations so relevant information contributes more strongly to a computation.
- encoderAn encoder is a neural-network component that transforms high-resolution input representations into progressively more compact representations of higher-level information.
- populationA population is the collection of candidate solutions maintained in an evolutionary algorithm at a particular generation.
- linear regressionLinear regression is a statistical modeling method that represents a continuous response as a linear function of one or more input variables.
- genetic algorithmA genetic algorithm is an evolutionary optimization technique that improves candidate solutions through selection, recombination, and mutation.
- convolution kernelA convolutional filter is a small learned grid of weights that detects a particular local pattern in image data.
- pheromonePheromone intensity is the numerical strength of a simulated pheromone signal associated with a path in ant colony optimization.
- vocabularyA vocabulary is a collection of distinct tokens recognized by a language-processing system, often associated with numerical identifiers.
- particle swarm optimizationParticle swarm optimization is a swarm-intelligence optimization technique in which particles adjust candidate solutions using collective and individual search information.
- decision treeA decision tree is a predictive model that recursively applies feature-based tests to partition examples and produce a classification or regression outcome.
- generationLanguage generation is the computational production of natural-language text from learned patterns or supplied information.
- denoisingA denoising process is an iterative procedure that removes predicted noise from a corrupted representation to recover structured data.
- backpropagationBackpropagation is an algorithm for computing gradients of a model's loss with respect to its parameters by propagating error derivatives backward through the model.
- diffusion modelA diffusion model is a generative model that learns to create structured data by reversing a gradual noise-addition process.
- sigmoidA sigmoid function is a bounded S-shaped mathematical function that maps real-valued inputs to values between two limits, commonly zero and one.
- evolutionary computationA population-based algorithmic technique that iteratively improves candidate solutions through variation and selection inspired by biological evolution.
- meanA mean is the arithmetic average of a set of numerical values.
- reinforcement learningReinforcement learning is a machine-learning paradigm in which an agent learns behavior through rewards for useful actions and penalties for harmful or unsuccessful actions in an environment.
- overfittingOverfitting is a condition in which a model matches training data too closely and performs poorly on varied unseen data.
- Q-learningQ-learning is a reinforcement-learning algorithm that learns action values for states without requiring a model of the environment's transition dynamics.
- Q-tableA Q-table is a tabular reinforcement-learning model that stores estimated values for actions in particular states.
- ant colony optimizationAnt colony optimization is a population-based optimization technique that uses simulated pheromone-guided behavior of ants to search for good solutions to combinatorial problems.
- similarity searchA search algorithm systematically explores a space of possible states or solutions to find a target or an optimal result.
- perceptronA perceptron is a computational unit and binary linear classifier that combines weighted inputs with a bias and applies an activation rule.
- labelA class is a category label assigned to an example in a classification task.
- crossoverA crossover method is a recombination technique that creates offspring by combining portions of parent chromosomes.
- label encodingLabel encoding maps each category to a numerical label, typically an integer in a fixed range.
- categorical encodingOne-hot encoding represents each category by a separate binary indicator, with one indicator active for each example.
- global optimumA global minimum is the lowest value of an objective function over its entire domain.
- tokenA token is a discrete unit of text, such as a word, subword, or symbol, used as an input element for language-model processing.
- decision nodeA decision node is an internal node of a decision tree that contains a test used to partition examples.
- tensorA tensor is a multidimensional numerical array used to represent data and intermediate computations in machine-learning models.
- image generation modelA generative image model is a model that creates or synthesizes images from learned visual patterns.
- position vectorA position is the point or vector in a search space that represents a particle's candidate solution in particle swarm optimization.
- residual connectionA skip connection is a direct connection that carries an earlier layer's representation to a later corresponding layer, bypassing intervening layers.
- machine learningMachine learning is the field of building systems that learn patterns or behavior from data rather than relying solely on explicitly programmed rules.
- decodeText decoding is the conversion of a model's internal numerical representations into human-readable language.
- preprocessingData preparation is the process of cleaning, formatting, and transforming raw data into a form suitable for analysis or model development.
- gradientA gradient is a vector or matrix of partial derivatives that describes how a function changes with respect to multiple parameters.
- environmentAn environment is the external setting in which an agent acts and receives consequences or feedback, including a simulated setting that models a market.
- noiseNoise is unwanted variation or extraneous content in observed data that is not part of the intended signal.
- dataData is recorded information, observations, measurements, or signals that can serve as inputs for processing and action.
- actionAn action is a choice or operation that an agent performs in an environment to change its situation or obtain an outcome.
- stopping criterionA stopping condition is a rule that determines when an iterative algorithm terminates.
- mutationMutation is an evolutionary algorithm operation that introduces small random changes into a candidate solution to create variation.
- chain ruleThe chain rule is a calculus rule for differentiating a composition of functions by multiplying the derivatives of its successive functions.
- derivativeA derivative is a mathematical quantity that measures the instantaneous rate of change of a function with respect to its input.
- nodeA node, also called a vertex, is an individual state or object represented within a graph.
- offspringOffspring are new candidate solutions generated from existing individuals by an evolutionary algorithm's reproduction operation.
- solutionA solution is a candidate answer to an optimization problem that can be evaluated against its objective and constraints.
- target q-valueA target Q-value is the reinforcement-learning estimate formed from an immediate reward plus a discounted estimate of the best future action value.
- velocityA velocity is a particle's vector describing the direction and magnitude of its movement through the search space.
- timestepA timestep is one discrete point in the sequence of stages used to progressively add or remove noise in a diffusion process.
- gradient descentGradient descent is an optimization technique that iteratively changes parameters in the direction that reduces an objective function.
- trend lineA regression line is a fitted straight-line model representing the relationship between a dependent variable and an independent variable.
- leaf nodeA leaf node is a terminal tree node that contains examples assigned to a final class or prediction.
- performanceAn evaluation metric is a quantitative measure of a model's performance on specified data or outcomes.
- context windowA context window is the maximum sequence of tokens a language model processes as contextual input at one time.
- timestep embeddingA time embedding is a numerical vector representation of a diffusion process timestep for model conditioning.
- model architectureA neural network architecture is the arrangement of computational layers, connections, inputs, and outputs that defines a neural network's structure.
- optimal solutionAn optimal solution is a solution that performs best according to the criterion used to evaluate solutions to a problem.
- depth-first searchDepth-first search is a graph or tree traversal algorithm that explores a path as deeply as possible before backtracking to explore alternatives.
- forward passA forward pass is the computation that propagates input through a model to produce predictions.
- AI agentAn AI agent is a computational system that perceives context, makes decisions, and takes actions to pursue objectives.
- paddingPadding is the addition of extra border values around an input array before an operation is applied.
- datasetA dataset is an organized collection of data examples considered together for analysis or machine learning.
- geneA gene is an individual value or position within an evolutionary algorithm chromosome that contributes to the encoded candidate solution.
- minimax algorithmA game-search algorithm that alternates maximizing an agent's score and minimizing the opponent's score while exploring possible future moves.
- CARTCART is a decision-tree algorithm that constructs binary trees for classification and regression.
- entropyEntropy is a measure of disorder or uncertainty in a probability distribution or dataset.
- Gini impurityThe Gini index is an impurity measure that quantifies the likelihood of incorrect class assignment in a labeled dataset.
- information gainInformation gain is the reduction in dataset uncertainty produced by applying a particular split or question.
- pruningPruning is the removal or restriction of branches in a decision tree to reduce excessive specificity and improve generalization.
- uncertaintyUncertainty is the degree of unpredictability or class mixture in a dataset.
- knapsack problemThe knapsack problem is an optimization problem that selects items with given weights and values to maximize total value without exceeding a weight capacity.
- breadth-first searchBreadth-first search is a search algorithm that explores a state tree level by level, processing all nodes at one depth before moving to the next.
- SwishSiLU is a smooth neural-network activation function defined by multiplying an input by its sigmoid.
- accuracyAn accuracy score is the proportion of evaluated predictions that match their correct outcomes.
- brute-force searchA brute-force approach systematically evaluates every possible combination or candidate in a problem's search space.
- noise scheduleA noise schedule is a prescribed sequence of coefficients or noise levels governing how noise is added and removed across diffusion timesteps.
- game treeA tree representation whose nodes are game states and whose branches represent possible moves between them.
- recursionA programming technique in which a function or algorithm calls itself until an exit condition is reached.
- final stateA game state in which the game has ended because a player has won or the game is a draw.
- feedforward networkA feed-forward layer transforms its inputs through learned parameters without recurrent state or feedback connections.
- weighted sumA weighted sum is a sum of values after each value has been multiplied by a corresponding numerical weight, optionally incorporating a bias term.
- antAn ant is a simulated agent that moves among destinations and deposits pheromone information while constructing a solution in ant colony optimization.
- roulette-wheel selectionRoulette-wheel selection is a probabilistic evolutionary selection technique that assigns larger selection probabilities to higher-fitness candidates while retaining nonzero probabilities for lower-fitness candidates.
- channelA feature channel is one parallel plane of activations or values in a neural-network representation or multidimensional image tensor.
- vanishing gradient problemThe vanishing gradient problem is a training difficulty in which derivatives become extremely small and cause neural-network parameter updates to become ineffective.
- captionAn image caption is textual language that describes the visual content of an image and its relevant attributes or relationships.
- tourA tour is a complete route constructed by an ant through the locations or attractions of a routing problem.
- selectionSelection is an evolutionary algorithm operation that chooses candidate solutions for continuation or reproduction based on their quality.
- transformer architectureThe Transformer is a neural-network architecture based primarily on attention mechanisms for processing sequences and modeling context.
- ordinary least squaresThe least-squares method fits a model by minimizing the sum of squared differences between observed and predicted values.
- inner productA dot product is an operation on two equal-length vectors that multiplies corresponding components and sums the resulting products.
- min-max normalizationMin-max scaling is a feature-scaling technique that linearly maps values between a specified minimum and maximum to a normalized range, commonly 0 to 1.
- training datasetTraining data is the collection of examples provided to a learning method for fitting a model, optionally including known outcome labels.
- transposed convolutionA transposed convolution is a learnable convolutional operation that projects a lower-resolution representation into a higher-resolution output space.
- downsamplingDownsampling is the process of reducing the spatial resolution of a representation while retaining information about larger-scale structure.
- group normalizationGroup normalization normalizes neural-network activations by dividing channels into groups and standardizing values within each group.
- strideA stride is the spatial step size by which a convolutional filter moves across an input.
- evaluation datasetA validation set is a held-out dataset used to assess a model during development without using it to fit the model's learned parameters.
- pathA path is an ordered sequence of steps or transitions leading from an initial situation toward a goal.
- biasBias is a systematic distortion in data selection, recording, interpretation, or resulting conclusions.
- Booth functionThe Booth function is a two-variable mathematical benchmark function with a known global minimum used to evaluate optimization methods.
- cognitive componentThe cognitive constant is a positive particle-swarm parameter below two that controls the influence of a particle's personal best position on its movement.
- convergenceConvergence is the process by which particles increasingly gather around a common region or solution in the search space.
- inertia componentThe inertia component is the particle-swarm velocity term that preserves a particle's previous movement momentum.
- social componentThe social component is the particle-swarm term that directs a particle toward information from the swarm's best-known solution.
- social constantThe social constant is a fixed particle-swarm parameter that controls the influence of the swarm's best-known position on particle movement.
- trainingTraining is the process of adjusting a model's parameters using examples so that its predictions better match desired outcomes.
- copyrightCopyright is a legal system granting creators exclusive rights over the reproduction, distribution, and adaptation of original works.
- output layerAn output layer is the final neural-network layer whose units produce the network's externally returned results.
- dimensionEmbedding size is the number of numerical dimensions in each learned vector representation.
- bigramA bigram is a sequence of two adjacent words or tokens used to model the likelihood of one following the other.
- underfittingUnderfitting is a condition in which a model is too simple or insufficiently trained to perform well even on its training data.
- swarm intelligenceAn algorithmic method that searches for solutions through interactions among multiple simple agents modeled on collective behavior.
- optimizationAn optimizer is an algorithm that adjusts model parameters to minimize or otherwise improve an objective function.
- positional embeddingPositional encoding is a method of representing an item's position in a sequence with numerical values that can be combined with its content representation.
- model-free methodModel-free reinforcement learning is a reinforcement-learning approach in which an agent learns favorable actions through direct trial-and-error interactions without an explicit environment model.
- A-star algorithmA* is a heuristic graph and tree search algorithm that prioritizes nodes using the cost already incurred plus a heuristic estimate of the remaining cost to the goal.
- chromosomeA chromosome is an encoded representation of a candidate solution in an evolutionary algorithm, consisting of gene or solution-value components.
- locally optimal solutionA local minimum is a point whose objective value is no greater than that of nearby points, without necessarily being the global minimum.
- attention headAn attention head is an independently parameterized component of an attention layer that learns relationships among tokens from a particular perspective using its own query, key, and value matrices.
- batch sizeBatch size is the number of training examples processed together in one model update.
- priority queueA priority queue is a data structure that removes or presents elements according to priority rather than insertion order.
- categorical dataCategorical data consists of values representing membership in discrete named or ordered categories.
- upsamplingUpsampling is the process of increasing the spatial resolution of a structured representation such as an image or feature map.
- informed searchInformed search is a search technique that uses domain knowledge or heuristic guidance to direct exploration toward promising solutions.
- bottleneck layerA bridge is the bottleneck component of an encoder-decoder network that connects the encoder and decoder at the most compressed representation.
- individualAn individual is one candidate solution represented as a member of an evolutionary algorithm's population.
- queueA queue is a data structure whose elements are removed in the order in which they were added.
- tokenizationTokenization is the process of breaking text into a sequence of discrete units for computational language processing.
- missing valueA missing value is an absent or unrecorded value for an attribute in a data record.
- alphaAn alpha is a diffusion-schedule coefficient that controls the retained signal or corresponding denoising contribution at a timestep.
- betaBeta is the diffusion coefficient that determines how much noise is added at a particular timestep.
- encodingText encoding is the conversion of written language into numerical representations that a computer model can process.
- optimal pathAn optimal path is a sequence of actions or transitions from an initial state to a goal that is best according to the relevant optimization criterion.
- normal distributionA normal distribution is a continuous probability distribution characterized by a symmetric bell-shaped density around its mean.
- depthThe number of layers is the count of successive computational layers in a neural-network architecture.
- classifierClassification is the assignment of an instance to one or more predefined categories based on its features.
- interceptA neural-network bias is a learned additive parameter that shifts a layer's computed output independently of its weighted inputs.
- stateA state is a configuration of the environment at a particular point in an agent's interaction with it.
- token idA token ID is an integer assigned to a token so that the token can be represented numerically for model processing.
- linear layerA linear layer is a neural-network layer that computes an affine or linear transformation of its input using learned weights and usually a bias.
- acceptable solutionAn acceptable solution is a candidate solution whose quality is sufficient for the requirements and use case, even if it is not optimal.
- U-NetA U-Net is an encoder-decoder neural-network architecture with skip connections commonly used for image segmentation and image generation.
- graphA graph is a data structure consisting of entities represented as vertices and relationships represented as edges.
- root nodeA root node is the topmost node in a tree and the starting point of its hierarchy.
- treeA tree is a connected acyclic data structure organized into nodes with a single root and hierarchical parent-child relationships.
- convolutional neural networkA convolutional neural network is a neural-network architecture that applies learned convolutional filters and typically pooling operations to detect spatial patterns in structured data such as images.
- diversityGenetic diversity is the variation in genetic makeup among individuals in a population.
- web crawlerA web crawler is software that automatically visits web pages and follows links to collect or index web content.
- trial and errorTrial and error is a problem-solving technique that tests alternative attempts and uses their outcomes to identify a successful solution.
- costComputational cost is the processing effort required by a function or algorithm, commonly measured by operations or execution time.
- emergent behaviorA collective pattern or capability that arises from interactions among simpler individual agents.
- cross entropy lossCross-entropy loss is a prediction-error measure computed as the negative logarithm of the probability assigned to the correct outcome.
- digital imageImage data is data that represents visual content through digital image values and associated metadata.
- generative adversarial networkA generative adversarial network is a machine-learning model consisting of a generator and a discriminator trained through competition to produce increasingly realistic synthetic data.
- learning rateA learning rate is a training hyperparameter that controls the step size used to update model parameters.
- generalizationGeneralization is a model's ability to perform effectively on new data drawn from the same underlying task or distribution.
- boilerplate strippingBoilerplate stripping is the removal of repetitive non-semantic material such as licensing text, markup, or website navigation from data.
- data quality monitoringA data-quality audit is a systematic evaluation of a dataset for cleanliness, balance, consistency, and suitability for a specified purpose.
- duplicate detectionNear-duplicate removal is the detection and removal of repeated or substantially similar content from a dataset.
- language filteringLanguage filtering is the removal of training text written in languages outside a model's intended language set.
- normalizationNormalization is the standardization of textual representation, including characters, casing, whitespace, and related formatting.
- personal dataPersonally identifiable information is data that can identify or be linked to a specific individual, such as a phone or credit-card number.
- safety and compliance filterA safety and compliance filter is a data-filtering process that removes harmful, offensive, or legally restricted content before model training.
- stackA stack is a linear data structure in which elements are added and removed from the same end.
- reproductionReproduction is an evolutionary algorithm operation that generates new candidate solutions from selected parent solutions.
- search spaceThe set of possible states, actions, or sequences that an algorithm may explore while solving a problem.
- artificial intelligenceThe field concerned with creating computational systems that perform tasks associated with human intelligence, such as reasoning, learning, and autonomous decision-making.
- softmaxThe softmax function converts a vector of real-valued scores into nonnegative values that sum to one.
- byte pair encodingByte-pair encoding is a tokenization technique that iteratively merges frequent adjacent symbol pairs to form a vocabulary of subword tokens.
- alpha-barAlpha-bar is the cumulative product of alpha values that represents the total original signal remaining after multiple diffusion steps.
- Gaussian noiseGaussian noise is random variation whose values follow a Gaussian probability distribution.
- continuous improvementA feedback loop is a recurring process in which the consequences of actions provide signals that influence subsequent actions or behavior.
- ReLUA ReLU is an activation function that outputs zero for negative inputs and a linearly increasing value for positive inputs.
- text-to-image modelText-to-image generation is the process of synthesizing an image from a textual description.
- binary representationBinary encoding represents solution components using binary values such as zero for exclusion and one for inclusion.
- promptA prompt is an instruction, question, or other text input provided to a language model to elicit a response.
- evolutionEvolution is the cumulative change in inherited characteristics of populations across generations through variation and differential survival or reproduction.
- evolutionary adaptationAdaptation is an inherited characteristic or change that improves an organism's fit to its environment.
- natural selectionNatural selection is the differential survival and reproduction of individuals according to how well their traits fit their environment.
- variationVariation is the presence of differences in inherited characteristics among individuals in a population.
- returnCumulative reward is the sum of reward signals accumulated across multiple actions or attempts.
- simulatorA simulator is a software system that reproduces the state transitions and consequences of an environment in response to agent actions.
- valueA value vector is the vector representation carrying the content contributed by a token in an attention computation.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
