Concepts starting with B
166 concepts, each with a plain-language explanation, examples and diagrams. Pick a letter or open a concept.
- Background Computation with Threads — A shared resource is an object that more than one thread uses, such as the image object in the source's example.
- Backpropagation — Tensors provide the multi-dimensional representations used by neural networks.
- Backpropagation and the computational graph — torch.no_grad() is a context manager that tells PyTorch not to track gradients, which saves memory and computation when a model…
- Backpropagation and Weight Updates — Identical starting weights make nodes in a layer perform the same operations and receive the same updates, so they never learn…
- Backpropagation in Neural Network Layers — The embedding layer is a lookup operation: a token ID selects a row of the weight matrix by position.
- Backward Elimination — Greedy selection evaluates feature subsets through the learning algorithm rather than separating selection from learning.
- Backward-view temporal-difference learning — The on-line λ-return algorithm motivates this topic because it combines strong performance with a complex forward-view…
- Balancing and Preprocessing the Dataset — Undersampling balances a dataset by reducing the majority class until it matches the minority class, using random selection.
- Balancing Exploration and Exploitation with Upper-Confidence-Bound Action Selection — UCB combines an estimated action value with an uncertainty bonus.
- Base and Derived Classes in C++ — Default copy and move operations are problematic in a class hierarchy because the base class does not know about the members of…
- Base Cases in Recursive Algorithms — A recursive binary search has two base cases: an empty range, which returns -1, and a value found at the middle position, which…
- Base Classes and Their Role — A class hierarchy is a set of classes ordered in a lattice created by derivation, and it is used to represent concepts that have…
- Base Hypothesis Class — The base class B provides the individual hypotheses used as building blocks.
- Basic for loop syntax — Loops scan through data by following a three-part structure: initialize a tracking variable, compute on each item, and inspect…
- Basic if Statements — An if-else statement creates two mutually exclusive branches: one executes if the condition is true, the other if it is false.
- Basic Mathematical Functions — Python's trigonometric functions (sin, cos, tan) take arguments in radians, not degrees
- Basic Operators in Python — Operator precedence is a set of rules that determines which operations Python performs first when multiple operators appear in…
- Basic Output and Formatted Output — System.out.print(x) outputs x after converting it to a string when necessary.
- Basic Recursion and the Call Stack — A non-empty linked list splits into a head node and a tail, and the tail is itself a shorter linked list.
- Basic Types in C++ — Arithmetic operators can be used with appropriate combinations of types, not with every combination by default.
- Basic while loop syntax — Loops scan through data by following a three-part structure: initialize a tracking variable, compute on each item, and inspect…
- Batch Monte Carlo Methods — The maximum-likelihood model is built from observed transition frequencies and average observed rewards.
- Batch Processing in LLM Training — A PyTorch training run repeats a core update cycle: reset gradients, calculate loss, perform a backward pass, and update weights.
- Batch Processing in Neural Network Training — Hyperparameters are settings chosen before training, and a validation dataset is the held-out data used to find the best of them.
- Batch Size and Gradient Accumulation — There is no universal optimal learning rate, so you find a workable one by experimenting within the typical range and reading…
- Batch Size and Its Effect on Training — Stride is the number of positions by which the input window shifts when the next batch is created from an input dataset.
- Batch Size and Training Stability — Batch size is a tradeoff: small batches give noisy updates, and it is a hyperparameter to experiment with when training LLMs.
- Batch Size Trade-offs in Training — The source suggests testing the data loader with max_length=2 and stride=2, and with max_length=8 and stride=2, to build…
- Batch Updating — Batch updating keeps all episodes seen so far and repeatedly presents that growing batch until convergence.
- Batching and Training Loops in PyTorch — The DataLoader class from torch.utils.data produces batches from a dataset for training, validation, and testing.
- Batching in Inference — Online APIs optimize for latency and process requests as they arrive, while batch APIs optimize for cost and can accept longer…
- Batching Input Data for Language Models — CausalAttention extends self-attention with a causal mask and a dropout layer, and it accepts batched inputs of shape (batch…
- Batching Instruction Examples with a Custom Collate Function — Instruction masking replaces the instruction and input tokens with the -100 mask, and Exercise 7.2 asks you to evaluate whether…
- Batching Text Data for Training — Padding extends each input shorter than the target length until it reaches the maximum number of tokens the model supports, so…
- Batching Text for Language Model Training — A round trip of encode followed by decode reveals which words the vocabulary can represent.
- Bayes Optimal Classification — 1-NN is analyzed as a sample-dependent hypothesis h_S for binary classification.
- Behavioral Training — Shaping uses reinforcement to guide behavior through successive approximations.
- Bellman Equations — v*(s) is the maximum expected return from a particular state under an optimal policy.
- Bellman Optimality Equation for q* — v* assigns each state its maximum expected return.
- Benchmark Correlation — A public leaderboard ranks models on a small subset of benchmarks, so its rank does not comprehensively evaluate a model or…
- Benchmark Selection — A public leaderboard ranks models on a small subset of benchmarks, so its rank does not comprehensively evaluate a model or…
- Benchmarking Foundation Models — Evaluation mitigates risks and uncovers opportunities across model selection, benchmarking, deployment readiness, and production…
- Benchmarks and Saturation in Model Evaluation — Open-ended tasks can have many correct responses, so a complete answer key is impossible to build and exact-match comparison is…
- Benefits and Applications of the Three-Phase Frame — The three-phase frame is useful both for the day-to-day work and as an organizational tool.
- Benefits and Trade-offs of Heuristic Search — Heuristic search focuses on the current state and its likely successors.
- Benefits of Class Hierarchies — Implementation inheritance means a base class provides functions or data that simplifies the implementation of derived classes.
- Bernoulli Variables — A Chernoff-bound problem begins with independent Bernoulli variables and their sum.
- Best Practices for Numerical Computations — Numerical problems are often subtle, so you should be certain about their mathematical aspects before relying on a result.
- Best Practices for Strings and Regular Expressions — Returning a string by value means the function sends the string itself back to its caller as the result.
- Best Practices for Template Programming — Templates are used to express algorithms that apply to many argument types.
- Best Practices for Time Measurement — std::chrono is the subnamespace of the C++ standard library that holds the standard facilities for dealing with time-related…
- Best Practices for Using C++ Libraries — The guidance 'don't reinvent the wheel; use libraries' recommends using pre-existing libraries instead of recreating…
- Best Practices for Using STL Algorithms — STL algorithms do not directly add or subtract elements from their argument sequences, so the sequence size is unchanged by the…
- Bias Mitigation in Language Models — Finetuning improves a model's quality on a specific task and can teach it to follow particular output structures.
- Bias-Complexity Tradeoff — Model selection is the task of choosing an algorithm for a particular problem and setting its parameters.
- Biases in User Feedback — Implicit feedback is inferred from actions users already take, such as choosing an image option or accepting a code suggestion…
- Bibliography and References in Machine Learning — Three important references are associated with neural network learning, pattern recognition and machine learning, and support…
- Big O Notation — Computational complexity measures the number of operations an algorithm performs.
- Binary Classification — X names the collection of objects being studied, while Y names the collection of possible labels.
- Binary Search — A recursive binary search has two base cases: an empty range, which returns -1, and a value found at the middle position, which…
- Binary Search Algorithm — A search compares the item with the root, then discards either the left or right subtree, and repeats on the remaining subtree.
- Binary Search on Sorted Arrays — A binary sort tree is a binary tree in which every node is at least as large as everything in its left subtree and no larger…
- Binary Tree Structure and Terminology — A subtree is a node together with all of its descendants, and it is itself a binary tree.
- Binding Function Arguments with std::bind — A random number generator in the C++ standard library is created by combining an engine, which is the source of randomness, with…
- Binomial Distribution — Slud's inequality converts a specified binomial probability into a normal-tail lower bound.
- Bipartite Ranking — A linear predictor for ranking is represented through the output y′ = h_w(x̄).
- Bitset Operations and Access — A bitset can be initialized with an integer or a string, using the brace form bitset<N> bs {value};
- Bitwise Operators on Integers — The complement operator ~ flips every bit of a bitset, and the other bitwise operators such as & combine bitsets one position at…
- Blackjack Policy Evaluation — Monte Carlo ES turns simulated Blackjack episodes into a search for a strong policy.
- Blocking Operations and the GUI Thread — ConnectionHandler is a subclass of Thread that opens the network connection and reads incoming messages, keeping blocking…
- Blocking Queues — wait() and notify() are instance methods of class Object, so any object can coordinate two threads
- Blocks and Compound Statements in Java — The if statement takes the form if ( boolean-expression ) statement-1 else statement-2.
- BNF Grammars and Syntax Rules — A recursive descent parser models every BNF grammar rule as a subroutine, so the structure of the program follows the structure…
- Boolean conjunctions — A Boolean conjunction maps X = {0, 1}^n to Y = {0, 1}.
- Boolean Expressions and Comparison Operators — Most statements (logical lines) that you write will contain expressions . A simple example of an expression is 2 + 3 . An…
- Boolean Expressions in Java — Boolean operators form complicated conditions from boolean values.
- Boolean Logic and Conditions — Sequential execution performs statements one after another in the order they appear in the script.
- Boolean Logic and Short-Circuit Evaluation — Defensive programming means asking 'What could go wrong?' before your program reaches users.
- Boolean Operators in Java — Java's relational operators are ==, !=, <, >, <=, and >=.
- Boolean Values and Comparison Operators — The and operator returns True only when both conditions are true; use it when you need multiple requirements to be satisfied…
- Boolean Values and Expressions — A boolean expression is any expression that evaluates to True or False; a condition is a boolean expression inside a conditional…
- Boolean Values and Logic — An if statement evaluates a condition and executes a block of code only if that condition is true.
- Boolean Values and Operators — The in operator is a boolean operator that returns True if a substring is found in a larger string, and False otherwise.
- Boosting Weak Learners — The task is binary face recognition: classify an image as a human face or not.
- Boosting: Improving Weak Learners — Weak learnability allows a learning algorithm to be useful even when its accuracy is only slightly better than random guessing.
- Bootstrapping in Temporal-Difference Learning — TD(0) and Monte Carlo can disagree because they use different evidence from the same episodes.
- Bootstrapping Methods — SGD variations are used to find a good weight vector for function approximation.
- Bottleneck Analysis in Operational Processes — A claims processing workflow is a chain of steps: opening the claim, gathering documentation, writing a narrative summary…
- Branches of Machine Learning — Supervised learning connects inputs with known targets through a collection of examples.
- Branching Statements — A while loop is a control structure for condition-based repetition.
- Breaking Down Complex Problems — Problem analysis identifies gaps and ambiguities in a problem statement before you begin coding.
- Breaking Down Problems into Steps — Programming is a creative partnership where humans provide ideas, creativity, and judgment while computers provide speed…
- Breaking Out of Loops with break — The else block is executed when the while loop condition becomes False - this may even be the first time that the condition is…
- Breaking Out of Loops: Using break and continue — An infinite loop never terminates because its condition never becomes false.
- Building a Basic Tokenizer — The tokenizer splits text with re.split at punctuation, the double dash, and whitespace, keeping matched punctuation through a…
- Building a Catalog of Reusable Work — A slice library is a moat for solo operators and small shops and a highway for larger teams, and it is valuable in both settings…
- Building a Content Database from Email Archives — Raw email data contains inconsistencies (mixed-case addresses, subdomain variations, gateway artifacts) that must be…
- Building a Convolutional Neural Network — Max pooling replaces each local window with its maximum value.
- Building a Custom Model Leaderboard — Benchmark results help you identify promising models, but there are too many benchmarks to examine them all, so selection is…
- Building a FeedForward Module — The FeedForward module maintains the shape of the input tensor, so the output has the same dimensions as the input.
- Building a GPT Model Architecture — Initializing the 124M GPT model and printing its output tensor gives a shape of [2, 4, 50257], where 50257 is the tokenizer's…
- Building a GPT Model from a Configuration Dictionary — BASE_CONFIG holds the settings shared by every GPT-2 size, including vocabulary size 50257, context length 1024, dropout rate…
- Building a GPT-Style Model from Transformer Blocks — The section's overall goal is to code a GPT-like large language model that can be trained to generate human-like text.
- Building a Growth Mindset for Programming — Programming mastery, like language fluency, requires time and patience to absorb and internalize concepts.
- Building a Language Model from Scratch — A large language model is a deep neural network designed to understand, generate, and respond to humanlike text.
- Building a Large Language Model — Emergent behavior is the ability of a model to perform tasks it was not explicitly trained to perform.
- Building a Minimal BPE Tokenizer from Scratch — Byte Pair Encoding is a tokenization method used in natural language processing, including in GPT-2.
- Building a Platform for Forward Deployed Engineers — An FDE is a customer-facing software engineer who deploys a technical product for a customer, and the role is justified only in…
- Building a Portfolio with Anthropic Plugins — Anthropic plugin templates are enterprise templates introduced at Code with Claude in 2026, spanning seven named industry areas.
- Building a PyTorch module for layer normalization — Layer normalization adjusts the activations of a layer so they have a mean of 0 and a variance of 1, which the source says…
- Building a Real Transformer Block — DummyGPTModel is a simplified GPT-style nn.Module. It builds token and positional embeddings, dropout, a stack of transformer…
- Building a Reliable Evaluation Pipeline for Open-Ended Applications — Foundation models are open-ended and powerful, which makes them harder to evaluate than traditional ML models, and investment in…
- Building a Reusable Slice Library — A slice library is a collection of reusable code slices accumulated from past engagements and meant to be adapted for new…
- Building a Simple Tokenizer with encode and decode — The encode method converts a text string into a list of integer token IDs, and the allowed_special parameter tells it which…
- Building a Simple Web Client — When you call encode() on a string, Python looks up each character and converts it to one or more bytes according to the UTF-8…
- Building a Vocabulary from Text — A tokenizer class implements encode and decode, and it holds a vocabulary that maps text tokens to integer IDs along with an…
- Building a Vocabulary from Training Text — A tokenizer's vocabulary can be extended with special context tokens that carry meanings ordinary words cannot express.
- Building a Vocabulary from Unique Tokens — Special tokens such as '<|endoftext|>' and '<|unk|>' are added to the token list after the regular unique words, using extend().
- Building a Web Scraper with Error Handling — Regular expressions operate on text as a linear sequence, while HTML is hierarchical. This fundamental mismatch causes regex…
- Building a Web Server with Sockets — A socket connection to port 80 establishes a reliable communication channel with a web server through a three-way handshake.
- Building AI Systems Incrementally — A minimal end-to-end slice is the smallest unit of work that forms a complete, end-to-end demonstration, and it is the first…
- Building and Consuming APIs — A web service is a set of services in an application's API that are made available over the web via HTTP.
- Building and Maintaining Competitive AI Products — Milestone planning turns a measurable goal into a sequence of intermediate targets, and the right sequence depends on where the…
- Building and Using Large Language Models — Custom-built LLMs are tailored to specific tasks or domains and can outperform general-purpose LLMs within them.
- Building Applications with Foundation Models — A Foundation Model is one component inside an application, and the application surrounds it with the logic that defines the task.
- Building Bespoke Layers for Competitive Advantage — AI has lowered the time and effort needed to build bespoke workflows, so many previously marginal workflows are now worth…
- Building Complex Models with the Keras Functional API — The Functional API describes a model as a connected route of tensor transformations.
- Building Complex Patterns with Alternation and Grouping — Raw strings (r'...') are mandatory for regex patterns because they prevent Python from interpreting backslashes as escape…
- Building Custom Neural Networks in PyTorch — PyTorch's deep learning utilities provide building blocks for creating custom deep neural networks.
- Building Deployment Templates — A demo succeeds when it creates desire that leads to a contract, which means showing one valuable outcome clearly rather than…
- Building Dictionaries from Text — Convert a dictionary to a list of (value, key) tuples so that sorting operates on the values (frequencies) rather than the keys…
- Building Foundation Model Applications — A low entry barrier makes AI applications easy to build, and therefore easy for competitors to copy
- Building Histograms from Data — Character counting uses a dictionary to store each unique character and its count.
- Building Histograms with Dictionaries — The get() method safely retrieves dictionary values, returning a default if the key is missing.
- Building Interactive Maps with OpenStreetMap and Leaflet — geodump.py converts database records into executable JavaScript code by extracting location names, latitudes, and longitudes and…
- Building LLMs from Scratch — The source material for this article does not describe the cover artwork, so the article teaches the historical context given in…
- Building Lookup Tables — Dictionaries outperform lists and variables for character counting because they only allocate space for characters that actually…
- Building Mental Models of Code — Programming is a language that requires gradual absorption over time, not linear mastery of isolated concepts.
- Building Network Applications — Web scraping is a program-based technique for retrieving web pages and extracting specific data from their HTML source code…
- Building Network Applications with Python — curl and wget are command-line tools for retrieving files from the web on Unix-like systems using HTTP or FTP protocols.
- Building Network Applications with Sockets — HTTP responses follow a three-part structure: status line, headers, blank line, and body.
- Building Network Applications: From HTTP to Web Scraping — A socket is a two-way connection between two programs that allows both reading and writing of data, similar to a file but…
- Building Normalized Email Databases with SQLite — Three Python scripts (gbasic.py, gword.py, gline.py) each answer a different question about email participation: who sent the…
- Building Panels and Containers in Swing — A grid layout can only have one component in each position, so a row that needs two pieces cannot place both directly into one…
- Building Programs with Variables, Expressions, and Statements — input() pauses program execution and waits for keyboard input from the user.
- Building REST APIs with JSON — JSON has become the industry standard for data exchange because its structure maps directly onto native data structures in…
- Building Swing Components — A layout manager is a java.awt class passed to setLayout() to decide how a container arranges its components.
- Building Your First API Request — An API is an application-to-application contract that publishes rules for accessing services provided by one program for use by…
- Building Your First C++ Program — Comments in C++ are written for the human reader, and the compiler ignores them.
- Building Your First GUI Application — Python bindings are translation layers that allow Python code to use GUI libraries written in C/C++, combining Python's…
- Building Your Own Evaluation Benchmarks — A top rank on a general public leaderboard does not guarantee the best model for your application, so start by matching…
- Building Your Own Objects — Web scraping demonstrates object orchestration: urllib fetches HTML, BeautifulSoup parses it into objects, and your code…
- Built-in arrays and pointer conversion — An array is a fixed-size sequence of elements of a single given type, with the number of elements specified at compile time.
- Built-in Arrays and Pointer Decay — An array is less flexible than a vector but simpler, and it can give a performance advantage when its elements are placed…
- Built-in Classes for Dialog Messages — Event handling is the process of handling events in a GUI application, and it can be implemented in different ways.
- Built-in Exception Types — Custom exceptions are user-defined classes that inherit from Exception, enabling you to represent errors specific to your…
- Built-in Functions and Their Types — Defining a function creates a variable that holds a function object with type 'function'.
- Built-in Functions for Inspection — The dir() function reveals all capabilities (methods and attributes) of any Python object by returning a list of strings.
- Built-in Functions: A Reference Guide — Built-in function names like max, len, sum, and print should be treated as reserved words and never used as variable names.
- Built-in Functions: max() and min() — Collect all numbers from the user into a list using a while loop that terminates when the user enters a sentinel value like…
- Built-in Subroutines and Functions — A subroutine is a named set of program instructions designed to perform a task.
- Built-In Types and Standard Strings in I/O — The iostream library handles input and output for built-in types, standard strings, and programmer-defined types.
- Built-in Types in C++ — A concrete class is a class designed so that its objects behave just like built-in types.
- Byte Pair Encoding (BPE) Tokenizer — Tokenization breaks raw text into tokens, which can be words or characters, and then converts those tokens into integer token IDs.
- Byte Streams and Binary Data in Java — InputStreamReader and OutputStreamWriter wrap an existing byte stream so that a program can read and write characters instead of…
- Byte Streams with OutputStream and InputStream — DataOutputStream writes typed values such as int and double into a stream in internal, binary-number format, and it is used when…